Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1565797
| Path | csiph.com!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Philipp Zabel <p.zabel@pengutronix.de> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v3 16/24] media: Add i.MX media core driver |
| Date | Tue, 24 Jan 2017 12:50:01 +0100 |
| Message-ID | <t37LP-3LP-21@gated-at.bofh.it> (permalink) |
| References | <sWOLT-2qI-3@gated-at.bofh.it> <sWOLU-2qI-55@gated-at.bofh.it> <sZbXJ-2vV-51@gated-at.bofh.it> <t1a1s-3mo-11@gated-at.bofh.it> <t1a1r-3mo-9@gated-at.bofh.it> |
| X-Original-To | Steve Longerbeam <slongerbeam@gmail.com> |
| Content-Type | text/plain; charset="UTF-8" |
| X-Mailer | Evolution 3.12.9-1+b1 |
| MIME-Version | 1.0 |
| Content-Transfer-Encoding | 7bit |
| X-Sa-Exim-Connect-IP | 2001:67c:670:100:3ad5:47ff:feaf:1a17 |
| X-Sa-Exim-Mail-From | p.zabel@pengutronix.de |
| X-Sa-Exim-Scanned | No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false |
| X-Ptx-Original-Recipient | linux-kernel@vger.kernel.org |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 65 |
| Organization | linux.* mail to news gateway |
| X-Original-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, 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, 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 <steve_longerbeam@mentor.com> |
| X-Original-Date | Tue, 24 Jan 2017 12:39:19 +0100 |
| X-Original-Message-ID | <1485257959.3600.108.camel@pengutronix.de> |
| X-Original-References | <1483755102-24785-1-git-send-email-steve_longerbeam@mentor.com> <1483755102-24785-17-git-send-email-steve_longerbeam@mentor.com> <1484320822.31475.96.camel@pengutronix.de> <2b1d2418-1ad4-6373-cb07-c3aeab48187f@gmail.com> <aaefdb64-5d45-a225-f764-b06ebda73264@gmail.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1565797 |
Show key headers only | View raw
On Wed, 2017-01-18 at 17:44 -0800, Steve Longerbeam wrote:
>
> On 01/14/2017 02:42 PM, Steve Longerbeam wrote:
> >
> >>> +/* parse inputs property from a sensor node */
> >>> +static void of_parse_sensor_inputs(struct imx_media_dev *imxmd,
> >>> + struct imx_media_subdev *sensor,
> >>> + struct device_node *sensor_np)
> >>> +{
> >>> + struct imx_media_sensor_input *sinput = &sensor->input;
> >>> + int ret, i;
> >>> +
> >>> + for (i = 0; i < IMX_MEDIA_MAX_SENSOR_INPUTS; i++) {
> >>> + const char *input_name;
> >>> + u32 val;
> >>> +
> >>> + ret = of_property_read_u32_index(sensor_np, "inputs", i, &val);
> >>> + if (ret)
> >>> + break;
> >>> +
> >>> + sinput->value[i] = val;
> >>> +
> >>> + ret = of_property_read_string_index(sensor_np, "input-names",
> >>> + i, &input_name);
> >>> + /*
> >>> + * if input-names not provided, they will be set using
> >>> + * the subdev name once the sensor is known during
> >>> + * async bind
> >>> + */
> >>> + if (!ret)
> >>> + strncpy(sinput->name[i], input_name,
> >>> + sizeof(sinput->name[i]));
> >>> + }
> >>> +
> >>> + sinput->num = i;
> >>> +
> >>> + /* if no inputs provided just assume a single input */
> >>> + if (sinput->num == 0)
> >>> + sinput->num = 1;
> >>> +}
> >> This should be parsed by the sensor driver, not imx-media.
> >
> > you're probably right. I'll submit a patch for adv7180.c.
>
> Actually, the problem here is that this parses an input routing value to
> pass to s_routing, and an input name string. There would need to be
> another subdev callback, maybe enum_imput, that would return this
> information for the bridge driver, if this info were to be parsed and
> maintained by the sensor.
>
> But this info should really be known and parsed by the bridge anyway,
> because as the header for s_routing states,
>
> "An i2c device shouldn't know about whether an input pin is connected
> to a Composite connector, because on another board or platform it
> might be connected to something else entirely. The calling driver is
> responsible for mapping a user-level input to the right pins on the i2c
> device."
I think this description is for non-DT only, as parsing the DT bindings
is the obligation of the bound driver, and with that it information it
can very well know its connections.
regards
Philipp
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
Re: [PATCH v3 16/24] media: Add i.MX media core driver Steve Longerbeam <slongerbeam@gmail.com> - 2017-01-19 02:50 +0100 Re: [PATCH v3 16/24] media: Add i.MX media core driver Philipp Zabel <p.zabel@pengutronix.de> - 2017-01-24 12:50 +0100
csiph-web