diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-10 12:19:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-10 12:19:44 -0400 |
commit | e7990d45bb88c2f0565b5ee4c32eefe81653faff (patch) | |
tree | 852ab6988b7226083fefa0e0e851dbff0e7ec7f2 /sound/soc | |
parent | 190a3998be3ede25d6145e187d6d321f504d28fb (diff) | |
parent | a5065eb6da55b226661456e6a7435f605df98111 (diff) |
Merge tag 'sound-fix-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound
Pull sound fixes from Takashi Iwai:
"Here is a bunch of small fixes that have been collected since the
previous pull request. In addition to various misc fixes, the
following are included:
- HD-audio quirks for Dell, HP, Chromebook, and ALC28x codecs
- HD-audio AMD HDMI regression fix
- Continued PM support/fixes for ice1712 driver
- Multiplatform fixes for ASoC samsung drivers
- Addition of device id tables to a few ASoC drivers
- Bit clock polarity config and error flag fixes in ASoC fsl_sai"
* tag 'sound-fix-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (32 commits)
ALSA: usb-audio: Suppress repetitive debug messages from retire_playback_urb()
ALSA: hda - Make full_reset boolean
ALSA: hda - add headset mic detect quirk for a Dell laptop
sound: dmasound: use module_platform_driver_probe()
ALSA: au1x00: use module_platform_driver()
ALSA: hda - Use runtime helper to check active state.
ALSA: ice1712: Fix boundary checks in PCM pointer ops
ASoC: davinci-mcasp: Fix bit clock polarity settings
ASoC: samsung: Fix build on multiplatform
ASoC: fsl_sai: Fix Bit Clock Polarity configurations
ALSA: hda - Do not assign streams in reverse order
ALSA: hda/realtek - Add eapd shutup to ALC283
ALSA: hda/realtek - Change model name alias for ChromeOS
ASoC: da732x: Print correct major id
ALSA: hda/realtek - Improve HP depop when system change power state on Chromebook
ASoC: cs42l52: Fix mask for REVID
sound/oss: Remove uncompilable DBG macro use
ALSA: ice1712: Save/restore routing and rate registers
ALSA: ice1712: restore AK4xxx volumes on resume
ASoC: alc56(23|32): fix undefined return value of probing code
...
Diffstat (limited to 'sound/soc')
-rw-r--r-- | sound/soc/codecs/alc5623.c | 3 | ||||
-rw-r--r-- | sound/soc/codecs/alc5632.c | 10 | ||||
-rw-r--r-- | sound/soc/codecs/cs42l52.c | 2 | ||||
-rw-r--r-- | sound/soc/codecs/cs42l52.h | 2 | ||||
-rw-r--r-- | sound/soc/codecs/cs42xx8.c | 11 | ||||
-rw-r--r-- | sound/soc/codecs/da732x.c | 3 | ||||
-rw-r--r-- | sound/soc/codecs/max98090.c | 7 | ||||
-rw-r--r-- | sound/soc/codecs/rt5640.c | 9 | ||||
-rw-r--r-- | sound/soc/codecs/tlv320aic23-i2c.c | 7 | ||||
-rw-r--r-- | sound/soc/davinci/davinci-mcasp.c | 6 | ||||
-rw-r--r-- | sound/soc/fsl/fsl_sai.c | 93 | ||||
-rw-r--r-- | sound/soc/fsl/fsl_sai.h | 15 | ||||
-rw-r--r-- | sound/soc/samsung/ac97.c | 6 | ||||
-rw-r--r-- | sound/soc/samsung/dma.h | 6 | ||||
-rw-r--r-- | sound/soc/samsung/i2s.c | 6 | ||||
-rw-r--r-- | sound/soc/samsung/pcm.c | 5 | ||||
-rw-r--r-- | sound/soc/samsung/s3c2412-i2s.c | 4 | ||||
-rw-r--r-- | sound/soc/samsung/s3c24xx-i2s.c | 4 | ||||
-rw-r--r-- | sound/soc/samsung/spdif.c | 3 |
19 files changed, 163 insertions, 39 deletions
diff --git a/sound/soc/codecs/alc5623.c b/sound/soc/codecs/alc5623.c index 09f7e773bafb..f500905e9373 100644 --- a/sound/soc/codecs/alc5623.c +++ b/sound/soc/codecs/alc5623.c | |||
@@ -902,7 +902,6 @@ static int alc5623_probe(struct snd_soc_codec *codec) | |||
902 | { | 902 | { |
903 | struct alc5623_priv *alc5623 = snd_soc_codec_get_drvdata(codec); | 903 | struct alc5623_priv *alc5623 = snd_soc_codec_get_drvdata(codec); |
904 | struct snd_soc_dapm_context *dapm = &codec->dapm; | 904 | struct snd_soc_dapm_context *dapm = &codec->dapm; |
905 | int ret; | ||
906 | 905 | ||
907 | alc5623_reset(codec); | 906 | alc5623_reset(codec); |
908 | 907 | ||
@@ -961,7 +960,7 @@ static int alc5623_probe(struct snd_soc_codec *codec) | |||
961 | return -EINVAL; | 960 | return -EINVAL; |
962 | } | 961 | } |
963 | 962 | ||
964 | return ret; | 963 | return 0; |
965 | } | 964 | } |
966 | 965 | ||
967 | /* power down chip */ | 966 | /* power down chip */ |
diff --git a/sound/soc/codecs/alc5632.c b/sound/soc/codecs/alc5632.c index ec071a6306ef..85942ca36cbf 100644 --- a/sound/soc/codecs/alc5632.c +++ b/sound/soc/codecs/alc5632.c | |||
@@ -1061,7 +1061,6 @@ static int alc5632_resume(struct snd_soc_codec *codec) | |||
1061 | static int alc5632_probe(struct snd_soc_codec *codec) | 1061 | static int alc5632_probe(struct snd_soc_codec *codec) |
1062 | { | 1062 | { |
1063 | struct alc5632_priv *alc5632 = snd_soc_codec_get_drvdata(codec); | 1063 | struct alc5632_priv *alc5632 = snd_soc_codec_get_drvdata(codec); |
1064 | int ret; | ||
1065 | 1064 | ||
1066 | /* power on device */ | 1065 | /* power on device */ |
1067 | alc5632_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | 1066 | alc5632_set_bias_level(codec, SND_SOC_BIAS_STANDBY); |
@@ -1075,7 +1074,7 @@ static int alc5632_probe(struct snd_soc_codec *codec) | |||
1075 | return -EINVAL; | 1074 | return -EINVAL; |
1076 | } | 1075 | } |
1077 | 1076 | ||
1078 | return ret; | 1077 | return 0; |
1079 | } | 1078 | } |
1080 | 1079 | ||
1081 | /* power down chip */ | 1080 | /* power down chip */ |
@@ -1191,11 +1190,18 @@ static const struct i2c_device_id alc5632_i2c_table[] = { | |||
1191 | }; | 1190 | }; |
1192 | MODULE_DEVICE_TABLE(i2c, alc5632_i2c_table); | 1191 | MODULE_DEVICE_TABLE(i2c, alc5632_i2c_table); |
1193 | 1192 | ||
1193 | static const struct of_device_id alc5632_of_match[] = { | ||
1194 | { .compatible = "realtek,alc5632", }, | ||
1195 | { } | ||
1196 | }; | ||
1197 | MODULE_DEVICE_TABLE(of, alc5632_of_match); | ||
1198 | |||
1194 | /* i2c codec control layer */ | 1199 | /* i2c codec control layer */ |
1195 | static struct i2c_driver alc5632_i2c_driver = { | 1200 | static struct i2c_driver alc5632_i2c_driver = { |
1196 | .driver = { | 1201 | .driver = { |
1197 | .name = "alc5632", | 1202 | .name = "alc5632", |
1198 | .owner = THIS_MODULE, | 1203 | .owner = THIS_MODULE, |
1204 | .of_match_table = of_match_ptr(alc5632_of_match), | ||
1199 | }, | 1205 | }, |
1200 | .probe = alc5632_i2c_probe, | 1206 | .probe = alc5632_i2c_probe, |
1201 | .remove = alc5632_i2c_remove, | 1207 | .remove = alc5632_i2c_remove, |
diff --git a/sound/soc/codecs/cs42l52.c b/sound/soc/codecs/cs42l52.c index f0ca6bee6771..460d35547a68 100644 --- a/sound/soc/codecs/cs42l52.c +++ b/sound/soc/codecs/cs42l52.c | |||
@@ -1259,7 +1259,7 @@ static int cs42l52_i2c_probe(struct i2c_client *i2c_client, | |||
1259 | } | 1259 | } |
1260 | 1260 | ||
1261 | dev_info(&i2c_client->dev, "Cirrus Logic CS42L52, Revision: %02X\n", | 1261 | dev_info(&i2c_client->dev, "Cirrus Logic CS42L52, Revision: %02X\n", |
1262 | reg & 0xFF); | 1262 | reg & CS42L52_CHIP_REV_MASK); |
1263 | 1263 | ||
1264 | /* Set Platform Data */ | 1264 | /* Set Platform Data */ |
1265 | if (cs42l52->pdata.mica_diff_cfg) | 1265 | if (cs42l52->pdata.mica_diff_cfg) |
diff --git a/sound/soc/codecs/cs42l52.h b/sound/soc/codecs/cs42l52.h index 6fb8f00f4191..ac445993e6bf 100644 --- a/sound/soc/codecs/cs42l52.h +++ b/sound/soc/codecs/cs42l52.h | |||
@@ -37,7 +37,7 @@ | |||
37 | #define CS42L52_CHIP_REV_A0 0x00 | 37 | #define CS42L52_CHIP_REV_A0 0x00 |
38 | #define CS42L52_CHIP_REV_A1 0x01 | 38 | #define CS42L52_CHIP_REV_A1 0x01 |
39 | #define CS42L52_CHIP_REV_B0 0x02 | 39 | #define CS42L52_CHIP_REV_B0 0x02 |
40 | #define CS42L52_CHIP_REV_MASK 0x03 | 40 | #define CS42L52_CHIP_REV_MASK 0x07 |
41 | 41 | ||
42 | #define CS42L52_PWRCTL1 0x02 | 42 | #define CS42L52_PWRCTL1 0x02 |
43 | #define CS42L52_PWRCTL1_PDN_ALL 0x9F | 43 | #define CS42L52_PWRCTL1_PDN_ALL 0x9F |
diff --git a/sound/soc/codecs/cs42xx8.c b/sound/soc/codecs/cs42xx8.c index 082299a4e2fa..85020322eee7 100644 --- a/sound/soc/codecs/cs42xx8.c +++ b/sound/soc/codecs/cs42xx8.c | |||
@@ -495,17 +495,16 @@ int cs42xx8_probe(struct device *dev, struct regmap *regmap) | |||
495 | regcache_cache_bypass(cs42xx8->regmap, true); | 495 | regcache_cache_bypass(cs42xx8->regmap, true); |
496 | 496 | ||
497 | /* Validate the chip ID */ | 497 | /* Validate the chip ID */ |
498 | regmap_read(cs42xx8->regmap, CS42XX8_CHIPID, &val); | 498 | ret = regmap_read(cs42xx8->regmap, CS42XX8_CHIPID, &val); |
499 | if (val < 0) { | 499 | if (ret < 0) { |
500 | dev_err(dev, "failed to get device ID: %x", val); | 500 | dev_err(dev, "failed to get device ID, ret = %d", ret); |
501 | ret = -EINVAL; | ||
502 | goto err_enable; | 501 | goto err_enable; |
503 | } | 502 | } |
504 | 503 | ||
505 | /* The top four bits of the chip ID should be 0000 */ | 504 | /* The top four bits of the chip ID should be 0000 */ |
506 | if ((val & CS42XX8_CHIPID_CHIP_ID_MASK) != 0x00) { | 505 | if (((val & CS42XX8_CHIPID_CHIP_ID_MASK) >> 4) != 0x00) { |
507 | dev_err(dev, "unmatched chip ID: %d\n", | 506 | dev_err(dev, "unmatched chip ID: %d\n", |
508 | val & CS42XX8_CHIPID_CHIP_ID_MASK); | 507 | (val & CS42XX8_CHIPID_CHIP_ID_MASK) >> 4); |
509 | ret = -EINVAL; | 508 | ret = -EINVAL; |
510 | goto err_enable; | 509 | goto err_enable; |
511 | } | 510 | } |
diff --git a/sound/soc/codecs/da732x.c b/sound/soc/codecs/da732x.c index 7d168ec71cd7..48f3fef68484 100644 --- a/sound/soc/codecs/da732x.c +++ b/sound/soc/codecs/da732x.c | |||
@@ -1571,7 +1571,8 @@ static int da732x_i2c_probe(struct i2c_client *i2c, | |||
1571 | } | 1571 | } |
1572 | 1572 | ||
1573 | dev_info(&i2c->dev, "Revision: %d.%d\n", | 1573 | dev_info(&i2c->dev, "Revision: %d.%d\n", |
1574 | (reg & DA732X_ID_MAJOR_MASK), (reg & DA732X_ID_MINOR_MASK)); | 1574 | (reg & DA732X_ID_MAJOR_MASK) >> 4, |
1575 | (reg & DA732X_ID_MINOR_MASK)); | ||
1575 | 1576 | ||
1576 | ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_da732x, | 1577 | ret = snd_soc_register_codec(&i2c->dev, &soc_codec_dev_da732x, |
1577 | da732x_dai, ARRAY_SIZE(da732x_dai)); | 1578 | da732x_dai, ARRAY_SIZE(da732x_dai)); |
diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c index 98c6e104357c..f7b0b37aa858 100644 --- a/sound/soc/codecs/max98090.c +++ b/sound/soc/codecs/max98090.c | |||
@@ -2399,11 +2399,18 @@ static const struct i2c_device_id max98090_i2c_id[] = { | |||
2399 | }; | 2399 | }; |
2400 | MODULE_DEVICE_TABLE(i2c, max98090_i2c_id); | 2400 | MODULE_DEVICE_TABLE(i2c, max98090_i2c_id); |
2401 | 2401 | ||
2402 | static const struct of_device_id max98090_of_match[] = { | ||
2403 | { .compatible = "maxim,max98090", }, | ||
2404 | { } | ||
2405 | }; | ||
2406 | MODULE_DEVICE_TABLE(of, max98090_of_match); | ||
2407 | |||
2402 | static struct i2c_driver max98090_i2c_driver = { | 2408 | static struct i2c_driver max98090_i2c_driver = { |
2403 | .driver = { | 2409 | .driver = { |
2404 | .name = "max98090", | 2410 | .name = "max98090", |
2405 | .owner = THIS_MODULE, | 2411 | .owner = THIS_MODULE, |
2406 | .pm = &max98090_pm, | 2412 | .pm = &max98090_pm, |
2413 | .of_match_table = of_match_ptr(max98090_of_match), | ||
2407 | }, | 2414 | }, |
2408 | .probe = max98090_i2c_probe, | 2415 | .probe = max98090_i2c_probe, |
2409 | .remove = max98090_i2c_remove, | 2416 | .remove = max98090_i2c_remove, |
diff --git a/sound/soc/codecs/rt5640.c b/sound/soc/codecs/rt5640.c index 0061ae6b6716..68b4dd622b87 100644 --- a/sound/soc/codecs/rt5640.c +++ b/sound/soc/codecs/rt5640.c | |||
@@ -2074,6 +2074,14 @@ static const struct i2c_device_id rt5640_i2c_id[] = { | |||
2074 | }; | 2074 | }; |
2075 | MODULE_DEVICE_TABLE(i2c, rt5640_i2c_id); | 2075 | MODULE_DEVICE_TABLE(i2c, rt5640_i2c_id); |
2076 | 2076 | ||
2077 | #if defined(CONFIG_OF) | ||
2078 | static const struct of_device_id rt5640_of_match[] = { | ||
2079 | { .compatible = "realtek,rt5640", }, | ||
2080 | {}, | ||
2081 | }; | ||
2082 | MODULE_DEVICE_TABLE(of, rt5640_of_match); | ||
2083 | #endif | ||
2084 | |||
2077 | #ifdef CONFIG_ACPI | 2085 | #ifdef CONFIG_ACPI |
2078 | static struct acpi_device_id rt5640_acpi_match[] = { | 2086 | static struct acpi_device_id rt5640_acpi_match[] = { |
2079 | { "INT33CA", 0 }, | 2087 | { "INT33CA", 0 }, |
@@ -2203,6 +2211,7 @@ static struct i2c_driver rt5640_i2c_driver = { | |||
2203 | .name = "rt5640", | 2211 | .name = "rt5640", |
2204 | .owner = THIS_MODULE, | 2212 | .owner = THIS_MODULE, |
2205 | .acpi_match_table = ACPI_PTR(rt5640_acpi_match), | 2213 | .acpi_match_table = ACPI_PTR(rt5640_acpi_match), |
2214 | .of_match_table = of_match_ptr(rt5640_of_match), | ||
2206 | }, | 2215 | }, |
2207 | .probe = rt5640_i2c_probe, | 2216 | .probe = rt5640_i2c_probe, |
2208 | .remove = rt5640_i2c_remove, | 2217 | .remove = rt5640_i2c_remove, |
diff --git a/sound/soc/codecs/tlv320aic23-i2c.c b/sound/soc/codecs/tlv320aic23-i2c.c index 20fc46092c2c..b73c94ebcc2a 100644 --- a/sound/soc/codecs/tlv320aic23-i2c.c +++ b/sound/soc/codecs/tlv320aic23-i2c.c | |||
@@ -43,9 +43,16 @@ static const struct i2c_device_id tlv320aic23_id[] = { | |||
43 | 43 | ||
44 | MODULE_DEVICE_TABLE(i2c, tlv320aic23_id); | 44 | MODULE_DEVICE_TABLE(i2c, tlv320aic23_id); |
45 | 45 | ||
46 | static const struct of_device_id tlv320aic23_of_match[] = { | ||
47 | { .compatible = "ti,tlv320aic23", }, | ||
48 | { } | ||
49 | }; | ||
50 | MODULE_DEVICE_TABLE(of, tlv320aic23_of_match); | ||
51 | |||
46 | static struct i2c_driver tlv320aic23_i2c_driver = { | 52 | static struct i2c_driver tlv320aic23_i2c_driver = { |
47 | .driver = { | 53 | .driver = { |
48 | .name = "tlv320aic23-codec", | 54 | .name = "tlv320aic23-codec", |
55 | .of_match_table = of_match_ptr(tlv320aic23_of_match), | ||
49 | }, | 56 | }, |
50 | .probe = tlv320aic23_i2c_probe, | 57 | .probe = tlv320aic23_i2c_probe, |
51 | .remove = __exit_p(tlv320aic23_i2c_remove), | 58 | .remove = __exit_p(tlv320aic23_i2c_remove), |
diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c index a01ae97c90aa..4f75cac462d1 100644 --- a/sound/soc/davinci/davinci-mcasp.c +++ b/sound/soc/davinci/davinci-mcasp.c | |||
@@ -336,7 +336,7 @@ static int davinci_mcasp_set_dai_fmt(struct snd_soc_dai *cpu_dai, | |||
336 | mcasp_clr_bits(mcasp, DAVINCI_MCASP_ACLKXCTL_REG, ACLKXPOL); | 336 | mcasp_clr_bits(mcasp, DAVINCI_MCASP_ACLKXCTL_REG, ACLKXPOL); |
337 | mcasp_clr_bits(mcasp, DAVINCI_MCASP_TXFMCTL_REG, FSXPOL); | 337 | mcasp_clr_bits(mcasp, DAVINCI_MCASP_TXFMCTL_REG, FSXPOL); |
338 | 338 | ||
339 | mcasp_set_bits(mcasp, DAVINCI_MCASP_ACLKRCTL_REG, ACLKRPOL); | 339 | mcasp_clr_bits(mcasp, DAVINCI_MCASP_ACLKRCTL_REG, ACLKRPOL); |
340 | mcasp_clr_bits(mcasp, DAVINCI_MCASP_RXFMCTL_REG, FSRPOL); | 340 | mcasp_clr_bits(mcasp, DAVINCI_MCASP_RXFMCTL_REG, FSRPOL); |
341 | break; | 341 | break; |
342 | 342 | ||
@@ -344,7 +344,7 @@ static int davinci_mcasp_set_dai_fmt(struct snd_soc_dai *cpu_dai, | |||
344 | mcasp_set_bits(mcasp, DAVINCI_MCASP_ACLKXCTL_REG, ACLKXPOL); | 344 | mcasp_set_bits(mcasp, DAVINCI_MCASP_ACLKXCTL_REG, ACLKXPOL); |
345 | mcasp_set_bits(mcasp, DAVINCI_MCASP_TXFMCTL_REG, FSXPOL); | 345 | mcasp_set_bits(mcasp, DAVINCI_MCASP_TXFMCTL_REG, FSXPOL); |
346 | 346 | ||
347 | mcasp_clr_bits(mcasp, DAVINCI_MCASP_ACLKRCTL_REG, ACLKRPOL); | 347 | mcasp_set_bits(mcasp, DAVINCI_MCASP_ACLKRCTL_REG, ACLKRPOL); |
348 | mcasp_set_bits(mcasp, DAVINCI_MCASP_RXFMCTL_REG, FSRPOL); | 348 | mcasp_set_bits(mcasp, DAVINCI_MCASP_RXFMCTL_REG, FSRPOL); |
349 | break; | 349 | break; |
350 | 350 | ||
@@ -352,7 +352,7 @@ static int davinci_mcasp_set_dai_fmt(struct snd_soc_dai *cpu_dai, | |||
352 | mcasp_clr_bits(mcasp, DAVINCI_MCASP_ACLKXCTL_REG, ACLKXPOL); | 352 | mcasp_clr_bits(mcasp, DAVINCI_MCASP_ACLKXCTL_REG, ACLKXPOL); |
353 | mcasp_set_bits(mcasp, DAVINCI_MCASP_TXFMCTL_REG, FSXPOL); | 353 | mcasp_set_bits(mcasp, DAVINCI_MCASP_TXFMCTL_REG, FSXPOL); |
354 | 354 | ||
355 | mcasp_set_bits(mcasp, DAVINCI_MCASP_ACLKRCTL_REG, ACLKRPOL); | 355 | mcasp_clr_bits(mcasp, DAVINCI_MCASP_ACLKRCTL_REG, ACLKRPOL); |
356 | mcasp_set_bits(mcasp, DAVINCI_MCASP_RXFMCTL_REG, FSRPOL); | 356 | mcasp_set_bits(mcasp, DAVINCI_MCASP_RXFMCTL_REG, FSRPOL); |
357 | break; | 357 | break; |
358 | 358 | ||
diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c index c4a423111673..56da8c8c5960 100644 --- a/sound/soc/fsl/fsl_sai.c +++ b/sound/soc/fsl/fsl_sai.c | |||
@@ -23,6 +23,71 @@ | |||
23 | 23 | ||
24 | #include "fsl_sai.h" | 24 | #include "fsl_sai.h" |
25 | 25 | ||
26 | #define FSL_SAI_FLAGS (FSL_SAI_CSR_SEIE |\ | ||
27 | FSL_SAI_CSR_FEIE) | ||
28 | |||
29 | static irqreturn_t fsl_sai_isr(int irq, void *devid) | ||
30 | { | ||
31 | struct fsl_sai *sai = (struct fsl_sai *)devid; | ||
32 | struct device *dev = &sai->pdev->dev; | ||
33 | u32 xcsr, mask; | ||
34 | |||
35 | /* Only handle those what we enabled */ | ||
36 | mask = (FSL_SAI_FLAGS >> FSL_SAI_CSR_xIE_SHIFT) << FSL_SAI_CSR_xF_SHIFT; | ||
37 | |||
38 | /* Tx IRQ */ | ||
39 | regmap_read(sai->regmap, FSL_SAI_TCSR, &xcsr); | ||
40 | xcsr &= mask; | ||
41 | |||
42 | if (xcsr & FSL_SAI_CSR_WSF) | ||
43 | dev_dbg(dev, "isr: Start of Tx word detected\n"); | ||
44 | |||
45 | if (xcsr & FSL_SAI_CSR_SEF) | ||
46 | dev_warn(dev, "isr: Tx Frame sync error detected\n"); | ||
47 | |||
48 | if (xcsr & FSL_SAI_CSR_FEF) { | ||
49 | dev_warn(dev, "isr: Transmit underrun detected\n"); | ||
50 | /* FIFO reset for safety */ | ||
51 | xcsr |= FSL_SAI_CSR_FR; | ||
52 | } | ||
53 | |||
54 | if (xcsr & FSL_SAI_CSR_FWF) | ||
55 | dev_dbg(dev, "isr: Enabled transmit FIFO is empty\n"); | ||
56 | |||
57 | if (xcsr & FSL_SAI_CSR_FRF) | ||
58 | dev_dbg(dev, "isr: Transmit FIFO watermark has been reached\n"); | ||
59 | |||
60 | regmap_update_bits(sai->regmap, FSL_SAI_TCSR, | ||
61 | FSL_SAI_CSR_xF_W_MASK | FSL_SAI_CSR_FR, xcsr); | ||
62 | |||
63 | /* Rx IRQ */ | ||
64 | regmap_read(sai->regmap, FSL_SAI_RCSR, &xcsr); | ||
65 | xcsr &= mask; | ||
66 | |||
67 | if (xcsr & FSL_SAI_CSR_WSF) | ||
68 | dev_dbg(dev, "isr: Start of Rx word detected\n"); | ||
69 | |||
70 | if (xcsr & FSL_SAI_CSR_SEF) | ||
71 | dev_warn(dev, "isr: Rx Frame sync error detected\n"); | ||
72 | |||
73 | if (xcsr & FSL_SAI_CSR_FEF) { | ||
74 | dev_warn(dev, "isr: Receive overflow detected\n"); | ||
75 | /* FIFO reset for safety */ | ||
76 | xcsr |= FSL_SAI_CSR_FR; | ||
77 | } | ||
78 | |||
79 | if (xcsr & FSL_SAI_CSR_FWF) | ||
80 | dev_dbg(dev, "isr: Enabled receive FIFO is full\n"); | ||
81 | |||
82 | if (xcsr & FSL_SAI_CSR_FRF) | ||
83 | dev_dbg(dev, "isr: Receive FIFO watermark has been reached\n"); | ||
84 | |||
85 | regmap_update_bits(sai->regmap, FSL_SAI_RCSR, | ||
86 | FSL_SAI_CSR_xF_W_MASK | FSL_SAI_CSR_FR, xcsr); | ||
87 | |||
88 | return IRQ_HANDLED; | ||
89 | } | ||
90 | |||
26 | static int fsl_sai_set_dai_sysclk_tr(struct snd_soc_dai *cpu_dai, | 91 | static int fsl_sai_set_dai_sysclk_tr(struct snd_soc_dai *cpu_dai, |
27 | int clk_id, unsigned int freq, int fsl_dir) | 92 | int clk_id, unsigned int freq, int fsl_dir) |
28 | { | 93 | { |
@@ -114,7 +179,7 @@ static int fsl_sai_set_dai_fmt_tr(struct snd_soc_dai *cpu_dai, | |||
114 | * that is, together with the last bit of the previous | 179 | * that is, together with the last bit of the previous |
115 | * data word. | 180 | * data word. |
116 | */ | 181 | */ |
117 | val_cr2 &= ~FSL_SAI_CR2_BCP; | 182 | val_cr2 |= FSL_SAI_CR2_BCP; |
118 | val_cr4 |= FSL_SAI_CR4_FSE | FSL_SAI_CR4_FSP; | 183 | val_cr4 |= FSL_SAI_CR4_FSE | FSL_SAI_CR4_FSP; |
119 | break; | 184 | break; |
120 | case SND_SOC_DAIFMT_LEFT_J: | 185 | case SND_SOC_DAIFMT_LEFT_J: |
@@ -122,7 +187,7 @@ static int fsl_sai_set_dai_fmt_tr(struct snd_soc_dai *cpu_dai, | |||
122 | * Frame high, one word length for frame sync, | 187 | * Frame high, one word length for frame sync, |
123 | * frame sync asserts with the first bit of the frame. | 188 | * frame sync asserts with the first bit of the frame. |
124 | */ | 189 | */ |
125 | val_cr2 &= ~FSL_SAI_CR2_BCP; | 190 | val_cr2 |= FSL_SAI_CR2_BCP; |
126 | val_cr4 &= ~(FSL_SAI_CR4_FSE | FSL_SAI_CR4_FSP); | 191 | val_cr4 &= ~(FSL_SAI_CR4_FSE | FSL_SAI_CR4_FSP); |
127 | break; | 192 | break; |
128 | case SND_SOC_DAIFMT_DSP_A: | 193 | case SND_SOC_DAIFMT_DSP_A: |
@@ -132,7 +197,7 @@ static int fsl_sai_set_dai_fmt_tr(struct snd_soc_dai *cpu_dai, | |||
132 | * that is, together with the last bit of the previous | 197 | * that is, together with the last bit of the previous |
133 | * data word. | 198 | * data word. |
134 | */ | 199 | */ |
135 | val_cr2 &= ~FSL_SAI_CR2_BCP; | 200 | val_cr2 |= FSL_SAI_CR2_BCP; |
136 | val_cr4 &= ~FSL_SAI_CR4_FSP; | 201 | val_cr4 &= ~FSL_SAI_CR4_FSP; |
137 | val_cr4 |= FSL_SAI_CR4_FSE; | 202 | val_cr4 |= FSL_SAI_CR4_FSE; |
138 | sai->is_dsp_mode = true; | 203 | sai->is_dsp_mode = true; |
@@ -142,7 +207,7 @@ static int fsl_sai_set_dai_fmt_tr(struct snd_soc_dai *cpu_dai, | |||
142 | * Frame high, one bit for frame sync, | 207 | * Frame high, one bit for frame sync, |
143 | * frame sync asserts with the first bit of the frame. | 208 | * frame sync asserts with the first bit of the frame. |
144 | */ | 209 | */ |
145 | val_cr2 &= ~FSL_SAI_CR2_BCP; | 210 | val_cr2 |= FSL_SAI_CR2_BCP; |
146 | val_cr4 &= ~(FSL_SAI_CR4_FSE | FSL_SAI_CR4_FSP); | 211 | val_cr4 &= ~(FSL_SAI_CR4_FSE | FSL_SAI_CR4_FSP); |
147 | sai->is_dsp_mode = true; | 212 | sai->is_dsp_mode = true; |
148 | break; | 213 | break; |
@@ -373,8 +438,8 @@ static int fsl_sai_dai_probe(struct snd_soc_dai *cpu_dai) | |||
373 | { | 438 | { |
374 | struct fsl_sai *sai = dev_get_drvdata(cpu_dai->dev); | 439 | struct fsl_sai *sai = dev_get_drvdata(cpu_dai->dev); |
375 | 440 | ||
376 | regmap_update_bits(sai->regmap, FSL_SAI_TCSR, 0xffffffff, 0x0); | 441 | regmap_update_bits(sai->regmap, FSL_SAI_TCSR, 0xffffffff, FSL_SAI_FLAGS); |
377 | regmap_update_bits(sai->regmap, FSL_SAI_RCSR, 0xffffffff, 0x0); | 442 | regmap_update_bits(sai->regmap, FSL_SAI_RCSR, 0xffffffff, FSL_SAI_FLAGS); |
378 | regmap_update_bits(sai->regmap, FSL_SAI_TCR1, FSL_SAI_CR1_RFW_MASK, | 443 | regmap_update_bits(sai->regmap, FSL_SAI_TCR1, FSL_SAI_CR1_RFW_MASK, |
379 | FSL_SAI_MAXBURST_TX * 2); | 444 | FSL_SAI_MAXBURST_TX * 2); |
380 | regmap_update_bits(sai->regmap, FSL_SAI_RCR1, FSL_SAI_CR1_RFW_MASK, | 445 | regmap_update_bits(sai->regmap, FSL_SAI_RCR1, FSL_SAI_CR1_RFW_MASK, |
@@ -490,12 +555,14 @@ static int fsl_sai_probe(struct platform_device *pdev) | |||
490 | struct fsl_sai *sai; | 555 | struct fsl_sai *sai; |
491 | struct resource *res; | 556 | struct resource *res; |
492 | void __iomem *base; | 557 | void __iomem *base; |
493 | int ret; | 558 | int irq, ret; |
494 | 559 | ||
495 | sai = devm_kzalloc(&pdev->dev, sizeof(*sai), GFP_KERNEL); | 560 | sai = devm_kzalloc(&pdev->dev, sizeof(*sai), GFP_KERNEL); |
496 | if (!sai) | 561 | if (!sai) |
497 | return -ENOMEM; | 562 | return -ENOMEM; |
498 | 563 | ||
564 | sai->pdev = pdev; | ||
565 | |||
499 | sai->big_endian_regs = of_property_read_bool(np, "big-endian-regs"); | 566 | sai->big_endian_regs = of_property_read_bool(np, "big-endian-regs"); |
500 | if (sai->big_endian_regs) | 567 | if (sai->big_endian_regs) |
501 | fsl_sai_regmap_config.val_format_endian = REGMAP_ENDIAN_BIG; | 568 | fsl_sai_regmap_config.val_format_endian = REGMAP_ENDIAN_BIG; |
@@ -514,6 +581,18 @@ static int fsl_sai_probe(struct platform_device *pdev) | |||
514 | return PTR_ERR(sai->regmap); | 581 | return PTR_ERR(sai->regmap); |
515 | } | 582 | } |
516 | 583 | ||
584 | irq = platform_get_irq(pdev, 0); | ||
585 | if (irq < 0) { | ||
586 | dev_err(&pdev->dev, "no irq for node %s\n", np->full_name); | ||
587 | return irq; | ||
588 | } | ||
589 | |||
590 | ret = devm_request_irq(&pdev->dev, irq, fsl_sai_isr, 0, np->name, sai); | ||
591 | if (ret) { | ||
592 | dev_err(&pdev->dev, "failed to claim irq %u\n", irq); | ||
593 | return ret; | ||
594 | } | ||
595 | |||
517 | sai->dma_params_rx.addr = res->start + FSL_SAI_RDR; | 596 | sai->dma_params_rx.addr = res->start + FSL_SAI_RDR; |
518 | sai->dma_params_tx.addr = res->start + FSL_SAI_TDR; | 597 | sai->dma_params_tx.addr = res->start + FSL_SAI_TDR; |
519 | sai->dma_params_rx.maxburst = FSL_SAI_MAXBURST_RX; | 598 | sai->dma_params_rx.maxburst = FSL_SAI_MAXBURST_RX; |
diff --git a/sound/soc/fsl/fsl_sai.h b/sound/soc/fsl/fsl_sai.h index e432260be598..a264185c7138 100644 --- a/sound/soc/fsl/fsl_sai.h +++ b/sound/soc/fsl/fsl_sai.h | |||
@@ -37,7 +37,21 @@ | |||
37 | 37 | ||
38 | /* SAI Transmit/Recieve Control Register */ | 38 | /* SAI Transmit/Recieve Control Register */ |
39 | #define FSL_SAI_CSR_TERE BIT(31) | 39 | #define FSL_SAI_CSR_TERE BIT(31) |
40 | #define FSL_SAI_CSR_FR BIT(25) | ||
41 | #define FSL_SAI_CSR_xF_SHIFT 16 | ||
42 | #define FSL_SAI_CSR_xF_W_SHIFT 18 | ||
43 | #define FSL_SAI_CSR_xF_MASK (0x1f << FSL_SAI_CSR_xF_SHIFT) | ||
44 | #define FSL_SAI_CSR_xF_W_MASK (0x7 << FSL_SAI_CSR_xF_W_SHIFT) | ||
45 | #define FSL_SAI_CSR_WSF BIT(20) | ||
46 | #define FSL_SAI_CSR_SEF BIT(19) | ||
47 | #define FSL_SAI_CSR_FEF BIT(18) | ||
40 | #define FSL_SAI_CSR_FWF BIT(17) | 48 | #define FSL_SAI_CSR_FWF BIT(17) |
49 | #define FSL_SAI_CSR_FRF BIT(16) | ||
50 | #define FSL_SAI_CSR_xIE_SHIFT 8 | ||
51 | #define FSL_SAI_CSR_WSIE BIT(12) | ||
52 | #define FSL_SAI_CSR_SEIE BIT(11) | ||
53 | #define FSL_SAI_CSR_FEIE BIT(10) | ||
54 | #define FSL_SAI_CSR_FWIE BIT(9) | ||
41 | #define FSL_SAI_CSR_FRIE BIT(8) | 55 | #define FSL_SAI_CSR_FRIE BIT(8) |
42 | #define FSL_SAI_CSR_FRDE BIT(0) | 56 | #define FSL_SAI_CSR_FRDE BIT(0) |
43 | 57 | ||
@@ -99,6 +113,7 @@ | |||
99 | #define FSL_SAI_MAXBURST_RX 6 | 113 | #define FSL_SAI_MAXBURST_RX 6 |
100 | 114 | ||
101 | struct fsl_sai { | 115 | struct fsl_sai { |
116 | struct platform_device *pdev; | ||
102 | struct regmap *regmap; | 117 | struct regmap *regmap; |
103 | 118 | ||
104 | bool big_endian_regs; | 119 | bool big_endian_regs; |
diff --git a/sound/soc/samsung/ac97.c b/sound/soc/samsung/ac97.c index 4a88e36c82ec..76b072bd4ba2 100644 --- a/sound/soc/samsung/ac97.c +++ b/sound/soc/samsung/ac97.c | |||
@@ -39,15 +39,15 @@ struct s3c_ac97_info { | |||
39 | }; | 39 | }; |
40 | static struct s3c_ac97_info s3c_ac97; | 40 | static struct s3c_ac97_info s3c_ac97; |
41 | 41 | ||
42 | static struct s3c2410_dma_client s3c_dma_client_out = { | 42 | static struct s3c_dma_client s3c_dma_client_out = { |
43 | .name = "AC97 PCMOut" | 43 | .name = "AC97 PCMOut" |
44 | }; | 44 | }; |
45 | 45 | ||
46 | static struct s3c2410_dma_client s3c_dma_client_in = { | 46 | static struct s3c_dma_client s3c_dma_client_in = { |
47 | .name = "AC97 PCMIn" | 47 | .name = "AC97 PCMIn" |
48 | }; | 48 | }; |
49 | 49 | ||
50 | static struct s3c2410_dma_client s3c_dma_client_micin = { | 50 | static struct s3c_dma_client s3c_dma_client_micin = { |
51 | .name = "AC97 MicIn" | 51 | .name = "AC97 MicIn" |
52 | }; | 52 | }; |
53 | 53 | ||
diff --git a/sound/soc/samsung/dma.h b/sound/soc/samsung/dma.h index 225e5378014e..ad7c0f04f00d 100644 --- a/sound/soc/samsung/dma.h +++ b/sound/soc/samsung/dma.h | |||
@@ -14,8 +14,12 @@ | |||
14 | 14 | ||
15 | #include <sound/dmaengine_pcm.h> | 15 | #include <sound/dmaengine_pcm.h> |
16 | 16 | ||
17 | struct s3c_dma_client { | ||
18 | char *name; | ||
19 | }; | ||
20 | |||
17 | struct s3c_dma_params { | 21 | struct s3c_dma_params { |
18 | struct s3c2410_dma_client *client; /* stream identifier */ | 22 | struct s3c_dma_client *client; /* stream identifier */ |
19 | int channel; /* Channel ID */ | 23 | int channel; /* Channel ID */ |
20 | dma_addr_t dma_addr; | 24 | dma_addr_t dma_addr; |
21 | int dma_size; /* Size of the DMA transfer */ | 25 | int dma_size; /* Size of the DMA transfer */ |
diff --git a/sound/soc/samsung/i2s.c b/sound/soc/samsung/i2s.c index 0a9b44c940ce..048ead967199 100644 --- a/sound/soc/samsung/i2s.c +++ b/sound/soc/samsung/i2s.c | |||
@@ -1211,10 +1211,10 @@ static int samsung_i2s_probe(struct platform_device *pdev) | |||
1211 | pri_dai->dma_playback.dma_addr = regs_base + I2STXD; | 1211 | pri_dai->dma_playback.dma_addr = regs_base + I2STXD; |
1212 | pri_dai->dma_capture.dma_addr = regs_base + I2SRXD; | 1212 | pri_dai->dma_capture.dma_addr = regs_base + I2SRXD; |
1213 | pri_dai->dma_playback.client = | 1213 | pri_dai->dma_playback.client = |
1214 | (struct s3c2410_dma_client *)&pri_dai->dma_playback; | 1214 | (struct s3c_dma_client *)&pri_dai->dma_playback; |
1215 | pri_dai->dma_playback.ch_name = "tx"; | 1215 | pri_dai->dma_playback.ch_name = "tx"; |
1216 | pri_dai->dma_capture.client = | 1216 | pri_dai->dma_capture.client = |
1217 | (struct s3c2410_dma_client *)&pri_dai->dma_capture; | 1217 | (struct s3c_dma_client *)&pri_dai->dma_capture; |
1218 | pri_dai->dma_capture.ch_name = "rx"; | 1218 | pri_dai->dma_capture.ch_name = "rx"; |
1219 | pri_dai->dma_playback.dma_size = 4; | 1219 | pri_dai->dma_playback.dma_size = 4; |
1220 | pri_dai->dma_capture.dma_size = 4; | 1220 | pri_dai->dma_capture.dma_size = 4; |
@@ -1233,7 +1233,7 @@ static int samsung_i2s_probe(struct platform_device *pdev) | |||
1233 | } | 1233 | } |
1234 | sec_dai->dma_playback.dma_addr = regs_base + I2STXDS; | 1234 | sec_dai->dma_playback.dma_addr = regs_base + I2STXDS; |
1235 | sec_dai->dma_playback.client = | 1235 | sec_dai->dma_playback.client = |
1236 | (struct s3c2410_dma_client *)&sec_dai->dma_playback; | 1236 | (struct s3c_dma_client *)&sec_dai->dma_playback; |
1237 | sec_dai->dma_playback.ch_name = "tx-sec"; | 1237 | sec_dai->dma_playback.ch_name = "tx-sec"; |
1238 | 1238 | ||
1239 | if (!np) { | 1239 | if (!np) { |
diff --git a/sound/soc/samsung/pcm.c b/sound/soc/samsung/pcm.c index 6a5e4bf6ac96..ab54e297957c 100644 --- a/sound/soc/samsung/pcm.c +++ b/sound/soc/samsung/pcm.c | |||
@@ -20,7 +20,6 @@ | |||
20 | #include <sound/pcm_params.h> | 20 | #include <sound/pcm_params.h> |
21 | 21 | ||
22 | #include <linux/platform_data/asoc-s3c.h> | 22 | #include <linux/platform_data/asoc-s3c.h> |
23 | #include <mach/dma.h> | ||
24 | 23 | ||
25 | #include "dma.h" | 24 | #include "dma.h" |
26 | #include "pcm.h" | 25 | #include "pcm.h" |
@@ -132,11 +131,11 @@ struct s3c_pcm_info { | |||
132 | struct s3c_dma_params *dma_capture; | 131 | struct s3c_dma_params *dma_capture; |
133 | }; | 132 | }; |
134 | 133 | ||
135 | static struct s3c2410_dma_client s3c_pcm_dma_client_out = { | 134 | static struct s3c_dma_client s3c_pcm_dma_client_out = { |
136 | .name = "PCM Stereo out" | 135 | .name = "PCM Stereo out" |
137 | }; | 136 | }; |
138 | 137 | ||
139 | static struct s3c2410_dma_client s3c_pcm_dma_client_in = { | 138 | static struct s3c_dma_client s3c_pcm_dma_client_in = { |
140 | .name = "PCM Stereo in" | 139 | .name = "PCM Stereo in" |
141 | }; | 140 | }; |
142 | 141 | ||
diff --git a/sound/soc/samsung/s3c2412-i2s.c b/sound/soc/samsung/s3c2412-i2s.c index d0794458963a..e9bb5d7a71ee 100644 --- a/sound/soc/samsung/s3c2412-i2s.c +++ b/sound/soc/samsung/s3c2412-i2s.c | |||
@@ -33,11 +33,11 @@ | |||
33 | #include "regs-i2s-v2.h" | 33 | #include "regs-i2s-v2.h" |
34 | #include "s3c2412-i2s.h" | 34 | #include "s3c2412-i2s.h" |
35 | 35 | ||
36 | static struct s3c2410_dma_client s3c2412_dma_client_out = { | 36 | static struct s3c_dma_client s3c2412_dma_client_out = { |
37 | .name = "I2S PCM Stereo out" | 37 | .name = "I2S PCM Stereo out" |
38 | }; | 38 | }; |
39 | 39 | ||
40 | static struct s3c2410_dma_client s3c2412_dma_client_in = { | 40 | static struct s3c_dma_client s3c2412_dma_client_in = { |
41 | .name = "I2S PCM Stereo in" | 41 | .name = "I2S PCM Stereo in" |
42 | }; | 42 | }; |
43 | 43 | ||
diff --git a/sound/soc/samsung/s3c24xx-i2s.c b/sound/soc/samsung/s3c24xx-i2s.c index f31e916dd8c4..d7b8457b5650 100644 --- a/sound/soc/samsung/s3c24xx-i2s.c +++ b/sound/soc/samsung/s3c24xx-i2s.c | |||
@@ -31,11 +31,11 @@ | |||
31 | #include "dma.h" | 31 | #include "dma.h" |
32 | #include "s3c24xx-i2s.h" | 32 | #include "s3c24xx-i2s.h" |
33 | 33 | ||
34 | static struct s3c2410_dma_client s3c24xx_dma_client_out = { | 34 | static struct s3c_dma_client s3c24xx_dma_client_out = { |
35 | .name = "I2S PCM Stereo out" | 35 | .name = "I2S PCM Stereo out" |
36 | }; | 36 | }; |
37 | 37 | ||
38 | static struct s3c2410_dma_client s3c24xx_dma_client_in = { | 38 | static struct s3c_dma_client s3c24xx_dma_client_in = { |
39 | .name = "I2S PCM Stereo in" | 39 | .name = "I2S PCM Stereo in" |
40 | }; | 40 | }; |
41 | 41 | ||
diff --git a/sound/soc/samsung/spdif.c b/sound/soc/samsung/spdif.c index 28487dcc4538..cfe63b7bcc9f 100644 --- a/sound/soc/samsung/spdif.c +++ b/sound/soc/samsung/spdif.c | |||
@@ -18,7 +18,6 @@ | |||
18 | #include <sound/pcm_params.h> | 18 | #include <sound/pcm_params.h> |
19 | 19 | ||
20 | #include <linux/platform_data/asoc-s3c.h> | 20 | #include <linux/platform_data/asoc-s3c.h> |
21 | #include <mach/dma.h> | ||
22 | 21 | ||
23 | #include "dma.h" | 22 | #include "dma.h" |
24 | #include "spdif.h" | 23 | #include "spdif.h" |
@@ -94,7 +93,7 @@ struct samsung_spdif_info { | |||
94 | struct s3c_dma_params *dma_playback; | 93 | struct s3c_dma_params *dma_playback; |
95 | }; | 94 | }; |
96 | 95 | ||
97 | static struct s3c2410_dma_client spdif_dma_client_out = { | 96 | static struct s3c_dma_client spdif_dma_client_out = { |
98 | .name = "S/PDIF Stereo out", | 97 | .name = "S/PDIF Stereo out", |
99 | }; | 98 | }; |
100 | 99 | ||