Skip to content

Commit c755512

Browse files
bijudasrobertfoss
authored andcommitted
drm: adv7511: Add has_dsi variable to struct adv7511_chip_info
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
1 parent 8d6cf57 commit c755512

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

drivers/gpu/drm/bridge/adv7511/adv7511.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ struct adv7511_chip_info {
340340
const char * const *supply_names;
341341
unsigned int num_supplies;
342342
unsigned int reg_cec_offset;
343+
bool has_dsi;
343344
};
344345

345346
struct adv7511 {

drivers/gpu/drm/bridge/adv7511/adv7511_drv.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ static void adv7511_power_on(struct adv7511 *adv7511)
373373
*/
374374
regcache_sync(adv7511->regmap);
375375

376-
if (adv7511->info->type == ADV7533 || adv7511->info->type == ADV7535)
376+
if (adv7511->info->has_dsi)
377377
adv7533_dsi_power_on(adv7511);
378378
adv7511->powered = true;
379379
}
@@ -397,7 +397,7 @@ static void __adv7511_power_off(struct adv7511 *adv7511)
397397
static void adv7511_power_off(struct adv7511 *adv7511)
398398
{
399399
__adv7511_power_off(adv7511);
400-
if (adv7511->info->type == ADV7533 || adv7511->info->type == ADV7535)
400+
if (adv7511->info->has_dsi)
401401
adv7533_dsi_power_off(adv7511);
402402
adv7511->powered = false;
403403
}
@@ -921,7 +921,7 @@ static enum drm_mode_status adv7511_bridge_mode_valid(struct drm_bridge *bridge,
921921
{
922922
struct adv7511 *adv = bridge_to_adv7511(bridge);
923923

924-
if (adv->info->type == ADV7533 || adv->info->type == ADV7535)
924+
if (adv->info->has_dsi)
925925
return adv7533_mode_valid(adv, mode);
926926
else
927927
return adv7511_mode_valid(adv, mode);
@@ -1311,7 +1311,7 @@ static int adv7511_probe(struct i2c_client *i2c)
13111311

13121312
adv7511_audio_init(dev, adv7511);
13131313

1314-
if (adv7511->info->type == ADV7533 || adv7511->info->type == ADV7535) {
1314+
if (adv7511->info->has_dsi) {
13151315
ret = adv7533_attach_dsi(adv7511);
13161316
if (ret)
13171317
goto err_unregister_audio;
@@ -1367,6 +1367,7 @@ static const struct adv7511_chip_info adv7533_chip_info = {
13671367
.supply_names = adv7533_supply_names,
13681368
.num_supplies = ARRAY_SIZE(adv7533_supply_names),
13691369
.reg_cec_offset = ADV7533_REG_CEC_OFFSET,
1370+
.has_dsi = true,
13701371
};
13711372

13721373
static const struct adv7511_chip_info adv7535_chip_info = {
@@ -1376,6 +1377,7 @@ static const struct adv7511_chip_info adv7535_chip_info = {
13761377
.supply_names = adv7533_supply_names,
13771378
.num_supplies = ARRAY_SIZE(adv7533_supply_names),
13781379
.reg_cec_offset = ADV7533_REG_CEC_OFFSET,
1380+
.has_dsi = true,
13791381
};
13801382

13811383
static const struct i2c_device_id adv7511_i2c_ids[] = {

0 commit comments

Comments
 (0)