diff options
| -rw-r--r-- | MAINTAINERS | 2 | ||||
| -rw-r--r-- | sound/soc/codecs/ak4642.c | 4 | ||||
| -rw-r--r-- | sound/soc/codecs/cs4271.c | 4 | ||||
| -rw-r--r-- | sound/soc/davinci/davinci-evm.c | 10 | ||||
| -rw-r--r-- | sound/soc/sh/rcar/core.c | 24 | ||||
| -rw-r--r-- | sound/soc/sh/rcar/dvc.c | 17 | ||||
| -rw-r--r-- | sound/soc/sh/rcar/rsnd.h | 11 | ||||
| -rw-r--r-- | sound/soc/sh/rcar/src.c | 17 | ||||
| -rw-r--r-- | sound/soc/sh/rcar/ssi.c | 17 |
9 files changed, 81 insertions, 25 deletions
diff --git a/MAINTAINERS b/MAINTAINERS index efbcb50e4969..3a3c461e0787 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
| @@ -1762,7 +1762,7 @@ S: Supported | |||
| 1762 | F: drivers/tty/serial/atmel_serial.c | 1762 | F: drivers/tty/serial/atmel_serial.c |
| 1763 | 1763 | ||
| 1764 | ATMEL Audio ALSA driver | 1764 | ATMEL Audio ALSA driver |
| 1765 | M: Bo Shen <voice.shen@atmel.com> | 1765 | M: Nicolas Ferre <nicolas.ferre@atmel.com> |
| 1766 | L: alsa-devel@alsa-project.org (moderated for non-subscribers) | 1766 | L: alsa-devel@alsa-project.org (moderated for non-subscribers) |
| 1767 | S: Supported | 1767 | S: Supported |
| 1768 | F: sound/soc/atmel | 1768 | F: sound/soc/atmel |
diff --git a/sound/soc/codecs/ak4642.c b/sound/soc/codecs/ak4642.c index dde8b49c19ad..fba80f30de4d 100644 --- a/sound/soc/codecs/ak4642.c +++ b/sound/soc/codecs/ak4642.c | |||
| @@ -468,13 +468,13 @@ static struct snd_soc_dai_driver ak4642_dai = { | |||
| 468 | .name = "ak4642-hifi", | 468 | .name = "ak4642-hifi", |
| 469 | .playback = { | 469 | .playback = { |
| 470 | .stream_name = "Playback", | 470 | .stream_name = "Playback", |
| 471 | .channels_min = 1, | 471 | .channels_min = 2, |
| 472 | .channels_max = 2, | 472 | .channels_max = 2, |
| 473 | .rates = SNDRV_PCM_RATE_8000_48000, | 473 | .rates = SNDRV_PCM_RATE_8000_48000, |
| 474 | .formats = SNDRV_PCM_FMTBIT_S16_LE }, | 474 | .formats = SNDRV_PCM_FMTBIT_S16_LE }, |
| 475 | .capture = { | 475 | .capture = { |
| 476 | .stream_name = "Capture", | 476 | .stream_name = "Capture", |
| 477 | .channels_min = 1, | 477 | .channels_min = 2, |
| 478 | .channels_max = 2, | 478 | .channels_max = 2, |
| 479 | .rates = SNDRV_PCM_RATE_8000_48000, | 479 | .rates = SNDRV_PCM_RATE_8000_48000, |
| 480 | .formats = SNDRV_PCM_FMTBIT_S16_LE }, | 480 | .formats = SNDRV_PCM_FMTBIT_S16_LE }, |
diff --git a/sound/soc/codecs/cs4271.c b/sound/soc/codecs/cs4271.c index 7d3a6accaf9a..e770ee6f36da 100644 --- a/sound/soc/codecs/cs4271.c +++ b/sound/soc/codecs/cs4271.c | |||
| @@ -561,10 +561,10 @@ static int cs4271_codec_probe(struct snd_soc_codec *codec) | |||
| 561 | if (gpio_is_valid(cs4271->gpio_nreset)) { | 561 | if (gpio_is_valid(cs4271->gpio_nreset)) { |
| 562 | /* Reset codec */ | 562 | /* Reset codec */ |
| 563 | gpio_direction_output(cs4271->gpio_nreset, 0); | 563 | gpio_direction_output(cs4271->gpio_nreset, 0); |
| 564 | udelay(1); | 564 | mdelay(1); |
| 565 | gpio_set_value(cs4271->gpio_nreset, 1); | 565 | gpio_set_value(cs4271->gpio_nreset, 1); |
| 566 | /* Give the codec time to wake up */ | 566 | /* Give the codec time to wake up */ |
| 567 | udelay(1); | 567 | mdelay(1); |
| 568 | } | 568 | } |
| 569 | 569 | ||
| 570 | ret = regmap_update_bits(cs4271->regmap, CS4271_MODE2, | 570 | ret = regmap_update_bits(cs4271->regmap, CS4271_MODE2, |
diff --git a/sound/soc/davinci/davinci-evm.c b/sound/soc/davinci/davinci-evm.c index b6bb5947a8a8..8c2b9be80a9a 100644 --- a/sound/soc/davinci/davinci-evm.c +++ b/sound/soc/davinci/davinci-evm.c | |||
| @@ -425,18 +425,8 @@ static int davinci_evm_probe(struct platform_device *pdev) | |||
| 425 | return ret; | 425 | return ret; |
| 426 | } | 426 | } |
| 427 | 427 | ||
| 428 | static int davinci_evm_remove(struct platform_device *pdev) | ||
| 429 | { | ||
| 430 | struct snd_soc_card *card = platform_get_drvdata(pdev); | ||
| 431 | |||
| 432 | snd_soc_unregister_card(card); | ||
| 433 | |||
| 434 | return 0; | ||
| 435 | } | ||
| 436 | |||
| 437 | static struct platform_driver davinci_evm_driver = { | 428 | static struct platform_driver davinci_evm_driver = { |
| 438 | .probe = davinci_evm_probe, | 429 | .probe = davinci_evm_probe, |
| 439 | .remove = davinci_evm_remove, | ||
| 440 | .driver = { | 430 | .driver = { |
| 441 | .name = "davinci_evm", | 431 | .name = "davinci_evm", |
| 442 | .pm = &snd_soc_pm_ops, | 432 | .pm = &snd_soc_pm_ops, |
diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index 110577c52317..31202e95be1e 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c | |||
| @@ -149,16 +149,29 @@ char *rsnd_mod_dma_name(struct rsnd_mod *mod) | |||
| 149 | return mod->ops->dma_name(mod); | 149 | return mod->ops->dma_name(mod); |
| 150 | } | 150 | } |
| 151 | 151 | ||
| 152 | void rsnd_mod_init(struct rsnd_mod *mod, | 152 | int rsnd_mod_init(struct rsnd_mod *mod, |
| 153 | struct rsnd_mod_ops *ops, | 153 | struct rsnd_mod_ops *ops, |
| 154 | struct clk *clk, | 154 | struct clk *clk, |
| 155 | enum rsnd_mod_type type, | 155 | enum rsnd_mod_type type, |
| 156 | int id) | 156 | int id) |
| 157 | { | 157 | { |
| 158 | int ret = clk_prepare(clk); | ||
| 159 | |||
| 160 | if (ret) | ||
| 161 | return ret; | ||
| 162 | |||
| 158 | mod->id = id; | 163 | mod->id = id; |
| 159 | mod->ops = ops; | 164 | mod->ops = ops; |
| 160 | mod->type = type; | 165 | mod->type = type; |
| 161 | mod->clk = clk; | 166 | mod->clk = clk; |
| 167 | |||
| 168 | return ret; | ||
| 169 | } | ||
| 170 | |||
| 171 | void rsnd_mod_quit(struct rsnd_mod *mod) | ||
| 172 | { | ||
| 173 | if (mod->clk) | ||
| 174 | clk_unprepare(mod->clk); | ||
| 162 | } | 175 | } |
| 163 | 176 | ||
| 164 | /* | 177 | /* |
| @@ -1290,6 +1303,12 @@ static int rsnd_remove(struct platform_device *pdev) | |||
| 1290 | { | 1303 | { |
| 1291 | struct rsnd_priv *priv = dev_get_drvdata(&pdev->dev); | 1304 | struct rsnd_priv *priv = dev_get_drvdata(&pdev->dev); |
| 1292 | struct rsnd_dai *rdai; | 1305 | struct rsnd_dai *rdai; |
| 1306 | void (*remove_func[])(struct platform_device *pdev, | ||
| 1307 | struct rsnd_priv *priv) = { | ||
| 1308 | rsnd_ssi_remove, | ||
| 1309 | rsnd_src_remove, | ||
| 1310 | rsnd_dvc_remove, | ||
| 1311 | }; | ||
| 1293 | int ret = 0, i; | 1312 | int ret = 0, i; |
| 1294 | 1313 | ||
| 1295 | pm_runtime_disable(&pdev->dev); | 1314 | pm_runtime_disable(&pdev->dev); |
| @@ -1299,6 +1318,9 @@ static int rsnd_remove(struct platform_device *pdev) | |||
| 1299 | ret |= rsnd_dai_call(remove, &rdai->capture, priv); | 1318 | ret |= rsnd_dai_call(remove, &rdai->capture, priv); |
| 1300 | } | 1319 | } |
| 1301 | 1320 | ||
| 1321 | for (i = 0; i < ARRAY_SIZE(remove_func); i++) | ||
| 1322 | remove_func[i](pdev, priv); | ||
| 1323 | |||
| 1302 | snd_soc_unregister_component(&pdev->dev); | 1324 | snd_soc_unregister_component(&pdev->dev); |
| 1303 | snd_soc_unregister_platform(&pdev->dev); | 1325 | snd_soc_unregister_platform(&pdev->dev); |
| 1304 | 1326 | ||
diff --git a/sound/soc/sh/rcar/dvc.c b/sound/soc/sh/rcar/dvc.c index d7f9ed959c4e..261997a3f589 100644 --- a/sound/soc/sh/rcar/dvc.c +++ b/sound/soc/sh/rcar/dvc.c | |||
| @@ -333,7 +333,7 @@ int rsnd_dvc_probe(struct platform_device *pdev, | |||
| 333 | struct rsnd_dvc *dvc; | 333 | struct rsnd_dvc *dvc; |
| 334 | struct clk *clk; | 334 | struct clk *clk; |
| 335 | char name[RSND_DVC_NAME_SIZE]; | 335 | char name[RSND_DVC_NAME_SIZE]; |
| 336 | int i, nr; | 336 | int i, nr, ret; |
| 337 | 337 | ||
| 338 | rsnd_of_parse_dvc(pdev, of_data, priv); | 338 | rsnd_of_parse_dvc(pdev, of_data, priv); |
| 339 | 339 | ||
| @@ -366,11 +366,24 @@ int rsnd_dvc_probe(struct platform_device *pdev, | |||
| 366 | 366 | ||
| 367 | dvc->info = &info->dvc_info[i]; | 367 | dvc->info = &info->dvc_info[i]; |
| 368 | 368 | ||
| 369 | rsnd_mod_init(&dvc->mod, &rsnd_dvc_ops, | 369 | ret = rsnd_mod_init(&dvc->mod, &rsnd_dvc_ops, |
| 370 | clk, RSND_MOD_DVC, i); | 370 | clk, RSND_MOD_DVC, i); |
| 371 | if (ret) | ||
| 372 | return ret; | ||
| 371 | 373 | ||
| 372 | dev_dbg(dev, "CMD%d probed\n", i); | 374 | dev_dbg(dev, "CMD%d probed\n", i); |
| 373 | } | 375 | } |
| 374 | 376 | ||
| 375 | return 0; | 377 | return 0; |
| 376 | } | 378 | } |
| 379 | |||
| 380 | void rsnd_dvc_remove(struct platform_device *pdev, | ||
| 381 | struct rsnd_priv *priv) | ||
| 382 | { | ||
| 383 | struct rsnd_dvc *dvc; | ||
| 384 | int i; | ||
| 385 | |||
| 386 | for_each_rsnd_dvc(dvc, priv, i) { | ||
| 387 | rsnd_mod_quit(&dvc->mod); | ||
| 388 | } | ||
| 389 | } | ||
diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h index e7914bd610e2..1bccc5515b5a 100644 --- a/sound/soc/sh/rcar/rsnd.h +++ b/sound/soc/sh/rcar/rsnd.h | |||
| @@ -260,14 +260,15 @@ struct rsnd_mod { | |||
| 260 | #define rsnd_dma_to_mod(_dma) container_of((_dma), struct rsnd_mod, dma) | 260 | #define rsnd_dma_to_mod(_dma) container_of((_dma), struct rsnd_mod, dma) |
| 261 | #define rsnd_mod_to_io(mod) ((mod)->io) | 261 | #define rsnd_mod_to_io(mod) ((mod)->io) |
| 262 | #define rsnd_mod_id(mod) ((mod)->id) | 262 | #define rsnd_mod_id(mod) ((mod)->id) |
| 263 | #define rsnd_mod_hw_start(mod) clk_prepare_enable((mod)->clk) | 263 | #define rsnd_mod_hw_start(mod) clk_enable((mod)->clk) |
| 264 | #define rsnd_mod_hw_stop(mod) clk_disable_unprepare((mod)->clk) | 264 | #define rsnd_mod_hw_stop(mod) clk_disable((mod)->clk) |
| 265 | 265 | ||
| 266 | void rsnd_mod_init(struct rsnd_mod *mod, | 266 | int rsnd_mod_init(struct rsnd_mod *mod, |
| 267 | struct rsnd_mod_ops *ops, | 267 | struct rsnd_mod_ops *ops, |
| 268 | struct clk *clk, | 268 | struct clk *clk, |
| 269 | enum rsnd_mod_type type, | 269 | enum rsnd_mod_type type, |
| 270 | int id); | 270 | int id); |
| 271 | void rsnd_mod_quit(struct rsnd_mod *mod); | ||
| 271 | char *rsnd_mod_name(struct rsnd_mod *mod); | 272 | char *rsnd_mod_name(struct rsnd_mod *mod); |
| 272 | char *rsnd_mod_dma_name(struct rsnd_mod *mod); | 273 | char *rsnd_mod_dma_name(struct rsnd_mod *mod); |
| 273 | 274 | ||
| @@ -480,6 +481,8 @@ int rsnd_kctrl_new_e(struct rsnd_mod *mod, | |||
| 480 | int rsnd_src_probe(struct platform_device *pdev, | 481 | int rsnd_src_probe(struct platform_device *pdev, |
| 481 | const struct rsnd_of_data *of_data, | 482 | const struct rsnd_of_data *of_data, |
| 482 | struct rsnd_priv *priv); | 483 | struct rsnd_priv *priv); |
| 484 | void rsnd_src_remove(struct platform_device *pdev, | ||
| 485 | struct rsnd_priv *priv); | ||
| 483 | struct rsnd_mod *rsnd_src_mod_get(struct rsnd_priv *priv, int id); | 486 | struct rsnd_mod *rsnd_src_mod_get(struct rsnd_priv *priv, int id); |
| 484 | unsigned int rsnd_src_get_ssi_rate(struct rsnd_priv *priv, | 487 | unsigned int rsnd_src_get_ssi_rate(struct rsnd_priv *priv, |
| 485 | struct rsnd_dai_stream *io, | 488 | struct rsnd_dai_stream *io, |
| @@ -498,6 +501,8 @@ int rsnd_src_ssi_irq_disable(struct rsnd_mod *ssi_mod); | |||
| 498 | int rsnd_ssi_probe(struct platform_device *pdev, | 501 | int rsnd_ssi_probe(struct platform_device *pdev, |
| 499 | const struct rsnd_of_data *of_data, | 502 | const struct rsnd_of_data *of_data, |
| 500 | struct rsnd_priv *priv); | 503 | struct rsnd_priv *priv); |
| 504 | void rsnd_ssi_remove(struct platform_device *pdev, | ||
| 505 | struct rsnd_priv *priv); | ||
| 501 | struct rsnd_mod *rsnd_ssi_mod_get(struct rsnd_priv *priv, int id); | 506 | struct rsnd_mod *rsnd_ssi_mod_get(struct rsnd_priv *priv, int id); |
| 502 | int rsnd_ssi_is_pin_sharing(struct rsnd_mod *mod); | 507 | int rsnd_ssi_is_pin_sharing(struct rsnd_mod *mod); |
| 503 | int rsnd_ssi_is_dma_mode(struct rsnd_mod *mod); | 508 | int rsnd_ssi_is_dma_mode(struct rsnd_mod *mod); |
diff --git a/sound/soc/sh/rcar/src.c b/sound/soc/sh/rcar/src.c index 81c182b4bad5..c77d059edc84 100644 --- a/sound/soc/sh/rcar/src.c +++ b/sound/soc/sh/rcar/src.c | |||
| @@ -850,7 +850,7 @@ int rsnd_src_probe(struct platform_device *pdev, | |||
| 850 | struct rsnd_mod_ops *ops; | 850 | struct rsnd_mod_ops *ops; |
| 851 | struct clk *clk; | 851 | struct clk *clk; |
| 852 | char name[RSND_SRC_NAME_SIZE]; | 852 | char name[RSND_SRC_NAME_SIZE]; |
| 853 | int i, nr; | 853 | int i, nr, ret; |
| 854 | 854 | ||
| 855 | ops = NULL; | 855 | ops = NULL; |
| 856 | if (rsnd_is_gen1(priv)) | 856 | if (rsnd_is_gen1(priv)) |
| @@ -890,10 +890,23 @@ int rsnd_src_probe(struct platform_device *pdev, | |||
| 890 | 890 | ||
| 891 | src->info = &info->src_info[i]; | 891 | src->info = &info->src_info[i]; |
| 892 | 892 | ||
| 893 | rsnd_mod_init(&src->mod, ops, clk, RSND_MOD_SRC, i); | 893 | ret = rsnd_mod_init(&src->mod, ops, clk, RSND_MOD_SRC, i); |
| 894 | if (ret) | ||
| 895 | return ret; | ||
| 894 | 896 | ||
| 895 | dev_dbg(dev, "SRC%d probed\n", i); | 897 | dev_dbg(dev, "SRC%d probed\n", i); |
| 896 | } | 898 | } |
| 897 | 899 | ||
| 898 | return 0; | 900 | return 0; |
| 899 | } | 901 | } |
| 902 | |||
| 903 | void rsnd_src_remove(struct platform_device *pdev, | ||
| 904 | struct rsnd_priv *priv) | ||
| 905 | { | ||
| 906 | struct rsnd_src *src; | ||
| 907 | int i; | ||
| 908 | |||
| 909 | for_each_rsnd_src(src, priv, i) { | ||
| 910 | rsnd_mod_quit(&src->mod); | ||
| 911 | } | ||
| 912 | } | ||
diff --git a/sound/soc/sh/rcar/ssi.c b/sound/soc/sh/rcar/ssi.c index 9e7b627c08e2..f7cb1fd635a0 100644 --- a/sound/soc/sh/rcar/ssi.c +++ b/sound/soc/sh/rcar/ssi.c | |||
| @@ -697,7 +697,7 @@ int rsnd_ssi_probe(struct platform_device *pdev, | |||
| 697 | struct clk *clk; | 697 | struct clk *clk; |
| 698 | struct rsnd_ssi *ssi; | 698 | struct rsnd_ssi *ssi; |
| 699 | char name[RSND_SSI_NAME_SIZE]; | 699 | char name[RSND_SSI_NAME_SIZE]; |
| 700 | int i, nr; | 700 | int i, nr, ret; |
| 701 | 701 | ||
| 702 | rsnd_of_parse_ssi(pdev, of_data, priv); | 702 | rsnd_of_parse_ssi(pdev, of_data, priv); |
| 703 | 703 | ||
| @@ -732,10 +732,23 @@ int rsnd_ssi_probe(struct platform_device *pdev, | |||
| 732 | else if (rsnd_ssi_pio_available(ssi)) | 732 | else if (rsnd_ssi_pio_available(ssi)) |
| 733 | ops = &rsnd_ssi_pio_ops; | 733 | ops = &rsnd_ssi_pio_ops; |
| 734 | 734 | ||
| 735 | rsnd_mod_init(&ssi->mod, ops, clk, RSND_MOD_SSI, i); | 735 | ret = rsnd_mod_init(&ssi->mod, ops, clk, RSND_MOD_SSI, i); |
| 736 | if (ret) | ||
| 737 | return ret; | ||
| 736 | 738 | ||
| 737 | rsnd_ssi_parent_clk_setup(priv, ssi); | 739 | rsnd_ssi_parent_clk_setup(priv, ssi); |
| 738 | } | 740 | } |
| 739 | 741 | ||
| 740 | return 0; | 742 | return 0; |
| 741 | } | 743 | } |
| 744 | |||
| 745 | void rsnd_ssi_remove(struct platform_device *pdev, | ||
| 746 | struct rsnd_priv *priv) | ||
| 747 | { | ||
| 748 | struct rsnd_ssi *ssi; | ||
| 749 | int i; | ||
| 750 | |||
| 751 | for_each_rsnd_ssi(ssi, priv, i) { | ||
| 752 | rsnd_mod_quit(&ssi->mod); | ||
| 753 | } | ||
| 754 | } | ||
