summaryrefslogtreecommitdiffstats
path: root/sound/soc/samsung/odroid.c
diff options
context:
space:
mode:
authorTakashi Iwai2018-04-02 19:51:39 +0200
committerTakashi Iwai2018-04-02 19:51:39 +0200
commit903d271a3f83826ef810a4b5dbbd9842cf0465d6 (patch)
tree07fd60b1d7ad07ba36c82b2e83ece7c7eb6e6ce9 /sound/soc/samsung/odroid.c
parentMerge branch 'for-next' into for-linus (diff)
parentMerge remote-tracking branch 'asoc/topic/zx_aud96p22' into asoc-next (diff)
downloadkernel-qcow2-linux-903d271a3f83826ef810a4b5dbbd9842cf0465d6.tar.gz
kernel-qcow2-linux-903d271a3f83826ef810a4b5dbbd9842cf0465d6.tar.xz
kernel-qcow2-linux-903d271a3f83826ef810a4b5dbbd9842cf0465d6.zip
Merge tag 'asoc-v4.17' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Updates for v4.17 This is a *very* big release for ASoC. Not much change in the core but there s the transition of all the individual drivers over to components which is intended to support further core work. The goal is to make it easier to do further core work by removing the need to special case all the different driver classes in the core, many of the devices end up being used in multiple roles in modern systems. We also have quite a lot of new drivers added this month of all kinds, quite a few for simple devices but also some more advanced ones with more substantial code. - The biggest thing is the huge series from Morimoto-san which converted everything over to components. This is a huge change by code volume but was fairly mechanical - Many fixes for some of the Realtek based Baytrail systems covering both the CODECs and the CPUs, contributed by Hans de Goode. - Lots of cleanups for Samsung based Odroid systems from Sylwester Nawrocki. - The Freescale SSI driver also got a lot of cleanups from Nicolin Chen. - The Blackfin drivers have been removed as part of the removal of the architecture. - New drivers for AKM AK4458 and AK5558, several AMD based machines, several Intel based machines, Maxim MAX9759, Motorola CPCAP, Socionext Uniphier SoCs, and TI PCM1789 and TDA7419
Diffstat (limited to 'sound/soc/samsung/odroid.c')
-rw-r--r--sound/soc/samsung/odroid.c33
1 files changed, 12 insertions, 21 deletions
diff --git a/sound/soc/samsung/odroid.c b/sound/soc/samsung/odroid.c
index 44b6de5a331a..e7b371b07230 100644
--- a/sound/soc/samsung/odroid.c
+++ b/sound/soc/samsung/odroid.c
@@ -36,23 +36,24 @@ static int odroid_card_hw_params(struct snd_pcm_substream *substream,
{
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct odroid_priv *priv = snd_soc_card_get_drvdata(rtd->card);
- unsigned int pll_freq, rclk_freq;
+ unsigned int pll_freq, rclk_freq, rfs;
int ret;
switch (params_rate(params)) {
- case 32000:
case 64000:
- pll_freq = 131072006U;
+ pll_freq = 196608001U;
+ rfs = 384;
break;
case 44100:
case 88200:
- case 176400:
pll_freq = 180633609U;
+ rfs = 512;
break;
+ case 32000:
case 48000:
case 96000:
- case 192000:
pll_freq = 196608001U;
+ rfs = 512;
break;
default:
return -EINVAL;
@@ -67,7 +68,7 @@ static int odroid_card_hw_params(struct snd_pcm_substream *substream,
* frequency values due to the EPLL output frequency not being exact
* multiple of the audio sampling rate.
*/
- rclk_freq = params_rate(params) * 256 + 1;
+ rclk_freq = params_rate(params) * rfs + 1;
ret = clk_set_rate(priv->sclk_i2s, rclk_freq);
if (ret < 0)
@@ -90,18 +91,6 @@ static const struct snd_soc_ops odroid_card_ops = {
.hw_params = odroid_card_hw_params,
};
-static void odroid_put_codec_of_nodes(struct snd_soc_dai_link *link)
-{
- struct snd_soc_dai_link_component *component = link->codecs;
- int i;
-
- for (i = 0; i < link->num_codecs; i++, component++) {
- if (!component->of_node)
- break;
- of_node_put(component->of_node);
- }
-}
-
static int odroid_audio_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
@@ -196,7 +185,7 @@ err_put_sclk:
err_put_i2s_n:
of_node_put(link->cpu_of_node);
err_put_codec_n:
- odroid_put_codec_of_nodes(link);
+ snd_soc_of_put_dai_link_codecs(link);
return ret;
}
@@ -205,7 +194,7 @@ static int odroid_audio_remove(struct platform_device *pdev)
struct odroid_priv *priv = platform_get_drvdata(pdev);
of_node_put(priv->dai_link.cpu_of_node);
- odroid_put_codec_of_nodes(&priv->dai_link);
+ snd_soc_of_put_dai_link_codecs(&priv->dai_link);
clk_put(priv->sclk_i2s);
clk_put(priv->clk_i2s_bus);
@@ -213,8 +202,10 @@ static int odroid_audio_remove(struct platform_device *pdev)
}
static const struct of_device_id odroid_audio_of_match[] = {
+ { .compatible = "hardkernel,odroid-xu3-audio" },
+ { .compatible = "hardkernel,odroid-xu4-audio" },
{ .compatible = "samsung,odroid-xu3-audio" },
- { .compatible = "samsung,odroid-xu4-audio"},
+ { .compatible = "samsung,odroid-xu4-audio" },
{ },
};
MODULE_DEVICE_TABLE(of, odroid_audio_of_match);