Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Tidy up ASoC VALUE control macros

Merge series from Charles Keepax <ckeepax@opensource.cirrus.com>:

Tidy up the ASoC control value macros. Fix some drivers that should be
using core macros that aren't, combine the existing core macros to be
a little more consistent in style, and update the core macros to use
each other where possible.

+68 -194
+24 -35
include/sound/soc-dapm.h
··· 326 326 327 327 /* dapm kcontrol types */ 328 328 #define SOC_DAPM_DOUBLE(xname, reg, lshift, rshift, max, invert) \ 329 - { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 330 - .info = snd_soc_info_volsw, \ 331 - .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ 332 - .private_value = SOC_DOUBLE_VALUE(reg, lshift, rshift, max, invert, 0) } 329 + SOC_DOUBLE_EXT(xname, reg, lshift, rshift, max, invert, \ 330 + snd_soc_dapm_get_volsw, snd_soc_dapm_put_volsw) 333 331 #define SOC_DAPM_DOUBLE_R(xname, lreg, rreg, shift, max, invert) \ 334 - { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 335 - .info = snd_soc_info_volsw, \ 336 - .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ 337 - .private_value = SOC_DOUBLE_R_VALUE(lreg, rreg, shift, max, invert) } 332 + SOC_DOUBLE_R_EXT(xname, lreg, rreg, shift, max, invert, \ 333 + snd_soc_dapm_get_volsw, snd_soc_dapm_put_volsw) 338 334 #define SOC_DAPM_SINGLE(xname, reg, shift, max, invert) \ 339 - { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 340 - .info = snd_soc_info_volsw, \ 341 - .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ 342 - .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert, 0) } 335 + SOC_SINGLE_EXT(xname, reg, shift, max, invert, \ 336 + snd_soc_dapm_get_volsw, snd_soc_dapm_put_volsw) 337 + #define SOC_DAPM_SINGLE_VIRT(xname, max) \ 338 + SOC_DAPM_SINGLE(xname, SND_SOC_NOPM, 0, max, 0) 339 + #define SOC_DAPM_DOUBLE_R_TLV(xname, lreg, rreg, shift, max, invert, tlv_array) \ 340 + SOC_DOUBLE_R_EXT_TLV(xname, lreg, rreg, shift, max, invert, \ 341 + snd_soc_dapm_get_volsw, snd_soc_dapm_put_volsw, \ 342 + tlv_array) 343 + #define SOC_DAPM_SINGLE_TLV(xname, reg, shift, max, invert, tlv_array) \ 344 + SOC_SINGLE_EXT_TLV(xname, reg, shift, max, invert, \ 345 + snd_soc_dapm_get_volsw, snd_soc_dapm_put_volsw, \ 346 + tlv_array) 347 + #define SOC_DAPM_SINGLE_TLV_VIRT(xname, max, tlv_array) \ 348 + SOC_DAPM_SINGLE(xname, SND_SOC_NOPM, 0, max, 0, tlv_array) 349 + #define SOC_DAPM_ENUM(xname, xenum) \ 350 + SOC_ENUM_EXT(xname, xenum, snd_soc_dapm_get_enum_double, \ 351 + snd_soc_dapm_put_enum_double) 352 + #define SOC_DAPM_ENUM_EXT(xname, xenum, xget, xput) \ 353 + SOC_ENUM_EXT(xname, xenum, xget, xput) 354 + 343 355 #define SOC_DAPM_SINGLE_AUTODISABLE(xname, reg, shift, max, invert) \ 344 356 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 345 357 .info = snd_soc_info_volsw, \ 346 358 .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ 347 359 .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert, 1) } 348 - #define SOC_DAPM_SINGLE_VIRT(xname, max) \ 349 - SOC_DAPM_SINGLE(xname, SND_SOC_NOPM, 0, max, 0) 350 - #define SOC_DAPM_SINGLE_TLV(xname, reg, shift, max, invert, tlv_array) \ 351 - { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 352 - .info = snd_soc_info_volsw, \ 353 - .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | SNDRV_CTL_ELEM_ACCESS_READWRITE,\ 354 - .tlv.p = (tlv_array), \ 355 - .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ 356 - .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert, 0) } 357 360 #define SOC_DAPM_SINGLE_TLV_AUTODISABLE(xname, reg, shift, max, invert, tlv_array) \ 358 361 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 359 362 .info = snd_soc_info_volsw, \ ··· 364 361 .tlv.p = (tlv_array), \ 365 362 .get = snd_soc_dapm_get_volsw, .put = snd_soc_dapm_put_volsw, \ 366 363 .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert, 1) } 367 - #define SOC_DAPM_SINGLE_TLV_VIRT(xname, max, tlv_array) \ 368 - SOC_DAPM_SINGLE(xname, SND_SOC_NOPM, 0, max, 0, tlv_array) 369 - #define SOC_DAPM_ENUM(xname, xenum) \ 370 - { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 371 - .info = snd_soc_info_enum_double, \ 372 - .get = snd_soc_dapm_get_enum_double, \ 373 - .put = snd_soc_dapm_put_enum_double, \ 374 - .private_value = (unsigned long)&xenum } 375 - #define SOC_DAPM_ENUM_EXT(xname, xenum, xget, xput) \ 376 - { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 377 - .info = snd_soc_info_enum_double, \ 378 - .get = xget, \ 379 - .put = xput, \ 380 - .private_value = (unsigned long)&xenum } 381 364 #define SOC_DAPM_PIN_SWITCH(xname) \ 382 365 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname " Switch", \ 383 366 .info = snd_soc_dapm_info_pin_switch, \
+10 -21
include/sound/soc.h
··· 51 51 .sign_bit = xsign_bit, .invert = xinvert, .autodisable = xautodisable}) 52 52 #define SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert, xautodisable) \ 53 53 SOC_DOUBLE_VALUE(xreg, xshift, xshift, xmax, xinvert, xautodisable) 54 - #define SOC_SINGLE_VALUE_EXT(xreg, xmax, xinvert) \ 55 - ((unsigned long)&(struct soc_mixer_control) \ 56 - {.reg = xreg, .max = xmax, .invert = xinvert}) 57 - #define SOC_DOUBLE_R_VALUE(xlreg, xrreg, xshift, xmax, xinvert) \ 58 - ((unsigned long)&(struct soc_mixer_control) \ 59 - {.reg = xlreg, .rreg = xrreg, .shift = xshift, .rshift = xshift, \ 60 - .max = xmax, .invert = xinvert}) 61 54 #define SOC_DOUBLE_R_S_VALUE(xlreg, xrreg, xshift, xmin, xmax, xsign_bit, xinvert) \ 62 55 ((unsigned long)&(struct soc_mixer_control) \ 63 56 {.reg = xlreg, .rreg = xrreg, .shift = xshift, .rshift = xshift, \ 64 57 .max = xmax, .min = xmin, .sign_bit = xsign_bit, \ 65 58 .invert = xinvert}) 66 - #define SOC_DOUBLE_R_RANGE_VALUE(xlreg, xrreg, xshift, xmin, xmax, xinvert) \ 67 - ((unsigned long)&(struct soc_mixer_control) \ 68 - {.reg = xlreg, .rreg = xrreg, .shift = xshift, .rshift = xshift, \ 69 - .min = xmin, .max = xmax, .invert = xinvert}) 59 + #define SOC_DOUBLE_R_VALUE(xlreg, xrreg, xshift, xmin, xmax, xinvert) \ 60 + SOC_DOUBLE_R_S_VALUE(xlreg, xrreg, xshift, xmin, xmax, 0, xinvert) 61 + 70 62 #define SOC_SINGLE(xname, reg, shift, max, invert) \ 71 63 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 72 64 .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\ ··· 122 130 .info = snd_soc_info_volsw, \ 123 131 .get = snd_soc_get_volsw, .put = snd_soc_put_volsw, \ 124 132 .private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, xshift, \ 125 - xmax, xinvert) } 133 + 0, xmax, xinvert) } 126 134 #define SOC_DOUBLE_R_RANGE(xname, reg_left, reg_right, xshift, xmin, \ 127 135 xmax, xinvert) \ 128 136 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ 129 137 .info = snd_soc_info_volsw_range, \ 130 138 .get = snd_soc_get_volsw_range, .put = snd_soc_put_volsw_range, \ 131 - .private_value = SOC_DOUBLE_R_RANGE_VALUE(reg_left, reg_right, \ 139 + .private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, \ 132 140 xshift, xmin, xmax, xinvert) } 133 141 #define SOC_DOUBLE_TLV(xname, reg, shift_left, shift_right, max, invert, tlv_array) \ 134 142 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ ··· 171 179 .info = snd_soc_info_volsw, \ 172 180 .get = snd_soc_get_volsw, .put = snd_soc_put_volsw, \ 173 181 .private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, xshift, \ 174 - xmax, xinvert) } 182 + 0, xmax, xinvert) } 175 183 #define SOC_DOUBLE_R_RANGE_TLV(xname, reg_left, reg_right, xshift, xmin, \ 176 184 xmax, xinvert, tlv_array) \ 177 185 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ ··· 180 188 .tlv.p = (tlv_array), \ 181 189 .info = snd_soc_info_volsw_range, \ 182 190 .get = snd_soc_get_volsw_range, .put = snd_soc_put_volsw_range, \ 183 - .private_value = SOC_DOUBLE_R_RANGE_VALUE(reg_left, reg_right, \ 191 + .private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, \ 184 192 xshift, xmin, xmax, xinvert) } 185 193 #define SOC_DOUBLE_R_SX_TLV(xname, xreg, xrreg, xshift, xmin, xmax, tlv_array) \ 186 194 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ ··· 190 198 .info = snd_soc_info_volsw_sx, \ 191 199 .get = snd_soc_get_volsw_sx, \ 192 200 .put = snd_soc_put_volsw_sx, \ 193 - .private_value = (unsigned long)&(struct soc_mixer_control) \ 194 - {.reg = xreg, .rreg = xrreg, \ 195 - .shift = xshift, .rshift = xshift, \ 196 - .max = xmax, .min = xmin} } 201 + .private_value = SOC_DOUBLE_R_VALUE(xreg, xrreg, xshift, xmin, xmax, 0) } 197 202 #define SOC_DOUBLE_R_S_TLV(xname, reg_left, reg_right, xshift, xmin, xmax, xsign_bit, xinvert, tlv_array) \ 198 203 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname),\ 199 204 .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ ··· 264 275 .info = snd_soc_info_volsw, \ 265 276 .get = xhandler_get, .put = xhandler_put, \ 266 277 .private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, xshift, \ 267 - xmax, xinvert) } 278 + 0, xmax, xinvert) } 268 279 #define SOC_SINGLE_EXT_TLV(xname, xreg, xshift, xmax, xinvert,\ 269 280 xhandler_get, xhandler_put, tlv_array) \ 270 281 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ ··· 305 316 .info = snd_soc_info_volsw, \ 306 317 .get = xhandler_get, .put = xhandler_put, \ 307 318 .private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, xshift, \ 308 - xmax, xinvert) } 319 + 0, xmax, xinvert) } 309 320 #define SOC_DOUBLE_R_S_EXT_TLV(xname, reg_left, reg_right, xshift, xmin, xmax, \ 310 321 xsign_bit, xinvert, xhandler_get, xhandler_put, \ 311 322 tlv_array) \
+2 -9
sound/soc/atmel/tse850-pcm5142.c
··· 227 227 static const struct snd_kcontrol_new mux2 = 228 228 SOC_DAPM_ENUM_EXT("MUX2", mux_enum, tse850_get_mux2, tse850_put_mux2); 229 229 230 - #define TSE850_DAPM_SINGLE_EXT(xname, reg, shift, max, invert, xget, xput) \ 231 - { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 232 - .info = snd_soc_info_volsw, \ 233 - .get = xget, \ 234 - .put = xput, \ 235 - .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert, 0) } 236 - 237 230 static const struct snd_kcontrol_new mix[] = { 238 - TSE850_DAPM_SINGLE_EXT("IN Switch", SND_SOC_NOPM, 0, 1, 0, 239 - tse850_get_mix, tse850_put_mix), 231 + SOC_SINGLE_EXT("IN Switch", SND_SOC_NOPM, 0, 1, 0, 232 + tse850_get_mix, tse850_put_mix), 240 233 }; 241 234 242 235 static const char * const ana_text[] = {
+6 -4
sound/soc/codecs/adau17x1.c
··· 254 254 } 255 255 256 256 #define DECLARE_ADAU17X1_DSP_MUX_CTRL(_name, _label, _stream, _text) \ 257 - const struct snd_kcontrol_new _name = \ 258 - SOC_DAPM_ENUM_EXT(_label, (const struct soc_enum)\ 257 + const struct soc_enum _name##_enum = \ 259 258 SOC_ENUM_SINGLE(SND_SOC_NOPM, _stream, \ 260 - ARRAY_SIZE(_text), _text), \ 261 - adau17x1_dsp_mux_enum_get, adau17x1_dsp_mux_enum_put) 259 + ARRAY_SIZE(_text), _text); \ 260 + const struct snd_kcontrol_new _name = \ 261 + SOC_DAPM_ENUM_EXT(_label, _name##_enum, \ 262 + adau17x1_dsp_mux_enum_get, \ 263 + adau17x1_dsp_mux_enum_put) 262 264 263 265 static const char * const adau17x1_dac_mux_text[] = { 264 266 "DSP",
+4 -28
sound/soc/codecs/jz4760.c
··· 314 314 }; 315 315 316 316 static const struct snd_kcontrol_new jz4760_codec_pcm_playback_controls[] = { 317 - { 318 - .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 319 - .name = "Volume", 320 - .info = snd_soc_info_volsw, 321 - .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ 322 - | SNDRV_CTL_ELEM_ACCESS_READWRITE, 323 - .tlv.p = dac_tlv, 324 - .get = snd_soc_dapm_get_volsw, 325 - .put = snd_soc_dapm_put_volsw, 326 - .private_value = SOC_DOUBLE_R_VALUE(JZ4760_CODEC_REG_GCR6, 327 - JZ4760_CODEC_REG_GCR5, 328 - REG_GCR_GAIN_OFFSET, 329 - REG_GCR_GAIN_MAX, 1), 330 - }, 317 + SOC_DAPM_DOUBLE_R_TLV("Volume", JZ4760_CODEC_REG_GCR6, JZ4760_CODEC_REG_GCR5, 318 + REG_GCR_GAIN_OFFSET, REG_GCR_GAIN_MAX, 1, dac_tlv), 331 319 }; 332 320 333 321 static const struct snd_kcontrol_new jz4760_codec_hp_playback_controls[] = { 334 - { 335 - .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 336 - .name = "Volume", 337 - .info = snd_soc_info_volsw, 338 - .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ 339 - | SNDRV_CTL_ELEM_ACCESS_READWRITE, 340 - .tlv.p = out_tlv, 341 - .get = snd_soc_dapm_get_volsw, 342 - .put = snd_soc_dapm_put_volsw, 343 - .private_value = SOC_DOUBLE_R_VALUE(JZ4760_CODEC_REG_GCR2, 344 - JZ4760_CODEC_REG_GCR1, 345 - REG_GCR_GAIN_OFFSET, 346 - REG_GCR_GAIN_MAX, 1), 347 - }, 322 + SOC_DAPM_DOUBLE_R_TLV("Volume", JZ4760_CODEC_REG_GCR2, JZ4760_CODEC_REG_GCR1, 323 + REG_GCR_GAIN_OFFSET, REG_GCR_GAIN_MAX, 1, out_tlv), 348 324 }; 349 325 350 326 static int hpout_event(struct snd_soc_dapm_widget *w,
+6 -34
sound/soc/codecs/jz4770.c
··· 331 331 }; 332 332 333 333 static const struct snd_kcontrol_new jz4770_codec_pcm_playback_controls[] = { 334 - { 335 - .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 336 - .name = "Volume", 337 - .info = snd_soc_info_volsw, 338 - .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ 339 - | SNDRV_CTL_ELEM_ACCESS_READWRITE, 340 - .tlv.p = dac_tlv, 341 - .get = snd_soc_dapm_get_volsw, 342 - .put = snd_soc_dapm_put_volsw, 343 - /* 344 - * NOTE: DACR/DACL are inversed; the gain value written to DACR 345 - * seems to affect the left channel, and the gain value written 346 - * to DACL seems to affect the right channel. 347 - */ 348 - .private_value = SOC_DOUBLE_R_VALUE(JZ4770_CODEC_REG_GCR_DACR, 349 - JZ4770_CODEC_REG_GCR_DACL, 350 - REG_GCR_GAIN_OFFSET, 351 - REG_GCR_GAIN_MAX, 1), 352 - }, 334 + SOC_DAPM_DOUBLE_R_TLV("Volume", JZ4770_CODEC_REG_GCR_DACR, 335 + JZ4770_CODEC_REG_GCR_DACL, REG_GCR_GAIN_OFFSET, 336 + REG_GCR_GAIN_MAX, 1, dac_tlv), 353 337 }; 354 338 355 339 static const struct snd_kcontrol_new jz4770_codec_hp_playback_controls[] = { 356 - { 357 - .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 358 - .name = "Volume", 359 - .info = snd_soc_info_volsw, 360 - .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ 361 - | SNDRV_CTL_ELEM_ACCESS_READWRITE, 362 - .tlv.p = out_tlv, 363 - .get = snd_soc_dapm_get_volsw, 364 - .put = snd_soc_dapm_put_volsw, 365 - /* HPR/HPL inversed for the same reason as above */ 366 - .private_value = SOC_DOUBLE_R_VALUE(JZ4770_CODEC_REG_GCR_HPR, 367 - JZ4770_CODEC_REG_GCR_HPL, 368 - REG_GCR_GAIN_OFFSET, 369 - REG_GCR_GAIN_MAX, 1), 370 - }, 340 + SOC_DAPM_DOUBLE_R_TLV("Volume", JZ4770_CODEC_REG_GCR_HPR, 341 + JZ4770_CODEC_REG_GCR_HPL, REG_GCR_GAIN_OFFSET, 342 + REG_GCR_GAIN_MAX, 1, out_tlv), 371 343 }; 372 344 373 345 static int hpout_event(struct snd_soc_dapm_widget *w,
-8
sound/soc/codecs/rt715-sdca.c
··· 427 427 .private_value = RT715_SDCA_PR_VALUE(reg_base, xcount, xmax, \ 428 428 xshift, xinvert)} 429 429 430 - #define SOC_DOUBLE_R_EXT(xname, reg_left, reg_right, xshift, xmax, xinvert,\ 431 - xhandler_get, xhandler_put) \ 432 - { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ 433 - .info = snd_soc_info_volsw, \ 434 - .get = xhandler_get, .put = xhandler_put, \ 435 - .private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, xshift, \ 436 - xmax, xinvert) } 437 - 438 430 #define RT715_SDCA_EXT_TLV(xname, reg_base, xhandler_get,\ 439 431 xhandler_put, tlv_array, xcount, xmax) \ 440 432 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \
-8
sound/soc/codecs/rt715.c
··· 486 486 return 0; 487 487 } 488 488 489 - #define SOC_DOUBLE_R_EXT(xname, reg_left, reg_right, xshift, xmax, xinvert,\ 490 - xhandler_get, xhandler_put) \ 491 - { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ 492 - .info = snd_soc_info_volsw, \ 493 - .get = xhandler_get, .put = xhandler_put, \ 494 - .private_value = SOC_DOUBLE_R_VALUE(reg_left, reg_right, xshift, \ 495 - xmax, xinvert) } 496 - 497 489 #define RT715_MAIN_SWITCH_EXT(xname, xhandler_get, xhandler_put) \ 498 490 { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = (xname), \ 499 491 .info = rt715_switch_info, \
+3 -8
sound/soc/codecs/sma1307.c
··· 1019 1019 .private_value = (unsigned long)&sma1307_aif_out_source_enum 1020 1020 }; 1021 1021 1022 - static const struct snd_kcontrol_new sma1307_sdo_control = { 1023 - .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 1024 - .name = "Switch", 1025 - .info = snd_soc_info_volsw, 1026 - .get = sma1307_dapm_sdo_enable_get, 1027 - .put = sma1307_dapm_sdo_enable_put, 1028 - .private_value = SOC_SINGLE_VALUE(SND_SOC_NOPM, 0, 1, 0, 0) 1029 - }; 1022 + static const struct snd_kcontrol_new sma1307_sdo_control = 1023 + SOC_SINGLE_EXT("Switch", SND_SOC_NOPM, 0, 1, 0, 1024 + sma1307_dapm_sdo_enable_get, sma1307_dapm_sdo_enable_put); 1030 1025 1031 1026 static const struct snd_kcontrol_new sma1307_enable_control = 1032 1027 SOC_DAPM_SINGLE("Switch", SMA1307_00_SYSTEM_CTRL, 0, 1, 0);
+3 -11
sound/soc/codecs/tas2562.c
··· 513 513 static const struct snd_kcontrol_new tas2562_snd_controls[] = { 514 514 SOC_SINGLE_TLV("Amp Gain Volume", TAS2562_PB_CFG1, 1, 0x1c, 0, 515 515 tas2562_dac_tlv), 516 - { 517 - .iface = SNDRV_CTL_ELEM_IFACE_MIXER, 518 - .name = "Digital Volume Control", 519 - .index = 0, 520 - .tlv.p = dvc_tlv, 521 - .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ | SNDRV_CTL_ELEM_ACCESS_READWRITE, 522 - .info = snd_soc_info_volsw, 523 - .get = tas2562_volume_control_get, 524 - .put = tas2562_volume_control_put, 525 - .private_value = SOC_SINGLE_VALUE(TAS2562_DVC_CFG1, 0, 110, 0, 0), 526 - }, 516 + SOC_SINGLE_EXT_TLV("Digital Volume Control", TAS2562_DVC_CFG1, 0, 110, 0, 517 + tas2562_volume_control_get, tas2562_volume_control_put, 518 + dvc_tlv), 527 519 }; 528 520 529 521 static const struct snd_soc_dapm_widget tas2110_dapm_widgets[] = {
+2 -7
sound/soc/codecs/wcd938x.c
··· 70 70 #define WCD_MBHC_HS_V_MAX 1600 71 71 72 72 #define WCD938X_EAR_PA_GAIN_TLV(xname, reg, shift, max, invert, tlv_array) \ 73 - { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 74 - .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ 75 - SNDRV_CTL_ELEM_ACCESS_READWRITE,\ 76 - .tlv.p = (tlv_array), \ 77 - .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\ 78 - .put = wcd938x_ear_pa_put_gain, \ 79 - .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert, 0) } 73 + SOC_SINGLE_EXT_TLV(xname, reg, shift, max, invert, snd_soc_get_volsw, \ 74 + wcd938x_ear_pa_put_gain, tlv_array) 80 75 81 76 enum { 82 77 WCD9380 = 0,
+3 -7
sound/soc/codecs/wm9712.c
··· 275 275 return 0; 276 276 } 277 277 278 - #define WM9712_HP_MIXER_CTRL(xname, xmixer, xshift) { \ 279 - .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 280 - .info = snd_soc_info_volsw, \ 281 - .get = wm9712_hp_mixer_get, .put = wm9712_hp_mixer_put, \ 282 - .private_value = SOC_SINGLE_VALUE(SND_SOC_NOPM, \ 283 - (xmixer << 8) | xshift, 1, 0, 0) \ 284 - } 278 + #define WM9712_HP_MIXER_CTRL(xname, xmixer, xshift) \ 279 + SOC_SINGLE_EXT(xname, SND_SOC_NOPM, ((xmixer) << 8) | (xshift), \ 280 + 1, 0, wm9712_hp_mixer_get, wm9712_hp_mixer_put) 285 281 286 282 /* Left Headphone Mixers */ 287 283 static const struct snd_kcontrol_new wm9712_hpl_mixer_controls[] = {
+3 -7
sound/soc/codecs/wm9713.c
··· 284 284 return 0; 285 285 } 286 286 287 - #define WM9713_HP_MIXER_CTRL(xname, xmixer, xshift) { \ 288 - .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 289 - .info = snd_soc_info_volsw, \ 290 - .get = wm9713_hp_mixer_get, .put = wm9713_hp_mixer_put, \ 291 - .private_value = SOC_DOUBLE_VALUE(SND_SOC_NOPM, \ 292 - xshift, xmixer, 1, 0, 0) \ 293 - } 287 + #define WM9713_HP_MIXER_CTRL(xname, xmixer, xshift) \ 288 + SOC_DOUBLE_EXT(xname, SND_SOC_NOPM, xshift, xmixer, 1, 0, \ 289 + wm9713_hp_mixer_get, wm9713_hp_mixer_put) 294 290 295 291 /* Left Headphone Mixers */ 296 292 static const struct snd_kcontrol_new wm9713_hpl_mixer_controls[] = {
+2 -7
sound/soc/codecs/wsa881x.c
··· 199 199 #define WSA881X_PROBE_TIMEOUT 1000 200 200 201 201 #define WSA881X_PA_GAIN_TLV(xname, reg, shift, max, invert, tlv_array) \ 202 - { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ 203 - .access = SNDRV_CTL_ELEM_ACCESS_TLV_READ |\ 204 - SNDRV_CTL_ELEM_ACCESS_READWRITE,\ 205 - .tlv.p = (tlv_array), \ 206 - .info = snd_soc_info_volsw, .get = snd_soc_get_volsw,\ 207 - .put = wsa881x_put_pa_gain, \ 208 - .private_value = SOC_SINGLE_VALUE(reg, shift, max, invert, 0) } 202 + SOC_SINGLE_EXT_TLV(xname, reg, shift, max, invert, \ 203 + snd_soc_get_volsw, wsa881x_put_pa_gain, tlv_array) 209 204 210 205 static struct reg_default wsa881x_defaults[] = { 211 206 { WSA881X_CHIP_ID0, 0x00 },