From 98a4b665bc91480cc4c054093a59249e153ac17e Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Tue, 29 Sep 2015 21:43:17 +0200 Subject: ASoC: sun4i-codec: pass through clk_set_rate error The current code, disregarding the clk_set_rate error code, was always returning -EINVAL. Fix that and return the code in order to have more clue about what's going on. Signed-off-by: Maxime Ripard Signed-off-by: Mark Brown --- sound/soc/sunxi/sun4i-codec.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'sound') diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c index 8d59d83b5aa4..77408af5d38b 100644 --- a/sound/soc/sunxi/sun4i-codec.c +++ b/sound/soc/sunxi/sun4i-codec.c @@ -283,7 +283,7 @@ static int sun4i_codec_hw_params(struct snd_pcm_substream *substream, struct snd_soc_pcm_runtime *rtd = substream->private_data; struct sun4i_codec *scodec = snd_soc_card_get_drvdata(rtd->card); unsigned long clk_freq; - int hwrate; + int ret, hwrate; u32 val; if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK) @@ -293,8 +293,9 @@ static int sun4i_codec_hw_params(struct snd_pcm_substream *substream, if (!clk_freq) return -EINVAL; - if (clk_set_rate(scodec->clk_module, clk_freq)) - return -EINVAL; + ret = clk_set_rate(scodec->clk_module, clk_freq); + if (ret) + return ret; hwrate = sun4i_codec_get_hw_rate(params); if (hwrate < 0) -- cgit v1.2.3 From debb97248741597fa9f38f563f2b9a17250ee4c5 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Tue, 29 Sep 2015 21:43:18 +0200 Subject: ASoC: sun4i-codec: Remove redundant SND_PCM_RATE_KNOT The SND_PCM_RATE_KNOT covers all the rate settings, even though some that we don't support, while we also list all the rate we support. Simply remove it. Signed-off-by: Maxime Ripard Signed-off-by: Mark Brown --- sound/soc/sunxi/sun4i-codec.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'sound') diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c index 77408af5d38b..47780552dcd0 100644 --- a/sound/soc/sunxi/sun4i-codec.c +++ b/sound/soc/sunxi/sun4i-codec.c @@ -389,8 +389,7 @@ static struct snd_soc_dai_driver sun4i_codec_dai = { .rate_max = 192000, .rates = SNDRV_PCM_RATE_8000_48000 | SNDRV_PCM_RATE_96000 | - SNDRV_PCM_RATE_192000 | - SNDRV_PCM_RATE_KNOT, + SNDRV_PCM_RATE_192000, .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE, .sig_bits = 24, -- cgit v1.2.3 From c570b82c5e6ac78be35b4e72594c0f1b1888fce1 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Wed, 7 Oct 2015 11:59:58 +0100 Subject: ASoC: sun4i-codec: Remove the routing property Most of the boards have their headphone jack directly connected to the matching pins of the SoCs. Since most of the time we will have the same routing path, it makes no sense to put that in the DTS, since it will only be some useless duplication there. It also fixes the following warning messages that were seen so far, on boards where we were using the bindings in the documentation example. sun4i-codec 1c22c00.codec: ASoC: no sink widget found for Headphone Jack sun4i-codec 1c22c00.codec: ASoC: Failed to add route HP Left -> direct -> Headphone Jack sun4i-codec 1c22c00.codec: ASoC: no sink widget found for Headphone Jack sun4i-codec 1c22c00.codec: ASoC: Failed to add route HP Right -> direct -> Headphone Jack Reported-by: Priit Laes Signed-off-by: Maxime Ripard Signed-off-by: Mark Brown --- sound/soc/sunxi/sun4i-codec.c | 7 ------- 1 file changed, 7 deletions(-) (limited to 'sound') diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c index 47780552dcd0..bcbf4da168b6 100644 --- a/sound/soc/sunxi/sun4i-codec.c +++ b/sound/soc/sunxi/sun4i-codec.c @@ -571,7 +571,6 @@ static struct snd_soc_dai_link *sun4i_codec_create_link(struct device *dev, static struct snd_soc_card *sun4i_codec_create_card(struct device *dev) { struct snd_soc_card *card; - int ret; card = devm_kzalloc(dev, sizeof(*card), GFP_KERNEL); if (!card) @@ -584,12 +583,6 @@ static struct snd_soc_card *sun4i_codec_create_card(struct device *dev) card->dev = dev; card->name = "sun4i-codec"; - ret = snd_soc_of_parse_audio_routing(card, "routing"); - if (ret) { - dev_err(dev, "Failed to create our audio routing\n"); - return NULL; - } - return card; }; -- cgit v1.2.3 From ce7b8dbdded8552d1fd25cc9289da361c5cc765e Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Tue, 20 Oct 2015 16:54:46 +0800 Subject: ASoC: ssm2518: Drop .volatile_reg implementation The implementation of ssm2518_register_volatile always returns false, this behavior is the same as no .volatile_reg callback implementation when cache_type != REGCACHE_NONE. Signed-off-by: Axel Lin Acked-by: Lars-Peter Clausen Signed-off-by: Mark Brown --- sound/soc/codecs/ssm2518.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'sound') diff --git a/sound/soc/codecs/ssm2518.c b/sound/soc/codecs/ssm2518.c index ddb0203fc649..86b81a60ac52 100644 --- a/sound/soc/codecs/ssm2518.c +++ b/sound/soc/codecs/ssm2518.c @@ -723,17 +723,11 @@ static struct snd_soc_codec_driver ssm2518_codec_driver = { .num_dapm_routes = ARRAY_SIZE(ssm2518_routes), }; -static bool ssm2518_register_volatile(struct device *dev, unsigned int reg) -{ - return false; -} - static const struct regmap_config ssm2518_regmap_config = { .val_bits = 8, .reg_bits = 8, .max_register = SSM2518_REG_DRC_9, - .volatile_reg = ssm2518_register_volatile, .cache_type = REGCACHE_RBTREE, .reg_defaults = ssm2518_reg_defaults, -- cgit v1.2.3