diff options
author | John Stultz <john.stultz@linaro.org> | 2017-01-16 19:52:50 -0500 |
---|---|---|
committer | Archit Taneja <architt@codeaurora.org> | 2017-01-18 22:37:03 -0500 |
commit | 651e4769ba2a9f20c4b8a823ae2727bf7fa9c9f0 (patch) | |
tree | 4a6a5af6539dde5e92afe2c8666274c7da03f73a /drivers/gpu | |
parent | 40d86d2d22b04c2b2e48e2fe7054b85cf5021f25 (diff) |
drm/bridge: adv7511: Rework adv7511_power_on/off() so they can be reused internally
In chasing down issues with EDID probing, I found some
duplicated but incomplete logic used to power the chip on and
off.
This patch refactors the adv7511_power_on/off functions, so
they can be used for internal needs.
Cc: David Airlie <airlied@linux.ie>
Cc: Archit Taneja <architt@codeaurora.org>
Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Archit Taneja <architt@codeaurora.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1484614372-15342-5-git-send-email-john.stultz@linaro.org
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c index 72939d429da6..545ceff5890f 100644 --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | |||
@@ -325,7 +325,7 @@ static void adv7511_set_link_config(struct adv7511 *adv7511, | |||
325 | adv7511->rgb = config->input_colorspace == HDMI_COLORSPACE_RGB; | 325 | adv7511->rgb = config->input_colorspace == HDMI_COLORSPACE_RGB; |
326 | } | 326 | } |
327 | 327 | ||
328 | static void adv7511_power_on(struct adv7511 *adv7511) | 328 | static void __adv7511_power_on(struct adv7511 *adv7511) |
329 | { | 329 | { |
330 | adv7511->current_edid_segment = -1; | 330 | adv7511->current_edid_segment = -1; |
331 | 331 | ||
@@ -354,6 +354,11 @@ static void adv7511_power_on(struct adv7511 *adv7511) | |||
354 | regmap_update_bits(adv7511->regmap, ADV7511_REG_POWER2, | 354 | regmap_update_bits(adv7511->regmap, ADV7511_REG_POWER2, |
355 | ADV7511_REG_POWER2_HPD_SRC_MASK, | 355 | ADV7511_REG_POWER2_HPD_SRC_MASK, |
356 | ADV7511_REG_POWER2_HPD_SRC_NONE); | 356 | ADV7511_REG_POWER2_HPD_SRC_NONE); |
357 | } | ||
358 | |||
359 | static void adv7511_power_on(struct adv7511 *adv7511) | ||
360 | { | ||
361 | __adv7511_power_on(adv7511); | ||
357 | 362 | ||
358 | /* | 363 | /* |
359 | * Most of the registers are reset during power down or when HPD is low. | 364 | * Most of the registers are reset during power down or when HPD is low. |
@@ -362,21 +367,23 @@ static void adv7511_power_on(struct adv7511 *adv7511) | |||
362 | 367 | ||
363 | if (adv7511->type == ADV7533) | 368 | if (adv7511->type == ADV7533) |
364 | adv7533_dsi_power_on(adv7511); | 369 | adv7533_dsi_power_on(adv7511); |
365 | |||
366 | adv7511->powered = true; | 370 | adv7511->powered = true; |
367 | } | 371 | } |
368 | 372 | ||
369 | static void adv7511_power_off(struct adv7511 *adv7511) | 373 | static void __adv7511_power_off(struct adv7511 *adv7511) |
370 | { | 374 | { |
371 | /* TODO: setup additional power down modes */ | 375 | /* TODO: setup additional power down modes */ |
372 | regmap_update_bits(adv7511->regmap, ADV7511_REG_POWER, | 376 | regmap_update_bits(adv7511->regmap, ADV7511_REG_POWER, |
373 | ADV7511_POWER_POWER_DOWN, | 377 | ADV7511_POWER_POWER_DOWN, |
374 | ADV7511_POWER_POWER_DOWN); | 378 | ADV7511_POWER_POWER_DOWN); |
375 | regcache_mark_dirty(adv7511->regmap); | 379 | regcache_mark_dirty(adv7511->regmap); |
380 | } | ||
376 | 381 | ||
382 | static void adv7511_power_off(struct adv7511 *adv7511) | ||
383 | { | ||
384 | __adv7511_power_off(adv7511); | ||
377 | if (adv7511->type == ADV7533) | 385 | if (adv7511->type == ADV7533) |
378 | adv7533_dsi_power_off(adv7511); | 386 | adv7533_dsi_power_off(adv7511); |
379 | |||
380 | adv7511->powered = false; | 387 | adv7511->powered = false; |
381 | } | 388 | } |
382 | 389 | ||