From: "Mats Randgaard (matrandg)" <matrandg@cisco.com>
To: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Hans Verkuil <hansverk@cisco.com>,
linux-media@vger.kernel.org, kernel@pengutronix.de
Subject: Re: [RFC 02/12] [media] tc358743: register v4l2 asynchronous subdevice
Date: Mon, 04 May 2015 16:09:39 +0200 [thread overview]
Message-ID: <55477DA3.20002@cisco.com> (raw)
In-Reply-To: <1427713856-10240-3-git-send-email-p.zabel@pengutronix.de>
On 03/30/2015 01:10 PM, Philipp Zabel wrote:
> Add support for registering the sensor subdevice using the v4l2-async API.
>
> Signed-off-by: Philipp Zabel<p.zabel@pengutronix.de>
> ---
> drivers/media/i2c/tc358743.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/drivers/media/i2c/tc358743.c b/drivers/media/i2c/tc358743.c
> index a86cbe0..dfc10f0 100644
> --- a/drivers/media/i2c/tc358743.c
> +++ b/drivers/media/i2c/tc358743.c
> @@ -1711,6 +1711,16 @@ static int tc358743_probe(struct i2c_client *client,
> goto err_hdl;
> }
>
> + state->pad.flags = MEDIA_PAD_FL_SOURCE;
> + err = media_entity_init(&sd->entity, 1, &state->pad, 0);
> + if (err < 0)
> + goto err_hdl;
> +
> + sd->dev = &client->dev;
sd->dev = &client->dev is already done by v4l2_i2c_subdev_init() ~50
lines above
The rest of the code seems fine to me, but I can not test it since the
kernel we use is too old to support async subdevs.
Regards,
Mats Randgaard
> + err = v4l2_async_register_subdev(sd);
> + if (err < 0)
> + goto err_hdl;
> +
> INIT_DELAYED_WORK(&state->delayed_work_enable_hotplug,
> tc358743_delayed_work_enable_hotplug);
>
> @@ -1731,6 +1741,7 @@ static int tc358743_probe(struct i2c_client *client,
> return 0;
>
> err_hdl:
> + media_entity_cleanup(&sd->entity);
> v4l2_ctrl_handler_free(&state->hdl);
> return err;
> }
> @@ -1742,6 +1753,7 @@ static int tc358743_remove(struct i2c_client *client)
>
> cancel_delayed_work(&state->delayed_work_enable_hotplug);
> destroy_workqueue(state->work_queues);
> + v4l2_async_unregister_subdev(sd);
> v4l2_device_unregister_subdev(sd);
> v4l2_ctrl_handler_free(&state->hdl);
>
next prev parent reply other threads:[~2015-05-04 14:09 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-30 11:10 [RFC 00/12] TC358743 async subdev and dt support Philipp Zabel
2015-03-30 11:10 ` [RFC 01/12] [media] Driver for Toshiba TC358743 CSI-2 to HDMI bridge Philipp Zabel
2015-03-30 11:10 ` [RFC 02/12] [media] tc358743: register v4l2 asynchronous subdevice Philipp Zabel
2015-05-04 14:09 ` Mats Randgaard (matrandg) [this message]
2015-03-30 11:10 ` [RFC 03/12] [media] tc358743: support probe from device tree Philipp Zabel
2015-05-04 14:09 ` Mats Randgaard (matrandg)
2015-03-30 11:10 ` [RFC 04/12] [media] tc358743: fix set_pll to enable PLL with default frequency Philipp Zabel
[not found] ` <55477DAE.5040408@cisco.com>
2015-05-04 14:13 ` Mats Randgaard (matrandg)
2015-03-30 11:10 ` [RFC 05/12] [media] tc358743: fix lane number calculation to include blanking Philipp Zabel
2015-05-04 14:09 ` Mats Randgaard (matrandg)
2015-03-30 11:10 ` [RFC 06/12] [media] tc358743: split set_csi into set_csi and start_csi Philipp Zabel
2015-03-30 11:10 ` [RFC 07/12] [media] tc358743: also set TCLK_TRAILCNT and TCLK_POSTCNT Philipp Zabel
2015-03-30 11:10 ` [RFC 08/12] [media] tc358743: parse MIPI CSI-2 endpoint, support noncontinuous clock Philipp Zabel
2015-03-30 11:10 ` [RFC 09/12] [media] tc358743: add direct interrupt handling Philipp Zabel
2015-03-30 11:10 ` [RFC 10/12] [media] tc358743: detect chip by ChipID instead of IntMask Philipp Zabel
2015-05-04 14:09 ` Mats Randgaard (matrandg)
2015-03-30 11:10 ` [RFC 11/12] [media] tc358743: don't return E2BIG from G_EDID Philipp Zabel
2015-03-30 11:10 ` [RFC 12/12] [media] tc358743: allow event subscription Philipp Zabel
2015-04-08 11:40 ` [RFC 00/12] TC358743 async subdev and dt support Mats Randgaard (matrandg)
[not found] ` <55477D9C.7050006@cisco.com>
2015-05-04 14:12 ` Mats Randgaard (matrandg)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=55477DA3.20002@cisco.com \
--to=matrandg@cisco.com \
--cc=hansverk@cisco.com \
--cc=kernel@pengutronix.de \
--cc=linux-media@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.