Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1710218
| From | codekipper@gmail.com |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v3 01/11] ASoC: sun4i-i2s: Add clkdiv offsets to quirks |
| Date | 2017-08-12 13:10 +0200 |
| Message-ID | <udCsN-8m9-7@gated-at.bofh.it> (permalink) |
| References | <udCsN-8m9-3@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Marcus Cooper <codekipper@gmail.com>
The BCLKDIV and MCLKDIV found on newer SoCs start from an offset of 1.
Add the functionality to adjust the division values according to the
needs to the device being used.
Signed-off-by: Marcus Cooper <codekipper@gmail.com>
---
sound/soc/sunxi/sun4i-i2s.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
index d7ee7a443e4e..9a35313c4f9b 100644
--- a/sound/soc/sunxi/sun4i-i2s.c
+++ b/sound/soc/sunxi/sun4i-i2s.c
@@ -94,9 +94,13 @@
* struct sun4i_i2s_quirks - Differences between SoC variants.
*
* @has_reset: SoC needs reset deasserted.
+ * @mclk_offset: Value by which mclkdiv needs to be adjusted.
+ * @bclk_offset: Value by which bclkdiv needs to be adjusted.
*/
struct sun4i_i2s_quirks {
bool has_reset;
+ unsigned int mclk_offset;
+ unsigned int bclk_offset;
};
struct sun4i_i2s {
@@ -237,6 +241,10 @@ static int sun4i_i2s_set_clk_rate(struct sun4i_i2s *i2s,
if (mclk_div < 0)
return -EINVAL;
+ /* Adjust the clock division values if needed */
+ bclk_div += i2s->variant->bclk_offset;
+ mclk_div += i2s->variant->mclk_offset;
+
regmap_write(i2s->regmap, SUN4I_I2S_CLK_DIV_REG,
SUN4I_I2S_CLK_DIV_BCLK(bclk_div) |
SUN4I_I2S_CLK_DIV_MCLK(mclk_div) |
--
2.14.1
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v3 00/11] ASoC: Add I2S support for Allwinner H3 SoCs codekipper@gmail.com - 2017-08-12 13:10 +0200
[PATCH v3 10/11] ASoC: sun4i-i2s: Update global enable with bitmask codekipper@gmail.com - 2017-08-12 13:10 +0200
[PATCH v3 01/11] ASoC: sun4i-i2s: Add clkdiv offsets to quirks codekipper@gmail.com - 2017-08-12 13:10 +0200
Re: [linux-sunxi] [PATCH v3 01/11] ASoC: sun4i-i2s: Add clkdiv offsets to quirks Chen-Yu Tsai <wens@csie.org> - 2017-08-12 13:50 +0200
Applied "ASoC: sun4i-i2s: Add clkdiv offsets to quirks" to the asoc tree Mark Brown <broonie@kernel.org> - 2017-08-14 18:50 +0200
[PATCH v3 05/11] ASoC: sun4i-i2s: Add regfields for word size select and sample resolution codekipper@gmail.com - 2017-08-12 13:10 +0200
[PATCH v3 07/11] ASoC: sun4i-i2s: Add mclk enable regmap field codekipper@gmail.com - 2017-08-12 13:10 +0200
[PATCH v3 09/11] ASoC: sun4i-i2s: Check for slave select bit codekipper@gmail.com - 2017-08-12 13:10 +0200
[PATCH v3 04/11] ASoC: sun4i-i2s: Add regmap fields for channels codekipper@gmail.com - 2017-08-12 13:10 +0200
Re: [linux-sunxi] [PATCH v3 04/11] ASoC: sun4i-i2s: Add regmap fields for channels Chen-Yu Tsai <wens@csie.org> - 2017-08-12 14:10 +0200
[PATCH v3 08/11] ASoC: sun4i-i2s: Add regmap field to set DAI format codekipper@gmail.com - 2017-08-12 13:10 +0200
[PATCH v3 06/11] ASoC: sun4i-i2s: bclk and lrclk polarity tidyup codekipper@gmail.com - 2017-08-12 13:10 +0200
[PATCH v3 02/11] ASoC: sun4i-i2s: Add regmap config to quirks codekipper@gmail.com - 2017-08-12 13:10 +0200
[PATCH v3 11/11] ASoC: sun4i-i2s: Add support for H3 codekipper@gmail.com - 2017-08-12 13:10 +0200
Re: [linux-sunxi] [PATCH v3 11/11] ASoC: sun4i-i2s: Add support for H3 Chen-Yu Tsai <wens@csie.org> - 2017-08-12 14:30 +0200
Re: [linux-sunxi] [PATCH v3 11/11] ASoC: sun4i-i2s: Add support for H3 Code Kipper <codekipper@gmail.com> - 2017-08-15 09:30 +0200
csiph-web