diff --git a/asoc/codecs/wsa881x-analog.c b/asoc/codecs/wsa881x-analog.c old mode 100644 new mode 100755 index 62247524f1cc..14d027ac141f --- a/asoc/codecs/wsa881x-analog.c +++ b/asoc/codecs/wsa881x-analog.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2015-2016, 2018-2021, The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. */ #include @@ -805,7 +806,40 @@ static int wsa881x_set_visense(struct snd_kcontrol *kcontrol, return 0; } +static int wsa881x_get_t0_init(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + struct snd_soc_component *component = + snd_soc_kcontrol_component(kcontrol); + struct wsa881x_pdata *wsa881x = + snd_soc_component_get_drvdata(component); + struct wsa881x_tz_priv *pdata = &wsa881x->tz_pdata; + + ucontrol->value.integer.value[0] = pdata->t0_init; + dev_dbg(component->dev, "%s: t0 init %d\n", __func__, pdata->t0_init); + + return 0; +} + +static int wsa881x_set_t0_init(struct snd_kcontrol *kcontrol, + struct snd_ctl_elem_value *ucontrol) +{ + struct snd_soc_component *component = + snd_soc_kcontrol_component(kcontrol); + struct wsa881x_pdata *wsa881x = + snd_soc_component_get_drvdata(component); + struct wsa881x_tz_priv *pdata = &wsa881x->tz_pdata; + + pdata->t0_init = ucontrol->value.integer.value[0]; + dev_dbg(component->dev, "%s: t0 init %d\n", __func__, pdata->t0_init); + + return 0; +} + static const struct snd_kcontrol_new wsa881x_snd_controls[] = { + SOC_SINGLE_EXT("WSA T0 Init", SND_SOC_NOPM, 0, 1, 0, + wsa881x_get_t0_init, wsa881x_set_t0_init), + SOC_SINGLE_EXT("BOOST Switch", SND_SOC_NOPM, 0, 1, 0, wsa881x_get_boost, wsa881x_set_boost),