Commit 94d4c132 authored by Enric Balletbo i Serra's avatar Enric Balletbo i Serra Committed by Sam Ravnborg

drm/bridge: ps8640: Print an error if VDO control fails

Print an error message inside ps8640_bridge_vdo_control() function when
it fails so we can simplify a bit the callers, they will only need to
check the error code.
Reviewed-by: default avatarSam Ravnborg <sam@ravnborg.org>
Signed-off-by: default avatarEnric Balletbo i Serra <enric.balletbo@collabora.com>
Reviewed-by: default avatarBilal Wasim <bwasim.lkml@gmail.com>
Tested-by: default avatarBilal Wasim <bwasim.lkml@gmail.com>
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200826081526.674866-5-enric.balletbo@collabora.com
parent 812a65ba
...@@ -82,8 +82,11 @@ static int ps8640_bridge_vdo_control(struct ps8640 *ps_bridge, ...@@ -82,8 +82,11 @@ static int ps8640_bridge_vdo_control(struct ps8640 *ps_bridge,
ret = i2c_smbus_write_i2c_block_data(client, PAGE3_SET_ADD, ret = i2c_smbus_write_i2c_block_data(client, PAGE3_SET_ADD,
sizeof(vdo_ctrl_buf), sizeof(vdo_ctrl_buf),
vdo_ctrl_buf); vdo_ctrl_buf);
if (ret < 0) if (ret < 0) {
DRM_ERROR("failed to %sable VDO: %d\n",
ctrl == ENABLE ? "en" : "dis", ret);
return ret; return ret;
}
return 0; return 0;
} }
...@@ -150,10 +153,8 @@ static void ps8640_pre_enable(struct drm_bridge *bridge) ...@@ -150,10 +153,8 @@ static void ps8640_pre_enable(struct drm_bridge *bridge)
} }
ret = ps8640_bridge_vdo_control(ps_bridge, ENABLE); ret = ps8640_bridge_vdo_control(ps_bridge, ENABLE);
if (ret) { if (ret)
DRM_ERROR("failed to enable VDO: %d\n", ret);
goto err_regulators_disable; goto err_regulators_disable;
}
/* Switch access edp panel's edid through i2c */ /* Switch access edp panel's edid through i2c */
ret = i2c_smbus_write_byte_data(client, PAGE2_I2C_BYPASS, ret = i2c_smbus_write_byte_data(client, PAGE2_I2C_BYPASS,
...@@ -175,9 +176,7 @@ static void ps8640_post_disable(struct drm_bridge *bridge) ...@@ -175,9 +176,7 @@ static void ps8640_post_disable(struct drm_bridge *bridge)
struct ps8640 *ps_bridge = bridge_to_ps8640(bridge); struct ps8640 *ps_bridge = bridge_to_ps8640(bridge);
int ret; int ret;
ret = ps8640_bridge_vdo_control(ps_bridge, DISABLE); ps8640_bridge_vdo_control(ps_bridge, DISABLE);
if (ret < 0)
DRM_ERROR("failed to disable VDO: %d\n", ret);
gpiod_set_value(ps_bridge->gpio_reset, 1); gpiod_set_value(ps_bridge->gpio_reset, 1);
gpiod_set_value(ps_bridge->gpio_powerdown, 1); gpiod_set_value(ps_bridge->gpio_powerdown, 1);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment