From mboxrd@z Thu Jan 1 00:00:00 1970 From: Laurent Pinchart Subject: Re: [PATCH v4] media: i2c: add support for omnivision's ov2659 sensor Date: Wed, 11 Mar 2015 20:22:06 +0200 Message-ID: <2415294.49LTQe4m32@avalon> References: <1425814407-22766-1-git-send-email-prabhakar.csengg@gmail.com> <20150310013556.GF11954@valkosipuli.retiisi.org.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Return-path: In-Reply-To: <20150310013556.GF11954@valkosipuli.retiisi.org.uk> Sender: linux-kernel-owner@vger.kernel.org To: Sakari Ailus Cc: Lad Prabhakar , Sakari Ailus , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Mauro Carvalho Chehab , Hans Verkuil , LMML , LKML , devicetree@vger.kernel.org List-Id: devicetree@vger.kernel.org On Tuesday 10 March 2015 03:35:57 Sakari Ailus wrote: > On Sun, Mar 08, 2015 at 11:33:27AM +0000, Lad Prabhakar wrote: > ... > > > +static struct ov2659_platform_data * > > +ov2659_get_pdata(struct i2c_client *client) > > +{ > > + struct ov2659_platform_data *pdata; > > + struct device_node *endpoint; > > + int ret; > > + > > + if (!IS_ENABLED(CONFIG_OF) || !client->dev.of_node) { > > + dev_err(&client->dev, "ov2659_get_pdata: DT Node found\n"); > > + return client->dev.platform_data; > > + } > > + > > + endpoint = of_graph_get_next_endpoint(client->dev.of_node, NULL); > > + if (!endpoint) > > + return NULL; > > + > > + pdata = devm_kzalloc(&client->dev, sizeof(*pdata), GFP_KERNEL); > > + if (!pdata) > > + goto done; > > + > > + ret = of_property_read_u32(endpoint, "link-frequencies", > > + &pdata->link_frequency); > > This is actually documented as being a 64-bit array. The main purpose of link-frequencies is to restrict the link frequencies acceptable in the system due to EMI requirements. One link frequency should be selected in the array based on the desired format and frame rate. This is usually done by exposing the frequency to userspace through a writable V4L2_CID_LINK_FREQ control, and exposing the resulting pixel rate as a read- only V4L2_CID_PIXEL_RATE control. V4L2_CID_PIXEL_RATE is mandatory to use the sensor with several drivers (including omap3isp and omap4iss), so it should really be implemented. > The smiapp wasn't even reading it from the endpoint node. Oh well... -- Regards, Laurent Pinchart