summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/jz4770.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/jz4770.c')
-rw-r--r--sound/soc/codecs/jz4770.c28
1 files changed, 8 insertions, 20 deletions
diff --git a/sound/soc/codecs/jz4770.c b/sound/soc/codecs/jz4770.c
index 312202ab5cea..be1ecdcc737b 100644
--- a/sound/soc/codecs/jz4770.c
+++ b/sound/soc/codecs/jz4770.c
@@ -179,7 +179,6 @@ struct jz_codec {
struct device *dev;
struct regmap *regmap;
void __iomem *base;
- struct clk *clk;
};
static int jz4770_codec_set_bias_level(struct snd_soc_component *codec,
@@ -217,7 +216,7 @@ static int jz4770_codec_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
struct snd_soc_component *codec = dai->component;
- struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(codec);
+ struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(codec);
/*
* SYSCLK output from the codec to the AIC is required to keep the
@@ -234,7 +233,7 @@ static void jz4770_codec_shutdown(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
struct snd_soc_component *codec = dai->component;
- struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(codec);
+ struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(codec);
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
snd_soc_dapm_disable_pin(dapm, "SYSCLK");
@@ -245,6 +244,7 @@ static int jz4770_codec_pcm_trigger(struct snd_pcm_substream *substream,
int cmd, struct snd_soc_dai *dai)
{
struct snd_soc_component *codec = dai->component;
+ struct snd_soc_dapm_context *dapm = snd_soc_component_to_dapm(codec);
int ret = 0;
switch (cmd) {
@@ -252,8 +252,7 @@ static int jz4770_codec_pcm_trigger(struct snd_pcm_substream *substream,
case SNDRV_PCM_TRIGGER_RESUME:
case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK)
- snd_soc_component_force_bias_level(codec,
- SND_SOC_BIAS_ON);
+ snd_soc_dapm_force_bias_level(dapm, SND_SOC_BIAS_ON);
break;
case SNDRV_PCM_TRIGGER_STOP:
case SNDRV_PCM_TRIGGER_SUSPEND:
@@ -634,25 +633,13 @@ static void jz4770_codec_codec_init_regs(struct snd_soc_component *codec)
static int jz4770_codec_codec_probe(struct snd_soc_component *codec)
{
- struct jz_codec *jz_codec = snd_soc_component_get_drvdata(codec);
-
- clk_prepare_enable(jz_codec->clk);
-
jz4770_codec_codec_init_regs(codec);
return 0;
}
-static void jz4770_codec_codec_remove(struct snd_soc_component *codec)
-{
- struct jz_codec *jz_codec = snd_soc_component_get_drvdata(codec);
-
- clk_disable_unprepare(jz_codec->clk);
-}
-
static const struct snd_soc_component_driver jz4770_codec_soc_codec_dev = {
.probe = jz4770_codec_codec_probe,
- .remove = jz4770_codec_codec_remove,
.set_bias_level = jz4770_codec_set_bias_level,
.controls = jz4770_codec_snd_controls,
.num_controls = ARRAY_SIZE(jz4770_codec_snd_controls),
@@ -865,6 +852,7 @@ static int jz4770_codec_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
struct jz_codec *codec;
+ struct clk *clk;
int ret;
codec = devm_kzalloc(dev, sizeof(*codec), GFP_KERNEL);
@@ -882,9 +870,9 @@ static int jz4770_codec_probe(struct platform_device *pdev)
if (IS_ERR(codec->regmap))
return PTR_ERR(codec->regmap);
- codec->clk = devm_clk_get(dev, "aic");
- if (IS_ERR(codec->clk))
- return PTR_ERR(codec->clk);
+ clk = devm_clk_get_enabled(dev, "aic");
+ if (IS_ERR(clk))
+ return PTR_ERR(clk);
platform_set_drvdata(pdev, codec);