ASoC: es8316: setting gpio only when it's available

The spk_ctl_gpio may not available and no need to set, or else
there will be error message.

Change-Id: I54b1775c4d2bd695f7a5373149b14bc2501ce136
Signed-off-by: Kever Yang <kever.yang@rock-chips.com>
This commit is contained in:
brian
2018-09-25 14:06:01 +08:00
committed by Tao Huang
parent 3604596d70
commit 251948079f

View File

@@ -103,7 +103,9 @@ static void es8316_enable_spk(struct es8316_priv *es8316, bool enable)
bool level;
level = enable ? es8316->spk_active_level : !es8316->spk_active_level;
gpio_set_value(es8316->spk_ctl_gpio, level);
if (INVALID_GPIO != es8316->spk_ctl_gpio)
gpio_set_value(es8316->spk_ctl_gpio, level);
}
static const DECLARE_TLV_DB_SCALE(dac_vol_tlv, -9600, 50, 1);