diff mbox series

[v3,05/13] ASoC: wcd938x: Use SOC_SINGLE_EXT_TLV() helper macro

Message ID 20250304140500.976127-6-ckeepax@opensource.cirrus.com (mailing list archive)
State Accepted
Commit 9bb7d7452363fc470b76766b0a6356807e752795
Headers show
Series Tidy up ASoC VALUE control macros | expand

Commit Message

Charles Keepax March 4, 2025, 2:04 p.m. UTC
Rather than open coding use the helper macro provided by the ASoC core.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---

No change since v2.

 sound/soc/codecs/wcd938x.c | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

Comments

Srinivas Kandagatla March 4, 2025, 2:57 p.m. UTC | #1
Thanks Charles,

On 04/03/2025 14:04, Charles Keepax wrote:
> Rather than open coding use the helper macro provided by the ASoC core.
> 
> Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
> ---
> 
> No change since v2.
> 
>   sound/soc/codecs/wcd938x.c | 9 ++-------
>   1 file changed, 2 insertions(+), 7 deletions(-)
> 
> diff --git a/sound/soc/codecs/wcd938x.c b/sound/soc/codecs/wcd938x.c
> index f2a4f3262bdbc..b536e8bdc5a74 100644
> --- a/sound/soc/codecs/wcd938x.c
> +++ b/sound/soc/codecs/wcd938x.c
> @@ -70,13 +70,8 @@
>   #define WCD_MBHC_HS_V_MAX           1600
>   
>   #define WCD938X_EAR_PA_GAIN_TLV(xname, reg, shift, max, invert, tlv_array) \

We remove WCD938X_EAR_PA_GAIN_TLV altogether.

Otherwise lgtm,

Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

--srini
> -{	.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
> -	.access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\
> -		 SNDRV_CTL_ELEM_ACCESS_READWRITE,\
> -	.tlv.p = (tlv_array), \
> -	.info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\
> -	.put = wcd938x_ear_pa_put_gain, \
> -	.private_value = SOC_SINGLE_VALUE(reg, shift, max, invert, 0) }
> +	SOC_SINGLE_EXT_TLV(xname, reg, shift, max, invert, snd_soc_get_volsw, \
> +			   wcd938x_ear_pa_put_gain, tlv_array)
>   
>   enum {
>   	WCD9380 = 0,
diff mbox series

Patch

diff --git a/sound/soc/codecs/wcd938x.c b/sound/soc/codecs/wcd938x.c
index f2a4f3262bdbc..b536e8bdc5a74 100644
--- a/sound/soc/codecs/wcd938x.c
+++ b/sound/soc/codecs/wcd938x.c
@@ -70,13 +70,8 @@ 
 #define WCD_MBHC_HS_V_MAX           1600
 
 #define WCD938X_EAR_PA_GAIN_TLV(xname, reg, shift, max, invert, tlv_array) \
-{	.iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \
-	.access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\
-		 SNDRV_CTL_ELEM_ACCESS_READWRITE,\
-	.tlv.p = (tlv_array), \
-	.info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\
-	.put = wcd938x_ear_pa_put_gain, \
-	.private_value = SOC_SINGLE_VALUE(reg, shift, max, invert, 0) }
+	SOC_SINGLE_EXT_TLV(xname, reg, shift, max, invert, snd_soc_get_volsw, \
+			   wcd938x_ear_pa_put_gain, tlv_array)
 
 enum {
 	WCD9380 = 0,