diff options
author | Takashi Iwai <tiwai@suse.de> | 2012-05-21 06:45:18 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2012-05-21 06:45:18 -0400 |
commit | 775b2449bdba7c97dda9f274c92bf7a83dac4142 (patch) | |
tree | b4bee45c13762ea93642b1e38c62de454e51cf5d /sound/soc/codecs/cs42l73.c | |
parent | 21363cf0ca5c9c62e34e37422fb1d13d70d3de3c (diff) | |
parent | 5fb86e5d4a951ddb0474cdfd809380c8e2a8d101 (diff) |
Merge branch 'topic/asoc' into for-linus
Diffstat (limited to 'sound/soc/codecs/cs42l73.c')
-rw-r--r-- | sound/soc/codecs/cs42l73.c | 93 |
1 files changed, 43 insertions, 50 deletions
diff --git a/sound/soc/codecs/cs42l73.c b/sound/soc/codecs/cs42l73.c index 3686417f5ea5..e0d45fdaa750 100644 --- a/sound/soc/codecs/cs42l73.c +++ b/sound/soc/codecs/cs42l73.c | |||
@@ -43,9 +43,6 @@ struct cs42l73_private { | |||
43 | }; | 43 | }; |
44 | 44 | ||
45 | static const struct reg_default cs42l73_reg_defaults[] = { | 45 | static const struct reg_default cs42l73_reg_defaults[] = { |
46 | { 1, 0x42 }, /* r01 - Device ID A&B */ | ||
47 | { 2, 0xA7 }, /* r02 - Device ID C&D */ | ||
48 | { 3, 0x30 }, /* r03 - Device ID E */ | ||
49 | { 6, 0xF1 }, /* r06 - Power Ctl 1 */ | 46 | { 6, 0xF1 }, /* r06 - Power Ctl 1 */ |
50 | { 7, 0xDF }, /* r07 - Power Ctl 2 */ | 47 | { 7, 0xDF }, /* r07 - Power Ctl 2 */ |
51 | { 8, 0x3F }, /* r08 - Power Ctl 3 */ | 48 | { 8, 0x3F }, /* r08 - Power Ctl 3 */ |
@@ -402,37 +399,37 @@ static const struct snd_kcontrol_new ear_amp_ctl = | |||
402 | 399 | ||
403 | static const struct snd_kcontrol_new cs42l73_snd_controls[] = { | 400 | static const struct snd_kcontrol_new cs42l73_snd_controls[] = { |
404 | SOC_DOUBLE_R_SX_TLV("Headphone Analog Playback Volume", | 401 | SOC_DOUBLE_R_SX_TLV("Headphone Analog Playback Volume", |
405 | CS42L73_HPAAVOL, CS42L73_HPBAVOL, 7, | 402 | CS42L73_HPAAVOL, CS42L73_HPBAVOL, 0, |
406 | 0xffffffC1, 0x0C, hpaloa_tlv), | 403 | 0x41, 0x4B, hpaloa_tlv), |
407 | 404 | ||
408 | SOC_DOUBLE_R_SX_TLV("LineOut Analog Playback Volume", CS42L73_LOAAVOL, | 405 | SOC_DOUBLE_R_SX_TLV("LineOut Analog Playback Volume", CS42L73_LOAAVOL, |
409 | CS42L73_LOBAVOL, 7, 0xffffffC1, 0x0C, hpaloa_tlv), | 406 | CS42L73_LOBAVOL, 0, 0x41, 0x4B, hpaloa_tlv), |
410 | 407 | ||
411 | SOC_DOUBLE_R_SX_TLV("Input PGA Analog Volume", CS42L73_MICAPREPGAAVOL, | 408 | SOC_DOUBLE_R_SX_TLV("Input PGA Analog Volume", CS42L73_MICAPREPGAAVOL, |
412 | CS42L73_MICBPREPGABVOL, 5, 0xffffff35, | 409 | CS42L73_MICBPREPGABVOL, 5, 0x34, |
413 | 0x34, micpga_tlv), | 410 | 0x24, micpga_tlv), |
414 | 411 | ||
415 | SOC_DOUBLE_R("MIC Preamp Switch", CS42L73_MICAPREPGAAVOL, | 412 | SOC_DOUBLE_R("MIC Preamp Switch", CS42L73_MICAPREPGAAVOL, |
416 | CS42L73_MICBPREPGABVOL, 6, 1, 1), | 413 | CS42L73_MICBPREPGABVOL, 6, 1, 1), |
417 | 414 | ||
418 | SOC_DOUBLE_R_SX_TLV("Input Path Digital Volume", CS42L73_IPADVOL, | 415 | SOC_DOUBLE_R_SX_TLV("Input Path Digital Volume", CS42L73_IPADVOL, |
419 | CS42L73_IPBDVOL, 7, 0xffffffA0, 0xA0, ipd_tlv), | 416 | CS42L73_IPBDVOL, 0, 0xA0, 0x6C, ipd_tlv), |
420 | 417 | ||
421 | SOC_DOUBLE_R_SX_TLV("HL Digital Playback Volume", | 418 | SOC_DOUBLE_R_SX_TLV("HL Digital Playback Volume", |
422 | CS42L73_HLADVOL, CS42L73_HLBDVOL, 7, 0xffffffE5, | 419 | CS42L73_HLADVOL, CS42L73_HLBDVOL, |
423 | 0xE4, hl_tlv), | 420 | 0, 0x34, 0xE4, hl_tlv), |
424 | 421 | ||
425 | SOC_SINGLE_TLV("ADC A Boost Volume", | 422 | SOC_SINGLE_TLV("ADC A Boost Volume", |
426 | CS42L73_ADCIPC, 2, 0x01, 1, adc_boost_tlv), | 423 | CS42L73_ADCIPC, 2, 0x01, 1, adc_boost_tlv), |
427 | 424 | ||
428 | SOC_SINGLE_TLV("ADC B Boost Volume", | 425 | SOC_SINGLE_TLV("ADC B Boost Volume", |
429 | CS42L73_ADCIPC, 6, 0x01, 1, adc_boost_tlv), | 426 | CS42L73_ADCIPC, 6, 0x01, 1, adc_boost_tlv), |
430 | 427 | ||
431 | SOC_SINGLE_TLV("Speakerphone Digital Playback Volume", | 428 | SOC_SINGLE_SX_TLV("Speakerphone Digital Volume", |
432 | CS42L73_SPKDVOL, 0, 0xE4, 1, hl_tlv), | 429 | CS42L73_SPKDVOL, 0, 0x34, 0xE4, hl_tlv), |
433 | 430 | ||
434 | SOC_SINGLE_TLV("Ear Speaker Digital Playback Volume", | 431 | SOC_SINGLE_SX_TLV("Ear Speaker Digital Volume", |
435 | CS42L73_ESLDVOL, 0, 0xE4, 1, hl_tlv), | 432 | CS42L73_ESLDVOL, 0, 0x34, 0xE4, hl_tlv), |
436 | 433 | ||
437 | SOC_DOUBLE_R("Headphone Analog Playback Switch", CS42L73_HPAAVOL, | 434 | SOC_DOUBLE_R("Headphone Analog Playback Switch", CS42L73_HPAAVOL, |
438 | CS42L73_HPBAVOL, 7, 1, 1), | 435 | CS42L73_HPBAVOL, 7, 1, 1), |
@@ -599,17 +596,17 @@ static const struct snd_soc_dapm_widget cs42l73_dapm_widgets[] = { | |||
599 | SND_SOC_DAPM_INPUT("MIC2"), | 596 | SND_SOC_DAPM_INPUT("MIC2"), |
600 | SND_SOC_DAPM_SUPPLY("MIC2 Bias", CS42L73_PWRCTL2, 7, 1, NULL, 0), | 597 | SND_SOC_DAPM_SUPPLY("MIC2 Bias", CS42L73_PWRCTL2, 7, 1, NULL, 0), |
601 | 598 | ||
602 | SND_SOC_DAPM_AIF_OUT("XSPOUTL", "XSP Capture", 0, | 599 | SND_SOC_DAPM_AIF_OUT("XSPOUTL", NULL, 0, |
603 | CS42L73_PWRCTL2, 1, 1), | 600 | CS42L73_PWRCTL2, 1, 1), |
604 | SND_SOC_DAPM_AIF_OUT("XSPOUTR", "XSP Capture", 0, | 601 | SND_SOC_DAPM_AIF_OUT("XSPOUTR", NULL, 0, |
605 | CS42L73_PWRCTL2, 1, 1), | 602 | CS42L73_PWRCTL2, 1, 1), |
606 | SND_SOC_DAPM_AIF_OUT("ASPOUTL", "ASP Capture", 0, | 603 | SND_SOC_DAPM_AIF_OUT("ASPOUTL", NULL, 0, |
607 | CS42L73_PWRCTL2, 3, 1), | 604 | CS42L73_PWRCTL2, 3, 1), |
608 | SND_SOC_DAPM_AIF_OUT("ASPOUTR", "ASP Capture", 0, | 605 | SND_SOC_DAPM_AIF_OUT("ASPOUTR", NULL, 0, |
609 | CS42L73_PWRCTL2, 3, 1), | 606 | CS42L73_PWRCTL2, 3, 1), |
610 | SND_SOC_DAPM_AIF_OUT("VSPOUTL", "VSP Capture", 0, | 607 | SND_SOC_DAPM_AIF_OUT("VSPOUTL", NULL, 0, |
611 | CS42L73_PWRCTL2, 4, 1), | 608 | CS42L73_PWRCTL2, 4, 1), |
612 | SND_SOC_DAPM_AIF_OUT("VSPOUTR", "VSP Capture", 0, | 609 | SND_SOC_DAPM_AIF_OUT("VSPOUTR", NULL, 0, |
613 | CS42L73_PWRCTL2, 4, 1), | 610 | CS42L73_PWRCTL2, 4, 1), |
614 | 611 | ||
615 | SND_SOC_DAPM_PGA("PGA Left", SND_SOC_NOPM, 0, 0, NULL, 0), | 612 | SND_SOC_DAPM_PGA("PGA Left", SND_SOC_NOPM, 0, 0, NULL, 0), |
@@ -638,21 +635,21 @@ static const struct snd_soc_dapm_widget cs42l73_dapm_widgets[] = { | |||
638 | SND_SOC_DAPM_MIXER("VSPL Output Mixer", SND_SOC_NOPM, 0, 0, NULL, 0), | 635 | SND_SOC_DAPM_MIXER("VSPL Output Mixer", SND_SOC_NOPM, 0, 0, NULL, 0), |
639 | SND_SOC_DAPM_MIXER("VSPR Output Mixer", SND_SOC_NOPM, 0, 0, NULL, 0), | 636 | SND_SOC_DAPM_MIXER("VSPR Output Mixer", SND_SOC_NOPM, 0, 0, NULL, 0), |
640 | 637 | ||
641 | SND_SOC_DAPM_AIF_IN("XSPINL", "XSP Playback", 0, | 638 | SND_SOC_DAPM_AIF_IN("XSPINL", NULL, 0, |
642 | CS42L73_PWRCTL2, 0, 1), | 639 | CS42L73_PWRCTL2, 0, 1), |
643 | SND_SOC_DAPM_AIF_IN("XSPINR", "XSP Playback", 0, | 640 | SND_SOC_DAPM_AIF_IN("XSPINR", NULL, 0, |
644 | CS42L73_PWRCTL2, 0, 1), | 641 | CS42L73_PWRCTL2, 0, 1), |
645 | SND_SOC_DAPM_AIF_IN("XSPINM", "XSP Playback", 0, | 642 | SND_SOC_DAPM_AIF_IN("XSPINM", NULL, 0, |
646 | CS42L73_PWRCTL2, 0, 1), | 643 | CS42L73_PWRCTL2, 0, 1), |
647 | 644 | ||
648 | SND_SOC_DAPM_AIF_IN("ASPINL", "ASP Playback", 0, | 645 | SND_SOC_DAPM_AIF_IN("ASPINL", NULL, 0, |
649 | CS42L73_PWRCTL2, 2, 1), | 646 | CS42L73_PWRCTL2, 2, 1), |
650 | SND_SOC_DAPM_AIF_IN("ASPINR", "ASP Playback", 0, | 647 | SND_SOC_DAPM_AIF_IN("ASPINR", NULL, 0, |
651 | CS42L73_PWRCTL2, 2, 1), | 648 | CS42L73_PWRCTL2, 2, 1), |
652 | SND_SOC_DAPM_AIF_IN("ASPINM", "ASP Playback", 0, | 649 | SND_SOC_DAPM_AIF_IN("ASPINM", NULL, 0, |
653 | CS42L73_PWRCTL2, 2, 1), | 650 | CS42L73_PWRCTL2, 2, 1), |
654 | 651 | ||
655 | SND_SOC_DAPM_AIF_IN("VSPIN", "VSP Playback", 0, | 652 | SND_SOC_DAPM_AIF_IN("VSPIN", NULL, 0, |
656 | CS42L73_PWRCTL2, 4, 1), | 653 | CS42L73_PWRCTL2, 4, 1), |
657 | 654 | ||
658 | SND_SOC_DAPM_MIXER("HL Left Mixer", SND_SOC_NOPM, 0, 0, NULL, 0), | 655 | SND_SOC_DAPM_MIXER("HL Left Mixer", SND_SOC_NOPM, 0, 0, NULL, 0), |
@@ -776,6 +773,14 @@ static const struct snd_soc_dapm_route cs42l73_audio_map[] = { | |||
776 | {"HL Left Mixer", NULL, "VSPIN"}, | 773 | {"HL Left Mixer", NULL, "VSPIN"}, |
777 | {"HL Right Mixer", NULL, "VSPIN"}, | 774 | {"HL Right Mixer", NULL, "VSPIN"}, |
778 | 775 | ||
776 | {"ASPINL", NULL, "ASP Playback"}, | ||
777 | {"ASPINM", NULL, "ASP Playback"}, | ||
778 | {"ASPINR", NULL, "ASP Playback"}, | ||
779 | {"XSPINL", NULL, "XSP Playback"}, | ||
780 | {"XSPINM", NULL, "XSP Playback"}, | ||
781 | {"XSPINR", NULL, "XSP Playback"}, | ||
782 | {"VSPIN", NULL, "VSP Playback"}, | ||
783 | |||
779 | /* Capture Paths */ | 784 | /* Capture Paths */ |
780 | {"MIC1", NULL, "MIC1 Bias"}, | 785 | {"MIC1", NULL, "MIC1 Bias"}, |
781 | {"PGA Left Mux", "Mic 1", "MIC1"}, | 786 | {"PGA Left Mux", "Mic 1", "MIC1"}, |
@@ -822,6 +827,13 @@ static const struct snd_soc_dapm_route cs42l73_audio_map[] = { | |||
822 | 827 | ||
823 | {"VSPOUTL", NULL, "VSPL Output Mixer"}, | 828 | {"VSPOUTL", NULL, "VSPL Output Mixer"}, |
824 | {"VSPOUTR", NULL, "VSPR Output Mixer"}, | 829 | {"VSPOUTR", NULL, "VSPR Output Mixer"}, |
830 | |||
831 | {"ASP Capture", NULL, "ASPOUTL"}, | ||
832 | {"ASP Capture", NULL, "ASPOUTR"}, | ||
833 | {"XSP Capture", NULL, "XSPOUTL"}, | ||
834 | {"XSP Capture", NULL, "XSPOUTR"}, | ||
835 | {"VSP Capture", NULL, "VSPOUTL"}, | ||
836 | {"VSP Capture", NULL, "VSPOUTR"}, | ||
825 | }; | 837 | }; |
826 | 838 | ||
827 | struct cs42l73_mclk_div { | 839 | struct cs42l73_mclk_div { |
@@ -1091,8 +1103,7 @@ static int cs42l73_pcm_hw_params(struct snd_pcm_substream *substream, | |||
1091 | struct snd_pcm_hw_params *params, | 1103 | struct snd_pcm_hw_params *params, |
1092 | struct snd_soc_dai *dai) | 1104 | struct snd_soc_dai *dai) |
1093 | { | 1105 | { |
1094 | struct snd_soc_pcm_runtime *rtd = substream->private_data; | 1106 | struct snd_soc_codec *codec = dai->codec; |
1095 | struct snd_soc_codec *codec = rtd->codec; | ||
1096 | struct cs42l73_private *priv = snd_soc_codec_get_drvdata(codec); | 1107 | struct cs42l73_private *priv = snd_soc_codec_get_drvdata(codec); |
1097 | int id = dai->id; | 1108 | int id = dai->id; |
1098 | int mclk_coeff; | 1109 | int mclk_coeff; |
@@ -1429,25 +1440,7 @@ static struct i2c_driver cs42l73_i2c_driver = { | |||
1429 | 1440 | ||
1430 | }; | 1441 | }; |
1431 | 1442 | ||
1432 | static int __init cs42l73_modinit(void) | 1443 | module_i2c_driver(cs42l73_i2c_driver); |
1433 | { | ||
1434 | int ret; | ||
1435 | ret = i2c_add_driver(&cs42l73_i2c_driver); | ||
1436 | if (ret != 0) { | ||
1437 | pr_err("Failed to register CS42L73 I2C driver: %d\n", ret); | ||
1438 | return ret; | ||
1439 | } | ||
1440 | return 0; | ||
1441 | } | ||
1442 | |||
1443 | module_init(cs42l73_modinit); | ||
1444 | |||
1445 | static void __exit cs42l73_exit(void) | ||
1446 | { | ||
1447 | i2c_del_driver(&cs42l73_i2c_driver); | ||
1448 | } | ||
1449 | |||
1450 | module_exit(cs42l73_exit); | ||
1451 | 1444 | ||
1452 | MODULE_DESCRIPTION("ASoC CS42L73 driver"); | 1445 | MODULE_DESCRIPTION("ASoC CS42L73 driver"); |
1453 | MODULE_AUTHOR("Georgi Vlaev, Nucleus Systems Ltd, <joe@nucleusys.com>"); | 1446 | MODULE_AUTHOR("Georgi Vlaev, Nucleus Systems Ltd, <joe@nucleusys.com>"); |