* [PATCH v5 1/3] media: dt-bindings: imx412: Extend compatible strings
[not found] <20221013125142.3321405-1-bryan.odonoghue@linaro.org>
@ 2022-10-13 12:51 ` Bryan O'Donoghue
2022-10-13 20:33 ` Rob Herring
2022-10-13 21:15 ` Krzysztof Kozlowski
2022-10-13 12:51 ` [PATCH v5 2/3] media: i2c: imx412: Assign v4l2 device subname based on compat string Bryan O'Donoghue
2022-10-13 12:51 ` [PATCH v5 3/3] media: i2c: imx412: Add new compatible strings Bryan O'Donoghue
2 siblings, 2 replies; 5+ messages in thread
From: Bryan O'Donoghue @ 2022-10-13 12:51 UTC (permalink / raw)
To: sakari.ailus, dave.stevenson, jacopo, paul.j.murphy,
daniele.alessandrelli, mchehab, linux-media
Cc: bryan.odonoghue, Rob Herring, Krzysztof Kozlowski, devicetree,
linux-kernel
Add compatible bindings for imx577 which uses the same silicon enabling
reference code from Sony in the available examples provided.
Cc: sakari.ailus@iki.fi
Cc: dave.stevenson@raspberrypi.com
Cc: jacopo@jmondi.org
Cc: "Paul J. Murphy" <paul.j.murphy@intel.com>
Cc: Daniele Alessandrelli <daniele.alessandrelli@intel.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
Cc: linux-media@vger.kernel.org
Cc: devicetree@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
Documentation/devicetree/bindings/media/i2c/sony,imx412.yaml | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/media/i2c/sony,imx412.yaml b/Documentation/devicetree/bindings/media/i2c/sony,imx412.yaml
index 26d1807d0bb6..d1561841ccbc 100644
--- a/Documentation/devicetree/bindings/media/i2c/sony,imx412.yaml
+++ b/Documentation/devicetree/bindings/media/i2c/sony,imx412.yaml
@@ -19,7 +19,10 @@ description:
properties:
compatible:
- const: sony,imx412
+ items:
+ - enum:
+ - sony,imx412
+ - sony,imx577
reg:
description: I2C address
maxItems: 1
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v5 2/3] media: i2c: imx412: Assign v4l2 device subname based on compat string
[not found] <20221013125142.3321405-1-bryan.odonoghue@linaro.org>
2022-10-13 12:51 ` [PATCH v5 1/3] media: dt-bindings: imx412: Extend compatible strings Bryan O'Donoghue
@ 2022-10-13 12:51 ` Bryan O'Donoghue
2022-10-13 12:51 ` [PATCH v5 3/3] media: i2c: imx412: Add new compatible strings Bryan O'Donoghue
2 siblings, 0 replies; 5+ messages in thread
From: Bryan O'Donoghue @ 2022-10-13 12:51 UTC (permalink / raw)
To: sakari.ailus, dave.stevenson, jacopo, paul.j.murphy,
daniele.alessandrelli, mchehab, linux-media
Cc: bryan.odonoghue, Rob Herring, Krzysztof Kozlowski, devicetree,
linux-kernel
imx412 and imx577 return the same chip-id when interrogated via i2c.
I've confirmed this myself by
Sakari suggested we should add a new compat which should be reflected in
the name of the media entity
https://patchwork.kernel.org/project/linux-media/patch/20220607134057.2427663-3-bryan.odonoghue@linaro.org/#24894500
Set up the .data parameter of of_device_id to pass a string which
we use to set the media entity name. Once done we can add in imx577 as a
compatible chips with the media names reflecting the directed compat string.
Cc: sakari.ailus@iki.fi
Cc: dave.stevenson@raspberrypi.com
Cc: jacopo@jmondi.org
Cc: "Paul J. Murphy" <paul.j.murphy@intel.com>
Cc: Daniele Alessandrelli <daniele.alessandrelli@intel.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
Cc: linux-media@vger.kernel.org
Cc: devicetree@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
drivers/media/i2c/imx412.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/media/i2c/imx412.c b/drivers/media/i2c/imx412.c
index a1394d6c1432..9f854a1a4c2f 100644
--- a/drivers/media/i2c/imx412.c
+++ b/drivers/media/i2c/imx412.c
@@ -1172,6 +1172,7 @@ static int imx412_init_controls(struct imx412 *imx412)
static int imx412_probe(struct i2c_client *client)
{
struct imx412 *imx412;
+ const char *name;
int ret;
imx412 = devm_kzalloc(&client->dev, sizeof(*imx412), GFP_KERNEL);
@@ -1179,6 +1180,9 @@ static int imx412_probe(struct i2c_client *client)
return -ENOMEM;
imx412->dev = &client->dev;
+ name = device_get_match_data(&client->dev);
+ if (!name)
+ return -ENODEV;
/* Initialize subdev */
v4l2_i2c_subdev_init(&imx412->sd, client, &imx412_subdev_ops);
@@ -1218,6 +1222,8 @@ static int imx412_probe(struct i2c_client *client)
imx412->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
imx412->sd.entity.function = MEDIA_ENT_F_CAM_SENSOR;
+ v4l2_i2c_subdev_set_name(&imx412->sd, client, name, NULL);
+
/* Initialize source pad */
imx412->pad.flags = MEDIA_PAD_FL_SOURCE;
ret = media_entity_pads_init(&imx412->sd.entity, 1, &imx412->pad);
@@ -1281,7 +1287,7 @@ static const struct dev_pm_ops imx412_pm_ops = {
};
static const struct of_device_id imx412_of_match[] = {
- { .compatible = "sony,imx412" },
+ { .compatible = "sony,imx412", .data = "imx412" },
{ }
};
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v5 3/3] media: i2c: imx412: Add new compatible strings
[not found] <20221013125142.3321405-1-bryan.odonoghue@linaro.org>
2022-10-13 12:51 ` [PATCH v5 1/3] media: dt-bindings: imx412: Extend compatible strings Bryan O'Donoghue
2022-10-13 12:51 ` [PATCH v5 2/3] media: i2c: imx412: Assign v4l2 device subname based on compat string Bryan O'Donoghue
@ 2022-10-13 12:51 ` Bryan O'Donoghue
2 siblings, 0 replies; 5+ messages in thread
From: Bryan O'Donoghue @ 2022-10-13 12:51 UTC (permalink / raw)
To: sakari.ailus, dave.stevenson, jacopo, paul.j.murphy,
daniele.alessandrelli, mchehab, linux-media
Cc: bryan.odonoghue, Rob Herring, Krzysztof Kozlowski, devicetree,
linux-kernel
The Sony imx577 uses the same silicon enabling reference code in the
available examples provided as the imx412.
Add in compatible strings to enable and differentiate the parts.
Cc: sakari.ailus@iki.fi
Cc: dave.stevenson@raspberrypi.com
Cc: jacopo@jmondi.org
Cc: "Paul J. Murphy" <paul.j.murphy@intel.com>
Cc: Daniele Alessandrelli <daniele.alessandrelli@intel.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Rob Herring <robh+dt@kernel.org>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
Cc: linux-media@vger.kernel.org
Cc: devicetree@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
---
drivers/media/i2c/imx412.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/media/i2c/imx412.c b/drivers/media/i2c/imx412.c
index 9f854a1a4c2f..88e6fc78106b 100644
--- a/drivers/media/i2c/imx412.c
+++ b/drivers/media/i2c/imx412.c
@@ -1288,6 +1288,7 @@ static const struct dev_pm_ops imx412_pm_ops = {
static const struct of_device_id imx412_of_match[] = {
{ .compatible = "sony,imx412", .data = "imx412" },
+ { .compatible = "sony,imx577", .data = "imx577" },
{ }
};
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v5 1/3] media: dt-bindings: imx412: Extend compatible strings
2022-10-13 12:51 ` [PATCH v5 1/3] media: dt-bindings: imx412: Extend compatible strings Bryan O'Donoghue
@ 2022-10-13 20:33 ` Rob Herring
2022-10-13 21:15 ` Krzysztof Kozlowski
1 sibling, 0 replies; 5+ messages in thread
From: Rob Herring @ 2022-10-13 20:33 UTC (permalink / raw)
To: Bryan O'Donoghue
Cc: linux-kernel, Krzysztof Kozlowski, devicetree, dave.stevenson,
mchehab, jacopo, paul.j.murphy, sakari.ailus, Rob Herring,
linux-media, daniele.alessandrelli
On Thu, 13 Oct 2022 13:51:40 +0100, Bryan O'Donoghue wrote:
> Add compatible bindings for imx577 which uses the same silicon enabling
> reference code from Sony in the available examples provided.
>
> Cc: sakari.ailus@iki.fi
> Cc: dave.stevenson@raspberrypi.com
> Cc: jacopo@jmondi.org
> Cc: "Paul J. Murphy" <paul.j.murphy@intel.com>
> Cc: Daniele Alessandrelli <daniele.alessandrelli@intel.com>
> Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
> Cc: Rob Herring <robh+dt@kernel.org>
> Cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
> Cc: linux-media@vger.kernel.org
> Cc: devicetree@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> ---
> Documentation/devicetree/bindings/media/i2c/sony,imx412.yaml | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
Acked-by: Rob Herring <robh@kernel.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v5 1/3] media: dt-bindings: imx412: Extend compatible strings
2022-10-13 12:51 ` [PATCH v5 1/3] media: dt-bindings: imx412: Extend compatible strings Bryan O'Donoghue
2022-10-13 20:33 ` Rob Herring
@ 2022-10-13 21:15 ` Krzysztof Kozlowski
1 sibling, 0 replies; 5+ messages in thread
From: Krzysztof Kozlowski @ 2022-10-13 21:15 UTC (permalink / raw)
To: Bryan O'Donoghue, sakari.ailus, dave.stevenson, jacopo,
paul.j.murphy, daniele.alessandrelli, mchehab, linux-media
Cc: Rob Herring, Krzysztof Kozlowski, devicetree, linux-kernel
On 13/10/2022 08:51, Bryan O'Donoghue wrote:
> Add compatible bindings for imx577 which uses the same silicon enabling
> reference code from Sony in the available examples provided.
>
> Cc: sakari.ailus@iki.fi
> Cc: dave.stevenson@raspberrypi.com
> Cc: jacopo@jmondi.org
> Cc: "Paul J. Murphy" <paul.j.murphy@intel.com>
> Cc: Daniele Alessandrelli <daniele.alessandrelli@intel.com>
> Cc: Mauro Carvalho Chehab <mchehab@kernel.org>
> Cc: Rob Herring <robh+dt@kernel.org>
> Cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
> Cc: linux-media@vger.kernel.org
> Cc: devicetree@vger.kernel.org
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
> ---
> Documentation/devicetree/bindings/media/i2c/sony,imx412.yaml | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/media/i2c/sony,imx412.yaml b/Documentation/devicetree/bindings/media/i2c/sony,imx412.yaml
> index 26d1807d0bb6..d1561841ccbc 100644
> --- a/Documentation/devicetree/bindings/media/i2c/sony,imx412.yaml
> +++ b/Documentation/devicetree/bindings/media/i2c/sony,imx412.yaml
> @@ -19,7 +19,10 @@ description:
>
> properties:
> compatible:
> - const: sony,imx412
> + items:
You have only one item, so drop the "items".
> + - enum:
> + - sony,imx412
> + - sony,imx577
> reg:
> description: I2C address
> maxItems: 1
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-10-13 21:18 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20221013125142.3321405-1-bryan.odonoghue@linaro.org>
2022-10-13 12:51 ` [PATCH v5 1/3] media: dt-bindings: imx412: Extend compatible strings Bryan O'Donoghue
2022-10-13 20:33 ` Rob Herring
2022-10-13 21:15 ` Krzysztof Kozlowski
2022-10-13 12:51 ` [PATCH v5 2/3] media: i2c: imx412: Assign v4l2 device subname based on compat string Bryan O'Donoghue
2022-10-13 12:51 ` [PATCH v5 3/3] media: i2c: imx412: Add new compatible strings Bryan O'Donoghue
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).