kirkwood-i2s.c (9e12cbd93232c20544d16aa33c587786a6cb726d) kirkwood-i2s.c (8a537f85e9db8a43b323b0ffcf358c51448491de)
1/*
2 * kirkwood-i2s.c
3 *
4 * (c) 2010 Arnaud Patard <apatard@mandriva.com>
5 * (c) 2010 Arnaud Patard <arnaud.patard@rtp-net.org>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the

--- 88 unchanged lines hidden (view full) ---

97}
98
99static void kirkwood_set_rate(struct snd_soc_dai *dai,
100 struct kirkwood_dma_data *priv, unsigned long rate)
101{
102 uint32_t clks_ctrl;
103
104 if (rate == 44100 || rate == 48000 || rate == 96000) {
1/*
2 * kirkwood-i2s.c
3 *
4 * (c) 2010 Arnaud Patard <apatard@mandriva.com>
5 * (c) 2010 Arnaud Patard <arnaud.patard@rtp-net.org>
6 *
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the

--- 88 unchanged lines hidden (view full) ---

97}
98
99static void kirkwood_set_rate(struct snd_soc_dai *dai,
100 struct kirkwood_dma_data *priv, unsigned long rate)
101{
102 uint32_t clks_ctrl;
103
104 if (rate == 44100 || rate == 48000 || rate == 96000) {
105 /* use internal dco for supported rates */
105 /* use internal dco for the supported rates
106 * defined in kirkwood_i2s_dai */
106 dev_dbg(dai->dev, "%s: dco set rate = %lu\n",
107 __func__, rate);
108 kirkwood_set_dco(priv->io, rate);
109
110 clks_ctrl = KIRKWOOD_MCLK_SOURCE_DCO;
107 dev_dbg(dai->dev, "%s: dco set rate = %lu\n",
108 __func__, rate);
109 kirkwood_set_dco(priv->io, rate);
110
111 clks_ctrl = KIRKWOOD_MCLK_SOURCE_DCO;
111 } else if (!IS_ERR(priv->extclk)) {
112 /* use optional external clk for other rates */
112 } else {
113 /* use the external clock for the other rates
114 * defined in kirkwood_i2s_dai_extclk */
113 dev_dbg(dai->dev, "%s: extclk set rate = %lu -> %lu\n",
114 __func__, rate, 256 * rate);
115 clk_set_rate(priv->extclk, 256 * rate);
116
117 clks_ctrl = KIRKWOOD_MCLK_SOURCE_EXTCLK;
118 }
119 writel(clks_ctrl, priv->io + KIRKWOOD_CLOCKS_CTRL);
120}

--- 438 unchanged lines hidden ---
115 dev_dbg(dai->dev, "%s: extclk set rate = %lu -> %lu\n",
116 __func__, rate, 256 * rate);
117 clk_set_rate(priv->extclk, 256 * rate);
118
119 clks_ctrl = KIRKWOOD_MCLK_SOURCE_EXTCLK;
120 }
121 writel(clks_ctrl, priv->io + KIRKWOOD_CLOCKS_CTRL);
122}

--- 438 unchanged lines hidden ---