From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751251AbdFCTiH (ORCPT ); Sat, 3 Jun 2017 15:38:07 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:35195 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750991AbdFCTiF (ORCPT ); Sat, 3 Jun 2017 15:38:05 -0400 Subject: Re: [PATCH v7 16/34] [media] add Omnivision OV5640 sensor driver To: Sakari Ailus , Pavel Machek Cc: robh+dt@kernel.org, mark.rutland@arm.com, shawnguo@kernel.org, kernel@pengutronix.de, fabio.estevam@nxp.com, linux@armlinux.org.uk, mchehab@kernel.org, hverkuil@xs4all.nl, nick@shmanahar.org, markus.heiser@darmarIT.de, p.zabel@pengutronix.de, laurent.pinchart+renesas@ideasonboard.com, bparrot@ti.com, geert@linux-m68k.org, arnd@arndb.de, sudipm.mukherjee@gmail.com, minghsiu.tsai@mediatek.com, tiffany.lin@mediatek.com, jean-christophe.trotin@st.com, horms+renesas@verge.net.au, niklas.soderlund+renesas@ragnatech.se, robert.jarzmik@free.fr, songjun.wu@microchip.com, andrew-ct.chen@mediatek.com, gregkh@linuxfoundation.org, shuah@kernel.org, sakari.ailus@linux.intel.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, devel@driverdev.osuosl.org, Steve Longerbeam References: <1495672189-29164-1-git-send-email-steve_longerbeam@mentor.com> <1495672189-29164-17-git-send-email-steve_longerbeam@mentor.com> <20170531195821.GA16962@amd> <20170601082659.GJ1019@valkosipuli.retiisi.org.uk> From: Steve Longerbeam Message-ID: <755909bf-d1de-e0f3-1569-0d4b16e26817@gmail.com> Date: Sat, 3 Jun 2017 12:38:01 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <20170601082659.GJ1019@valkosipuli.retiisi.org.uk> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/01/2017 01:26 AM, Sakari Ailus wrote: > Hi Pavel, > > On Wed, May 31, 2017 at 09:58:21PM +0200, Pavel Machek wrote: >> Hi! >> >>> +/* min/typical/max system clock (xclk) frequencies */ >>> +#define OV5640_XCLK_MIN 6000000 >>> +#define OV5640_XCLK_MAX 24000000 >>> + >>> +/* >>> + * FIXME: there is no subdev API to set the MIPI CSI-2 >>> + * virtual channel yet, so this is hardcoded for now. >>> + */ >>> +#define OV5640_MIPI_VC 1 >> >> Can the FIXME be fixed? > > Yes, but it's quite a bit of work. It makes sense to use a static virtual > channel for now. A patchset which is however incomplete can be found here: > > > > For what it's worth, all other devices use virtual channel zero for image > data and so should this one. Actually no. The CSI2IPU gasket in i.MX6 quad sends virtual channel 0 streams to IPU1-CSI0. But input to IPU1-CSI0 is also muxed with parallel bus cameras. So if vc0 were chosen instead, platforms that support parallel cameras to IPU1-CSI0 (SabreLite, SabreSD) would not be able to use them concurrently with a MIPI CSI-2 source to IPU1-CSI1. So I prefer to use static channel 1 to support those platforms. I could convert this to a module parameter however, until a virtual channel selection subdev API becomes available, at which point that would have to be stripped. > >> >>> +/* >>> + * image size under 1280 * 960 are SUBSAMPLING >> >> -> Image >> >>> + * image size upper 1280 * 960 are SCALING >> >> above? >> done. >>> +/* >>> + * FIXME: all of these register tables are likely filled with >>> + * entries that set the register to their power-on default values, >>> + * and which are otherwise not touched by this driver. Those entries >>> + * should be identified and removed to speed register load time >>> + * over i2c. >>> + */ >> >> load->loading? Can the FIXME be fixed? That's a lot of work, and risky work at that. If someone could take this on (strip out power-on default values from the tables), I'd be grateful, but I don't have the time. For now at least, these registers sets work fine. >> >>> + /* Auto/manual exposure */ >>> + ctrls->auto_exp = v4l2_ctrl_new_std_menu(hdl, ops, >>> + V4L2_CID_EXPOSURE_AUTO, >>> + V4L2_EXPOSURE_MANUAL, 0, >>> + V4L2_EXPOSURE_AUTO); >>> + ctrls->exposure = v4l2_ctrl_new_std(hdl, ops, >>> + V4L2_CID_EXPOSURE_ABSOLUTE, >>> + 0, 65535, 1, 0); >> >> Is exposure_absolute supposed to be in microseconds...? > > Yes. According to the docs V4L2_CID_EXPOSURE_ABSOLUTE is in 100 usec units. OTOH V4L2_CID_EXPOSURE has no defined unit, so it's a better fit IMO. > Way more drivers appear to be using EXPOSURE than EXPOSURE_ABSOLUTE, too. Done, switched to V4L2_CID_EXPOSURE. It's true, this control is not taking 100 usec units, so unit-less is better. Steve From mboxrd@z Thu Jan 1 00:00:00 1970 From: Steve Longerbeam Subject: Re: [PATCH v7 16/34] [media] add Omnivision OV5640 sensor driver Date: Sat, 3 Jun 2017 12:38:01 -0700 Message-ID: <755909bf-d1de-e0f3-1569-0d4b16e26817@gmail.com> References: <1495672189-29164-1-git-send-email-steve_longerbeam@mentor.com> <1495672189-29164-17-git-send-email-steve_longerbeam@mentor.com> <20170531195821.GA16962@amd> <20170601082659.GJ1019@valkosipuli.retiisi.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20170601082659.GJ1019-S+BSfZ9RZZmRSg0ZkenSGLdO1Tsj/99ntUK59QYPAWc@public.gmane.org> Content-Language: en-US Sender: devicetree-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Sakari Ailus , Pavel Machek Cc: robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, mark.rutland-5wv7dgnIgG8@public.gmane.org, shawnguo-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, kernel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org, fabio.estevam-3arQi8VN3Tc@public.gmane.org, linux-I+IVW8TIWO2tmTQ+vhA3Yw@public.gmane.org, mchehab-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, hverkuil-qWit8jRvyhVmR6Xm/wNWPw@public.gmane.org, nick-gcszYUEDH4VrovVCs/uTlw@public.gmane.org, markus.heiser-O6JHGLzbNUwb1SvskN2V4Q@public.gmane.org, p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org, laurent.pinchart+renesas-ryLnwIuWjnjg/C1BVhZhaw@public.gmane.org, bparrot-l0cyMroinI0@public.gmane.org, geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org, arnd-r2nGTMty4D4@public.gmane.org, sudipm.mukherjee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, minghsiu.tsai-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org, tiffany.lin-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org, jean-christophe.trotin-qxv4g6HH51o@public.gmane.org, horms+renesas-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org, niklas.soderlund+renesas-1zkq55x86MTxsAP9Fp7wbw@public.gmane.org, robert.jarzmik-GANU6spQydw@public.gmane.org, songjun.wu-UWL1GkI3JZL3oGB3hsPCZA@public.gmane.org, andrew-ct.chen-NuS5LvNUpcJWk0Htik3J/w@public.gmane.org, gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org, shuah-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, sakari.ailus-VuQAYsv1563Yd54FQh9/CA@public.gmane.org, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, linux-media-u79uwXL29TZNg+MwTxZMZA@public.gmane.org List-Id: devicetree@vger.kernel.org On 06/01/2017 01:26 AM, Sakari Ailus wrote: > Hi Pavel, > > On Wed, May 31, 2017 at 09:58:21PM +0200, Pavel Machek wrote: >> Hi! >> >>> +/* min/typical/max system clock (xclk) frequencies */ >>> +#define OV5640_XCLK_MIN 6000000 >>> +#define OV5640_XCLK_MAX 24000000 >>> + >>> +/* >>> + * FIXME: there is no subdev API to set the MIPI CSI-2 >>> + * virtual channel yet, so this is hardcoded for now. >>> + */ >>> +#define OV5640_MIPI_VC 1 >> >> Can the FIXME be fixed? > > Yes, but it's quite a bit of work. It makes sense to use a static virtual > channel for now. A patchset which is however incomplete can be found here: > > > > For what it's worth, all other devices use virtual channel zero for image > data and so should this one. Actually no. The CSI2IPU gasket in i.MX6 quad sends virtual channel 0 streams to IPU1-CSI0. But input to IPU1-CSI0 is also muxed with parallel bus cameras. So if vc0 were chosen instead, platforms that support parallel cameras to IPU1-CSI0 (SabreLite, SabreSD) would not be able to use them concurrently with a MIPI CSI-2 source to IPU1-CSI1. So I prefer to use static channel 1 to support those platforms. I could convert this to a module parameter however, until a virtual channel selection subdev API becomes available, at which point that would have to be stripped. > >> >>> +/* >>> + * image size under 1280 * 960 are SUBSAMPLING >> >> -> Image >> >>> + * image size upper 1280 * 960 are SCALING >> >> above? >> done. >>> +/* >>> + * FIXME: all of these register tables are likely filled with >>> + * entries that set the register to their power-on default values, >>> + * and which are otherwise not touched by this driver. Those entries >>> + * should be identified and removed to speed register load time >>> + * over i2c. >>> + */ >> >> load->loading? Can the FIXME be fixed? That's a lot of work, and risky work at that. If someone could take this on (strip out power-on default values from the tables), I'd be grateful, but I don't have the time. For now at least, these registers sets work fine. >> >>> + /* Auto/manual exposure */ >>> + ctrls->auto_exp = v4l2_ctrl_new_std_menu(hdl, ops, >>> + V4L2_CID_EXPOSURE_AUTO, >>> + V4L2_EXPOSURE_MANUAL, 0, >>> + V4L2_EXPOSURE_AUTO); >>> + ctrls->exposure = v4l2_ctrl_new_std(hdl, ops, >>> + V4L2_CID_EXPOSURE_ABSOLUTE, >>> + 0, 65535, 1, 0); >> >> Is exposure_absolute supposed to be in microseconds...? > > Yes. According to the docs V4L2_CID_EXPOSURE_ABSOLUTE is in 100 usec units. OTOH V4L2_CID_EXPOSURE has no defined unit, so it's a better fit IMO. > Way more drivers appear to be using EXPOSURE than EXPOSURE_ABSOLUTE, too. Done, switched to V4L2_CID_EXPOSURE. It's true, this control is not taking 100 usec units, so unit-less is better. Steve -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 From: slongerbeam@gmail.com (Steve Longerbeam) Date: Sat, 3 Jun 2017 12:38:01 -0700 Subject: [PATCH v7 16/34] [media] add Omnivision OV5640 sensor driver In-Reply-To: <20170601082659.GJ1019@valkosipuli.retiisi.org.uk> References: <1495672189-29164-1-git-send-email-steve_longerbeam@mentor.com> <1495672189-29164-17-git-send-email-steve_longerbeam@mentor.com> <20170531195821.GA16962@amd> <20170601082659.GJ1019@valkosipuli.retiisi.org.uk> Message-ID: <755909bf-d1de-e0f3-1569-0d4b16e26817@gmail.com> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On 06/01/2017 01:26 AM, Sakari Ailus wrote: > Hi Pavel, > > On Wed, May 31, 2017 at 09:58:21PM +0200, Pavel Machek wrote: >> Hi! >> >>> +/* min/typical/max system clock (xclk) frequencies */ >>> +#define OV5640_XCLK_MIN 6000000 >>> +#define OV5640_XCLK_MAX 24000000 >>> + >>> +/* >>> + * FIXME: there is no subdev API to set the MIPI CSI-2 >>> + * virtual channel yet, so this is hardcoded for now. >>> + */ >>> +#define OV5640_MIPI_VC 1 >> >> Can the FIXME be fixed? > > Yes, but it's quite a bit of work. It makes sense to use a static virtual > channel for now. A patchset which is however incomplete can be found here: > > > > For what it's worth, all other devices use virtual channel zero for image > data and so should this one. Actually no. The CSI2IPU gasket in i.MX6 quad sends virtual channel 0 streams to IPU1-CSI0. But input to IPU1-CSI0 is also muxed with parallel bus cameras. So if vc0 were chosen instead, platforms that support parallel cameras to IPU1-CSI0 (SabreLite, SabreSD) would not be able to use them concurrently with a MIPI CSI-2 source to IPU1-CSI1. So I prefer to use static channel 1 to support those platforms. I could convert this to a module parameter however, until a virtual channel selection subdev API becomes available, at which point that would have to be stripped. > >> >>> +/* >>> + * image size under 1280 * 960 are SUBSAMPLING >> >> -> Image >> >>> + * image size upper 1280 * 960 are SCALING >> >> above? >> done. >>> +/* >>> + * FIXME: all of these register tables are likely filled with >>> + * entries that set the register to their power-on default values, >>> + * and which are otherwise not touched by this driver. Those entries >>> + * should be identified and removed to speed register load time >>> + * over i2c. >>> + */ >> >> load->loading? Can the FIXME be fixed? That's a lot of work, and risky work at that. If someone could take this on (strip out power-on default values from the tables), I'd be grateful, but I don't have the time. For now at least, these registers sets work fine. >> >>> + /* Auto/manual exposure */ >>> + ctrls->auto_exp = v4l2_ctrl_new_std_menu(hdl, ops, >>> + V4L2_CID_EXPOSURE_AUTO, >>> + V4L2_EXPOSURE_MANUAL, 0, >>> + V4L2_EXPOSURE_AUTO); >>> + ctrls->exposure = v4l2_ctrl_new_std(hdl, ops, >>> + V4L2_CID_EXPOSURE_ABSOLUTE, >>> + 0, 65535, 1, 0); >> >> Is exposure_absolute supposed to be in microseconds...? > > Yes. According to the docs V4L2_CID_EXPOSURE_ABSOLUTE is in 100 usec units. OTOH V4L2_CID_EXPOSURE has no defined unit, so it's a better fit IMO. > Way more drivers appear to be using EXPOSURE than EXPOSURE_ABSOLUTE, too. Done, switched to V4L2_CID_EXPOSURE. It's true, this control is not taking 100 usec units, so unit-less is better. Steve