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

ASoC: tegra: tegra210: use snd_kcontrol_chip() instead of snd_soc_kcontrol_component()

We have very similar name functions (A)(B). Both gets component from
snd_kcontrol, but (A) is used in callback functions which is registered
through snd_soc_add_component_controls(), (B) is used through
snd_soc_dapm_new_widgets().

(A) snd_soc_kcontrol_component()
(B) snd_soc_dapm_kcontrol_component()

(B) is using very picky way to get component but using it is necessary in
ASoC. But (A) is just wrapper function to snd_kcontrol_chip(), and directly
using it without wrapper is very common way on ALSA.
To reduce confusions of similar function, let's use common way on (A).

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Link: https://patch.msgid.link/87ecr6m7jn.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie@kernel.org>

authored by

Kuninori Morimoto and committed by
Mark Brown
308eee44 626cf627

+74 -74
+8 -8
sound/soc/tegra/tegra210_admaif.c
··· 493 493 static int tegra210_admaif_pget_mono_to_stereo(struct snd_kcontrol *kcontrol, 494 494 struct snd_ctl_elem_value *ucontrol) 495 495 { 496 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 496 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 497 497 struct tegra_admaif *admaif = snd_soc_component_get_drvdata(cmpnt); 498 498 struct soc_enum *ec = (struct soc_enum *)kcontrol->private_value; 499 499 ··· 506 506 static int tegra210_admaif_pput_mono_to_stereo(struct snd_kcontrol *kcontrol, 507 507 struct snd_ctl_elem_value *ucontrol) 508 508 { 509 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 509 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 510 510 struct tegra_admaif *admaif = snd_soc_component_get_drvdata(cmpnt); 511 511 struct soc_enum *ec = (struct soc_enum *)kcontrol->private_value; 512 512 unsigned int value = ucontrol->value.enumerated.item[0]; ··· 522 522 static int tegra210_admaif_cget_mono_to_stereo(struct snd_kcontrol *kcontrol, 523 523 struct snd_ctl_elem_value *ucontrol) 524 524 { 525 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 525 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 526 526 struct tegra_admaif *admaif = snd_soc_component_get_drvdata(cmpnt); 527 527 struct soc_enum *ec = (struct soc_enum *)kcontrol->private_value; 528 528 ··· 535 535 static int tegra210_admaif_cput_mono_to_stereo(struct snd_kcontrol *kcontrol, 536 536 struct snd_ctl_elem_value *ucontrol) 537 537 { 538 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 538 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 539 539 struct tegra_admaif *admaif = snd_soc_component_get_drvdata(cmpnt); 540 540 struct soc_enum *ec = (struct soc_enum *)kcontrol->private_value; 541 541 unsigned int value = ucontrol->value.enumerated.item[0]; ··· 551 551 static int tegra210_admaif_pget_stereo_to_mono(struct snd_kcontrol *kcontrol, 552 552 struct snd_ctl_elem_value *ucontrol) 553 553 { 554 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 554 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 555 555 struct tegra_admaif *admaif = snd_soc_component_get_drvdata(cmpnt); 556 556 struct soc_enum *ec = (struct soc_enum *)kcontrol->private_value; 557 557 ··· 564 564 static int tegra210_admaif_pput_stereo_to_mono(struct snd_kcontrol *kcontrol, 565 565 struct snd_ctl_elem_value *ucontrol) 566 566 { 567 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 567 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 568 568 struct tegra_admaif *admaif = snd_soc_component_get_drvdata(cmpnt); 569 569 struct soc_enum *ec = (struct soc_enum *)kcontrol->private_value; 570 570 unsigned int value = ucontrol->value.enumerated.item[0]; ··· 580 580 static int tegra210_admaif_cget_stereo_to_mono(struct snd_kcontrol *kcontrol, 581 581 struct snd_ctl_elem_value *ucontrol) 582 582 { 583 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 583 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 584 584 struct tegra_admaif *admaif = snd_soc_component_get_drvdata(cmpnt); 585 585 struct soc_enum *ec = (struct soc_enum *)kcontrol->private_value; 586 586 ··· 593 593 static int tegra210_admaif_cput_stereo_to_mono(struct snd_kcontrol *kcontrol, 594 594 struct snd_ctl_elem_value *ucontrol) 595 595 { 596 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 596 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 597 597 struct tegra_admaif *admaif = snd_soc_component_get_drvdata(cmpnt); 598 598 struct soc_enum *ec = (struct soc_enum *)kcontrol->private_value; 599 599 unsigned int value = ucontrol->value.enumerated.item[0];
+2 -2
sound/soc/tegra/tegra210_adx.c
··· 186 186 static int tegra210_adx_get_byte_map(struct snd_kcontrol *kcontrol, 187 187 struct snd_ctl_elem_value *ucontrol) 188 188 { 189 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 189 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 190 190 struct tegra210_adx *adx = snd_soc_component_get_drvdata(cmpnt); 191 191 struct soc_mixer_control *mc; 192 192 unsigned char *bytes_map = (unsigned char *)adx->map; ··· 216 216 static int tegra210_adx_put_byte_map(struct snd_kcontrol *kcontrol, 217 217 struct snd_ctl_elem_value *ucontrol) 218 218 { 219 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 219 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 220 220 struct tegra210_adx *adx = snd_soc_component_get_drvdata(cmpnt); 221 221 unsigned char *bytes_map = (unsigned char *)adx->map; 222 222 int value = ucontrol->value.integer.value[0];
+2 -2
sound/soc/tegra/tegra210_amx.c
··· 208 208 static int tegra210_amx_get_byte_map(struct snd_kcontrol *kcontrol, 209 209 struct snd_ctl_elem_value *ucontrol) 210 210 { 211 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 211 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 212 212 struct soc_mixer_control *mc = 213 213 (struct soc_mixer_control *)kcontrol->private_value; 214 214 struct tegra210_amx *amx = snd_soc_component_get_drvdata(cmpnt); ··· 241 241 { 242 242 struct soc_mixer_control *mc = 243 243 (struct soc_mixer_control *)kcontrol->private_value; 244 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 244 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 245 245 struct tegra210_amx *amx = snd_soc_component_get_drvdata(cmpnt); 246 246 unsigned char *bytes_map = (unsigned char *)amx->map; 247 247 int reg = mc->reg;
+12 -12
sound/soc/tegra/tegra210_dmic.c
··· 160 160 static int tegra210_dmic_get_boost_gain(struct snd_kcontrol *kcontrol, 161 161 struct snd_ctl_elem_value *ucontrol) 162 162 { 163 - struct snd_soc_component *comp = snd_soc_kcontrol_component(kcontrol); 163 + struct snd_soc_component *comp = snd_kcontrol_chip(kcontrol); 164 164 struct tegra210_dmic *dmic = snd_soc_component_get_drvdata(comp); 165 165 166 166 ucontrol->value.integer.value[0] = dmic->boost_gain; ··· 171 171 static int tegra210_dmic_put_boost_gain(struct snd_kcontrol *kcontrol, 172 172 struct snd_ctl_elem_value *ucontrol) 173 173 { 174 - struct snd_soc_component *comp = snd_soc_kcontrol_component(kcontrol); 174 + struct snd_soc_component *comp = snd_kcontrol_chip(kcontrol); 175 175 struct tegra210_dmic *dmic = snd_soc_component_get_drvdata(comp); 176 176 int value = ucontrol->value.integer.value[0]; 177 177 ··· 186 186 static int tegra210_dmic_get_ch_select(struct snd_kcontrol *kcontrol, 187 187 struct snd_ctl_elem_value *ucontrol) 188 188 { 189 - struct snd_soc_component *comp = snd_soc_kcontrol_component(kcontrol); 189 + struct snd_soc_component *comp = snd_kcontrol_chip(kcontrol); 190 190 struct tegra210_dmic *dmic = snd_soc_component_get_drvdata(comp); 191 191 192 192 ucontrol->value.enumerated.item[0] = dmic->ch_select; ··· 197 197 static int tegra210_dmic_put_ch_select(struct snd_kcontrol *kcontrol, 198 198 struct snd_ctl_elem_value *ucontrol) 199 199 { 200 - struct snd_soc_component *comp = snd_soc_kcontrol_component(kcontrol); 200 + struct snd_soc_component *comp = snd_kcontrol_chip(kcontrol); 201 201 struct tegra210_dmic *dmic = snd_soc_component_get_drvdata(comp); 202 202 unsigned int value = ucontrol->value.enumerated.item[0]; 203 203 ··· 212 212 static int tegra210_dmic_get_mono_to_stereo(struct snd_kcontrol *kcontrol, 213 213 struct snd_ctl_elem_value *ucontrol) 214 214 { 215 - struct snd_soc_component *comp = snd_soc_kcontrol_component(kcontrol); 215 + struct snd_soc_component *comp = snd_kcontrol_chip(kcontrol); 216 216 struct tegra210_dmic *dmic = snd_soc_component_get_drvdata(comp); 217 217 218 218 ucontrol->value.enumerated.item[0] = dmic->mono_to_stereo; ··· 223 223 static int tegra210_dmic_put_mono_to_stereo(struct snd_kcontrol *kcontrol, 224 224 struct snd_ctl_elem_value *ucontrol) 225 225 { 226 - struct snd_soc_component *comp = snd_soc_kcontrol_component(kcontrol); 226 + struct snd_soc_component *comp = snd_kcontrol_chip(kcontrol); 227 227 struct tegra210_dmic *dmic = snd_soc_component_get_drvdata(comp); 228 228 unsigned int value = ucontrol->value.enumerated.item[0]; 229 229 ··· 238 238 static int tegra210_dmic_get_stereo_to_mono(struct snd_kcontrol *kcontrol, 239 239 struct snd_ctl_elem_value *ucontrol) 240 240 { 241 - struct snd_soc_component *comp = snd_soc_kcontrol_component(kcontrol); 241 + struct snd_soc_component *comp = snd_kcontrol_chip(kcontrol); 242 242 struct tegra210_dmic *dmic = snd_soc_component_get_drvdata(comp); 243 243 244 244 ucontrol->value.enumerated.item[0] = dmic->stereo_to_mono; ··· 249 249 static int tegra210_dmic_put_stereo_to_mono(struct snd_kcontrol *kcontrol, 250 250 struct snd_ctl_elem_value *ucontrol) 251 251 { 252 - struct snd_soc_component *comp = snd_soc_kcontrol_component(kcontrol); 252 + struct snd_soc_component *comp = snd_kcontrol_chip(kcontrol); 253 253 struct tegra210_dmic *dmic = snd_soc_component_get_drvdata(comp); 254 254 unsigned int value = ucontrol->value.enumerated.item[0]; 255 255 ··· 264 264 static int tegra210_dmic_get_osr_val(struct snd_kcontrol *kcontrol, 265 265 struct snd_ctl_elem_value *ucontrol) 266 266 { 267 - struct snd_soc_component *comp = snd_soc_kcontrol_component(kcontrol); 267 + struct snd_soc_component *comp = snd_kcontrol_chip(kcontrol); 268 268 struct tegra210_dmic *dmic = snd_soc_component_get_drvdata(comp); 269 269 270 270 ucontrol->value.enumerated.item[0] = dmic->osr_val; ··· 275 275 static int tegra210_dmic_put_osr_val(struct snd_kcontrol *kcontrol, 276 276 struct snd_ctl_elem_value *ucontrol) 277 277 { 278 - struct snd_soc_component *comp = snd_soc_kcontrol_component(kcontrol); 278 + struct snd_soc_component *comp = snd_kcontrol_chip(kcontrol); 279 279 struct tegra210_dmic *dmic = snd_soc_component_get_drvdata(comp); 280 280 unsigned int value = ucontrol->value.enumerated.item[0]; 281 281 ··· 290 290 static int tegra210_dmic_get_pol_sel(struct snd_kcontrol *kcontrol, 291 291 struct snd_ctl_elem_value *ucontrol) 292 292 { 293 - struct snd_soc_component *comp = snd_soc_kcontrol_component(kcontrol); 293 + struct snd_soc_component *comp = snd_kcontrol_chip(kcontrol); 294 294 struct tegra210_dmic *dmic = snd_soc_component_get_drvdata(comp); 295 295 296 296 ucontrol->value.enumerated.item[0] = dmic->lrsel; ··· 301 301 static int tegra210_dmic_put_pol_sel(struct snd_kcontrol *kcontrol, 302 302 struct snd_ctl_elem_value *ucontrol) 303 303 { 304 - struct snd_soc_component *comp = snd_soc_kcontrol_component(kcontrol); 304 + struct snd_soc_component *comp = snd_kcontrol_chip(kcontrol); 305 305 struct tegra210_dmic *dmic = snd_soc_component_get_drvdata(comp); 306 306 unsigned int value = ucontrol->value.enumerated.item[0]; 307 307
+16 -16
sound/soc/tegra/tegra210_i2s.c
··· 319 319 static int tegra210_i2s_get_loopback(struct snd_kcontrol *kcontrol, 320 320 struct snd_ctl_elem_value *ucontrol) 321 321 { 322 - struct snd_soc_component *compnt = snd_soc_kcontrol_component(kcontrol); 322 + struct snd_soc_component *compnt = snd_kcontrol_chip(kcontrol); 323 323 struct tegra210_i2s *i2s = snd_soc_component_get_drvdata(compnt); 324 324 325 325 ucontrol->value.integer.value[0] = i2s->loopback; ··· 330 330 static int tegra210_i2s_put_loopback(struct snd_kcontrol *kcontrol, 331 331 struct snd_ctl_elem_value *ucontrol) 332 332 { 333 - struct snd_soc_component *compnt = snd_soc_kcontrol_component(kcontrol); 333 + struct snd_soc_component *compnt = snd_kcontrol_chip(kcontrol); 334 334 struct tegra210_i2s *i2s = snd_soc_component_get_drvdata(compnt); 335 335 int value = ucontrol->value.integer.value[0]; 336 336 ··· 348 348 static int tegra210_i2s_get_fsync_width(struct snd_kcontrol *kcontrol, 349 349 struct snd_ctl_elem_value *ucontrol) 350 350 { 351 - struct snd_soc_component *compnt = snd_soc_kcontrol_component(kcontrol); 351 + struct snd_soc_component *compnt = snd_kcontrol_chip(kcontrol); 352 352 struct tegra210_i2s *i2s = snd_soc_component_get_drvdata(compnt); 353 353 354 354 ucontrol->value.integer.value[0] = i2s->fsync_width; ··· 359 359 static int tegra210_i2s_put_fsync_width(struct snd_kcontrol *kcontrol, 360 360 struct snd_ctl_elem_value *ucontrol) 361 361 { 362 - struct snd_soc_component *compnt = snd_soc_kcontrol_component(kcontrol); 362 + struct snd_soc_component *compnt = snd_kcontrol_chip(kcontrol); 363 363 struct tegra210_i2s *i2s = snd_soc_component_get_drvdata(compnt); 364 364 int value = ucontrol->value.integer.value[0]; 365 365 ··· 386 386 static int tegra210_i2s_cget_stereo_to_mono(struct snd_kcontrol *kcontrol, 387 387 struct snd_ctl_elem_value *ucontrol) 388 388 { 389 - struct snd_soc_component *compnt = snd_soc_kcontrol_component(kcontrol); 389 + struct snd_soc_component *compnt = snd_kcontrol_chip(kcontrol); 390 390 struct tegra210_i2s *i2s = snd_soc_component_get_drvdata(compnt); 391 391 392 392 ucontrol->value.enumerated.item[0] = i2s->stereo_to_mono[I2S_TX_PATH]; ··· 397 397 static int tegra210_i2s_cput_stereo_to_mono(struct snd_kcontrol *kcontrol, 398 398 struct snd_ctl_elem_value *ucontrol) 399 399 { 400 - struct snd_soc_component *compnt = snd_soc_kcontrol_component(kcontrol); 400 + struct snd_soc_component *compnt = snd_kcontrol_chip(kcontrol); 401 401 struct tegra210_i2s *i2s = snd_soc_component_get_drvdata(compnt); 402 402 unsigned int value = ucontrol->value.enumerated.item[0]; 403 403 ··· 412 412 static int tegra210_i2s_cget_mono_to_stereo(struct snd_kcontrol *kcontrol, 413 413 struct snd_ctl_elem_value *ucontrol) 414 414 { 415 - struct snd_soc_component *compnt = snd_soc_kcontrol_component(kcontrol); 415 + struct snd_soc_component *compnt = snd_kcontrol_chip(kcontrol); 416 416 struct tegra210_i2s *i2s = snd_soc_component_get_drvdata(compnt); 417 417 418 418 ucontrol->value.enumerated.item[0] = i2s->mono_to_stereo[I2S_TX_PATH]; ··· 423 423 static int tegra210_i2s_cput_mono_to_stereo(struct snd_kcontrol *kcontrol, 424 424 struct snd_ctl_elem_value *ucontrol) 425 425 { 426 - struct snd_soc_component *compnt = snd_soc_kcontrol_component(kcontrol); 426 + struct snd_soc_component *compnt = snd_kcontrol_chip(kcontrol); 427 427 struct tegra210_i2s *i2s = snd_soc_component_get_drvdata(compnt); 428 428 unsigned int value = ucontrol->value.enumerated.item[0]; 429 429 ··· 438 438 static int tegra210_i2s_pget_stereo_to_mono(struct snd_kcontrol *kcontrol, 439 439 struct snd_ctl_elem_value *ucontrol) 440 440 { 441 - struct snd_soc_component *compnt = snd_soc_kcontrol_component(kcontrol); 441 + struct snd_soc_component *compnt = snd_kcontrol_chip(kcontrol); 442 442 struct tegra210_i2s *i2s = snd_soc_component_get_drvdata(compnt); 443 443 444 444 ucontrol->value.enumerated.item[0] = i2s->stereo_to_mono[I2S_RX_PATH]; ··· 449 449 static int tegra210_i2s_pput_stereo_to_mono(struct snd_kcontrol *kcontrol, 450 450 struct snd_ctl_elem_value *ucontrol) 451 451 { 452 - struct snd_soc_component *compnt = snd_soc_kcontrol_component(kcontrol); 452 + struct snd_soc_component *compnt = snd_kcontrol_chip(kcontrol); 453 453 struct tegra210_i2s *i2s = snd_soc_component_get_drvdata(compnt); 454 454 unsigned int value = ucontrol->value.enumerated.item[0]; 455 455 ··· 464 464 static int tegra210_i2s_pget_mono_to_stereo(struct snd_kcontrol *kcontrol, 465 465 struct snd_ctl_elem_value *ucontrol) 466 466 { 467 - struct snd_soc_component *compnt = snd_soc_kcontrol_component(kcontrol); 467 + struct snd_soc_component *compnt = snd_kcontrol_chip(kcontrol); 468 468 struct tegra210_i2s *i2s = snd_soc_component_get_drvdata(compnt); 469 469 470 470 ucontrol->value.enumerated.item[0] = i2s->mono_to_stereo[I2S_RX_PATH]; ··· 475 475 static int tegra210_i2s_pput_mono_to_stereo(struct snd_kcontrol *kcontrol, 476 476 struct snd_ctl_elem_value *ucontrol) 477 477 { 478 - struct snd_soc_component *compnt = snd_soc_kcontrol_component(kcontrol); 478 + struct snd_soc_component *compnt = snd_kcontrol_chip(kcontrol); 479 479 struct tegra210_i2s *i2s = snd_soc_component_get_drvdata(compnt); 480 480 unsigned int value = ucontrol->value.enumerated.item[0]; 481 481 ··· 490 490 static int tegra210_i2s_pget_fifo_th(struct snd_kcontrol *kcontrol, 491 491 struct snd_ctl_elem_value *ucontrol) 492 492 { 493 - struct snd_soc_component *compnt = snd_soc_kcontrol_component(kcontrol); 493 + struct snd_soc_component *compnt = snd_kcontrol_chip(kcontrol); 494 494 struct tegra210_i2s *i2s = snd_soc_component_get_drvdata(compnt); 495 495 496 496 ucontrol->value.integer.value[0] = i2s->rx_fifo_th; ··· 501 501 static int tegra210_i2s_pput_fifo_th(struct snd_kcontrol *kcontrol, 502 502 struct snd_ctl_elem_value *ucontrol) 503 503 { 504 - struct snd_soc_component *compnt = snd_soc_kcontrol_component(kcontrol); 504 + struct snd_soc_component *compnt = snd_kcontrol_chip(kcontrol); 505 505 struct tegra210_i2s *i2s = snd_soc_component_get_drvdata(compnt); 506 506 int value = ucontrol->value.integer.value[0]; 507 507 ··· 516 516 static int tegra210_i2s_get_bclk_ratio(struct snd_kcontrol *kcontrol, 517 517 struct snd_ctl_elem_value *ucontrol) 518 518 { 519 - struct snd_soc_component *compnt = snd_soc_kcontrol_component(kcontrol); 519 + struct snd_soc_component *compnt = snd_kcontrol_chip(kcontrol); 520 520 struct tegra210_i2s *i2s = snd_soc_component_get_drvdata(compnt); 521 521 522 522 ucontrol->value.integer.value[0] = i2s->bclk_ratio; ··· 527 527 static int tegra210_i2s_put_bclk_ratio(struct snd_kcontrol *kcontrol, 528 528 struct snd_ctl_elem_value *ucontrol) 529 529 { 530 - struct snd_soc_component *compnt = snd_soc_kcontrol_component(kcontrol); 530 + struct snd_soc_component *compnt = snd_kcontrol_chip(kcontrol); 531 531 struct tegra210_i2s *i2s = snd_soc_component_get_drvdata(compnt); 532 532 int value = ucontrol->value.integer.value[0]; 533 533
+12 -12
sound/soc/tegra/tegra210_mbdrc.c
··· 235 235 { 236 236 struct soc_mixer_control *mc = 237 237 (struct soc_mixer_control *)kcontrol->private_value; 238 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 238 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 239 239 struct tegra210_ope *ope = snd_soc_component_get_drvdata(cmpnt); 240 240 unsigned int val; 241 241 ··· 251 251 { 252 252 struct soc_mixer_control *mc = 253 253 (struct soc_mixer_control *)kcontrol->private_value; 254 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 254 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 255 255 struct tegra210_ope *ope = snd_soc_component_get_drvdata(cmpnt); 256 256 unsigned int val = ucontrol->value.integer.value[0]; 257 257 bool change = false; ··· 267 267 static int tegra210_mbdrc_get_enum(struct snd_kcontrol *kcontrol, 268 268 struct snd_ctl_elem_value *ucontrol) 269 269 { 270 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 270 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 271 271 struct tegra210_ope *ope = snd_soc_component_get_drvdata(cmpnt); 272 272 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 273 273 unsigned int val; ··· 282 282 static int tegra210_mbdrc_put_enum(struct snd_kcontrol *kcontrol, 283 283 struct snd_ctl_elem_value *ucontrol) 284 284 { 285 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 285 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 286 286 struct tegra210_ope *ope = snd_soc_component_get_drvdata(cmpnt); 287 287 struct soc_enum *e = (struct soc_enum *)kcontrol->private_value; 288 288 bool change = false; ··· 305 305 struct snd_ctl_elem_value *ucontrol) 306 306 { 307 307 struct tegra_soc_bytes *params = (void *)kcontrol->private_value; 308 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 308 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 309 309 struct tegra210_ope *ope = snd_soc_component_get_drvdata(cmpnt); 310 310 u32 *data = (u32 *)ucontrol->value.bytes.data; 311 311 u32 regs = params->soc.base; ··· 326 326 struct snd_ctl_elem_value *ucontrol) 327 327 { 328 328 struct tegra_soc_bytes *params = (void *)kcontrol->private_value; 329 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 329 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 330 330 struct tegra210_ope *ope = snd_soc_component_get_drvdata(cmpnt); 331 331 u32 *data = (u32 *)ucontrol->value.bytes.data; 332 332 u32 regs = params->soc.base; ··· 351 351 struct snd_ctl_elem_value *ucontrol) 352 352 { 353 353 struct tegra_soc_bytes *params = (void *)kcontrol->private_value; 354 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 354 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 355 355 struct tegra210_ope *ope = snd_soc_component_get_drvdata(cmpnt); 356 356 u32 *data = (u32 *)ucontrol->value.bytes.data; 357 357 u32 regs = params->soc.base; ··· 379 379 struct snd_ctl_elem_value *ucontrol) 380 380 { 381 381 struct tegra_soc_bytes *params = (void *)kcontrol->private_value; 382 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 382 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 383 383 struct tegra210_ope *ope = snd_soc_component_get_drvdata(cmpnt); 384 384 u32 *data = (u32 *)ucontrol->value.bytes.data; 385 385 u32 regs = params->soc.base; ··· 412 412 struct snd_ctl_elem_value *ucontrol) 413 413 { 414 414 struct tegra_soc_bytes *params = (void *)kcontrol->private_value; 415 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 415 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 416 416 u32 *data = (u32 *)ucontrol->value.bytes.data; 417 417 418 418 memset(data, 0, params->soc.num_regs * cmpnt->val_bytes); ··· 424 424 struct snd_ctl_elem_value *ucontrol) 425 425 { 426 426 struct tegra_soc_bytes *params = (void *)kcontrol->private_value; 427 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 427 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 428 428 struct tegra210_ope *ope = snd_soc_component_get_drvdata(cmpnt); 429 429 u32 reg_ctrl = params->soc.base; 430 430 u32 reg_data = reg_ctrl + cmpnt->val_bytes; ··· 452 452 { 453 453 struct soc_mixer_control *mc = 454 454 (struct soc_mixer_control *)kcontrol->private_value; 455 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 455 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 456 456 struct tegra210_ope *ope = snd_soc_component_get_drvdata(cmpnt); 457 457 int val; 458 458 ··· 469 469 { 470 470 struct soc_mixer_control *mc = 471 471 (struct soc_mixer_control *)kcontrol->private_value; 472 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 472 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 473 473 struct tegra210_ope *ope = snd_soc_component_get_drvdata(cmpnt); 474 474 int val = ucontrol->value.integer.value[0]; 475 475 bool change = false;
+2 -2
sound/soc/tegra/tegra210_mixer.c
··· 178 178 { 179 179 struct soc_mixer_control *mc = 180 180 (struct soc_mixer_control *)kcontrol->private_value; 181 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 181 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 182 182 struct tegra210_mixer *mixer = snd_soc_component_get_drvdata(cmpnt); 183 183 unsigned int reg = mc->reg; 184 184 unsigned int i; ··· 197 197 { 198 198 struct soc_mixer_control *mc = 199 199 (struct soc_mixer_control *)kcontrol->private_value; 200 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 200 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 201 201 struct tegra210_mixer *mixer = snd_soc_component_get_drvdata(cmpnt); 202 202 unsigned int reg = mc->reg, id; 203 203 int err;
+6 -6
sound/soc/tegra/tegra210_mvc.c
··· 109 109 110 110 static u32 tegra210_mvc_get_ctrl_reg(struct snd_kcontrol *kcontrol) 111 111 { 112 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 112 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 113 113 struct tegra210_mvc *mvc = snd_soc_component_get_drvdata(cmpnt); 114 114 u32 val; 115 115 ··· 194 194 struct snd_ctl_elem_value *ucontrol, 195 195 bool per_chan_ctrl) 196 196 { 197 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 197 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 198 198 struct tegra210_mvc *mvc = snd_soc_component_get_drvdata(cmpnt); 199 199 u32 mute_val = ucontrol->value.integer.value[0]; 200 200 u32 per_ch_ctrl_val; ··· 260 260 { 261 261 struct soc_mixer_control *mc = 262 262 (struct soc_mixer_control *)kcontrol->private_value; 263 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 263 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 264 264 struct tegra210_mvc *mvc = snd_soc_component_get_drvdata(cmpnt); 265 265 u8 chan = TEGRA210_MVC_GET_CHAN(mc->reg, TEGRA210_MVC_TARGET_VOL); 266 266 s32 val = mvc->volume[chan]; ··· 289 289 { 290 290 struct soc_mixer_control *mc = 291 291 (struct soc_mixer_control *)kcontrol->private_value; 292 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 292 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 293 293 struct tegra210_mvc *mvc = snd_soc_component_get_drvdata(cmpnt); 294 294 u8 chan = TEGRA210_MVC_GET_CHAN(mc->reg, TEGRA210_MVC_TARGET_VOL); 295 295 int old_volume = mvc->volume[chan]; ··· 394 394 static int tegra210_mvc_get_curve_type(struct snd_kcontrol *kcontrol, 395 395 struct snd_ctl_elem_value *ucontrol) 396 396 { 397 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 397 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 398 398 struct tegra210_mvc *mvc = snd_soc_component_get_drvdata(cmpnt); 399 399 400 400 ucontrol->value.enumerated.item[0] = mvc->curve_type; ··· 405 405 static int tegra210_mvc_put_curve_type(struct snd_kcontrol *kcontrol, 406 406 struct snd_ctl_elem_value *ucontrol) 407 407 { 408 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 408 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 409 409 struct tegra210_mvc *mvc = snd_soc_component_get_drvdata(cmpnt); 410 410 unsigned int value; 411 411
+2 -2
sound/soc/tegra/tegra210_ope.c
··· 202 202 static int tegra210_ope_get_data_dir(struct snd_kcontrol *kcontrol, 203 203 struct snd_ctl_elem_value *ucontrol) 204 204 { 205 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 205 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 206 206 struct tegra210_ope *ope = snd_soc_component_get_drvdata(cmpnt); 207 207 208 208 ucontrol->value.enumerated.item[0] = ope->data_dir; ··· 213 213 static int tegra210_ope_put_data_dir(struct snd_kcontrol *kcontrol, 214 214 struct snd_ctl_elem_value *ucontrol) 215 215 { 216 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 216 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 217 217 struct tegra210_ope *ope = snd_soc_component_get_drvdata(cmpnt); 218 218 unsigned int value = ucontrol->value.enumerated.item[0]; 219 219
+4 -4
sound/soc/tegra/tegra210_peq.c
··· 100 100 { 101 101 struct soc_mixer_control *mc = 102 102 (struct soc_mixer_control *)kcontrol->private_value; 103 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 103 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 104 104 struct tegra210_ope *ope = snd_soc_component_get_drvdata(cmpnt); 105 105 unsigned int mask = (1 << fls(mc->max)) - 1; 106 106 unsigned int val; ··· 123 123 { 124 124 struct soc_mixer_control *mc = 125 125 (struct soc_mixer_control *)kcontrol->private_value; 126 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 126 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 127 127 struct tegra210_ope *ope = snd_soc_component_get_drvdata(cmpnt); 128 128 unsigned int mask = (1 << fls(mc->max)) - 1; 129 129 bool change = false; ··· 146 146 struct snd_ctl_elem_value *ucontrol) 147 147 { 148 148 struct tegra_soc_bytes *params = (void *)kcontrol->private_value; 149 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 149 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 150 150 struct tegra210_ope *ope = snd_soc_component_get_drvdata(cmpnt); 151 151 u32 i, reg_ctrl = params->soc.base; 152 152 u32 reg_data = reg_ctrl + cmpnt->val_bytes; ··· 169 169 struct snd_ctl_elem_value *ucontrol) 170 170 { 171 171 struct tegra_soc_bytes *params = (void *)kcontrol->private_value; 172 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 172 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 173 173 struct tegra210_ope *ope = snd_soc_component_get_drvdata(cmpnt); 174 174 u32 i, reg_ctrl = params->soc.base; 175 175 u32 reg_data = reg_ctrl + cmpnt->val_bytes;
+8 -8
sound/soc/tegra/tegra210_sfc.c
··· 3276 3276 static int tegra210_sfc_iget_stereo_to_mono(struct snd_kcontrol *kcontrol, 3277 3277 struct snd_ctl_elem_value *ucontrol) 3278 3278 { 3279 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 3279 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 3280 3280 struct tegra210_sfc *sfc = snd_soc_component_get_drvdata(cmpnt); 3281 3281 3282 3282 ucontrol->value.enumerated.item[0] = sfc->stereo_to_mono[SFC_RX_PATH]; ··· 3287 3287 static int tegra210_sfc_iput_stereo_to_mono(struct snd_kcontrol *kcontrol, 3288 3288 struct snd_ctl_elem_value *ucontrol) 3289 3289 { 3290 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 3290 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 3291 3291 struct tegra210_sfc *sfc = snd_soc_component_get_drvdata(cmpnt); 3292 3292 unsigned int value = ucontrol->value.enumerated.item[0]; 3293 3293 ··· 3302 3302 static int tegra210_sfc_iget_mono_to_stereo(struct snd_kcontrol *kcontrol, 3303 3303 struct snd_ctl_elem_value *ucontrol) 3304 3304 { 3305 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 3305 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 3306 3306 struct tegra210_sfc *sfc = snd_soc_component_get_drvdata(cmpnt); 3307 3307 3308 3308 ucontrol->value.enumerated.item[0] = sfc->mono_to_stereo[SFC_RX_PATH]; ··· 3313 3313 static int tegra210_sfc_iput_mono_to_stereo(struct snd_kcontrol *kcontrol, 3314 3314 struct snd_ctl_elem_value *ucontrol) 3315 3315 { 3316 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 3316 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 3317 3317 struct tegra210_sfc *sfc = snd_soc_component_get_drvdata(cmpnt); 3318 3318 unsigned int value = ucontrol->value.enumerated.item[0]; 3319 3319 ··· 3328 3328 static int tegra210_sfc_oget_stereo_to_mono(struct snd_kcontrol *kcontrol, 3329 3329 struct snd_ctl_elem_value *ucontrol) 3330 3330 { 3331 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 3331 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 3332 3332 struct tegra210_sfc *sfc = snd_soc_component_get_drvdata(cmpnt); 3333 3333 3334 3334 ucontrol->value.enumerated.item[0] = sfc->stereo_to_mono[SFC_TX_PATH]; ··· 3339 3339 static int tegra210_sfc_oput_stereo_to_mono(struct snd_kcontrol *kcontrol, 3340 3340 struct snd_ctl_elem_value *ucontrol) 3341 3341 { 3342 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 3342 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 3343 3343 struct tegra210_sfc *sfc = snd_soc_component_get_drvdata(cmpnt); 3344 3344 unsigned int value = ucontrol->value.enumerated.item[0]; 3345 3345 ··· 3354 3354 static int tegra210_sfc_oget_mono_to_stereo(struct snd_kcontrol *kcontrol, 3355 3355 struct snd_ctl_elem_value *ucontrol) 3356 3356 { 3357 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 3357 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 3358 3358 struct tegra210_sfc *sfc = snd_soc_component_get_drvdata(cmpnt); 3359 3359 3360 3360 ucontrol->value.enumerated.item[0] = sfc->mono_to_stereo[SFC_TX_PATH]; ··· 3365 3365 static int tegra210_sfc_oput_mono_to_stereo(struct snd_kcontrol *kcontrol, 3366 3366 struct snd_ctl_elem_value *ucontrol) 3367 3367 { 3368 - struct snd_soc_component *cmpnt = snd_soc_kcontrol_component(kcontrol); 3368 + struct snd_soc_component *cmpnt = snd_kcontrol_chip(kcontrol); 3369 3369 struct tegra210_sfc *sfc = snd_soc_component_get_drvdata(cmpnt); 3370 3370 unsigned int value = ucontrol->value.enumerated.item[0]; 3371 3371