diff options
author | Russell King <rmk+kernel@armlinux.org.uk> | 2019-03-02 00:21:38 +0300 |
---|---|---|
committer | Russell King <rmk+kernel@armlinux.org.uk> | 2019-06-13 23:54:56 +0300 |
commit | 900b2b7250b8fe49270e9272a1d937fa69350538 (patch) | |
tree | ef77488677f3d19b9dddc77330b7b23c0d370339 /drivers/gpu/drm | |
parent | 26f7bf1251c70bafe99f73edd222f6126b395b3b (diff) | |
download | linux-900b2b7250b8fe49270e9272a1d937fa69350538.tar.xz |
drm/i2c: tda998x: clean up tda998x_configure_audio()
tda998x_configure_audio() is called via some paths where an error
return is meaningless, and as a result of moving the audio routing
code, this function no longer returns any errors, so let's make it
void. We can also make tda998x_write_aif() return void as well.
tda998x_configure_audio() also only ever needs to write the current
audio settings, so simplify the code in tda998x_audio_hw_params()
so that can happen.
Tested-by: Sven Van Asbroeck <TheSven73@gmail.com>
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/i2c/tda998x_drv.c | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c b/drivers/gpu/drm/i2c/tda998x_drv.c index 0d47cd14011d..e4f0f5699d65 100644 --- a/drivers/gpu/drm/i2c/tda998x_drv.c +++ b/drivers/gpu/drm/i2c/tda998x_drv.c @@ -849,16 +849,14 @@ tda998x_write_if(struct tda998x_priv *priv, u8 bit, u16 addr, reg_set(priv, REG_DIP_IF_FLAGS, bit); } -static int tda998x_write_aif(struct tda998x_priv *priv, - const struct hdmi_audio_infoframe *cea) +static void tda998x_write_aif(struct tda998x_priv *priv, + const struct hdmi_audio_infoframe *cea) { union hdmi_infoframe frame; frame.audio = *cea; tda998x_write_if(priv, DIP_IF_FLAGS_IF4, REG_IF4_HB0, &frame); - - return 0; } static void @@ -992,15 +990,15 @@ static void tda998x_audio_mute(struct tda998x_priv *priv, bool on) } } -static int tda998x_configure_audio(struct tda998x_priv *priv, - const struct tda998x_audio_settings *settings) +static void tda998x_configure_audio(struct tda998x_priv *priv) { + const struct tda998x_audio_settings *settings = &priv->audio; u8 buf[6], adiv; u32 n; /* If audio is not configured, there is nothing to do. */ if (settings->ena_ap == 0) - return 0; + return; adiv = tda998x_get_adiv(priv, settings->params.sample_rate); @@ -1048,7 +1046,7 @@ static int tda998x_configure_audio(struct tda998x_priv *priv, msleep(20); tda998x_audio_mute(priv, false); - return tda998x_write_aif(priv, &settings->params.cea); + tda998x_write_aif(priv, &settings->params.cea); } static int tda998x_audio_hw_params(struct device *dev, void *data, @@ -1108,16 +1106,12 @@ static int tda998x_audio_hw_params(struct device *dev, void *data, return ret; mutex_lock(&priv->audio_mutex); + priv->audio = audio; if (priv->supports_infoframes && priv->sink_has_audio) - ret = tda998x_configure_audio(priv, &audio); - else - ret = 0; - - if (ret == 0) - priv->audio = audio; + tda998x_configure_audio(priv); mutex_unlock(&priv->audio_mutex); - return ret; + return 0; } static void tda998x_audio_shutdown(struct device *dev, void *data) @@ -1629,7 +1623,7 @@ static void tda998x_bridge_mode_set(struct drm_bridge *bridge, tda998x_write_avi(priv, adjusted_mode); if (priv->sink_has_audio) - tda998x_configure_audio(priv, &priv->audio); + tda998x_configure_audio(priv); } mutex_unlock(&priv->audio_mutex); |