diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-27 12:25:15 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-27 12:25:15 -0400 |
commit | 75623437167d9d1ef14acaf6b3fb4ccd38fcbc84 (patch) | |
tree | b7136121995cc6c2b5211a5393b1ad7c179a2f3b /sound/soc/codecs | |
parent | 70a3eff5768350c0313a9ae70a15da113171d0ab (diff) | |
parent | 636f78581dbd5529a52057973fe2bdfc1c2f528e (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: (22 commits)
ALSA: hda - Cirrus Logic CS421x support
ALSA: Make pcm.h self-contained
ALSA: hda - Allow codec-specific set_power_state ops
ALSA: hda - Add post_suspend patch ops
ALSA: hda - Make CONFIG_SND_HDA_POWER_SAVE depending on CONFIG_PM
ALSA: hda - Make sure mute led reflects master mute state
ALSA: hda - Fix invalid mute led state on resume of IDT codecs
ASoC: Revert "ASoC: SAMSUNG: Add I2S0 internal dma driver"
ALSA: hda - Add support of the 4 internal speakers on certain HP laptops
ALSA: Make snd_pcm_debug_name usable outside pcm_lib
ALSA: hda - Fix DAC filling for multi-connection pins in Realtek parser
ASoC: dapm - Add methods to retrieve snd_card and soc_card from dapm context.
ASoC: SAMSUNG: Add I2S0 internal dma driver
ASoC: SAMSUNG: Modify I2S driver to support idma
ASoC: davinci: add missing break statement
ASoC: davinci: fix codec start and stop functions
ASoC: dapm - add DAPM macro for external enum widgets
ASoC: Acknowledge WM8962 interrupts before acting on them
ASoC: sgtl5000: guide user when regulator support is needed
ASoC: sgtl5000: refactor registering internal ldo
...
Diffstat (limited to 'sound/soc/codecs')
-rw-r--r-- | sound/soc/codecs/sgtl5000.c | 70 | ||||
-rw-r--r-- | sound/soc/codecs/wm8962.c | 6 |
2 files changed, 35 insertions, 41 deletions
diff --git a/sound/soc/codecs/sgtl5000.c b/sound/soc/codecs/sgtl5000.c index ff29380c9ed3..76258f2a2ffb 100644 --- a/sound/soc/codecs/sgtl5000.c +++ b/sound/soc/codecs/sgtl5000.c | |||
@@ -907,6 +907,7 @@ static int ldo_regulator_register(struct snd_soc_codec *codec, | |||
907 | struct regulator_init_data *init_data, | 907 | struct regulator_init_data *init_data, |
908 | int voltage) | 908 | int voltage) |
909 | { | 909 | { |
910 | dev_err(codec->dev, "this setup needs regulator support in the kernel\n"); | ||
910 | return -EINVAL; | 911 | return -EINVAL; |
911 | } | 912 | } |
912 | 913 | ||
@@ -1218,6 +1219,34 @@ static int sgtl5000_set_power_regs(struct snd_soc_codec *codec) | |||
1218 | return 0; | 1219 | return 0; |
1219 | } | 1220 | } |
1220 | 1221 | ||
1222 | static int sgtl5000_replace_vddd_with_ldo(struct snd_soc_codec *codec) | ||
1223 | { | ||
1224 | struct sgtl5000_priv *sgtl5000 = snd_soc_codec_get_drvdata(codec); | ||
1225 | int ret; | ||
1226 | |||
1227 | /* set internal ldo to 1.2v */ | ||
1228 | ret = ldo_regulator_register(codec, &ldo_init_data, LDO_VOLTAGE); | ||
1229 | if (ret) { | ||
1230 | dev_err(codec->dev, | ||
1231 | "Failed to register vddd internal supplies: %d\n", ret); | ||
1232 | return ret; | ||
1233 | } | ||
1234 | |||
1235 | sgtl5000->supplies[VDDD].supply = LDO_CONSUMER_NAME; | ||
1236 | |||
1237 | ret = regulator_bulk_get(codec->dev, ARRAY_SIZE(sgtl5000->supplies), | ||
1238 | sgtl5000->supplies); | ||
1239 | |||
1240 | if (ret) { | ||
1241 | ldo_regulator_remove(codec); | ||
1242 | dev_err(codec->dev, "Failed to request supplies: %d\n", ret); | ||
1243 | return ret; | ||
1244 | } | ||
1245 | |||
1246 | dev_info(codec->dev, "Using internal LDO instead of VDDD\n"); | ||
1247 | return 0; | ||
1248 | } | ||
1249 | |||
1221 | static int sgtl5000_enable_regulators(struct snd_soc_codec *codec) | 1250 | static int sgtl5000_enable_regulators(struct snd_soc_codec *codec) |
1222 | { | 1251 | { |
1223 | u16 reg; | 1252 | u16 reg; |
@@ -1235,30 +1264,9 @@ static int sgtl5000_enable_regulators(struct snd_soc_codec *codec) | |||
1235 | if (!ret) | 1264 | if (!ret) |
1236 | external_vddd = 1; | 1265 | external_vddd = 1; |
1237 | else { | 1266 | else { |
1238 | /* set internal ldo to 1.2v */ | 1267 | ret = sgtl5000_replace_vddd_with_ldo(codec); |
1239 | int voltage = LDO_VOLTAGE; | 1268 | if (ret) |
1240 | |||
1241 | ret = ldo_regulator_register(codec, &ldo_init_data, voltage); | ||
1242 | if (ret) { | ||
1243 | dev_err(codec->dev, | ||
1244 | "Failed to register vddd internal supplies: %d\n", | ||
1245 | ret); | ||
1246 | return ret; | ||
1247 | } | ||
1248 | |||
1249 | sgtl5000->supplies[VDDD].supply = LDO_CONSUMER_NAME; | ||
1250 | |||
1251 | ret = regulator_bulk_get(codec->dev, | ||
1252 | ARRAY_SIZE(sgtl5000->supplies), | ||
1253 | sgtl5000->supplies); | ||
1254 | |||
1255 | if (ret) { | ||
1256 | ldo_regulator_remove(codec); | ||
1257 | dev_err(codec->dev, | ||
1258 | "Failed to request supplies: %d\n", ret); | ||
1259 | |||
1260 | return ret; | 1269 | return ret; |
1261 | } | ||
1262 | } | 1270 | } |
1263 | 1271 | ||
1264 | ret = regulator_bulk_enable(ARRAY_SIZE(sgtl5000->supplies), | 1272 | ret = regulator_bulk_enable(ARRAY_SIZE(sgtl5000->supplies), |
@@ -1287,7 +1295,6 @@ static int sgtl5000_enable_regulators(struct snd_soc_codec *codec) | |||
1287 | * roll back to use internal LDO | 1295 | * roll back to use internal LDO |
1288 | */ | 1296 | */ |
1289 | if (external_vddd && rev >= 0x11) { | 1297 | if (external_vddd && rev >= 0x11) { |
1290 | int voltage = LDO_VOLTAGE; | ||
1291 | /* disable all regulator first */ | 1298 | /* disable all regulator first */ |
1292 | regulator_bulk_disable(ARRAY_SIZE(sgtl5000->supplies), | 1299 | regulator_bulk_disable(ARRAY_SIZE(sgtl5000->supplies), |
1293 | sgtl5000->supplies); | 1300 | sgtl5000->supplies); |
@@ -1295,23 +1302,10 @@ static int sgtl5000_enable_regulators(struct snd_soc_codec *codec) | |||
1295 | regulator_bulk_free(ARRAY_SIZE(sgtl5000->supplies), | 1302 | regulator_bulk_free(ARRAY_SIZE(sgtl5000->supplies), |
1296 | sgtl5000->supplies); | 1303 | sgtl5000->supplies); |
1297 | 1304 | ||
1298 | ret = ldo_regulator_register(codec, &ldo_init_data, voltage); | 1305 | ret = sgtl5000_replace_vddd_with_ldo(codec); |
1299 | if (ret) | 1306 | if (ret) |
1300 | return ret; | 1307 | return ret; |
1301 | 1308 | ||
1302 | sgtl5000->supplies[VDDD].supply = LDO_CONSUMER_NAME; | ||
1303 | |||
1304 | ret = regulator_bulk_get(codec->dev, | ||
1305 | ARRAY_SIZE(sgtl5000->supplies), | ||
1306 | sgtl5000->supplies); | ||
1307 | if (ret) { | ||
1308 | ldo_regulator_remove(codec); | ||
1309 | dev_err(codec->dev, | ||
1310 | "Failed to request supplies: %d\n", ret); | ||
1311 | |||
1312 | return ret; | ||
1313 | } | ||
1314 | |||
1315 | ret = regulator_bulk_enable(ARRAY_SIZE(sgtl5000->supplies), | 1309 | ret = regulator_bulk_enable(ARRAY_SIZE(sgtl5000->supplies), |
1316 | sgtl5000->supplies); | 1310 | sgtl5000->supplies); |
1317 | if (ret) | 1311 | if (ret) |
diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c index 8499c563a9b5..60d740ebeb5b 100644 --- a/sound/soc/codecs/wm8962.c +++ b/sound/soc/codecs/wm8962.c | |||
@@ -3409,6 +3409,9 @@ static irqreturn_t wm8962_irq(int irq, void *data) | |||
3409 | active = snd_soc_read(codec, WM8962_INTERRUPT_STATUS_2); | 3409 | active = snd_soc_read(codec, WM8962_INTERRUPT_STATUS_2); |
3410 | active &= ~mask; | 3410 | active &= ~mask; |
3411 | 3411 | ||
3412 | /* Acknowledge the interrupts */ | ||
3413 | snd_soc_write(codec, WM8962_INTERRUPT_STATUS_2, active); | ||
3414 | |||
3412 | if (active & WM8962_FLL_LOCK_EINT) { | 3415 | if (active & WM8962_FLL_LOCK_EINT) { |
3413 | dev_dbg(codec->dev, "FLL locked\n"); | 3416 | dev_dbg(codec->dev, "FLL locked\n"); |
3414 | complete(&wm8962->fll_lock); | 3417 | complete(&wm8962->fll_lock); |
@@ -3433,9 +3436,6 @@ static irqreturn_t wm8962_irq(int irq, void *data) | |||
3433 | msecs_to_jiffies(250)); | 3436 | msecs_to_jiffies(250)); |
3434 | } | 3437 | } |
3435 | 3438 | ||
3436 | /* Acknowledge the interrupts */ | ||
3437 | snd_soc_write(codec, WM8962_INTERRUPT_STATUS_2, active); | ||
3438 | |||
3439 | return IRQ_HANDLED; | 3439 | return IRQ_HANDLED; |
3440 | } | 3440 | } |
3441 | 3441 | ||