From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Jacopo Mondi <jacopo+renesas@jmondi.org>
Cc: niklas.soderlund@ragnatech.se, linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH v1 04/12] media: i2c: mt9m111: Add source pad
Date: Tue, 20 Jun 2017 10:50:49 +0300 [thread overview]
Message-ID: <2850479.zc574Vm8BG@avalon> (raw)
In-Reply-To: <1497891889-8038-5-git-send-email-jacopo+renesas@jmondi.org>
Hi Jacopo,
Thank you for the patch.
On Monday 19 Jun 2017 19:04:41 Jacopo Mondi wrote:
> Add a single source pad to mt9m111 media entity.
>
> Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
> ---
> drivers/media/i2c/mt9m111.c | 17 ++++++++++++++++-
> 1 file changed, 16 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/i2c/mt9m111.c b/drivers/media/i2c/mt9m111.c
> index 8e86d51..7e70969 100644
> --- a/drivers/media/i2c/mt9m111.c
> +++ b/drivers/media/i2c/mt9m111.c
> @@ -141,6 +141,8 @@
> #define MT9M111_MAX_HEIGHT 1024
> #define MT9M111_MAX_WIDTH 1280
>
> +#define MT9M111_MEDIA_PAD 1
> +
> struct mt9m111_context {
> u16 read_mode;
> u16 blanking_h;
> @@ -215,6 +217,8 @@ struct mt9m111 {
> int power_count;
> const struct mt9m111_datafmt *fmt;
> int lastpage; /* PageMap cache value */
> +
> + struct media_pad pad;
> };
>
> /* Find a data format by a pixel code */
> @@ -963,13 +967,23 @@ static int mt9m111_probe(struct i2c_client *client,
> if (ret < 0)
> goto out_hdlfree;
>
> + mt9m111->pad.flags = MEDIA_PAD_FL_SOURCE;
> + ret = media_entity_pads_init(&mt9m111->subdev.entity,
MT9M111_MEDIA_PAD,
The second argument is the number of pads, not a pad number. The macro name is
quite confusing. Given that you use it once only, you can drop it and hardcode
the value.
> + &mt9m111->pad);
> + if (ret)
> + goto out_hdlfree;
> +
> mt9m111->subdev.dev = &client->dev;
> + mt9m111->subdev.flags = V4L2_SUBDEV_FL_HAS_DEVNODE;
> + mt9m111->subdev.entity.function = MEDIA_ENT_F_CAM_SENSOR;
> ret = v4l2_async_register_subdev(&mt9m111->subdev);
> if (ret < 0)
> - goto out_hdlfree;
> + goto out_mediafree;
>
> return 0;
>
> +out_mediafree:
Maybe out_media_cleanup ?
> + media_entity_cleanup(&mt9m111->subdev.entity);
> out_hdlfree:
> v4l2_ctrl_handler_free(&mt9m111->hdl);
> out_clkput:
> @@ -982,6 +996,7 @@ static int mt9m111_remove(struct i2c_client *client)
> {
> struct mt9m111 *mt9m111 = to_mt9m111(client);
>
> + media_entity_cleanup(&mt9m111->subdev.entity);
> v4l2_async_unregister_subdev(&mt9m111->subdev);
> v4l2_clk_put(mt9m111->clk);
> v4l2_ctrl_handler_free(&mt9m111->hdl);
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2017-06-20 7:50 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-19 17:04 [PATCH v1 00/12] rcar: vin: Add digital input to Gen3 Jacopo Mondi
2017-06-19 17:04 ` [PATCH v1 01/12] arm64: boot: dts: salvator-x: Add camera module Jacopo Mondi
2017-06-20 7:20 ` Geert Uytterhoeven
2017-06-20 7:45 ` Laurent Pinchart
2017-06-19 17:04 ` [PATCH v1 02/12] arm64: boot: dts: Salvator-X: Add VIN parallel input Jacopo Mondi
2017-06-19 19:32 ` Niklas Söderlund
2017-06-19 17:04 ` [PATCH v1 03/12] media: i2c: mt9m111: Skip chid identification Jacopo Mondi
2017-06-20 7:48 ` Laurent Pinchart
2017-06-26 13:19 ` jmondi
2017-06-19 17:04 ` [PATCH v1 04/12] media: i2c: mt9m111: Add source pad Jacopo Mondi
2017-06-20 7:50 ` Laurent Pinchart [this message]
2017-06-19 17:04 ` [PATCH v1 05/12] media: rcar: vin: Prepare to parse Gen3 digital input Jacopo Mondi
2017-06-19 19:39 ` Niklas Söderlund
2017-06-20 7:28 ` jmondi
2017-06-19 17:04 ` [PATCH v1 06/12] media: rcar: vin: Accept parallel input on Gen3 Jacopo Mondi
2017-06-19 17:04 ` [PATCH v1 07/12] media: rcar: vin: Add ID for " Jacopo Mondi
2017-06-19 19:46 ` Niklas Söderlund
2017-06-19 17:04 ` [PATCH v1 08/12] media: rcar: vin: Parse digital input after CSI " Jacopo Mondi
2017-06-19 17:04 ` [PATCH v1 09/12] media: rcar: vin: Install notifier for digital input Jacopo Mondi
2017-06-19 19:51 ` Niklas Söderlund
2017-06-20 7:32 ` jmondi
2017-06-19 17:04 ` [PATCH v1 10/12] media: rcar: vin: Add digital input mask to vin_dev Jacopo Mondi
2017-06-19 17:04 ` [PATCH v1 11/12] media: rcar: vin: Store VIN instance id Jacopo Mondi
2017-06-19 17:04 ` [PATCH v1 12/12] media: rcar: vin: Link digital subdev to VIN instance Jacopo Mondi
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=2850479.zc574Vm8BG@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=jacopo+renesas@jmondi.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=niklas.soderlund@ragnatech.se \
/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.