diff options
-rw-r--r-- | sound/soc/codecs/Kconfig | 1 | ||||
-rw-r--r-- | sound/soc/codecs/max98090.c | 31 | ||||
-rw-r--r-- | sound/soc/codecs/max98090.h | 10 | ||||
-rw-r--r-- | sound/soc/codecs/rt286.c | 2 | ||||
-rw-r--r-- | sound/soc/rockchip/Kconfig | 3 | ||||
-rw-r--r-- | sound/soc/rockchip/Makefile | 2 | ||||
-rw-r--r-- | sound/soc/rockchip/rockchip_i2s.c | 28 | ||||
-rw-r--r-- | sound/soc/sh/rcar/core.c | 6 |
8 files changed, 41 insertions, 42 deletions
diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig index 7678122f8fe0..0563cc6cd4d0 100644 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig | |||
@@ -483,6 +483,7 @@ config SND_SOC_RL6231 | |||
483 | 483 | ||
484 | config SND_SOC_RT286 | 484 | config SND_SOC_RT286 |
485 | tristate | 485 | tristate |
486 | depends on I2C | ||
486 | 487 | ||
487 | config SND_SOC_RT5631 | 488 | config SND_SOC_RT5631 |
488 | tristate | 489 | tristate |
diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c index 7e111865946a..d519294f57c7 100644 --- a/sound/soc/codecs/max98090.c +++ b/sound/soc/codecs/max98090.c | |||
@@ -2159,12 +2159,16 @@ static void max98090_jack_work(struct work_struct *work) | |||
2159 | 2159 | ||
2160 | static irqreturn_t max98090_interrupt(int irq, void *data) | 2160 | static irqreturn_t max98090_interrupt(int irq, void *data) |
2161 | { | 2161 | { |
2162 | struct snd_soc_codec *codec = data; | 2162 | struct max98090_priv *max98090 = data; |
2163 | struct max98090_priv *max98090 = snd_soc_codec_get_drvdata(codec); | 2163 | struct snd_soc_codec *codec = max98090->codec; |
2164 | int ret; | 2164 | int ret; |
2165 | unsigned int mask; | 2165 | unsigned int mask; |
2166 | unsigned int active; | 2166 | unsigned int active; |
2167 | 2167 | ||
2168 | /* Treat interrupt before codec is initialized as spurious */ | ||
2169 | if (codec == NULL) | ||
2170 | return IRQ_NONE; | ||
2171 | |||
2168 | dev_dbg(codec->dev, "***** max98090_interrupt *****\n"); | 2172 | dev_dbg(codec->dev, "***** max98090_interrupt *****\n"); |
2169 | 2173 | ||
2170 | ret = regmap_read(max98090->regmap, M98090_REG_INTERRUPT_S, &mask); | 2174 | ret = regmap_read(max98090->regmap, M98090_REG_INTERRUPT_S, &mask); |
@@ -2329,7 +2333,6 @@ static int max98090_probe(struct snd_soc_codec *codec) | |||
2329 | max98090->lin_state = 0; | 2333 | max98090->lin_state = 0; |
2330 | max98090->pa1en = 0; | 2334 | max98090->pa1en = 0; |
2331 | max98090->pa2en = 0; | 2335 | max98090->pa2en = 0; |
2332 | max98090->extmic_mux = 0; | ||
2333 | 2336 | ||
2334 | ret = snd_soc_read(codec, M98090_REG_REVISION_ID); | 2337 | ret = snd_soc_read(codec, M98090_REG_REVISION_ID); |
2335 | if (ret < 0) { | 2338 | if (ret < 0) { |
@@ -2367,17 +2370,6 @@ static int max98090_probe(struct snd_soc_codec *codec) | |||
2367 | snd_soc_write(codec, M98090_REG_JACK_DETECT, | 2370 | snd_soc_write(codec, M98090_REG_JACK_DETECT, |
2368 | M98090_JDETEN_MASK | M98090_JDEB_25MS); | 2371 | M98090_JDETEN_MASK | M98090_JDEB_25MS); |
2369 | 2372 | ||
2370 | /* Register for interrupts */ | ||
2371 | dev_dbg(codec->dev, "irq = %d\n", max98090->irq); | ||
2372 | |||
2373 | ret = devm_request_threaded_irq(codec->dev, max98090->irq, NULL, | ||
2374 | max98090_interrupt, IRQF_TRIGGER_FALLING | IRQF_ONESHOT, | ||
2375 | "max98090_interrupt", codec); | ||
2376 | if (ret < 0) { | ||
2377 | dev_err(codec->dev, "request_irq failed: %d\n", | ||
2378 | ret); | ||
2379 | } | ||
2380 | |||
2381 | /* | 2373 | /* |
2382 | * Clear any old interrupts. | 2374 | * Clear any old interrupts. |
2383 | * An old interrupt ocurring prior to installing the ISR | 2375 | * An old interrupt ocurring prior to installing the ISR |
@@ -2417,6 +2409,7 @@ static int max98090_remove(struct snd_soc_codec *codec) | |||
2417 | cancel_delayed_work_sync(&max98090->pll_det_enable_work); | 2409 | cancel_delayed_work_sync(&max98090->pll_det_enable_work); |
2418 | cancel_work_sync(&max98090->pll_det_disable_work); | 2410 | cancel_work_sync(&max98090->pll_det_disable_work); |
2419 | cancel_work_sync(&max98090->pll_work); | 2411 | cancel_work_sync(&max98090->pll_work); |
2412 | max98090->codec = NULL; | ||
2420 | 2413 | ||
2421 | return 0; | 2414 | return 0; |
2422 | } | 2415 | } |
@@ -2469,7 +2462,6 @@ static int max98090_i2c_probe(struct i2c_client *i2c, | |||
2469 | max98090->devtype = driver_data; | 2462 | max98090->devtype = driver_data; |
2470 | i2c_set_clientdata(i2c, max98090); | 2463 | i2c_set_clientdata(i2c, max98090); |
2471 | max98090->pdata = i2c->dev.platform_data; | 2464 | max98090->pdata = i2c->dev.platform_data; |
2472 | max98090->irq = i2c->irq; | ||
2473 | 2465 | ||
2474 | max98090->regmap = devm_regmap_init_i2c(i2c, &max98090_regmap); | 2466 | max98090->regmap = devm_regmap_init_i2c(i2c, &max98090_regmap); |
2475 | if (IS_ERR(max98090->regmap)) { | 2467 | if (IS_ERR(max98090->regmap)) { |
@@ -2478,6 +2470,15 @@ static int max98090_i2c_probe(struct i2c_client *i2c, | |||
2478 | goto err_enable; | 2470 | goto err_enable; |
2479 | } | 2471 | } |
2480 | 2472 | ||
2473 | ret = devm_request_threaded_irq(&i2c->dev, i2c->irq, NULL, | ||
2474 | max98090_interrupt, IRQF_TRIGGER_FALLING | IRQF_ONESHOT, | ||
2475 | "max98090_interrupt", max98090); | ||
2476 | if (ret < 0) { | ||
2477 | dev_err(&i2c->dev, "request_irq failed: %d\n", | ||
2478 | ret); | ||
2479 | return ret; | ||
2480 | } | ||
2481 | |||
2481 | ret = snd_soc_register_codec(&i2c->dev, | 2482 | ret = snd_soc_register_codec(&i2c->dev, |
2482 | &soc_codec_dev_max98090, max98090_dai, | 2483 | &soc_codec_dev_max98090, max98090_dai, |
2483 | ARRAY_SIZE(max98090_dai)); | 2484 | ARRAY_SIZE(max98090_dai)); |
diff --git a/sound/soc/codecs/max98090.h b/sound/soc/codecs/max98090.h index 14427a566f41..a5f6bada06da 100644 --- a/sound/soc/codecs/max98090.h +++ b/sound/soc/codecs/max98090.h | |||
@@ -11,11 +11,6 @@ | |||
11 | #ifndef _MAX98090_H | 11 | #ifndef _MAX98090_H |
12 | #define _MAX98090_H | 12 | #define _MAX98090_H |
13 | 13 | ||
14 | #include <linux/version.h> | ||
15 | |||
16 | /* One can override the Linux version here with an explicit version number */ | ||
17 | #define M98090_LINUX_VERSION LINUX_VERSION_CODE | ||
18 | |||
19 | /* | 14 | /* |
20 | * MAX98090 Register Definitions | 15 | * MAX98090 Register Definitions |
21 | */ | 16 | */ |
@@ -1502,9 +1497,6 @@ | |||
1502 | #define M98090_REVID_WIDTH 8 | 1497 | #define M98090_REVID_WIDTH 8 |
1503 | #define M98090_REVID_NUM (1<<M98090_REVID_WIDTH) | 1498 | #define M98090_REVID_NUM (1<<M98090_REVID_WIDTH) |
1504 | 1499 | ||
1505 | #define M98090_BYTE1(w) ((w >> 8) & 0xff) | ||
1506 | #define M98090_BYTE0(w) (w & 0xff) | ||
1507 | |||
1508 | /* Silicon revision number */ | 1500 | /* Silicon revision number */ |
1509 | #define M98090_REVA 0x40 | 1501 | #define M98090_REVA 0x40 |
1510 | #define M98091_REVA 0x50 | 1502 | #define M98091_REVA 0x50 |
@@ -1529,7 +1521,6 @@ struct max98090_priv { | |||
1529 | unsigned int bclk; | 1521 | unsigned int bclk; |
1530 | unsigned int lrclk; | 1522 | unsigned int lrclk; |
1531 | struct max98090_cdata dai[1]; | 1523 | struct max98090_cdata dai[1]; |
1532 | int irq; | ||
1533 | int jack_state; | 1524 | int jack_state; |
1534 | struct delayed_work jack_work; | 1525 | struct delayed_work jack_work; |
1535 | struct delayed_work pll_det_enable_work; | 1526 | struct delayed_work pll_det_enable_work; |
@@ -1542,7 +1533,6 @@ struct max98090_priv { | |||
1542 | u8 lin_state; | 1533 | u8 lin_state; |
1543 | unsigned int pa1en; | 1534 | unsigned int pa1en; |
1544 | unsigned int pa2en; | 1535 | unsigned int pa2en; |
1545 | unsigned int extmic_mux; | ||
1546 | unsigned int sidetone; | 1536 | unsigned int sidetone; |
1547 | bool master; | 1537 | bool master; |
1548 | }; | 1538 | }; |
diff --git a/sound/soc/codecs/rt286.c b/sound/soc/codecs/rt286.c index b86b426f159d..4aa555cbcca8 100644 --- a/sound/soc/codecs/rt286.c +++ b/sound/soc/codecs/rt286.c | |||
@@ -269,6 +269,7 @@ static int rt286_hw_read(void *context, unsigned int reg, unsigned int *value) | |||
269 | return 0; | 269 | return 0; |
270 | } | 270 | } |
271 | 271 | ||
272 | #ifdef CONFIG_PM | ||
272 | static void rt286_index_sync(struct snd_soc_codec *codec) | 273 | static void rt286_index_sync(struct snd_soc_codec *codec) |
273 | { | 274 | { |
274 | struct rt286_priv *rt286 = snd_soc_codec_get_drvdata(codec); | 275 | struct rt286_priv *rt286 = snd_soc_codec_get_drvdata(codec); |
@@ -279,6 +280,7 @@ static void rt286_index_sync(struct snd_soc_codec *codec) | |||
279 | rt286->index_cache[i].def); | 280 | rt286->index_cache[i].def); |
280 | } | 281 | } |
281 | } | 282 | } |
283 | #endif | ||
282 | 284 | ||
283 | static int rt286_support_power_controls[] = { | 285 | static int rt286_support_power_controls[] = { |
284 | RT286_DAC_OUT1, | 286 | RT286_DAC_OUT1, |
diff --git a/sound/soc/rockchip/Kconfig b/sound/soc/rockchip/Kconfig index c196a466eef6..78fc159559b0 100644 --- a/sound/soc/rockchip/Kconfig +++ b/sound/soc/rockchip/Kconfig | |||
@@ -2,11 +2,10 @@ config SND_SOC_ROCKCHIP | |||
2 | tristate "ASoC support for Rockchip" | 2 | tristate "ASoC support for Rockchip" |
3 | depends on COMPILE_TEST || ARCH_ROCKCHIP | 3 | depends on COMPILE_TEST || ARCH_ROCKCHIP |
4 | select SND_SOC_GENERIC_DMAENGINE_PCM | 4 | select SND_SOC_GENERIC_DMAENGINE_PCM |
5 | select SND_ROCKCHIP_I2S | ||
6 | help | 5 | help |
7 | Say Y or M if you want to add support for codecs attached to | 6 | Say Y or M if you want to add support for codecs attached to |
8 | the Rockchip SoCs' Audio interfaces. You will also need to | 7 | the Rockchip SoCs' Audio interfaces. You will also need to |
9 | select the audio interfaces to support below. | 8 | select the audio interfaces to support below. |
10 | 9 | ||
11 | config SND_ROCKCHIP_I2S | 10 | config SND_SOC_ROCKCHIP_I2S |
12 | tristate | 11 | tristate |
diff --git a/sound/soc/rockchip/Makefile b/sound/soc/rockchip/Makefile index 1006418e1394..b9219092b47f 100644 --- a/sound/soc/rockchip/Makefile +++ b/sound/soc/rockchip/Makefile | |||
@@ -1,4 +1,4 @@ | |||
1 | # ROCKCHIP Platform Support | 1 | # ROCKCHIP Platform Support |
2 | snd-soc-i2s-objs := rockchip_i2s.o | 2 | snd-soc-i2s-objs := rockchip_i2s.o |
3 | 3 | ||
4 | obj-$(CONFIG_SND_ROCKCHIP_I2S) += snd-soc-i2s.o | 4 | obj-$(CONFIG_SND_SOC_ROCKCHIP_I2S) += snd-soc-i2s.o |
diff --git a/sound/soc/rockchip/rockchip_i2s.c b/sound/soc/rockchip/rockchip_i2s.c index fb9e05c9f471..033487c9a164 100644 --- a/sound/soc/rockchip/rockchip_i2s.c +++ b/sound/soc/rockchip/rockchip_i2s.c | |||
@@ -244,16 +244,6 @@ static int rockchip_i2s_hw_params(struct snd_pcm_substream *substream, | |||
244 | regmap_update_bits(i2s->regmap, I2S_TXCR, I2S_TXCR_VDW_MASK, val); | 244 | regmap_update_bits(i2s->regmap, I2S_TXCR, I2S_TXCR_VDW_MASK, val); |
245 | regmap_update_bits(i2s->regmap, I2S_RXCR, I2S_RXCR_VDW_MASK, val); | 245 | regmap_update_bits(i2s->regmap, I2S_RXCR, I2S_RXCR_VDW_MASK, val); |
246 | 246 | ||
247 | if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) { | ||
248 | dai->playback_dma_data = &i2s->playback_dma_data; | ||
249 | regmap_update_bits(i2s->regmap, I2S_DMACR, I2S_DMACR_TDL_MASK, | ||
250 | I2S_DMACR_TDL(1) | I2S_DMACR_TDE_ENABLE); | ||
251 | } else { | ||
252 | dai->capture_dma_data = &i2s->capture_dma_data; | ||
253 | regmap_update_bits(i2s->regmap, I2S_DMACR, I2S_DMACR_RDL_MASK, | ||
254 | I2S_DMACR_RDL(1) | I2S_DMACR_RDE_ENABLE); | ||
255 | } | ||
256 | |||
257 | return 0; | 247 | return 0; |
258 | } | 248 | } |
259 | 249 | ||
@@ -301,6 +291,16 @@ static int rockchip_i2s_set_sysclk(struct snd_soc_dai *cpu_dai, int clk_id, | |||
301 | return ret; | 291 | return ret; |
302 | } | 292 | } |
303 | 293 | ||
294 | static int rockchip_i2s_dai_probe(struct snd_soc_dai *dai) | ||
295 | { | ||
296 | struct rk_i2s_dev *i2s = snd_soc_dai_get_drvdata(dai); | ||
297 | |||
298 | dai->capture_dma_data = &i2s->capture_dma_data; | ||
299 | dai->playback_dma_data = &i2s->playback_dma_data; | ||
300 | |||
301 | return 0; | ||
302 | } | ||
303 | |||
304 | static const struct snd_soc_dai_ops rockchip_i2s_dai_ops = { | 304 | static const struct snd_soc_dai_ops rockchip_i2s_dai_ops = { |
305 | .hw_params = rockchip_i2s_hw_params, | 305 | .hw_params = rockchip_i2s_hw_params, |
306 | .set_sysclk = rockchip_i2s_set_sysclk, | 306 | .set_sysclk = rockchip_i2s_set_sysclk, |
@@ -309,7 +309,9 @@ static const struct snd_soc_dai_ops rockchip_i2s_dai_ops = { | |||
309 | }; | 309 | }; |
310 | 310 | ||
311 | static struct snd_soc_dai_driver rockchip_i2s_dai = { | 311 | static struct snd_soc_dai_driver rockchip_i2s_dai = { |
312 | .probe = rockchip_i2s_dai_probe, | ||
312 | .playback = { | 313 | .playback = { |
314 | .stream_name = "Playback", | ||
313 | .channels_min = 2, | 315 | .channels_min = 2, |
314 | .channels_max = 8, | 316 | .channels_max = 8, |
315 | .rates = SNDRV_PCM_RATE_8000_192000, | 317 | .rates = SNDRV_PCM_RATE_8000_192000, |
@@ -319,6 +321,7 @@ static struct snd_soc_dai_driver rockchip_i2s_dai = { | |||
319 | SNDRV_PCM_FMTBIT_S24_LE), | 321 | SNDRV_PCM_FMTBIT_S24_LE), |
320 | }, | 322 | }, |
321 | .capture = { | 323 | .capture = { |
324 | .stream_name = "Capture", | ||
322 | .channels_min = 2, | 325 | .channels_min = 2, |
323 | .channels_max = 2, | 326 | .channels_max = 2, |
324 | .rates = SNDRV_PCM_RATE_8000_192000, | 327 | .rates = SNDRV_PCM_RATE_8000_192000, |
@@ -420,6 +423,11 @@ static int rockchip_i2s_probe(struct platform_device *pdev) | |||
420 | dev_err(&pdev->dev, "Can't retrieve i2s bus clock\n"); | 423 | dev_err(&pdev->dev, "Can't retrieve i2s bus clock\n"); |
421 | return PTR_ERR(i2s->hclk); | 424 | return PTR_ERR(i2s->hclk); |
422 | } | 425 | } |
426 | ret = clk_prepare_enable(i2s->hclk); | ||
427 | if (ret) { | ||
428 | dev_err(i2s->dev, "hclock enable failed %d\n", ret); | ||
429 | return ret; | ||
430 | } | ||
423 | 431 | ||
424 | i2s->mclk = devm_clk_get(&pdev->dev, "i2s_clk"); | 432 | i2s->mclk = devm_clk_get(&pdev->dev, "i2s_clk"); |
425 | if (IS_ERR(i2s->mclk)) { | 433 | if (IS_ERR(i2s->mclk)) { |
diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index 19f78963e8b9..1922ec57d10a 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c | |||
@@ -798,10 +798,8 @@ if (name##_node) { \ | |||
798 | mod_parse(src); | 798 | mod_parse(src); |
799 | mod_parse(dvc); | 799 | mod_parse(dvc); |
800 | 800 | ||
801 | if (playback) | 801 | of_node_put(playback); |
802 | of_node_put(playback); | 802 | of_node_put(capture); |
803 | if (capture) | ||
804 | of_node_put(capture); | ||
805 | } | 803 | } |
806 | 804 | ||
807 | dai_i++; | 805 | dai_i++; |