| OLD | NEW |
| 1 /* | 1 /* |
| 2 * ams-delta.c -- SoC audio for Amstrad E3 (Delta) videophone | 2 * ams-delta.c -- SoC audio for Amstrad E3 (Delta) videophone |
| 3 * | 3 * |
| 4 * Copyright (C) 2009 Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> | 4 * Copyright (C) 2009 Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> |
| 5 * | 5 * |
| 6 * Initially based on sound/soc/omap/osk5912.x | 6 * Initially based on sound/soc/omap/osk5912.x |
| 7 * Copyright (C) 2008 Mistral Solutions | 7 * Copyright (C) 2008 Mistral Solutions |
| 8 * | 8 * |
| 9 * This program is free software; you can redistribute it and/or | 9 * This program is free software; you can redistribute it and/or |
| 10 * modify it under the terms of the GNU General Public License | 10 * modify it under the terms of the GNU General Public License |
| 11 * version 2 as published by the Free Software Foundation. | 11 * version 2 as published by the Free Software Foundation. |
| 12 * | 12 * |
| 13 * This program is distributed in the hope that it will be useful, but | 13 * This program is distributed in the hope that it will be useful, but |
| 14 * WITHOUT ANY WARRANTY; without even the implied warranty of | 14 * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 16 * General Public License for more details. | 16 * General Public License for more details. |
| 17 * | 17 * |
| 18 * You should have received a copy of the GNU General Public License | 18 * You should have received a copy of the GNU General Public License |
| 19 * along with this program; if not, write to the Free Software | 19 * along with this program; if not, write to the Free Software |
| 20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | 20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA |
| 21 * 02110-1301 USA | 21 * 02110-1301 USA |
| 22 * | 22 * |
| 23 */ | 23 */ |
| 24 | 24 |
| 25 #include <linux/gpio.h> | 25 #include <linux/gpio.h> |
| 26 #include <linux/spinlock.h> | 26 #include <linux/spinlock.h> |
| 27 #include <linux/tty.h> | 27 #include <linux/tty.h> |
| 28 | 28 |
| 29 #include <sound/soc-dapm.h> | 29 #include <sound/soc.h> |
| 30 #include <sound/jack.h> | 30 #include <sound/jack.h> |
| 31 | 31 |
| 32 #include <asm/mach-types.h> | 32 #include <asm/mach-types.h> |
| 33 | 33 |
| 34 #include <plat/board-ams-delta.h> | 34 #include <plat/board-ams-delta.h> |
| 35 #include <plat/mcbsp.h> | 35 #include <plat/mcbsp.h> |
| 36 | 36 |
| 37 #include "omap-mcbsp.h" | 37 #include "omap-mcbsp.h" |
| 38 #include "omap-pcm.h" | 38 #include "omap-pcm.h" |
| 39 #include "../codecs/cx20442.h" | 39 #include "../codecs/cx20442.h" |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 AMS_DELTA_HANDSFREE, | 87 AMS_DELTA_HANDSFREE, |
| 88 AMS_DELTA_SPEAKERPHONE, | 88 AMS_DELTA_SPEAKERPHONE, |
| 89 }; | 89 }; |
| 90 | 90 |
| 91 static unsigned short ams_delta_audio_agc; | 91 static unsigned short ams_delta_audio_agc; |
| 92 | 92 |
| 93 static int ams_delta_set_audio_mode(struct snd_kcontrol *kcontrol, | 93 static int ams_delta_set_audio_mode(struct snd_kcontrol *kcontrol, |
| 94 struct snd_ctl_elem_value *ucontrol) | 94 struct snd_ctl_elem_value *ucontrol) |
| 95 { | 95 { |
| 96 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); | 96 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); |
| 97 struct snd_soc_dapm_context *dapm = &codec->dapm; |
| 97 struct soc_enum *control = (struct soc_enum *)kcontrol->private_value; | 98 struct soc_enum *control = (struct soc_enum *)kcontrol->private_value; |
| 98 unsigned short pins; | 99 unsigned short pins; |
| 99 int pin, changed = 0; | 100 int pin, changed = 0; |
| 100 | 101 |
| 101 /* Refuse any mode changes if we are not able to control the codec. */ | 102 /* Refuse any mode changes if we are not able to control the codec. */ |
| 102 if (!codec->hw_write) | 103 if (!codec->hw_write) |
| 103 return -EUNATCH; | 104 return -EUNATCH; |
| 104 | 105 |
| 105 if (ucontrol->value.enumerated.item[0] >= control->max) | 106 if (ucontrol->value.enumerated.item[0] >= control->max) |
| 106 return -EINVAL; | 107 return -EINVAL; |
| 107 | 108 |
| 108 mutex_lock(&codec->mutex); | 109 mutex_lock(&codec->mutex); |
| 109 | 110 |
| 110 /* Translate selection to bitmap */ | 111 /* Translate selection to bitmap */ |
| 111 pins = ams_delta_audio_mode_pins[ucontrol->value.enumerated.item[0]]; | 112 pins = ams_delta_audio_mode_pins[ucontrol->value.enumerated.item[0]]; |
| 112 | 113 |
| 113 /* Setup pins after corresponding bits if changed */ | 114 /* Setup pins after corresponding bits if changed */ |
| 114 pin = !!(pins & (1 << AMS_DELTA_MOUTHPIECE)); | 115 pin = !!(pins & (1 << AMS_DELTA_MOUTHPIECE)); |
| 115 » if (pin != snd_soc_dapm_get_pin_status(codec, "Mouthpiece")) { | 116 » if (pin != snd_soc_dapm_get_pin_status(dapm, "Mouthpiece")) { |
| 116 changed = 1; | 117 changed = 1; |
| 117 if (pin) | 118 if (pin) |
| 118 » » » snd_soc_dapm_enable_pin(codec, "Mouthpiece"); | 119 » » » snd_soc_dapm_enable_pin(dapm, "Mouthpiece"); |
| 119 else | 120 else |
| 120 » » » snd_soc_dapm_disable_pin(codec, "Mouthpiece"); | 121 » » » snd_soc_dapm_disable_pin(dapm, "Mouthpiece"); |
| 121 } | 122 } |
| 122 pin = !!(pins & (1 << AMS_DELTA_EARPIECE)); | 123 pin = !!(pins & (1 << AMS_DELTA_EARPIECE)); |
| 123 » if (pin != snd_soc_dapm_get_pin_status(codec, "Earpiece")) { | 124 » if (pin != snd_soc_dapm_get_pin_status(dapm, "Earpiece")) { |
| 124 changed = 1; | 125 changed = 1; |
| 125 if (pin) | 126 if (pin) |
| 126 » » » snd_soc_dapm_enable_pin(codec, "Earpiece"); | 127 » » » snd_soc_dapm_enable_pin(dapm, "Earpiece"); |
| 127 else | 128 else |
| 128 » » » snd_soc_dapm_disable_pin(codec, "Earpiece"); | 129 » » » snd_soc_dapm_disable_pin(dapm, "Earpiece"); |
| 129 } | 130 } |
| 130 pin = !!(pins & (1 << AMS_DELTA_MICROPHONE)); | 131 pin = !!(pins & (1 << AMS_DELTA_MICROPHONE)); |
| 131 » if (pin != snd_soc_dapm_get_pin_status(codec, "Microphone")) { | 132 » if (pin != snd_soc_dapm_get_pin_status(dapm, "Microphone")) { |
| 132 changed = 1; | 133 changed = 1; |
| 133 if (pin) | 134 if (pin) |
| 134 » » » snd_soc_dapm_enable_pin(codec, "Microphone"); | 135 » » » snd_soc_dapm_enable_pin(dapm, "Microphone"); |
| 135 else | 136 else |
| 136 » » » snd_soc_dapm_disable_pin(codec, "Microphone"); | 137 » » » snd_soc_dapm_disable_pin(dapm, "Microphone"); |
| 137 } | 138 } |
| 138 pin = !!(pins & (1 << AMS_DELTA_SPEAKER)); | 139 pin = !!(pins & (1 << AMS_DELTA_SPEAKER)); |
| 139 » if (pin != snd_soc_dapm_get_pin_status(codec, "Speaker")) { | 140 » if (pin != snd_soc_dapm_get_pin_status(dapm, "Speaker")) { |
| 140 changed = 1; | 141 changed = 1; |
| 141 if (pin) | 142 if (pin) |
| 142 » » » snd_soc_dapm_enable_pin(codec, "Speaker"); | 143 » » » snd_soc_dapm_enable_pin(dapm, "Speaker"); |
| 143 else | 144 else |
| 144 » » » snd_soc_dapm_disable_pin(codec, "Speaker"); | 145 » » » snd_soc_dapm_disable_pin(dapm, "Speaker"); |
| 145 } | 146 } |
| 146 pin = !!(pins & (1 << AMS_DELTA_AGC)); | 147 pin = !!(pins & (1 << AMS_DELTA_AGC)); |
| 147 if (pin != ams_delta_audio_agc) { | 148 if (pin != ams_delta_audio_agc) { |
| 148 ams_delta_audio_agc = pin; | 149 ams_delta_audio_agc = pin; |
| 149 changed = 1; | 150 changed = 1; |
| 150 if (pin) | 151 if (pin) |
| 151 » » » snd_soc_dapm_enable_pin(codec, "AGCIN"); | 152 » » » snd_soc_dapm_enable_pin(dapm, "AGCIN"); |
| 152 else | 153 else |
| 153 » » » snd_soc_dapm_disable_pin(codec, "AGCIN"); | 154 » » » snd_soc_dapm_disable_pin(dapm, "AGCIN"); |
| 154 } | 155 } |
| 155 if (changed) | 156 if (changed) |
| 156 » » snd_soc_dapm_sync(codec); | 157 » » snd_soc_dapm_sync(dapm); |
| 157 | 158 |
| 158 mutex_unlock(&codec->mutex); | 159 mutex_unlock(&codec->mutex); |
| 159 | 160 |
| 160 return changed; | 161 return changed; |
| 161 } | 162 } |
| 162 | 163 |
| 163 static int ams_delta_get_audio_mode(struct snd_kcontrol *kcontrol, | 164 static int ams_delta_get_audio_mode(struct snd_kcontrol *kcontrol, |
| 164 struct snd_ctl_elem_value *ucontrol) | 165 struct snd_ctl_elem_value *ucontrol) |
| 165 { | 166 { |
| 166 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); | 167 struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol); |
| 168 struct snd_soc_dapm_context *dapm = &codec->dapm; |
| 167 unsigned short pins, mode; | 169 unsigned short pins, mode; |
| 168 | 170 |
| 169 » pins = ((snd_soc_dapm_get_pin_status(codec, "Mouthpiece") << | 171 » pins = ((snd_soc_dapm_get_pin_status(dapm, "Mouthpiece") << |
| 170 AMS_DELTA_MOUTHPIECE) | | 172 AMS_DELTA_MOUTHPIECE) | |
| 171 » » » (snd_soc_dapm_get_pin_status(codec, "Earpiece") << | 173 » » » (snd_soc_dapm_get_pin_status(dapm, "Earpiece") << |
| 172 AMS_DELTA_EARPIECE)); | 174 AMS_DELTA_EARPIECE)); |
| 173 if (pins) | 175 if (pins) |
| 174 » » pins |= (snd_soc_dapm_get_pin_status(codec, "Microphone") << | 176 » » pins |= (snd_soc_dapm_get_pin_status(dapm, "Microphone") << |
| 175 AMS_DELTA_MICROPHONE); | 177 AMS_DELTA_MICROPHONE); |
| 176 else | 178 else |
| 177 » » pins = ((snd_soc_dapm_get_pin_status(codec, "Microphone") << | 179 » » pins = ((snd_soc_dapm_get_pin_status(dapm, "Microphone") << |
| 178 AMS_DELTA_MICROPHONE) | | 180 AMS_DELTA_MICROPHONE) | |
| 179 » » » (snd_soc_dapm_get_pin_status(codec, "Speaker") << | 181 » » » (snd_soc_dapm_get_pin_status(dapm, "Speaker") << |
| 180 AMS_DELTA_SPEAKER) | | 182 AMS_DELTA_SPEAKER) | |
| 181 (ams_delta_audio_agc << AMS_DELTA_AGC)); | 183 (ams_delta_audio_agc << AMS_DELTA_AGC)); |
| 182 | 184 |
| 183 for (mode = 0; mode < ARRAY_SIZE(ams_delta_audio_mode); mode++) | 185 for (mode = 0; mode < ARRAY_SIZE(ams_delta_audio_mode); mode++) |
| 184 if (pins == ams_delta_audio_mode_pins[mode]) | 186 if (pins == ams_delta_audio_mode_pins[mode]) |
| 185 break; | 187 break; |
| 186 | 188 |
| 187 if (mode >= ARRAY_SIZE(ams_delta_audio_mode)) | 189 if (mode >= ARRAY_SIZE(ams_delta_audio_mode)) |
| 188 return -EINVAL; | 190 return -EINVAL; |
| 189 | 191 |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 if (ret < 0) | 295 if (ret < 0) |
| 294 tty->disc_data = NULL; | 296 tty->disc_data = NULL; |
| 295 | 297 |
| 296 return ret; | 298 return ret; |
| 297 } | 299 } |
| 298 | 300 |
| 299 /* Line discipline .close() */ | 301 /* Line discipline .close() */ |
| 300 static void cx81801_close(struct tty_struct *tty) | 302 static void cx81801_close(struct tty_struct *tty) |
| 301 { | 303 { |
| 302 struct snd_soc_codec *codec = tty->disc_data; | 304 struct snd_soc_codec *codec = tty->disc_data; |
| 305 struct snd_soc_dapm_context *dapm = &codec->dapm; |
| 303 | 306 |
| 304 del_timer_sync(&cx81801_timer); | 307 del_timer_sync(&cx81801_timer); |
| 305 | 308 |
| 306 /* Prevent the hook switch from further changing the DAPM pins */ | 309 /* Prevent the hook switch from further changing the DAPM pins */ |
| 307 INIT_LIST_HEAD(&ams_delta_hook_switch.pins); | 310 INIT_LIST_HEAD(&ams_delta_hook_switch.pins); |
| 308 | 311 |
| 309 if (!codec) | 312 if (!codec) |
| 310 return; | 313 return; |
| 311 | 314 |
| 312 v253_ops.close(tty); | 315 v253_ops.close(tty); |
| 313 | 316 |
| 314 /* Revert back to default audio input/output constellation */ | 317 /* Revert back to default audio input/output constellation */ |
| 315 » snd_soc_dapm_disable_pin(codec, "Mouthpiece"); | 318 » snd_soc_dapm_disable_pin(dapm, "Mouthpiece"); |
| 316 » snd_soc_dapm_enable_pin(codec, "Earpiece"); | 319 » snd_soc_dapm_enable_pin(dapm, "Earpiece"); |
| 317 » snd_soc_dapm_enable_pin(codec, "Microphone"); | 320 » snd_soc_dapm_enable_pin(dapm, "Microphone"); |
| 318 » snd_soc_dapm_disable_pin(codec, "Speaker"); | 321 » snd_soc_dapm_disable_pin(dapm, "Speaker"); |
| 319 » snd_soc_dapm_disable_pin(codec, "AGCIN"); | 322 » snd_soc_dapm_disable_pin(dapm, "AGCIN"); |
| 320 » snd_soc_dapm_sync(codec); | 323 » snd_soc_dapm_sync(dapm); |
| 321 } | 324 } |
| 322 | 325 |
| 323 /* Line discipline .hangup() */ | 326 /* Line discipline .hangup() */ |
| 324 static int cx81801_hangup(struct tty_struct *tty) | 327 static int cx81801_hangup(struct tty_struct *tty) |
| 325 { | 328 { |
| 326 cx81801_close(tty); | 329 cx81801_close(tty); |
| 327 return 0; | 330 return 0; |
| 328 } | 331 } |
| 329 | 332 |
| 330 /* Line discipline .recieve_buf() */ | 333 /* Line discipline .recieve_buf() */ |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 /* Board specific codec bias level control */ | 428 /* Board specific codec bias level control */ |
| 426 static int ams_delta_set_bias_level(struct snd_soc_card *card, | 429 static int ams_delta_set_bias_level(struct snd_soc_card *card, |
| 427 enum snd_soc_bias_level level) | 430 enum snd_soc_bias_level level) |
| 428 { | 431 { |
| 429 struct snd_soc_codec *codec = card->rtd->codec; | 432 struct snd_soc_codec *codec = card->rtd->codec; |
| 430 | 433 |
| 431 switch (level) { | 434 switch (level) { |
| 432 case SND_SOC_BIAS_ON: | 435 case SND_SOC_BIAS_ON: |
| 433 case SND_SOC_BIAS_PREPARE: | 436 case SND_SOC_BIAS_PREPARE: |
| 434 case SND_SOC_BIAS_STANDBY: | 437 case SND_SOC_BIAS_STANDBY: |
| 435 » » if (codec->bias_level == SND_SOC_BIAS_OFF) | 438 » » if (codec->dapm.bias_level == SND_SOC_BIAS_OFF) |
| 436 ams_delta_latch2_write(AMS_DELTA_LATCH2_MODEM_NRESET, | 439 ams_delta_latch2_write(AMS_DELTA_LATCH2_MODEM_NRESET, |
| 437 AMS_DELTA_LATCH2_MODEM_NRESET); | 440 AMS_DELTA_LATCH2_MODEM_NRESET); |
| 438 break; | 441 break; |
| 439 case SND_SOC_BIAS_OFF: | 442 case SND_SOC_BIAS_OFF: |
| 440 » » if (codec->bias_level != SND_SOC_BIAS_OFF) | 443 » » if (codec->dapm.bias_level != SND_SOC_BIAS_OFF) |
| 441 ams_delta_latch2_write(AMS_DELTA_LATCH2_MODEM_NRESET, | 444 ams_delta_latch2_write(AMS_DELTA_LATCH2_MODEM_NRESET, |
| 442 0); | 445 0); |
| 443 } | 446 } |
| 444 » codec->bias_level = level; | 447 » codec->dapm.bias_level = level; |
| 445 | 448 |
| 446 return 0; | 449 return 0; |
| 447 } | 450 } |
| 448 | 451 |
| 449 /* Digital mute implemented using modem/CPU multiplexer. | 452 /* Digital mute implemented using modem/CPU multiplexer. |
| 450 * Shares hardware with codec config pulse generation */ | 453 * Shares hardware with codec config pulse generation */ |
| 451 static bool ams_delta_muted = 1; | 454 static bool ams_delta_muted = 1; |
| 452 | 455 |
| 453 static int ams_delta_digital_mute(struct snd_soc_dai *dai, int mute) | 456 static int ams_delta_digital_mute(struct snd_soc_dai *dai, int mute) |
| 454 { | 457 { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 485 } | 488 } |
| 486 | 489 |
| 487 | 490 |
| 488 /* | 491 /* |
| 489 * Card initialization | 492 * Card initialization |
| 490 */ | 493 */ |
| 491 | 494 |
| 492 static int ams_delta_cx20442_init(struct snd_soc_pcm_runtime *rtd) | 495 static int ams_delta_cx20442_init(struct snd_soc_pcm_runtime *rtd) |
| 493 { | 496 { |
| 494 struct snd_soc_codec *codec = rtd->codec; | 497 struct snd_soc_codec *codec = rtd->codec; |
| 498 struct snd_soc_dapm_context *dapm = &codec->dapm; |
| 495 struct snd_soc_dai *codec_dai = rtd->codec_dai; | 499 struct snd_soc_dai *codec_dai = rtd->codec_dai; |
| 496 struct snd_soc_card *card = rtd->card; | 500 struct snd_soc_card *card = rtd->card; |
| 497 int ret; | 501 int ret; |
| 498 /* Codec is ready, now add/activate board specific controls */ | 502 /* Codec is ready, now add/activate board specific controls */ |
| 499 | 503 |
| 500 /* Store a pointer to the codec structure for tty ldisc use */ | 504 /* Store a pointer to the codec structure for tty ldisc use */ |
| 501 cx20442_codec = codec; | 505 cx20442_codec = codec; |
| 502 | 506 |
| 503 /* Set up digital mute if not provided by the codec */ | 507 /* Set up digital mute if not provided by the codec */ |
| 504 if (!codec_dai->driver->ops) { | 508 if (!codec_dai->driver->ops) { |
| 505 codec_dai->driver->ops = &ams_delta_dai_ops; | 509 codec_dai->driver->ops = &ams_delta_dai_ops; |
| 506 } else if (!codec_dai->driver->ops->digital_mute) { | |
| 507 codec_dai->driver->ops->digital_mute = ams_delta_digital_mute; | |
| 508 } else { | 510 } else { |
| 509 ams_delta_ops.startup = ams_delta_startup; | 511 ams_delta_ops.startup = ams_delta_startup; |
| 510 ams_delta_ops.shutdown = ams_delta_shutdown; | 512 ams_delta_ops.shutdown = ams_delta_shutdown; |
| 511 } | 513 } |
| 512 | 514 |
| 513 /* Set codec bias level */ | 515 /* Set codec bias level */ |
| 514 ams_delta_set_bias_level(card, SND_SOC_BIAS_STANDBY); | 516 ams_delta_set_bias_level(card, SND_SOC_BIAS_STANDBY); |
| 515 | 517 |
| 516 /* Add hook switch - can be used to control the codec from userspace | 518 /* Add hook switch - can be used to control the codec from userspace |
| 517 * even if line discipline fails */ | 519 * even if line discipline fails */ |
| (...skipping 16 matching lines...) Expand all Loading... |
| 534 /* Register optional line discipline for over the modem control */ | 536 /* Register optional line discipline for over the modem control */ |
| 535 ret = tty_register_ldisc(N_V253, &cx81801_ops); | 537 ret = tty_register_ldisc(N_V253, &cx81801_ops); |
| 536 if (ret) { | 538 if (ret) { |
| 537 dev_warn(card->dev, | 539 dev_warn(card->dev, |
| 538 "Failed to register line discipline, " | 540 "Failed to register line discipline, " |
| 539 "will continue without any controls.\n"); | 541 "will continue without any controls.\n"); |
| 540 return 0; | 542 return 0; |
| 541 } | 543 } |
| 542 | 544 |
| 543 /* Add board specific DAPM widgets and routes */ | 545 /* Add board specific DAPM widgets and routes */ |
| 544 » ret = snd_soc_dapm_new_controls(codec, ams_delta_dapm_widgets, | 546 » ret = snd_soc_dapm_new_controls(dapm, ams_delta_dapm_widgets, |
| 545 ARRAY_SIZE(ams_delta_dapm_widgets)); | 547 ARRAY_SIZE(ams_delta_dapm_widgets)); |
| 546 if (ret) { | 548 if (ret) { |
| 547 dev_warn(card->dev, | 549 dev_warn(card->dev, |
| 548 "Failed to register DAPM controls, " | 550 "Failed to register DAPM controls, " |
| 549 "will continue without any.\n"); | 551 "will continue without any.\n"); |
| 550 return 0; | 552 return 0; |
| 551 } | 553 } |
| 552 | 554 |
| 553 » ret = snd_soc_dapm_add_routes(codec, ams_delta_audio_map, | 555 » ret = snd_soc_dapm_add_routes(dapm, ams_delta_audio_map, |
| 554 ARRAY_SIZE(ams_delta_audio_map)); | 556 ARRAY_SIZE(ams_delta_audio_map)); |
| 555 if (ret) { | 557 if (ret) { |
| 556 dev_warn(card->dev, | 558 dev_warn(card->dev, |
| 557 "Failed to set up DAPM routes, " | 559 "Failed to set up DAPM routes, " |
| 558 "will continue with codec default map.\n"); | 560 "will continue with codec default map.\n"); |
| 559 return 0; | 561 return 0; |
| 560 } | 562 } |
| 561 | 563 |
| 562 /* Set up initial pin constellation */ | 564 /* Set up initial pin constellation */ |
| 563 » snd_soc_dapm_disable_pin(codec, "Mouthpiece"); | 565 » snd_soc_dapm_disable_pin(dapm, "Mouthpiece"); |
| 564 » snd_soc_dapm_enable_pin(codec, "Earpiece"); | 566 » snd_soc_dapm_enable_pin(dapm, "Earpiece"); |
| 565 » snd_soc_dapm_enable_pin(codec, "Microphone"); | 567 » snd_soc_dapm_enable_pin(dapm, "Microphone"); |
| 566 » snd_soc_dapm_disable_pin(codec, "Speaker"); | 568 » snd_soc_dapm_disable_pin(dapm, "Speaker"); |
| 567 » snd_soc_dapm_disable_pin(codec, "AGCIN"); | 569 » snd_soc_dapm_disable_pin(dapm, "AGCIN"); |
| 568 » snd_soc_dapm_disable_pin(codec, "AGCOUT"); | 570 » snd_soc_dapm_disable_pin(dapm, "AGCOUT"); |
| 569 » snd_soc_dapm_sync(codec); | 571 » snd_soc_dapm_sync(dapm); |
| 570 | 572 |
| 571 /* Add virtual switch */ | 573 /* Add virtual switch */ |
| 572 ret = snd_soc_add_controls(codec, ams_delta_audio_controls, | 574 ret = snd_soc_add_controls(codec, ams_delta_audio_controls, |
| 573 ARRAY_SIZE(ams_delta_audio_controls)); | 575 ARRAY_SIZE(ams_delta_audio_controls)); |
| 574 if (ret) | 576 if (ret) |
| 575 dev_warn(card->dev, | 577 dev_warn(card->dev, |
| 576 "Failed to register audio mode control, " | 578 "Failed to register audio mode control, " |
| 577 "will continue without it.\n"); | 579 "will continue without it.\n"); |
| 578 | 580 |
| 579 return 0; | 581 return 0; |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 649 ams_delta_set_bias_level(&ams_delta_audio_card, SND_SOC_BIAS_STANDBY); | 651 ams_delta_set_bias_level(&ams_delta_audio_card, SND_SOC_BIAS_STANDBY); |
| 650 | 652 |
| 651 platform_device_unregister(cx20442_platform_device); | 653 platform_device_unregister(cx20442_platform_device); |
| 652 platform_device_unregister(ams_delta_audio_platform_device); | 654 platform_device_unregister(ams_delta_audio_platform_device); |
| 653 } | 655 } |
| 654 module_exit(ams_delta_module_exit); | 656 module_exit(ams_delta_module_exit); |
| 655 | 657 |
| 656 MODULE_AUTHOR("Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>"); | 658 MODULE_AUTHOR("Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>"); |
| 657 MODULE_DESCRIPTION("ALSA SoC driver for Amstrad E3 (Delta) videophone"); | 659 MODULE_DESCRIPTION("ALSA SoC driver for Amstrad E3 (Delta) videophone"); |
| 658 MODULE_LICENSE("GPL"); | 660 MODULE_LICENSE("GPL"); |
| OLD | NEW |