From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stanimir Varbanov Subject: Re: [PATCH v2 03/11] v4l: Introduce sensor operation for getting interface configuration Date: Fri, 02 Dec 2011 15:32:36 +0200 Message-ID: <4ED8D374.1030206@mm-sol.com> References: <1322698500-29924-1-git-send-email-saaguirre@ti.com> <1322698500-29924-4-git-send-email-saaguirre@ti.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from ns.mm-sol.com ([213.240.235.226]:58262 "EHLO extserv.mm-sol.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755618Ab1LBNir (ORCPT ); Fri, 2 Dec 2011 08:38:47 -0500 In-Reply-To: <1322698500-29924-4-git-send-email-saaguirre@ti.com> Sender: linux-omap-owner@vger.kernel.org List-Id: linux-omap@vger.kernel.org To: Sergio Aguirre Cc: linux-media@vger.kernel.org, linux-omap@vger.kernel.org, laurent.pinchart@ideasonboard.com, sakari.ailus@iki.fi Hi, Sergio This change in interface is not used from the omap4iss driver. You could drop it from the patch set, if so. On 12/01/2011 02:14 AM, Sergio Aguirre wrote: > From: Stanimir Varbanov > > Introduce g_interface_parms sensor operation for getting sensor > interface parameters. These parameters are needed from the host side > to determine it's own configuration. > > Signed-off-by: Stanimir Varbanov > --- > include/media/v4l2-subdev.h | 42 ++++++++++++++++++++++++++++++++++++++++++ > 1 files changed, 42 insertions(+), 0 deletions(-) > > diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h > index f0f3358..0d322ed 100644 > --- a/include/media/v4l2-subdev.h > +++ b/include/media/v4l2-subdev.h > @@ -362,6 +362,42 @@ struct v4l2_subdev_vbi_ops { > int (*s_sliced_fmt)(struct v4l2_subdev *sd, struct v4l2_sliced_vbi_format *fmt); > }; > > +/* Which interface the sensor use to provide it's image data */ > +enum v4l2_subdev_sensor_iface { > + V4L2_SUBDEV_SENSOR_PARALLEL, > + V4L2_SUBDEV_SENSOR_SERIAL, > +}; > + > +/* Each interface could use the following modes */ > +/* Image sensor provides horizontal and vertical sync signals */ > +#define V4L2_SUBDEV_SENSOR_MODE_PARALLEL_SYNC 0 > +/* BT.656 interface. Embedded sync */ > +#define V4L2_SUBDEV_SENSOR_MODE_PARALLEL_ITU 1 > +/* MIPI CSI1 */ > +#define V4L2_SUBDEV_SENSOR_MODE_SERIAL_CSI1 2 > +/* MIPI CSI2 */ > +#define V4L2_SUBDEV_SENSOR_MODE_SERIAL_CSI2 3 > + > +struct v4l2_subdev_sensor_serial_parms { > + unsigned char lanes; /* number of lanes used */ > + unsigned char channel; /* virtual channel */ > + unsigned int phy_rate; /* output rate at CSI phy in bps */ > + unsigned int pix_clk; /* pixel clock in Hz */ > +}; > + > +struct v4l2_subdev_sensor_parallel_parms { > + unsigned int pix_clk; /* pixel clock in Hz */ > +}; > + > +struct v4l2_subdev_sensor_interface_parms { > + enum v4l2_subdev_sensor_iface if_type; > + unsigned int if_mode; > + union { > + struct v4l2_subdev_sensor_serial_parms serial; > + struct v4l2_subdev_sensor_parallel_parms parallel; > + } parms; > +}; > + > /** > * struct v4l2_subdev_sensor_ops - v4l2-subdev sensor operations > * @g_skip_top_lines: number of lines at the top of the image to be skipped. > @@ -371,10 +407,16 @@ struct v4l2_subdev_vbi_ops { > * @g_skip_frames: number of frames to skip at stream start. This is needed for > * buggy sensors that generate faulty frames when they are > * turned on. > + * @g_interface_parms: get sensor interface parameters. The sensor subdev should > + * fill this structure with current interface params. These > + * interface parameters are needed on host side to configure > + * it's own hardware receivers. > */ > struct v4l2_subdev_sensor_ops { > int (*g_skip_top_lines)(struct v4l2_subdev *sd, u32 *lines); > int (*g_skip_frames)(struct v4l2_subdev *sd, u32 *frames); > + int (*g_interface_parms)(struct v4l2_subdev *sd, > + struct v4l2_subdev_sensor_interface_parms *parms); > }; > > /* -- best regards, Stan