Commit 250acc70 authored by Mark Brown's avatar Mark Brown

Merge remote-tracking branches 'asoc/fix/ak4642', 'asoc/fix/atmel',...

Merge remote-tracking branches 'asoc/fix/ak4642', 'asoc/fix/atmel', 'asoc/fix/cs4271', 'asoc/fix/davinci' and 'asoc/fix/rcar' into asoc-linus
...@@ -1762,7 +1762,7 @@ S: Supported ...@@ -1762,7 +1762,7 @@ S: Supported
F: drivers/tty/serial/atmel_serial.c F: drivers/tty/serial/atmel_serial.c
ATMEL Audio ALSA driver ATMEL Audio ALSA driver
M: Bo Shen <voice.shen@atmel.com> M: Nicolas Ferre <nicolas.ferre@atmel.com>
L: alsa-devel@alsa-project.org (moderated for non-subscribers) L: alsa-devel@alsa-project.org (moderated for non-subscribers)
S: Supported S: Supported
F: sound/soc/atmel F: sound/soc/atmel
......
...@@ -468,13 +468,13 @@ static struct snd_soc_dai_driver ak4642_dai = { ...@@ -468,13 +468,13 @@ static struct snd_soc_dai_driver ak4642_dai = {
.name = "ak4642-hifi", .name = "ak4642-hifi",
.playback = { .playback = {
.stream_name = "Playback", .stream_name = "Playback",
.channels_min = 1, .channels_min = 2,
.channels_max = 2, .channels_max = 2,
.rates = SNDRV_PCM_RATE_8000_48000, .rates = SNDRV_PCM_RATE_8000_48000,
.formats = SNDRV_PCM_FMTBIT_S16_LE }, .formats = SNDRV_PCM_FMTBIT_S16_LE },
.capture = { .capture = {
.stream_name = "Capture", .stream_name = "Capture",
.channels_min = 1, .channels_min = 2,
.channels_max = 2, .channels_max = 2,
.rates = SNDRV_PCM_RATE_8000_48000, .rates = SNDRV_PCM_RATE_8000_48000,
.formats = SNDRV_PCM_FMTBIT_S16_LE }, .formats = SNDRV_PCM_FMTBIT_S16_LE },
......
...@@ -561,10 +561,10 @@ static int cs4271_codec_probe(struct snd_soc_codec *codec) ...@@ -561,10 +561,10 @@ static int cs4271_codec_probe(struct snd_soc_codec *codec)
if (gpio_is_valid(cs4271->gpio_nreset)) { if (gpio_is_valid(cs4271->gpio_nreset)) {
/* Reset codec */ /* Reset codec */
gpio_direction_output(cs4271->gpio_nreset, 0); gpio_direction_output(cs4271->gpio_nreset, 0);
udelay(1); mdelay(1);
gpio_set_value(cs4271->gpio_nreset, 1); gpio_set_value(cs4271->gpio_nreset, 1);
/* Give the codec time to wake up */ /* Give the codec time to wake up */
udelay(1); mdelay(1);
} }
ret = regmap_update_bits(cs4271->regmap, CS4271_MODE2, ret = regmap_update_bits(cs4271->regmap, CS4271_MODE2,
......
...@@ -425,18 +425,8 @@ static int davinci_evm_probe(struct platform_device *pdev) ...@@ -425,18 +425,8 @@ static int davinci_evm_probe(struct platform_device *pdev)
return ret; return ret;
} }
static int davinci_evm_remove(struct platform_device *pdev)
{
struct snd_soc_card *card = platform_get_drvdata(pdev);
snd_soc_unregister_card(card);
return 0;
}
static struct platform_driver davinci_evm_driver = { static struct platform_driver davinci_evm_driver = {
.probe = davinci_evm_probe, .probe = davinci_evm_probe,
.remove = davinci_evm_remove,
.driver = { .driver = {
.name = "davinci_evm", .name = "davinci_evm",
.pm = &snd_soc_pm_ops, .pm = &snd_soc_pm_ops,
......
...@@ -149,16 +149,29 @@ char *rsnd_mod_dma_name(struct rsnd_mod *mod) ...@@ -149,16 +149,29 @@ char *rsnd_mod_dma_name(struct rsnd_mod *mod)
return mod->ops->dma_name(mod); return mod->ops->dma_name(mod);
} }
void rsnd_mod_init(struct rsnd_mod *mod, int rsnd_mod_init(struct rsnd_mod *mod,
struct rsnd_mod_ops *ops, struct rsnd_mod_ops *ops,
struct clk *clk, struct clk *clk,
enum rsnd_mod_type type, enum rsnd_mod_type type,
int id) int id)
{ {
int ret = clk_prepare(clk);
if (ret)
return ret;
mod->id = id; mod->id = id;
mod->ops = ops; mod->ops = ops;
mod->type = type; mod->type = type;
mod->clk = clk; mod->clk = clk;
return ret;
}
void rsnd_mod_quit(struct rsnd_mod *mod)
{
if (mod->clk)
clk_unprepare(mod->clk);
} }
/* /*
...@@ -1290,6 +1303,12 @@ static int rsnd_remove(struct platform_device *pdev) ...@@ -1290,6 +1303,12 @@ static int rsnd_remove(struct platform_device *pdev)
{ {
struct rsnd_priv *priv = dev_get_drvdata(&pdev->dev); struct rsnd_priv *priv = dev_get_drvdata(&pdev->dev);
struct rsnd_dai *rdai; struct rsnd_dai *rdai;
void (*remove_func[])(struct platform_device *pdev,
struct rsnd_priv *priv) = {
rsnd_ssi_remove,
rsnd_src_remove,
rsnd_dvc_remove,
};
int ret = 0, i; int ret = 0, i;
pm_runtime_disable(&pdev->dev); pm_runtime_disable(&pdev->dev);
...@@ -1299,6 +1318,9 @@ static int rsnd_remove(struct platform_device *pdev) ...@@ -1299,6 +1318,9 @@ static int rsnd_remove(struct platform_device *pdev)
ret |= rsnd_dai_call(remove, &rdai->capture, priv); ret |= rsnd_dai_call(remove, &rdai->capture, priv);
} }
for (i = 0; i < ARRAY_SIZE(remove_func); i++)
remove_func[i](pdev, priv);
snd_soc_unregister_component(&pdev->dev); snd_soc_unregister_component(&pdev->dev);
snd_soc_unregister_platform(&pdev->dev); snd_soc_unregister_platform(&pdev->dev);
......
...@@ -333,7 +333,7 @@ int rsnd_dvc_probe(struct platform_device *pdev, ...@@ -333,7 +333,7 @@ int rsnd_dvc_probe(struct platform_device *pdev,
struct rsnd_dvc *dvc; struct rsnd_dvc *dvc;
struct clk *clk; struct clk *clk;
char name[RSND_DVC_NAME_SIZE]; char name[RSND_DVC_NAME_SIZE];
int i, nr; int i, nr, ret;
rsnd_of_parse_dvc(pdev, of_data, priv); rsnd_of_parse_dvc(pdev, of_data, priv);
...@@ -366,11 +366,24 @@ int rsnd_dvc_probe(struct platform_device *pdev, ...@@ -366,11 +366,24 @@ int rsnd_dvc_probe(struct platform_device *pdev,
dvc->info = &info->dvc_info[i]; dvc->info = &info->dvc_info[i];
rsnd_mod_init(&dvc->mod, &rsnd_dvc_ops, ret = rsnd_mod_init(&dvc->mod, &rsnd_dvc_ops,
clk, RSND_MOD_DVC, i); clk, RSND_MOD_DVC, i);
if (ret)
return ret;
dev_dbg(dev, "CMD%d probed\n", i); dev_dbg(dev, "CMD%d probed\n", i);
} }
return 0; return 0;
} }
void rsnd_dvc_remove(struct platform_device *pdev,
struct rsnd_priv *priv)
{
struct rsnd_dvc *dvc;
int i;
for_each_rsnd_dvc(dvc, priv, i) {
rsnd_mod_quit(&dvc->mod);
}
}
...@@ -260,14 +260,15 @@ struct rsnd_mod { ...@@ -260,14 +260,15 @@ struct rsnd_mod {
#define rsnd_dma_to_mod(_dma) container_of((_dma), struct rsnd_mod, dma) #define rsnd_dma_to_mod(_dma) container_of((_dma), struct rsnd_mod, dma)
#define rsnd_mod_to_io(mod) ((mod)->io) #define rsnd_mod_to_io(mod) ((mod)->io)
#define rsnd_mod_id(mod) ((mod)->id) #define rsnd_mod_id(mod) ((mod)->id)
#define rsnd_mod_hw_start(mod) clk_prepare_enable((mod)->clk) #define rsnd_mod_hw_start(mod) clk_enable((mod)->clk)
#define rsnd_mod_hw_stop(mod) clk_disable_unprepare((mod)->clk) #define rsnd_mod_hw_stop(mod) clk_disable((mod)->clk)
void rsnd_mod_init(struct rsnd_mod *mod, int rsnd_mod_init(struct rsnd_mod *mod,
struct rsnd_mod_ops *ops, struct rsnd_mod_ops *ops,
struct clk *clk, struct clk *clk,
enum rsnd_mod_type type, enum rsnd_mod_type type,
int id); int id);
void rsnd_mod_quit(struct rsnd_mod *mod);
char *rsnd_mod_name(struct rsnd_mod *mod); char *rsnd_mod_name(struct rsnd_mod *mod);
char *rsnd_mod_dma_name(struct rsnd_mod *mod); char *rsnd_mod_dma_name(struct rsnd_mod *mod);
...@@ -480,6 +481,8 @@ int rsnd_kctrl_new_e(struct rsnd_mod *mod, ...@@ -480,6 +481,8 @@ int rsnd_kctrl_new_e(struct rsnd_mod *mod,
int rsnd_src_probe(struct platform_device *pdev, int rsnd_src_probe(struct platform_device *pdev,
const struct rsnd_of_data *of_data, const struct rsnd_of_data *of_data,
struct rsnd_priv *priv); struct rsnd_priv *priv);
void rsnd_src_remove(struct platform_device *pdev,
struct rsnd_priv *priv);
struct rsnd_mod *rsnd_src_mod_get(struct rsnd_priv *priv, int id); struct rsnd_mod *rsnd_src_mod_get(struct rsnd_priv *priv, int id);
unsigned int rsnd_src_get_ssi_rate(struct rsnd_priv *priv, unsigned int rsnd_src_get_ssi_rate(struct rsnd_priv *priv,
struct rsnd_dai_stream *io, struct rsnd_dai_stream *io,
...@@ -498,6 +501,8 @@ int rsnd_src_ssi_irq_disable(struct rsnd_mod *ssi_mod); ...@@ -498,6 +501,8 @@ int rsnd_src_ssi_irq_disable(struct rsnd_mod *ssi_mod);
int rsnd_ssi_probe(struct platform_device *pdev, int rsnd_ssi_probe(struct platform_device *pdev,
const struct rsnd_of_data *of_data, const struct rsnd_of_data *of_data,
struct rsnd_priv *priv); struct rsnd_priv *priv);
void rsnd_ssi_remove(struct platform_device *pdev,
struct rsnd_priv *priv);
struct rsnd_mod *rsnd_ssi_mod_get(struct rsnd_priv *priv, int id); struct rsnd_mod *rsnd_ssi_mod_get(struct rsnd_priv *priv, int id);
int rsnd_ssi_is_pin_sharing(struct rsnd_mod *mod); int rsnd_ssi_is_pin_sharing(struct rsnd_mod *mod);
int rsnd_ssi_is_dma_mode(struct rsnd_mod *mod); int rsnd_ssi_is_dma_mode(struct rsnd_mod *mod);
......
...@@ -850,7 +850,7 @@ int rsnd_src_probe(struct platform_device *pdev, ...@@ -850,7 +850,7 @@ int rsnd_src_probe(struct platform_device *pdev,
struct rsnd_mod_ops *ops; struct rsnd_mod_ops *ops;
struct clk *clk; struct clk *clk;
char name[RSND_SRC_NAME_SIZE]; char name[RSND_SRC_NAME_SIZE];
int i, nr; int i, nr, ret;
ops = NULL; ops = NULL;
if (rsnd_is_gen1(priv)) if (rsnd_is_gen1(priv))
...@@ -890,10 +890,23 @@ int rsnd_src_probe(struct platform_device *pdev, ...@@ -890,10 +890,23 @@ int rsnd_src_probe(struct platform_device *pdev,
src->info = &info->src_info[i]; src->info = &info->src_info[i];
rsnd_mod_init(&src->mod, ops, clk, RSND_MOD_SRC, i); ret = rsnd_mod_init(&src->mod, ops, clk, RSND_MOD_SRC, i);
if (ret)
return ret;
dev_dbg(dev, "SRC%d probed\n", i); dev_dbg(dev, "SRC%d probed\n", i);
} }
return 0; return 0;
} }
void rsnd_src_remove(struct platform_device *pdev,
struct rsnd_priv *priv)
{
struct rsnd_src *src;
int i;
for_each_rsnd_src(src, priv, i) {
rsnd_mod_quit(&src->mod);
}
}
...@@ -697,7 +697,7 @@ int rsnd_ssi_probe(struct platform_device *pdev, ...@@ -697,7 +697,7 @@ int rsnd_ssi_probe(struct platform_device *pdev,
struct clk *clk; struct clk *clk;
struct rsnd_ssi *ssi; struct rsnd_ssi *ssi;
char name[RSND_SSI_NAME_SIZE]; char name[RSND_SSI_NAME_SIZE];
int i, nr; int i, nr, ret;
rsnd_of_parse_ssi(pdev, of_data, priv); rsnd_of_parse_ssi(pdev, of_data, priv);
...@@ -732,10 +732,23 @@ int rsnd_ssi_probe(struct platform_device *pdev, ...@@ -732,10 +732,23 @@ int rsnd_ssi_probe(struct platform_device *pdev,
else if (rsnd_ssi_pio_available(ssi)) else if (rsnd_ssi_pio_available(ssi))
ops = &rsnd_ssi_pio_ops; ops = &rsnd_ssi_pio_ops;
rsnd_mod_init(&ssi->mod, ops, clk, RSND_MOD_SSI, i); ret = rsnd_mod_init(&ssi->mod, ops, clk, RSND_MOD_SSI, i);
if (ret)
return ret;
rsnd_ssi_parent_clk_setup(priv, ssi); rsnd_ssi_parent_clk_setup(priv, ssi);
} }
return 0; return 0;
} }
void rsnd_ssi_remove(struct platform_device *pdev,
struct rsnd_priv *priv)
{
struct rsnd_ssi *ssi;
int i;
for_each_rsnd_ssi(ssi, priv, i) {
rsnd_mod_quit(&ssi->mod);
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment