]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm: adv7511: Add has_dsi variable to struct adv7511_chip_info
authorBiju Das <biju.das.jz@bp.renesas.com>
Wed, 30 Aug 2023 14:23:56 +0000 (15:23 +0100)
committerRobert Foss <rfoss@kernel.org>
Mon, 16 Oct 2023 09:09:32 +0000 (11:09 +0200)
The ADV7533 and ADV7535 have DSI support. Add a variable has_dsi to
struct adv7511_chip_info for handling configuration related to DSI.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: Robert Foss <rfoss@kernel.org>
Signed-off-by: Robert Foss <rfoss@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20230830142358.275459-7-biju.das.jz@bp.renesas.com
drivers/gpu/drm/bridge/adv7511/adv7511.h
drivers/gpu/drm/bridge/adv7511/adv7511_drv.c

index a728bfb33d034e355166e1ff3ef85743b95a5bf4..0dd56e3110398fbce5bf9980806ba77b163b59a6 100644 (file)
@@ -340,6 +340,7 @@ struct adv7511_chip_info {
        const char * const *supply_names;
        unsigned int num_supplies;
        unsigned int reg_cec_offset;
+       bool has_dsi;
 };
 
 struct adv7511 {
index 45dcfc9d9212863cdd04ee1f8dd0f8f71ede5f64..5a3adaf95f0ddf88b07392586c4f3f0f27d75281 100644 (file)
@@ -373,7 +373,7 @@ static void adv7511_power_on(struct adv7511 *adv7511)
         */
        regcache_sync(adv7511->regmap);
 
-       if (adv7511->info->type == ADV7533 || adv7511->info->type == ADV7535)
+       if (adv7511->info->has_dsi)
                adv7533_dsi_power_on(adv7511);
        adv7511->powered = true;
 }
@@ -397,7 +397,7 @@ static void __adv7511_power_off(struct adv7511 *adv7511)
 static void adv7511_power_off(struct adv7511 *adv7511)
 {
        __adv7511_power_off(adv7511);
-       if (adv7511->info->type == ADV7533 || adv7511->info->type == ADV7535)
+       if (adv7511->info->has_dsi)
                adv7533_dsi_power_off(adv7511);
        adv7511->powered = false;
 }
@@ -921,7 +921,7 @@ static enum drm_mode_status adv7511_bridge_mode_valid(struct drm_bridge *bridge,
 {
        struct adv7511 *adv = bridge_to_adv7511(bridge);
 
-       if (adv->info->type == ADV7533 || adv->info->type == ADV7535)
+       if (adv->info->has_dsi)
                return adv7533_mode_valid(adv, mode);
        else
                return adv7511_mode_valid(adv, mode);
@@ -1311,7 +1311,7 @@ static int adv7511_probe(struct i2c_client *i2c)
 
        adv7511_audio_init(dev, adv7511);
 
-       if (adv7511->info->type == ADV7533 || adv7511->info->type == ADV7535) {
+       if (adv7511->info->has_dsi) {
                ret = adv7533_attach_dsi(adv7511);
                if (ret)
                        goto err_unregister_audio;
@@ -1367,6 +1367,7 @@ static const struct adv7511_chip_info adv7533_chip_info = {
        .supply_names = adv7533_supply_names,
        .num_supplies = ARRAY_SIZE(adv7533_supply_names),
        .reg_cec_offset = ADV7533_REG_CEC_OFFSET,
+       .has_dsi = true,
 };
 
 static const struct adv7511_chip_info adv7535_chip_info = {
@@ -1376,6 +1377,7 @@ static const struct adv7511_chip_info adv7535_chip_info = {
        .supply_names = adv7533_supply_names,
        .num_supplies = ARRAY_SIZE(adv7533_supply_names),
        .reg_cec_offset = ADV7533_REG_CEC_OFFSET,
+       .has_dsi = true,
 };
 
 static const struct i2c_device_id adv7511_i2c_ids[] = {