aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/devicetree/bindings/sound/fsl,ssi.txt21
-rw-r--r--sound/soc/codecs/alc5632.c10
-rw-r--r--sound/soc/codecs/cs42l52.c2
-rw-r--r--sound/soc/codecs/cs42l52.h2
-rw-r--r--sound/soc/codecs/cs42xx8.c11
-rw-r--r--sound/soc/codecs/da732x.c3
-rw-r--r--sound/soc/codecs/max98090.c7
-rw-r--r--sound/soc/davinci/davinci-mcasp.c6
-rw-r--r--sound/soc/fsl/fsl_sai.c93
-rw-r--r--sound/soc/fsl/fsl_sai.h15
10 files changed, 140 insertions, 30 deletions
diff --git a/Documentation/devicetree/bindings/sound/fsl,ssi.txt b/Documentation/devicetree/bindings/sound/fsl,ssi.txt
index b93e9a91e30e..3aa4a8f528f4 100644
--- a/Documentation/devicetree/bindings/sound/fsl,ssi.txt
+++ b/Documentation/devicetree/bindings/sound/fsl,ssi.txt
@@ -20,15 +20,6 @@ Required properties:
20 have. 20 have.
21- interrupt-parent: The phandle for the interrupt controller that 21- interrupt-parent: The phandle for the interrupt controller that
22 services interrupts for this device. 22 services interrupts for this device.
23- fsl,mode: The operating mode for the SSI interface.
24 "i2s-slave" - I2S mode, SSI is clock slave
25 "i2s-master" - I2S mode, SSI is clock master
26 "lj-slave" - left-justified mode, SSI is clock slave
27 "lj-master" - l.j. mode, SSI is clock master
28 "rj-slave" - right-justified mode, SSI is clock slave
29 "rj-master" - r.j., SSI is clock master
30 "ac97-slave" - AC97 mode, SSI is clock slave
31 "ac97-master" - AC97 mode, SSI is clock master
32- fsl,playback-dma: Phandle to a node for the DMA channel to use for 23- fsl,playback-dma: Phandle to a node for the DMA channel to use for
33 playback of audio. This is typically dictated by SOC 24 playback of audio. This is typically dictated by SOC
34 design. See the notes below. 25 design. See the notes below.
@@ -47,6 +38,9 @@ Required properties:
47 be connected together, and SRFS and STFS be connected 38 be connected together, and SRFS and STFS be connected
48 together. This would still allow different sample sizes, 39 together. This would still allow different sample sizes,
49 but not different sample rates. 40 but not different sample rates.
41 - clocks: "ipg" - Required clock for the SSI unit
42 "baud" - Required clock for SSI master mode. Otherwise this
43 clock is not used
50 44
51Required are also ac97 link bindings if ac97 is used. See 45Required are also ac97 link bindings if ac97 is used. See
52Documentation/devicetree/bindings/sound/soc-ac97link.txt for the necessary 46Documentation/devicetree/bindings/sound/soc-ac97link.txt for the necessary
@@ -64,6 +58,15 @@ Optional properties:
64 Documentation/devicetree/bindings/dma/dma.txt. 58 Documentation/devicetree/bindings/dma/dma.txt.
65- dma-names: Two dmas have to be defined, "tx" and "rx", if fsl,imx-fiq 59- dma-names: Two dmas have to be defined, "tx" and "rx", if fsl,imx-fiq
66 is not defined. 60 is not defined.
61- fsl,mode: The operating mode for the SSI interface.
62 "i2s-slave" - I2S mode, SSI is clock slave
63 "i2s-master" - I2S mode, SSI is clock master
64 "lj-slave" - left-justified mode, SSI is clock slave
65 "lj-master" - l.j. mode, SSI is clock master
66 "rj-slave" - right-justified mode, SSI is clock slave
67 "rj-master" - r.j., SSI is clock master
68 "ac97-slave" - AC97 mode, SSI is clock slave
69 "ac97-master" - AC97 mode, SSI is clock master
67 70
68Child 'codec' node required properties: 71Child 'codec' node required properties:
69- compatible: Compatible list, contains the name of the codec 72- compatible: Compatible list, contains the name of the codec
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)
1061static int alc5632_probe(struct snd_soc_codec *codec) 1061static 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};
1192MODULE_DEVICE_TABLE(i2c, alc5632_i2c_table); 1191MODULE_DEVICE_TABLE(i2c, alc5632_i2c_table);
1193 1192
1193static const struct of_device_id alc5632_of_match[] = {
1194 { .compatible = "realtek,alc5632", },
1195 { }
1196};
1197MODULE_DEVICE_TABLE(of, alc5632_of_match);
1198
1194/* i2c codec control layer */ 1199/* i2c codec control layer */
1195static struct i2c_driver alc5632_i2c_driver = { 1200static 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};
2400MODULE_DEVICE_TABLE(i2c, max98090_i2c_id); 2400MODULE_DEVICE_TABLE(i2c, max98090_i2c_id);
2401 2401
2402static const struct of_device_id max98090_of_match[] = {
2403 { .compatible = "maxim,max98090", },
2404 { }
2405};
2406MODULE_DEVICE_TABLE(of, max98090_of_match);
2407
2402static struct i2c_driver max98090_i2c_driver = { 2408static 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/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
29static 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
26static int fsl_sai_set_dai_sysclk_tr(struct snd_soc_dai *cpu_dai, 91static 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
101struct fsl_sai { 115struct 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;