Re: [PATCH 2/4] ASoC: sunxi: Add Allwinner A10 Digital Audio driver

2016-06-10 Thread Maxime Ripard
Hi Mark, On Fri, Jun 10, 2016 at 01:37:55AM +0100, Mark Brown wrote: > > > > +static int sun4i_i2s_dai_probe(struct snd_soc_dai *dai) > > > > +{ > > > > + struct sun4i_i2s *i2s = snd_soc_dai_get_drvdata(dai); > > > > > + /* Enable the whole hardware block */ > > > > + regmap_wri

Re: [PATCH 2/4] ASoC: sunxi: Add Allwinner A10 Digital Audio driver

2016-06-09 Thread Mark Brown
On Thu, Jun 09, 2016 at 11:05:15PM +0200, Maxime Ripard wrote: > On Thu, Jun 02, 2016 at 11:26:51AM +0100, Mark Brown wrote: > > > +static int sun4i_i2s_params_to_sr(struct snd_pcm_hw_params *params) > > > +{ > > > + switch (params_width(params)) { > > > + case 16: > > > + return 0; > > > +

Re: [PATCH 2/4] ASoC: sunxi: Add Allwinner A10 Digital Audio driver

2016-06-09 Thread Maxime Ripard
Hi Markus, On Thu, Jun 02, 2016 at 10:03:21AM +0200, Code Kipper wrote: > snip > > + > > + /* Always favor the highest oversampling rate */ > > + for (i = (ARRAY_SIZE(sun4i_i2s_oversample_rates) - 1); i >= 0; i--) > > { > > + unsigned int oversample_rate = > > sun4i_i2s

Re: [PATCH 2/4] ASoC: sunxi: Add Allwinner A10 Digital Audio driver

2016-06-09 Thread Maxime Ripard
Hi Mark, On Thu, Jun 02, 2016 at 11:26:51AM +0100, Mark Brown wrote: > > +static int sun4i_i2s_params_to_sr(struct snd_pcm_hw_params *params) > > +{ > > + switch (params_width(params)) { > > + case 16: > > + return 0; > > + } > > + > > + return -EINVAL; > > +} > > The switch sta

Re: [PATCH 2/4] ASoC: sunxi: Add Allwinner A10 Digital Audio driver

2016-06-02 Thread Mark Brown
On Wed, Jun 01, 2016 at 07:54:28PM +0200, Maxime Ripard wrote: > @@ -16,4 +25,5 @@ config SND_SUN4I_SPDIF > help > Say Y or M to add support for the S/PDIF audio block in the Allwinner > A10 and affiliated SoCs. > + > endmenu Unrelated whitespace change. > +static int sun4

Re: [PATCH 2/4] ASoC: sunxi: Add Allwinner A10 Digital Audio driver

2016-06-02 Thread Code Kipper
snip > + > + /* Always favor the highest oversampling rate */ > + for (i = (ARRAY_SIZE(sun4i_i2s_oversample_rates) - 1); i >= 0; i--) { > + unsigned int oversample_rate = sun4i_i2s_oversample_rates[i]; > + > + bclk_div = sun4i_i2s_get_bclk_div(i2s, oversample

[PATCH 2/4] ASoC: sunxi: Add Allwinner A10 Digital Audio driver

2016-06-01 Thread Maxime Ripard
The Allwinner A10 and later come with a hardware block that used for the PCM and I2S interfaces. Add a driver for it in ASoC. Signed-off-by: Maxime Ripard --- sound/soc/sunxi/Kconfig | 10 + sound/soc/sunxi/Makefile| 2 +- sound/soc/sunxi/sun4i-i2s.c | 714 +++