diff mbox series

[v2,7/8] drm: adv7511: Add link_config variable to struct adv7511_chip_info

Message ID 20230830142358.275459-8-biju.das.jz@bp.renesas.com (mailing list archive)
State Accepted
Delegated to: Kieran Bingham
Headers show
Series ADV7511 driver enhancements | expand

Commit Message

Biju Das Aug. 30, 2023, 2:23 p.m. UTC
The ADV7511 needs link configuration whereas ADV75{33,35} does not need
it. Add a variable link_config to struct adv7511_chip_info to handle
this difference.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
v1->v2:
 * Add Rb tag from Laurent.
 * Replaced variable type from unsigned->bool.
---
 drivers/gpu/drm/bridge/adv7511/adv7511.h     | 1 +
 drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)

Comments

Robert Foss Oct. 16, 2023, 8:59 a.m. UTC | #1
On Wed, Aug 30, 2023 at 4:25 PM Biju Das <biju.das.jz@bp.renesas.com> wrote:
>
> The ADV7511 needs link configuration whereas ADV75{33,35} does not need
> it. Add a variable link_config to struct adv7511_chip_info to handle
> this difference.
>
> Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> v1->v2:
>  * Add Rb tag from Laurent.
>  * Replaced variable type from unsigned->bool.
> ---
>  drivers/gpu/drm/bridge/adv7511/adv7511.h     | 1 +
>  drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 5 +++--
>  2 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511.h b/drivers/gpu/drm/bridge/adv7511/adv7511.h
> index 0dd56e311039..0d39e32b0793 100644
> --- a/drivers/gpu/drm/bridge/adv7511/adv7511.h
> +++ b/drivers/gpu/drm/bridge/adv7511/adv7511.h
> @@ -341,6 +341,7 @@ struct adv7511_chip_info {
>         unsigned int num_supplies;
>         unsigned int reg_cec_offset;
>         bool has_dsi;
> +       bool link_config;
>  };
>
>  struct adv7511 {
> diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> index 9d88c29b6f59..e0ec3c098225 100644
> --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
> @@ -1203,7 +1203,7 @@ static int adv7511_probe(struct i2c_client *i2c)
>
>         memset(&link_config, 0, sizeof(link_config));
>
> -       if (adv7511->info->type == ADV7511)
> +       if (adv7511->info->link_config)
>                 ret = adv7511_parse_dt(dev->of_node, &link_config);
>         else
>                 ret = adv7533_parse_dt(dev->of_node, adv7511);
> @@ -1292,7 +1292,7 @@ static int adv7511_probe(struct i2c_client *i2c)
>
>         i2c_set_clientdata(i2c, adv7511);
>
> -       if (adv7511->info->type == ADV7511)
> +       if (adv7511->info->link_config)
>                 adv7511_set_link_config(adv7511, &link_config);
>
>         ret = adv7511_cec_init(dev, adv7511);
> @@ -1358,6 +1358,7 @@ static const struct adv7511_chip_info adv7511_chip_info = {
>         .type = ADV7511,
>         .supply_names = adv7511_supply_names,
>         .num_supplies = ARRAY_SIZE(adv7511_supply_names),
> +       .link_config = true,
>  };
>
>  static const struct adv7511_chip_info adv7533_chip_info = {
> --
> 2.25.1
>

Reviewed-by: Robert Foss <rfoss@kernel.org>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511.h b/drivers/gpu/drm/bridge/adv7511/adv7511.h
index 0dd56e311039..0d39e32b0793 100644
--- a/drivers/gpu/drm/bridge/adv7511/adv7511.h
+++ b/drivers/gpu/drm/bridge/adv7511/adv7511.h
@@ -341,6 +341,7 @@  struct adv7511_chip_info {
 	unsigned int num_supplies;
 	unsigned int reg_cec_offset;
 	bool has_dsi;
+	bool link_config;
 };
 
 struct adv7511 {
diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
index 9d88c29b6f59..e0ec3c098225 100644
--- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
+++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
@@ -1203,7 +1203,7 @@  static int adv7511_probe(struct i2c_client *i2c)
 
 	memset(&link_config, 0, sizeof(link_config));
 
-	if (adv7511->info->type == ADV7511)
+	if (adv7511->info->link_config)
 		ret = adv7511_parse_dt(dev->of_node, &link_config);
 	else
 		ret = adv7533_parse_dt(dev->of_node, adv7511);
@@ -1292,7 +1292,7 @@  static int adv7511_probe(struct i2c_client *i2c)
 
 	i2c_set_clientdata(i2c, adv7511);
 
-	if (adv7511->info->type == ADV7511)
+	if (adv7511->info->link_config)
 		adv7511_set_link_config(adv7511, &link_config);
 
 	ret = adv7511_cec_init(dev, adv7511);
@@ -1358,6 +1358,7 @@  static const struct adv7511_chip_info adv7511_chip_info = {
 	.type = ADV7511,
 	.supply_names = adv7511_supply_names,
 	.num_supplies = ARRAY_SIZE(adv7511_supply_names),
+	.link_config = true,
 };
 
 static const struct adv7511_chip_info adv7533_chip_info = {