* [PATCH v3 0/2] Match data improvements for it66121 driver
@ 2023-08-18 19:18 Biju Das
2023-08-18 19:18 ` [PATCH v3 1/2] drm: bridge: it66121: Extend match support for OF tables Biju Das
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Biju Das @ 2023-08-18 19:18 UTC (permalink / raw)
To: Phong LE, Neil Armstrong, Andrzej Hajda, Robert Foss,
David Airlie, Daniel Vetter
Cc: Jernej Skrabec, Geert Uytterhoeven, Jonas Karlman,
Prabhakar Mahadev Lad, dri-devel, linux-renesas-soc,
Laurent Pinchart, Biju Das, Andy Shevchenko
This patch series aims to add match data improvements for it66121 driver.
v2->v3:
* Removed fixes tag from patch#1 as nothing broken.
* Added Rb tag from Andy.
v1->v2:
* Split the patch into two.
* patch#1 extend match support for OF tables compared to legacy ID
lookup and fixes tag.
* patch#2 simplifies the probe() by using i2c_get_match_data.
* Dropped sentence for dropping local variable as it is integral part of
the patch.
Biju Das (2):
drm: bridge: it66121: Extend match support for OF tables
drm: bridge: it66121: Simplify probe()
drivers/gpu/drm/bridge/ite-it66121.c | 17 ++++++++---------
1 file changed, 8 insertions(+), 9 deletions(-)
--
2.25.1
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH v3 1/2] drm: bridge: it66121: Extend match support for OF tables 2023-08-18 19:18 [PATCH v3 0/2] Match data improvements for it66121 driver Biju Das @ 2023-08-18 19:18 ` Biju Das 2023-08-21 12:30 ` Laurent Pinchart 2023-08-18 19:18 ` [PATCH v3 2/2] drm: bridge: it66121: Simplify probe() Biju Das 2023-09-05 14:20 ` [PATCH v3 0/2] Match data improvements for it66121 driver Robert Foss 2 siblings, 1 reply; 6+ messages in thread From: Biju Das @ 2023-08-18 19:18 UTC (permalink / raw) To: Phong LE, Neil Armstrong, Andrzej Hajda, Robert Foss, David Airlie, Daniel Vetter Cc: Jernej Skrabec, Geert Uytterhoeven, Jonas Karlman, Prabhakar Mahadev Lad, dri-devel, linux-renesas-soc, Laurent Pinchart, Biju Das, Andy Shevchenko The driver has OF match table, still it uses ID lookup table for retrieving match data. Currently the driver is working on the assumption that a I2C device registered via OF will always match a legacy I2C device ID. The correct approach is to have an OF device ID table using of_device_match_data() if the devices are registered via OF. Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> --- v2->v3: * Removed fixes tag as nothing broken. * Added Rb tag from Andy. v2: * New patch. --- drivers/gpu/drm/bridge/ite-it66121.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/bridge/ite-it66121.c b/drivers/gpu/drm/bridge/ite-it66121.c index 466641c77fe9..ba95ad46e259 100644 --- a/drivers/gpu/drm/bridge/ite-it66121.c +++ b/drivers/gpu/drm/bridge/ite-it66121.c @@ -1523,7 +1523,10 @@ static int it66121_probe(struct i2c_client *client) ctx->dev = dev; ctx->client = client; - ctx->info = (const struct it66121_chip_info *) id->driver_data; + if (dev_fwnode(&client->dev)) + ctx->info = of_device_get_match_data(&client->dev); + else + ctx->info = (const struct it66121_chip_info *) id->driver_data; of_property_read_u32(ep, "bus-width", &ctx->bus_width); of_node_put(ep); @@ -1609,13 +1612,6 @@ static void it66121_remove(struct i2c_client *client) mutex_destroy(&ctx->lock); } -static const struct of_device_id it66121_dt_match[] = { - { .compatible = "ite,it66121" }, - { .compatible = "ite,it6610" }, - { } -}; -MODULE_DEVICE_TABLE(of, it66121_dt_match); - static const struct it66121_chip_info it66121_chip_info = { .id = ID_IT66121, .vid = 0x4954, @@ -1628,6 +1624,13 @@ static const struct it66121_chip_info it6610_chip_info = { .pid = 0x0611, }; +static const struct of_device_id it66121_dt_match[] = { + { .compatible = "ite,it66121", &it66121_chip_info }, + { .compatible = "ite,it6610", &it6610_chip_info }, + { } +}; +MODULE_DEVICE_TABLE(of, it66121_dt_match); + static const struct i2c_device_id it66121_id[] = { { "it66121", (kernel_ulong_t) &it66121_chip_info }, { "it6610", (kernel_ulong_t) &it6610_chip_info }, -- 2.25.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v3 1/2] drm: bridge: it66121: Extend match support for OF tables 2023-08-18 19:18 ` [PATCH v3 1/2] drm: bridge: it66121: Extend match support for OF tables Biju Das @ 2023-08-21 12:30 ` Laurent Pinchart 0 siblings, 0 replies; 6+ messages in thread From: Laurent Pinchart @ 2023-08-21 12:30 UTC (permalink / raw) To: Biju Das Cc: Neil Armstrong, Robert Foss, Andrzej Hajda, Geert Uytterhoeven, Jonas Karlman, Prabhakar Mahadev Lad, Jernej Skrabec, Phong LE, dri-devel, linux-renesas-soc, Andy Shevchenko Hi Biju, Thank you for the patch. On Fri, Aug 18, 2023 at 08:18:16PM +0100, Biju Das wrote: > The driver has OF match table, still it uses ID lookup table for > retrieving match data. Currently the driver is working on the > assumption that a I2C device registered via OF will always match a > legacy I2C device ID. The correct approach is to have an OF device ID > table using of_device_match_data() if the devices are registered via OF. > > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> > Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> > --- > v2->v3: > * Removed fixes tag as nothing broken. > * Added Rb tag from Andy. > v2: > * New patch. > --- > drivers/gpu/drm/bridge/ite-it66121.c | 19 +++++++++++-------- > 1 file changed, 11 insertions(+), 8 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/ite-it66121.c b/drivers/gpu/drm/bridge/ite-it66121.c > index 466641c77fe9..ba95ad46e259 100644 > --- a/drivers/gpu/drm/bridge/ite-it66121.c > +++ b/drivers/gpu/drm/bridge/ite-it66121.c > @@ -1523,7 +1523,10 @@ static int it66121_probe(struct i2c_client *client) > > ctx->dev = dev; > ctx->client = client; > - ctx->info = (const struct it66121_chip_info *) id->driver_data; > + if (dev_fwnode(&client->dev)) > + ctx->info = of_device_get_match_data(&client->dev); > + else > + ctx->info = (const struct it66121_chip_info *) id->driver_data; > > of_property_read_u32(ep, "bus-width", &ctx->bus_width); > of_node_put(ep); > @@ -1609,13 +1612,6 @@ static void it66121_remove(struct i2c_client *client) > mutex_destroy(&ctx->lock); > } > > -static const struct of_device_id it66121_dt_match[] = { > - { .compatible = "ite,it66121" }, > - { .compatible = "ite,it6610" }, > - { } > -}; > -MODULE_DEVICE_TABLE(of, it66121_dt_match); > - > static const struct it66121_chip_info it66121_chip_info = { > .id = ID_IT66121, > .vid = 0x4954, > @@ -1628,6 +1624,13 @@ static const struct it66121_chip_info it6610_chip_info = { > .pid = 0x0611, > }; > > +static const struct of_device_id it66121_dt_match[] = { > + { .compatible = "ite,it66121", &it66121_chip_info }, > + { .compatible = "ite,it6610", &it6610_chip_info }, > + { } > +}; > +MODULE_DEVICE_TABLE(of, it66121_dt_match); > + > static const struct i2c_device_id it66121_id[] = { > { "it66121", (kernel_ulong_t) &it66121_chip_info }, > { "it6610", (kernel_ulong_t) &it6610_chip_info }, -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH v3 2/2] drm: bridge: it66121: Simplify probe() 2023-08-18 19:18 [PATCH v3 0/2] Match data improvements for it66121 driver Biju Das 2023-08-18 19:18 ` [PATCH v3 1/2] drm: bridge: it66121: Extend match support for OF tables Biju Das @ 2023-08-18 19:18 ` Biju Das 2023-08-21 12:30 ` Laurent Pinchart 2023-09-05 14:20 ` [PATCH v3 0/2] Match data improvements for it66121 driver Robert Foss 2 siblings, 1 reply; 6+ messages in thread From: Biju Das @ 2023-08-18 19:18 UTC (permalink / raw) To: Phong LE, Neil Armstrong, Andrzej Hajda, Robert Foss, David Airlie, Daniel Vetter Cc: Jernej Skrabec, Geert Uytterhoeven, Jonas Karlman, Prabhakar Mahadev Lad, dri-devel, linux-renesas-soc, Laurent Pinchart, Biju Das, Andy Shevchenko Simplify probe() by replacing of_device_get_match_data() and ID lookup for retrieving match data by i2c_get_match_data(). Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> --- v2->v3: * Added Rb tag from Andy. v1->v2: * Dropped sentence for dropping local variable as it is integral part of the patch. --- drivers/gpu/drm/bridge/ite-it66121.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/gpu/drm/bridge/ite-it66121.c b/drivers/gpu/drm/bridge/ite-it66121.c index ba95ad46e259..a80246ef4ffe 100644 --- a/drivers/gpu/drm/bridge/ite-it66121.c +++ b/drivers/gpu/drm/bridge/ite-it66121.c @@ -1501,7 +1501,6 @@ static const char * const it66121_supplies[] = { static int it66121_probe(struct i2c_client *client) { - const struct i2c_device_id *id = i2c_client_get_device_id(client); u32 revision_id, vendor_ids[2] = { 0 }, device_ids[2] = { 0 }; struct device_node *ep; int ret; @@ -1523,10 +1522,7 @@ static int it66121_probe(struct i2c_client *client) ctx->dev = dev; ctx->client = client; - if (dev_fwnode(&client->dev)) - ctx->info = of_device_get_match_data(&client->dev); - else - ctx->info = (const struct it66121_chip_info *) id->driver_data; + ctx->info = i2c_get_match_data(client); of_property_read_u32(ep, "bus-width", &ctx->bus_width); of_node_put(ep); -- 2.25.1 ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH v3 2/2] drm: bridge: it66121: Simplify probe() 2023-08-18 19:18 ` [PATCH v3 2/2] drm: bridge: it66121: Simplify probe() Biju Das @ 2023-08-21 12:30 ` Laurent Pinchart 0 siblings, 0 replies; 6+ messages in thread From: Laurent Pinchart @ 2023-08-21 12:30 UTC (permalink / raw) To: Biju Das Cc: Neil Armstrong, Robert Foss, Andrzej Hajda, Geert Uytterhoeven, Jonas Karlman, Prabhakar Mahadev Lad, Jernej Skrabec, Phong LE, dri-devel, linux-renesas-soc, Andy Shevchenko Hi Biju, Thank you for the patch. On Fri, Aug 18, 2023 at 08:18:17PM +0100, Biju Das wrote: > Simplify probe() by replacing of_device_get_match_data() and ID lookup > for retrieving match data by i2c_get_match_data(). > > Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com> > Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> > --- > v2->v3: > * Added Rb tag from Andy. > v1->v2: > * Dropped sentence for dropping local variable as it is integral part of > the patch. > --- > drivers/gpu/drm/bridge/ite-it66121.c | 6 +----- > 1 file changed, 1 insertion(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/bridge/ite-it66121.c b/drivers/gpu/drm/bridge/ite-it66121.c > index ba95ad46e259..a80246ef4ffe 100644 > --- a/drivers/gpu/drm/bridge/ite-it66121.c > +++ b/drivers/gpu/drm/bridge/ite-it66121.c > @@ -1501,7 +1501,6 @@ static const char * const it66121_supplies[] = { > > static int it66121_probe(struct i2c_client *client) > { > - const struct i2c_device_id *id = i2c_client_get_device_id(client); > u32 revision_id, vendor_ids[2] = { 0 }, device_ids[2] = { 0 }; > struct device_node *ep; > int ret; > @@ -1523,10 +1522,7 @@ static int it66121_probe(struct i2c_client *client) > > ctx->dev = dev; > ctx->client = client; > - if (dev_fwnode(&client->dev)) > - ctx->info = of_device_get_match_data(&client->dev); > - else > - ctx->info = (const struct it66121_chip_info *) id->driver_data; > + ctx->info = i2c_get_match_data(client); > > of_property_read_u32(ep, "bus-width", &ctx->bus_width); > of_node_put(ep); -- Regards, Laurent Pinchart ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v3 0/2] Match data improvements for it66121 driver 2023-08-18 19:18 [PATCH v3 0/2] Match data improvements for it66121 driver Biju Das 2023-08-18 19:18 ` [PATCH v3 1/2] drm: bridge: it66121: Extend match support for OF tables Biju Das 2023-08-18 19:18 ` [PATCH v3 2/2] drm: bridge: it66121: Simplify probe() Biju Das @ 2023-09-05 14:20 ` Robert Foss 2 siblings, 0 replies; 6+ messages in thread From: Robert Foss @ 2023-09-05 14:20 UTC (permalink / raw) To: David Airlie, Daniel Vetter, Andrzej Hajda, Neil Armstrong, Phong LE, Biju Das Cc: Jernej Skrabec, Geert Uytterhoeven, Jonas Karlman, Prabhakar Mahadev Lad, dri-devel, linux-renesas-soc, Laurent Pinchart, Andy Shevchenko On Fri, 18 Aug 2023 20:18:15 +0100, Biju Das wrote: > This patch series aims to add match data improvements for it66121 driver. > > v2->v3: > * Removed fixes tag from patch#1 as nothing broken. > * Added Rb tag from Andy. > v1->v2: > * Split the patch into two. > * patch#1 extend match support for OF tables compared to legacy ID > lookup and fixes tag. > * patch#2 simplifies the probe() by using i2c_get_match_data. > * Dropped sentence for dropping local variable as it is integral part of > the patch. > > [...] Applied, thanks! [1/2] drm: bridge: it66121: Extend match support for OF tables https://cgit.freedesktop.org/drm/drm-misc/commit/?id=c11c1a50573e [2/2] drm: bridge: it66121: Simplify probe() https://cgit.freedesktop.org/drm/drm-misc/commit/?id=29ff3b7e23af Rob ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-09-05 14:20 UTC | newest] Thread overview: 6+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2023-08-18 19:18 [PATCH v3 0/2] Match data improvements for it66121 driver Biju Das 2023-08-18 19:18 ` [PATCH v3 1/2] drm: bridge: it66121: Extend match support for OF tables Biju Das 2023-08-21 12:30 ` Laurent Pinchart 2023-08-18 19:18 ` [PATCH v3 2/2] drm: bridge: it66121: Simplify probe() Biju Das 2023-08-21 12:30 ` Laurent Pinchart 2023-09-05 14:20 ` [PATCH v3 0/2] Match data improvements for it66121 driver Robert Foss
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox