Re: [linux-sunxi] [PATCH] arm64: dts: allwinner: h6: orangepi-one-plus: Fix ethernet

2020-11-01 Thread Code Kipper
On Sun, 1 Nov 2020 at 08:20, Jernej Skrabec  wrote:
>
> RX/TX delay on OrangePi One Plus board is set on PHY. Reflect that in
> ethernet node.
>
> Fixes: 7ee32a17e0d6 ("arm64: dts: allwinner: h6: orangepi-one-plus: Enable 
> ethernet")
> Signed-off-by: Jernej Skrabec 
Hi Jernej,
Tested-by: Marcus Cooper 
BR,
CK
> ---
>  arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-one-plus.dts | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-one-plus.dts 
> b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-one-plus.dts
> index fceb298bfd53..29a081e72a9b 100644
> --- a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-one-plus.dts
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-one-plus.dts
> @@ -27,7 +27,7 @@ reg_gmac_3v3: gmac-3v3 {
>  &emac {
> pinctrl-names = "default";
> pinctrl-0 = <&ext_rgmii_pins>;
> -   phy-mode = "rgmii";
> +   phy-mode = "rgmii-id";
> phy-handle = <&ext_rgmii_phy>;
> phy-supply = <®_gmac_3v3>;
> allwinner,rx-delay-ps = <200>;
> --
> 2.29.2
>
> --
> You received this message because you are subscribed to the Google Groups 
> "linux-sunxi" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to linux-sunxi+unsubscr...@googlegroups.com.
> To view this discussion on the web, visit 
> https://groups.google.com/d/msgid/linux-sunxi/20201101072609.1681891-1-jernej.skrabec%40siol.net.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/CAEKpxB%3Do1qh4b%2B5KPnP51dYMb4YmpuaKixgt5nZ7CfL%3DA46wzQ%40mail.gmail.com.


Re: [linux-sunxi] sun8i-r40 spi3 node different from BSP

2020-03-11 Thread Code Kipper
Good catchSPI2 is also wrong they should be

spi2: spi@1c17000 and spi3: spi@1c1f000
CK

On Tue, 10 Mar 2020 at 13:08, JuanEsf  wrote:
>
> Hello along with greeting, I wish you good morning.
> In kernel 5.6-rc5 the SPI nodes in R40 SoC have been added,
> But the SPI3 node in mainline 
> (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/sun8i-r40.dtsi?h=v5.6-rc5#n695)
>  is different from BSP 
> (https://github.com/BPI-SINOVOIP/BPI-M2U-bsp/blob/master/linux-sunxi/arch/arm/boot/dts/sun8iw11p1.dtsi#L672)
>  which is assigned to mmc0 
> (https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/sun8i-r40.dtsi?h=v5.6-rc5#n198)
>  and 
> (https://github.com/BPI-SINOVOIP/BPI-M2U-bsp/blob/master/linux-sunxi/arch/arm/boot/dts/sun8iw11p1.dtsi#L923).
>
> --
> You received this message because you are subscribed to the Google Groups 
> "linux-sunxi" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to linux-sunxi+unsubscr...@googlegroups.com.
> To view this discussion on the web, visit 
> https://groups.google.com/d/msgid/linux-sunxi/d96aa907-c215-4e41-a88b-f5cd80d0780d%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/CAEKpxBnJiR8WSZvaz32V4Ofi_sNkz%3DU4qwyfm0tBQ%3Dv2jQZXZw%40mail.gmail.com.


[linux-sunxi] Re: [PATCH v6 1/7] ASoC: sun4i-i2s: Move channel select offset

2019-10-16 Thread Code Kipper
On Wed, 16 Oct 2019 at 10:04, Maxime Ripard  wrote:
>
> On Wed, Oct 16, 2019 at 09:07:34AM +0200, codekip...@gmail.com wrote:
> > From: Marcus Cooper 
> >
> > On the newer SoCs the offset is used to set the mode of the
> > connection. As it is to be used elsewhere then it makes sense
> > to move it to the main structure.
>
> Elsewhere where, and to do what?
Thanks...How does this sound?

As it is to be used to set the same offset for each TX data channel in use
during multi-channel audio then let's move it to the main structure.

BR,
CK
>
> Maxime

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/CAEKpxBmNCA4U8-X8iSwOxBZ7T3dp6352S2Kfxc6f5E4N671zvg%40mail.gmail.com.


[linux-sunxi] Re: [PATCH v6 2/7] ASoC: sun4i-i2s: Add functions for RX and TX channel offsets

2019-10-16 Thread Code Kipper
On Wed, 16 Oct 2019 at 10:06, Maxime Ripard  wrote:
>
> Hi,
>
> On Wed, Oct 16, 2019 at 09:07:35AM +0200, codekip...@gmail.com wrote:
> > From: Marcus Cooper 
> >
> > Newer SoCs like the H6 have the channel offset bits in a different
> > position to what is on the H3. As we will eventually add multi-
> > channel support then create function calls as opposed to regmap
> > fields to add support for different devices.
> >
> > Signed-off-by: Marcus Cooper 
> > ---
> >  sound/soc/sunxi/sun4i-i2s.c | 31 +--
> >  1 file changed, 25 insertions(+), 6 deletions(-)
> >
> > diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
> > index f1a80973c450..875567881f30 100644
> > --- a/sound/soc/sunxi/sun4i-i2s.c
> > +++ b/sound/soc/sunxi/sun4i-i2s.c
> > @@ -157,6 +157,8 @@ struct sun4i_i2s_quirks {
> >   int (*set_chan_cfg)(const struct sun4i_i2s *,
> >   const struct snd_pcm_hw_params *);
> >   int (*set_fmt)(struct sun4i_i2s *, unsigned int);
> > + void(*set_txchanoffset)(const struct sun4i_i2s *, int);
> > + void(*set_rxchanoffset)(const struct sun4i_i2s *);
>
> The point of removing the regmap_field was that because having a
> one-size-fits-all function with regmap_field sort of making the
> abstraction was becoming more and more of a burden to maintain.
>
> Having functions for each and every register access is exactly the
> same as using regmap_field here, and the issue we adressed is not with
> regmap_fields in itself.
>
> If the H6 has a different register layout, then so be it, create a new
> set_chan_cfg or set_fmt function for the H6.
The H3 and the H6 have a similar register layout but the issue here is
that sooner
rather than later we would want to be supporting multi-channel audio
which requires the
offset to be applied to each TX channel channel select register(8chan
PCM for HDMI
requires 4 Tx channels). Currently we're only using one.
BR,
CK
>
> Maxime

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/CAEKpxBmuYe-kHpa4cvo6iabTM_qNro2hXVAkjioBZFt9N4pHdA%40mail.gmail.com.


[linux-sunxi] Re: [PATCH] ASoC: sun4i-i2s: incorrect regmap for A83t

2019-09-02 Thread Code Kipper
On Fri, 30 Aug 2019 at 13:45, Mark Brown  wrote:
>
> On Wed, Aug 21, 2019 at 06:23:20PM +0200, codekip...@gmail.com wrote:
> > From: Marcus Cooper 
> >
> > Fixes: 21faaea1343f ("ASoC: sun4i-i2s: Add support for A83T")
> > Signed-off-by: Marcus Cooper 
> > ---
>
> This doesn't apply against current code, please check and resend.
This patch is no longer valid and the fix has been done through the reverts,
BR,
CK

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/CAEKpxB%3DBnQNraPmTtqj0KWi982OWe0bGQ-6F4N5owPH_OX67%3DA%40mail.gmail.com.


[linux-sunxi] Re: [PATCH v6 2/3] ASoC: sun4i-i2s: Add regmap field to sign extend sample

2019-08-27 Thread Code Kipper
On Tue, 27 Aug 2019 at 11:34, Maxime Ripard  wrote:
>
> On Mon, Aug 26, 2019 at 08:07:33PM +0200, codekip...@gmail.com wrote:
> > From: Marcus Cooper 
> >
> > On the newer SoCs such as the H3 and A64 this is set by default
> > to transfer a 0 after each sample in each slot. However the A10
> > and A20 SoCs that this driver was developed on had a default
> > setting where it padded the audio gain with zeros.
> >
> > This isn't a problem whilst we have only support for 16bit audio
> > but with larger sample resolution rates in the pipeline then SEXT
> > bits should be cleared so that they also pad at the LSB. Without
> > this the audio gets distorted.
> >
> > Signed-off-by: Marcus Cooper 
>
> If anything, I'd like to have less regmap_fields rather than more of
> them. This is pretty easy to add to one of the callbacks, especially
> since the field itself has been completely reworked from one
> generation to the other.
>
ACK
That's fineI've been doing that with the patches which follow this.
CK
> Maxime
>
> --
> Maxime Ripard, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/CAEKpxBmpNk%3DQPnOqCX7cWCV8qvxqhgEVT2AWhwGUmFMRyoF50g%40mail.gmail.com.


[linux-sunxi] Re: [PATCH v6 3/3] ASoC: sun4i-i2s: Adjust LRCLK width

2019-08-27 Thread Code Kipper
On Tue, 27 Aug 2019 at 09:01, Maxime Ripard  wrote:
>
> On Mon, Aug 26, 2019 at 08:07:34PM +0200, codekip...@gmail.com wrote:
> > From: Marcus Cooper 
> >
> > Some codecs such as i2s based HDMI audio and the Pine64 DAC require
> > a different amount of bit clocks per frame than what is calculated
> > by the sample width. Use the values obtained by the tdm slot bindings
> > to adjust the LRCLK width accordingly.
> >
> > Signed-off-by: Marcus Cooper 
> > ---
> >  sound/soc/sunxi/sun4i-i2s.c | 5 -
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> >
> > diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
> > index 056a299c03fb..0965a97c96e5 100644
> > --- a/sound/soc/sunxi/sun4i-i2s.c
> > +++ b/sound/soc/sunxi/sun4i-i2s.c
> > @@ -455,7 +455,10 @@ static int sun8i_i2s_set_chan_cfg(const struct 
> > sun4i_i2s *i2s,
> >   break;
> >
> >   case SND_SOC_DAIFMT_I2S:
> > - lrck_period = params_physical_width(params);
> > + if (i2s->slot_width)
> > + lrck_period = i2s->slot_width;
> > + else
> > + lrck_period = params_physical_width(params);
> >   break;
>
> That would be the case with the DSP formats too, right?

Maybebut I need a TDM test volunteer!,
CK
>
> Maxime
>
> --
> Maxime Ripard, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/CAEKpxBnCzC5hX%2Bb4UMPpKLzKyABZ0e07RwZvULfauphzC4x7%3DA%40mail.gmail.com.


Re: [linux-sunxi] [PATCH v6 1/3] ASoC: sun4i-i2s: incorrect regmap for A83T

2019-08-27 Thread Code Kipper
On Tue, 27 Aug 2019 at 10:01, Chen-Yu Tsai  wrote:
>
> On Tue, Aug 27, 2019 at 1:55 PM Code Kipper  wrote:
> >
> > On Tue, 27 Aug 2019 at 06:13, Chen-Yu Tsai  wrote:
> > >
> > > On Tue, Aug 27, 2019 at 2:07 AM  wrote:
> > > >
> > > > From: Marcus Cooper 
> > > >
> > > > The regmap configuration is set up for the legacy block on the
> > > > A83T whereas it uses the new block with a larger register map.
> > >
> > > Looking at the code Allwinner previously released [1], that doesn't seem 
> > > to be
> > > the case. Keep in mind that the register map shown in the user manual is 
> > > for
> > > the TDM interface, which we don't actually support right now.
> >
> > Should it matter what we support right now?, the block according to the user
> > manual shows the bigger range. I don't have a A83T device and from what I
>
> There are a total of four I2S controllers on the A83T. Currently three of them
> are listed in the dtsi file, which are _not_ the one shown in the user manual.
> The one shown is the fourth one, which is the TDM controller.

The configuration for the A83T suggests that it's a mixture of old and
new which I don't
think is the case considering it was released around the same time as
the H3. There
is enough similarity between the blocks for it to still work. For
example on the H6
we referenced by mistake the H3 block and we still got audio (with
only slight distortion).
I would suggest to validate all of the i2s blocks we need to test
using the internal loopback
as that will also cover capture.

>
> It's not like we haven't seen this before. IIRC the A64 also had two variants
> of the I2S interface. The one coupled with the audio codec was different from
> the others.

Yes...but the i2s of the audio codec was documented in the audio codec
section. I've used
this device to ensure that I've not broken anything in the old block
with these new changes.

>
> > gather not many users do. But the compatible for the H3 has been removed
> > and replaced with the settings for the A83T which also has default settings 
> > in
> > registers further up than SUNXI_RXCHMAP.
>
> I'll sync up with Maxime on this.
>
> > >
> > > The file shows the base address as 0x01c22800, and the last defined 
> > > register
> > > is SUNXI_RXCHMAP at 0x3c.
> > >
> > > The I2S driver [2] also shows that it is the old register map size, but 
> > > with
> > > TX_FIFO and INT_STA swapped around. This might mean that it would need a
> > > separate regmap_config, as the read/write callbacks need to be changed to
> > > fit the swapped registers.
> > >
> > > Finally, the TDM driver [3], which matches the TDM section in the manual, 
> > > shows
> > > a larger register map.
> > >
> > > A83T is SUN8IW6, while SUN8IW7 refers to the H3.
> >
> > Since when have we trusted Allwinner code?, the TDM labelled block
> > clearly supports
>
> Since they haven't listed the I2S block in the user manual, so that is what we
> have to go by.
>
> The TDM section in the user manual only lists the block at 0x1c23000. The 
> memory
> map says DAUDIO-[012] for addresses 0x1c22000, 0x1c22400, 0x1c22800, and TDM 
> for
> address 0x1c23000. One would assume this meant these are somewhat different.
>
> > I2S. The biggest use case for this block is getting HDMI audio working
> > on the newer
>
> I understand that.
>
> > devices(LibreELEC nightlies has a user base of over 300) and I've tested 
> > this on
> > numerous set ups over the last couple of years.
>
> Tested on the H3, correct?

Yesbut only with the additional changes for multi-channel with my
LibreELEC build.
These changes I tested on my pine64 before pushing upstream.

>
> > Failing that reverting (3e9acd7ac693: "ASoC: sun4i-i2s: Remove
> > duplicated quirks structure")
> > would help.
>
> I'll take a look. IIRC it worked with the old layout, with the two registers
> swapped, playing standard 48 KHz / 16 bit audio when I added supported for
> the A83T. Then again maybe the stars were perfectly aligned. At the very least
> we could separate A83T and H3 as you suggested.

Thanks,
CK
>
> ChenYu
>
>
> > BR,
> > CK
> > >
> > > ChenYu
> > >
> > > [1] 
> > > https://github.com/allwinner-zh/linux-3.4-sunxi/blob/master/sound/soc/sunxi/hdmiaudio/sunxi-hdmipcm.h
> > > [2] 
> > > https://github.com/allwinner-zh/linux-3.4-sunxi/blob/maste

Re: [linux-sunxi] [PATCH v6 1/3] ASoC: sun4i-i2s: incorrect regmap for A83T

2019-08-26 Thread Code Kipper
On Tue, 27 Aug 2019 at 06:13, Chen-Yu Tsai  wrote:
>
> On Tue, Aug 27, 2019 at 2:07 AM  wrote:
> >
> > From: Marcus Cooper 
> >
> > The regmap configuration is set up for the legacy block on the
> > A83T whereas it uses the new block with a larger register map.
>
> Looking at the code Allwinner previously released [1], that doesn't seem to be
> the case. Keep in mind that the register map shown in the user manual is for
> the TDM interface, which we don't actually support right now.

Should it matter what we support right now?, the block according to the user
manual shows the bigger range. I don't have a A83T device and from what I
gather not many users do. But the compatible for the H3 has been removed
and replaced with the settings for the A83T which also has default settings in
registers further up than SUNXI_RXCHMAP.

>
> The file shows the base address as 0x01c22800, and the last defined register
> is SUNXI_RXCHMAP at 0x3c.
>
> The I2S driver [2] also shows that it is the old register map size, but with
> TX_FIFO and INT_STA swapped around. This might mean that it would need a
> separate regmap_config, as the read/write callbacks need to be changed to
> fit the swapped registers.
>
> Finally, the TDM driver [3], which matches the TDM section in the manual, 
> shows
> a larger register map.
>
> A83T is SUN8IW6, while SUN8IW7 refers to the H3.

Since when have we trusted Allwinner code?, the TDM labelled block
clearly supports
I2S. The biggest use case for this block is getting HDMI audio working
on the newer
devices(LibreELEC nightlies has a user base of over 300) and I've tested this on
numerous set ups over the last couple of years.

Failing that reverting (3e9acd7ac693: "ASoC: sun4i-i2s: Remove
duplicated quirks structure")
would help.

BR,
CK
>
> ChenYu
>
> [1] 
> https://github.com/allwinner-zh/linux-3.4-sunxi/blob/master/sound/soc/sunxi/hdmiaudio/sunxi-hdmipcm.h
> [2] 
> https://github.com/allwinner-zh/linux-3.4-sunxi/blob/master/sound/soc/sunxi/i2s0/sunxi-i2s0.h
> [3] 
> https://github.com/allwinner-zh/linux-3.4-sunxi/blob/master/sound/soc/sunxi/daudio0/sunxi-daudio0.h
>
> > Fixes: 21faaea1343f ("ASoC: sun4i-i2s: Add support for A83T")
> > Signed-off-by: Marcus Cooper 
> > ---
> >  sound/soc/sunxi/sun4i-i2s.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
> > index 57bf2a33753e..34575a8aa9f6 100644
> > --- a/sound/soc/sunxi/sun4i-i2s.c
> > +++ b/sound/soc/sunxi/sun4i-i2s.c
> > @@ -1100,7 +1100,7 @@ static const struct sun4i_i2s_quirks 
> > sun6i_a31_i2s_quirks = {
> >  static const struct sun4i_i2s_quirks sun8i_a83t_i2s_quirks = {
> > .has_reset  = true,
> > .reg_offset_txdata  = SUN8I_I2S_FIFO_TX_REG,
> > -   .sun4i_i2s_regmap   = &sun4i_i2s_regmap_config,
> > +   .sun4i_i2s_regmap   = &sun8i_i2s_regmap_config,
> > .field_clkdiv_mclk_en   = REG_FIELD(SUN4I_I2S_CLK_DIV_REG, 8, 8),
> > .field_fmt_wss  = REG_FIELD(SUN4I_I2S_FMT0_REG, 0, 2),
> > .field_fmt_sr   = REG_FIELD(SUN4I_I2S_FMT0_REG, 4, 6),
> > --
> > 2.23.0
> >
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "linux-sunxi" group.
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to linux-sunxi+unsubscr...@googlegroups.com.
> > To view this discussion on the web, visit 
> > https://groups.google.com/d/msgid/linux-sunxi/20190826180734.15801-2-codekipper%40gmail.com.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/CAEKpxBmCg4AkqKM-O3C76gto%2BmPWyEdDbviAmRJ8PxLOOMTJ7w%40mail.gmail.com.


[linux-sunxi] Re: [PATCH v5 09/15] clk: sunxi-ng: h6: Allow I2S to change parent rate

2019-08-21 Thread Code Kipper
On Wed, 14 Aug 2019 at 08:09,  wrote:
>
> From: Jernej Skrabec 
>
> I2S doesn't work if parent rate couldn't be change. Difference between
> wanted and actual rate is too big.
>
> Fix this by adding CLK_SET_RATE_PARENT flag to I2S clocks.
>
> Signed-off-by: Jernej Skrabec 

Signed-off-by: Marcus Cooper 

> ---
>  drivers/clk/sunxi-ng/ccu-sun50i-h6.c | 8 
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/clk/sunxi-ng/ccu-sun50i-h6.c 
> b/drivers/clk/sunxi-ng/ccu-sun50i-h6.c
> index aebef4af9861..d89353a3cdec 100644
> --- a/drivers/clk/sunxi-ng/ccu-sun50i-h6.c
> +++ b/drivers/clk/sunxi-ng/ccu-sun50i-h6.c
> @@ -505,7 +505,7 @@ static struct ccu_div i2s3_clk = {
> .hw.init= CLK_HW_INIT_PARENTS("i2s3",
>   audio_parents,
>   &ccu_div_ops,
> - 0),
> + CLK_SET_RATE_PARENT),
> },
>  };
>
> @@ -518,7 +518,7 @@ static struct ccu_div i2s0_clk = {
> .hw.init= CLK_HW_INIT_PARENTS("i2s0",
>   audio_parents,
>   &ccu_div_ops,
> - 0),
> + CLK_SET_RATE_PARENT),
> },
>  };
>
> @@ -531,7 +531,7 @@ static struct ccu_div i2s1_clk = {
> .hw.init= CLK_HW_INIT_PARENTS("i2s1",
>   audio_parents,
>   &ccu_div_ops,
> - 0),
> + CLK_SET_RATE_PARENT),
> },
>  };
>
> @@ -544,7 +544,7 @@ static struct ccu_div i2s2_clk = {
> .hw.init= CLK_HW_INIT_PARENTS("i2s2",
>   audio_parents,
>   &ccu_div_ops,
> - 0),
> + CLK_SET_RATE_PARENT),
> },
>  };
>
> --
> 2.22.0
>

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/CAEKpxB%3D9NNoZgZoY_GpcEuDYoMUGzb%2BATgZOSM64qy9tirC_MQ%40mail.gmail.com.


Re: [linux-sunxi] [PATCH v5 09/15] clk: sunxi-ng: h6: Allow I2S to change parent rate

2019-08-20 Thread Code Kipper
ThanksI've added to my next patch series but if you could add it
when applying that would be great.
BR,
CK

On Wed, 21 Aug 2019 at 06:07, Chen-Yu Tsai  wrote:
>
> On Wed, Aug 14, 2019 at 2:09 PM  wrote:
> >
> > From: Jernej Skrabec 
> >
> > I2S doesn't work if parent rate couldn't be change. Difference between
> > wanted and actual rate is too big.
> >
> > Fix this by adding CLK_SET_RATE_PARENT flag to I2S clocks.
> >
> > Signed-off-by: Jernej Skrabec 
>
> This lacks your SoB. Please reply and I can add it when applying.
>
> ChenYu

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/CAEKpxBnxf%3Diejk887A7qFkzt3BXVxiRS1PeA45aZYR9DsBAU4Q%40mail.gmail.com.


[linux-sunxi] Re: [PATCH v5 02/15] ASoC: sun4i-i2s: Add set_tdm_slot functionality

2019-08-15 Thread Code Kipper
On Wed, 14 Aug 2019 at 13:08, Maxime Ripard  wrote:
>
> Hi,
>
> On Wed, Aug 14, 2019 at 08:08:41AM +0200, codekip...@gmail.com wrote:
> > From: Marcus Cooper 
> >
> > Codecs without a control connection such as i2s based HDMI audio and
> > the Pine64 DAC require a different amount of bit clocks per frame than
> > what is calculated by the sample width. Use the tdm slot bindings to
> > provide this mechanism.
> >
> > Signed-off-by: Marcus Cooper 
> > ---
> >  sound/soc/sunxi/sun4i-i2s.c | 23 +--
> >  1 file changed, 21 insertions(+), 2 deletions(-)
> >
> > diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
> > index 8201334a059b..7c37b6291df0 100644
> > --- a/sound/soc/sunxi/sun4i-i2s.c
> > +++ b/sound/soc/sunxi/sun4i-i2s.c
> > @@ -195,6 +195,9 @@ struct sun4i_i2s {
> >   struct regmap_field *field_rxchansel;
> >
> >   const struct sun4i_i2s_quirks   *variant;
> > +
> > + unsigned inttdm_slots;
> > + unsigned intslot_width;
> >  };
> >
> >  struct sun4i_i2s_clk_div {
> > @@ -346,7 +349,7 @@ static int sun4i_i2s_set_clk_rate(struct snd_soc_dai 
> > *dai,
> >   if (i2s->variant->has_fmt_set_lrck_period)
> >   regmap_update_bits(i2s->regmap, SUN4I_I2S_FMT0_REG,
> >  SUN8I_I2S_FMT0_LRCK_PERIOD_MASK,
> > -SUN8I_I2S_FMT0_LRCK_PERIOD(32));
> > +SUN8I_I2S_FMT0_LRCK_PERIOD(word_size));
> >
> >
> >   /* Set sign extension to pad out LSB with 0 */
> >   regmap_field_write(i2s->field_fmt_sext, 0);
> > @@ -450,7 +453,8 @@ static int sun4i_i2s_hw_params(struct snd_pcm_substream 
> > *substream,
> >   regmap_field_write(i2s->field_fmt_sr, sr);
> >
> >   return sun4i_i2s_set_clk_rate(dai, params_rate(params),
> > -   params_width(params));
> > +   i2s->tdm_slots ?
> > +   i2s->slot_width : params_width(params));
>
> This is slightly more complicated than that.

At this point we're only supporting 2 channels with fixed slot
settings. I've added a comment to state
that we're using the tdm_slot at the moment as an indicator to
override the slot width. Do you think
that is enough for now?.

Thanks,
CK
>
> On the H3 (and all related ones), the CHAN_CFG_TX_SLOT_NUM and
> _RX_SLOT_NUM fields in the CHAN_CFG register need to be set to the
> number of slots as well.
>
> Maxime
>
> --
> Maxime Ripard, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/CAEKpxBkOu0%2Bzek9f%3D4grNEhyPS%3DLy3nweCUCgaz6y8M61xvpaQ%40mail.gmail.com.


[linux-sunxi] Re: [PATCH v5 02/15] ASoC: sun4i-i2s: Add set_tdm_slot functionality

2019-08-15 Thread Code Kipper
On Wed, 14 Aug 2019 at 11:30, Mark Brown  wrote:
>
> On Wed, Aug 14, 2019 at 08:08:41AM +0200, codekip...@gmail.com wrote:
> > From: Marcus Cooper 
> >
> > Codecs without a control connection such as i2s based HDMI audio and
> > the Pine64 DAC require a different amount of bit clocks per frame than
>
> This isn't a universal property of CODECs without a control, and it's
> something that CODECs with control can require too.

ACK
>
> >   return sun4i_i2s_set_clk_rate(dai, params_rate(params),
> > -   params_width(params));
> > +   i2s->tdm_slots ?
> > +   i2s->slot_width : params_width(params));
>
> Please write normal conditional statements unless there's a strong
> reason to do otherwise, it makes things more legible.
ACK
>
> > +static int sun4i_i2s_set_dai_tdm_slot(struct snd_soc_dai *dai,
> > +   unsigned int tx_mask,
> > +   unsigned int rx_mask,
> > +   int slots, int width)
> > +{
> > + struct sun4i_i2s *i2s = snd_soc_dai_get_drvdata(dai);
> > +
> > + i2s->tdm_slots = slots;
> > +
> > + i2s->slot_width = width;
> > +
> > + return 0;
> > +}
>
> No validation of the parameters here?
ACK
Thanks,
CK

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/CAEKpxBkbuQZ9-XLCOcWxV5gzyXPbASmBgYVJ6fL5yj98GE0f9w%40mail.gmail.com.


[linux-sunxi] Re: [PATCH v5 01/15] ASoC: sun4i-i2s: Add regmap field to sign extend sample

2019-08-14 Thread Code Kipper
On Wed, 14 Aug 2019 at 13:08, Maxime Ripard  wrote:
>
> Hi,
>
> On Wed, Aug 14, 2019 at 08:08:40AM +0200, codekip...@gmail.com wrote:
> > From: Marcus Cooper 
> >
> > On the newer SoCs such as the H3 and A64 this is set by default
> > to transfer a 0 after each sample in each slot. However the A10
> > and A20 SoCs that this driver was developed on had a default
> > setting where it padded the audio gain with zeros.
> >
> > This isn't a problem whilst we have only support for 16bit audio
> > but with larger sample resolution rates in the pipeline then SEXT
> > bits should be cleared so that they also pad at the LSB. Without
> > this the audio gets distorted.
> >
> > Signed-off-by: Marcus Cooper 
> > ---
> >  sound/soc/sunxi/sun4i-i2s.c | 16 
> >  1 file changed, 16 insertions(+)
> >
> > diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
> > index 793457394efe..8201334a059b 100644
> > --- a/sound/soc/sunxi/sun4i-i2s.c
> > +++ b/sound/soc/sunxi/sun4i-i2s.c
> > @@ -135,6 +135,7 @@ struct sun4i_i2s;
> >   * @field_fmt_bclk: regmap field to set clk polarity.
> >   * @field_fmt_lrclk: regmap field to set frame polarity.
> >   * @field_fmt_mode: regmap field to set the operational mode.
> > + * @field_fmt_sext: regmap field to set the sign extension.
> >   * @field_txchanmap: location of the tx channel mapping register.
> >   * @field_rxchanmap: location of the rx channel mapping register.
> >   * @field_txchansel: location of the tx channel select bit fields.
> > @@ -159,6 +160,7 @@ struct sun4i_i2s_quirks {
> >   struct reg_fieldfield_fmt_bclk;
> >   struct reg_fieldfield_fmt_lrclk;
> >   struct reg_fieldfield_fmt_mode;
> > + struct reg_fieldfield_fmt_sext;
> >   struct reg_fieldfield_txchanmap;
> >   struct reg_fieldfield_rxchanmap;
> >   struct reg_fieldfield_txchansel;
> > @@ -186,6 +188,7 @@ struct sun4i_i2s {
> >   struct regmap_field *field_fmt_bclk;
> >   struct regmap_field *field_fmt_lrclk;
> >   struct regmap_field *field_fmt_mode;
> > + struct regmap_field *field_fmt_sext;
> >   struct regmap_field *field_txchanmap;
> >   struct regmap_field *field_rxchanmap;
> >   struct regmap_field *field_txchansel;
> > @@ -345,6 +348,9 @@ static int sun4i_i2s_set_clk_rate(struct snd_soc_dai 
> > *dai,
> >  SUN8I_I2S_FMT0_LRCK_PERIOD_MASK,
> >  SUN8I_I2S_FMT0_LRCK_PERIOD(32));
> >
> > + /* Set sign extension to pad out LSB with 0 */
> > + regmap_field_write(i2s->field_fmt_sext, 0);
> > +
> >   return 0;
> >  }
> >
> > @@ -917,6 +923,7 @@ static const struct sun4i_i2s_quirks 
> > sun4i_a10_i2s_quirks = {
> >   .field_fmt_lrclk= REG_FIELD(SUN4I_I2S_FMT0_REG, 7, 7),
> >   .has_slave_select_bit   = true,
> >   .field_fmt_mode = REG_FIELD(SUN4I_I2S_FMT0_REG, 0, 1),
> > + .field_fmt_sext = REG_FIELD(SUN4I_I2S_FMT1_REG, 8, 8),
> >   .field_txchanmap= REG_FIELD(SUN4I_I2S_TX_CHAN_MAP_REG, 0, 31),
> >   .field_rxchanmap= REG_FIELD(SUN4I_I2S_RX_CHAN_MAP_REG, 0, 31),
> >   .field_txchansel= REG_FIELD(SUN4I_I2S_TX_CHAN_SEL_REG, 0, 2),
> > @@ -936,6 +943,7 @@ static const struct sun4i_i2s_quirks 
> > sun6i_a31_i2s_quirks = {
> >   .field_fmt_lrclk= REG_FIELD(SUN4I_I2S_FMT0_REG, 7, 7),
> >   .has_slave_select_bit   = true,
> >   .field_fmt_mode = REG_FIELD(SUN4I_I2S_FMT0_REG, 0, 1),
> > + .field_fmt_sext = REG_FIELD(SUN4I_I2S_FMT1_REG, 8, 8),
> >   .field_txchanmap= REG_FIELD(SUN4I_I2S_TX_CHAN_MAP_REG, 0, 31),
> >   .field_rxchanmap= REG_FIELD(SUN4I_I2S_RX_CHAN_MAP_REG, 0, 31),
> >   .field_txchansel= REG_FIELD(SUN4I_I2S_TX_CHAN_SEL_REG, 0, 2),
> > @@ -979,6 +987,7 @@ static const struct sun4i_i2s_quirks 
> > sun8i_h3_i2s_quirks = {
> >   .field_fmt_bclk = REG_FIELD(SUN4I_I2S_FMT0_REG, 7, 7),
> >   .field_fmt_lrclk= REG_FIELD(SUN4I_I2S_FMT0_REG, 19, 19),
> >   .field_fmt_mode = REG_FIELD(SUN4I_I2S_CTRL_REG, 4, 5),
> > + .field_fmt_sext = REG_FIELD(SUN4I_I2S_FMT1_REG, 4, 5),
> >   .field_txchanmap= REG_FIELD(SUN8I_I2S_TX_CHAN_MAP_REG, 0, 31),
> >   .field_rxchanmap= REG_FIELD(SUN8I_I2S_RX_CHAN_MAP_REG, 0, 31),
> >   .field_txchansel= REG_FIELD(SUN8I_I2S_TX_CHAN_SEL_REG, 0, 2),
> > @@ -998,6 +1007,7 @@ static const struct sun4i_i2s_quirks 
> > sun50i_a64_codec_i2s_quirks = {
> >   .field_fmt_bclk = REG_FIELD(SUN4I_I2S_FMT0_REG, 6, 6),
> >   .field_fmt_lrclk= REG_FIELD(SUN4I_I2S_FMT0_REG, 7, 7),
> >   .field_fmt_mode = REG_FIELD(SUN4I_I2S_FMT0_REG, 0, 1),
> > + .field_fmt_sext = REG_FIELD(SUN4I_I2S_FMT1_REG, 8, 8),
> >   .field_txchanmap= R

[linux-sunxi] Re: [PATCH v5 04/15] ASoC: sun4i-i2s: Support more formats on newer SoCs

2019-08-14 Thread Code Kipper
On Wed, 14 Aug 2019 at 13:08, Maxime Ripard  wrote:
>
> On Wed, Aug 14, 2019 at 08:08:43AM +0200, codekip...@gmail.com wrote:
> > From: Marcus Cooper 
> >
> > There is a need to support more formats on the newer SoCs(H3 and later).
> > Extend the formats supported to include DSP_A and DSP_B modes.
> >
> > Signed-off-by: Marcus Cooper 
> > ---
> >  sound/soc/sunxi/sun4i-i2s.c | 87 +++--
> >  1 file changed, 63 insertions(+), 24 deletions(-)
> >
> > diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
> > index 34f31439ae7b..3553c17318b0 100644
> > --- a/sound/soc/sunxi/sun4i-i2s.c
> > +++ b/sound/soc/sunxi/sun4i-i2s.c
> > @@ -27,6 +27,8 @@
> >  #define SUN4I_I2S_CTRL_MODE_MASK BIT(5)
> >  #define SUN4I_I2S_CTRL_MODE_SLAVE(1 << 5)
> >  #define SUN4I_I2S_CTRL_MODE_MASTER   (0 << 5)
> > +#define SUN4I_I2S_CTRL_PCM   BIT(4)
> > +#define SUN4I_I2S_CTRL_LOOP  BIT(3)
> >  #define SUN4I_I2S_CTRL_TX_EN BIT(2)
> >  #define SUN4I_I2S_CTRL_RX_EN BIT(1)
> >  #define SUN4I_I2S_CTRL_GL_EN BIT(0)
> > @@ -91,6 +93,9 @@
> >  /* Defines required for sun8i-h3 support */
> >  #define SUN8I_I2S_CTRL_BCLK_OUT  BIT(18)
> >  #define SUN8I_I2S_CTRL_LRCK_OUT  BIT(17)
> > +#define SUN8I_I2S_CTRL_MODE_RIGHT_J  (2 << 0)
> > +#define SUN8I_I2S_CTRL_MODE_I2S_LEFT_J   (1 << 0)
> > +#define SUN8I_I2S_CTRL_MODE_PCM  (0 << 0)
> >
> >  #define SUN8I_I2S_FMT0_LRCK_PERIOD_MASK  GENMASK(17, 8)
> >  #define SUN8I_I2S_FMT0_LRCK_PERIOD(period)   ((period - 1) << 8)
> > @@ -164,6 +169,7 @@ struct sun4i_i2s_quirks {
> >
> >   s8  (*get_sr)(const struct sun4i_i2s *, int);
> >   s8  (*get_wss)(const struct sun4i_i2s *, int);
> > + int (*set_format)(struct sun4i_i2s *, unsigned int);
> >  };
> >
> >  struct sun4i_i2s {
> > @@ -194,6 +200,7 @@ struct sun4i_i2s {
> >
> >   unsigned inttdm_slots;
> >   unsigned intslot_width;
> > + unsigned intoffset;
> >  };
> >
> >  struct sun4i_i2s_clk_div {
> > @@ -484,19 +491,14 @@ static int sun4i_i2s_hw_params(struct 
> > snd_pcm_substream *substream,
> > i2s->slot_width : params_width(params));
> >  }
> >
> > -static int sun4i_i2s_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
> > +static int sun4i_i2s_set_format(struct sun4i_i2s *i2s, unsigned int fmt)
> >  {
> > - struct sun4i_i2s *i2s = snd_soc_dai_get_drvdata(dai);
> >   u32 val;
> > - u32 offset = 0;
> > - u32 bclk_polarity = SUN4I_I2S_FMT0_POLARITY_NORMAL;
> > - u32 lrclk_polarity = SUN4I_I2S_FMT0_POLARITY_NORMAL;
> >
> >   /* DAI Mode */
> >   switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
> >   case SND_SOC_DAIFMT_I2S:
> >   val = SUN4I_I2S_FMT0_FMT_I2S;
> > - offset = 1;
> >   break;
> >   case SND_SOC_DAIFMT_LEFT_J:
> >   val = SUN4I_I2S_FMT0_FMT_LEFT_J;
> > @@ -505,32 +507,64 @@ static int sun4i_i2s_set_fmt(struct snd_soc_dai *dai, 
> > unsigned int fmt)
> >   val = SUN4I_I2S_FMT0_FMT_RIGHT_J;
> >   break;
> >   default:
> > - dev_err(dai->dev, "Unsupported format: %d\n",
> > - fmt & SND_SOC_DAIFMT_FORMAT_MASK);
> >   return -EINVAL;
> >   }
> >
> > - if (i2s->variant->has_chsel_offset) {
> > - /*
> > -  * offset being set indicates that we're connected to an i2s
> > -  * device, however offset is only used on the sun8i block and
> > -  * i2s shares the same setting with the LJ format. Increment
> > -  * val so that the bit to value to write is correct.
> > -  */
> > - if (offset > 0)
> > - val++;
> > - /* blck offset determines whether i2s or LJ */
> > - regmap_update_bits(i2s->regmap, SUN8I_I2S_TX_CHAN_SEL_REG,
> > -SUN8I_I2S_TX_CHAN_OFFSET_MASK,
> > -SUN8I_I2S_TX_CHAN_OFFSET(offset));
> > + regmap_field_write(i2s->field_fmt_mode, val);
> > +
> > + return 0;
> > +}
> > +
> > +static int sun8i_i2s_set_format(struct sun4i_i2s *i2s, unsigned int fmt)
> > +{
> > + u32 val;
> >
> > - regmap_update_bits(i2s->regmap, SUN8I_I2S_RX_CHAN_SEL_REG,
> > -SUN8I_I2S_TX_CHAN_OFFSET_MASK,
> > -SUN8I_I2S_TX_CHAN_OFFSET(offset));
> > + /* DAI Mode */
> > + switch (fmt & SND_SOC_DAIFMT_FORMAT_MASK) {
> > + case SND_SOC_DAIFMT_I2S:
> > + i2s->offset = 1;
> > + case SND_SOC_DAIFMT_LEFT_J:
> > + val = SUN8I_I2S_CTRL_MODE_I2S_LEFT_J;
> > + break;
> > + case SND_SOC_DAIFMT_RIGHT_J:
> > + val = SUN8I_I2S_

[linux-sunxi] Re: [PATCH v5 12/15] ASoC: sun4i-i2s: Add multi-lane functionality

2019-08-14 Thread Code Kipper
On Wed, 14 Aug 2019 at 13:08, Maxime Ripard  wrote:
>
> On Wed, Aug 14, 2019 at 08:08:51AM +0200, codekip...@gmail.com wrote:
> > From: Marcus Cooper 
> >
> > The i2s block supports multi-lane i2s output however this functionality
> > is only possible in earlier SoCs where the pins are exposed and for
> > the i2s block used for HDMI audio on the later SoCs.
> >
> > To enable this functionality, an optional property has been added to
> > the bindings.
> >
> > Signed-off-by: Marcus Cooper 
>
> Wasn't the plan to support only stereo for now?
Stereo HDMI can be introduced on the H3 and later if we get the first
three patches
merged. Post those patches is the work to get multi-channel working.
>
> Either way, that property should be documented.
I can do this...but I'm thinking we should bang our heads together to
find a solution
that we all agree on...especially if we're considering multi-channel
tdm support.
Thanks,
CK
>
> Maxime
> --
> Maxime Ripard, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/CAEKpxBk4H%3DN-SVzXpAGkF79xmOhczOmKpJ7rJ9Js9vquw_QE7Q%40mail.gmail.com.


[linux-sunxi] Re: [PATCH v5 11/15] ASoC: sun4i-i2s: Add support for H6 I2S

2019-08-14 Thread Code Kipper
On Wed, 14 Aug 2019 at 09:57, Jernej Škrabec  wrote:
>
> Hi!
>
> Dne sreda, 14. avgust 2019 ob 08:08:50 CEST je codekip...@gmail.com
> napisal(a):
> > From: Jernej Skrabec 
> >
> > H6 I2S is very similar to that in H3, except it supports up to 16
> > channels.
> >
> > Signed-off-by: Jernej Skrabec 
>
> Your Signed-off-by is missing here and on all other patches made originally by
> me.
ACK
>
> Best regards,
> Jernej
>
> > ---
> >  sound/soc/sunxi/sun4i-i2s.c | 148 
> >  1 file changed, 148 insertions(+)
> >
> > diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
> > index 6de3cb41aaf6..a8d98696fe7c 100644
> > --- a/sound/soc/sunxi/sun4i-i2s.c
> > +++ b/sound/soc/sunxi/sun4i-i2s.c
> > @@ -121,6 +121,21 @@
> >  #define SUN8I_I2S_RX_CHAN_SEL_REG0x54
> >  #define SUN8I_I2S_RX_CHAN_MAP_REG0x58
> >
> > +/* Defines required for sun50i-h6 support */
> > +#define SUN50I_H6_I2S_TX_CHAN_SEL_OFFSET_MASKGENMASK(21, 20)
> > +#define SUN50I_H6_I2S_TX_CHAN_SEL_OFFSET(offset) ((offset) << 20)
> > +#define SUN50I_H6_I2S_TX_CHAN_SEL_MASK   GENMASK(19, 16)
> > +#define SUN50I_H6_I2S_TX_CHAN_SEL(chan)  ((chan - 1) << 16)
> > +#define SUN50I_H6_I2S_TX_CHAN_EN_MASKGENMASK(15, 0)
> > +#define SUN50I_H6_I2S_TX_CHAN_EN(num_chan)   (((1 << num_chan) - 1))
> > +
> > +#define SUN50I_H6_I2S_TX_CHAN_MAP0_REG   0x44
> > +#define SUN50I_H6_I2S_TX_CHAN_MAP1_REG   0x48
> > +
> > +#define SUN50I_H6_I2S_RX_CHAN_SEL_REG0x64
> > +#define SUN50I_H6_I2S_RX_CHAN_MAP0_REG   0x68
> > +#define SUN50I_H6_I2S_RX_CHAN_MAP1_REG   0x6C
> > +
> >  struct sun4i_i2s;
> >
> >  /**
> > @@ -440,6 +455,25 @@ static void sun8i_i2s_set_rxchanoffset(const struct
> > sun4i_i2s *i2s) SUN8I_I2S_TX_CHAN_OFFSET(i2s->offset));
> >  }
> >
> > +static void sun50i_h6_i2s_set_txchanoffset(const struct sun4i_i2s *i2s, int
> > output) +{
> > + if (output >= 0 && output < 4) {
> > + regmap_update_bits(i2s->regmap,
> > +SUN8I_I2S_TX_CHAN_SEL_REG +
> (output * 4),
> > +
> SUN50I_H6_I2S_TX_CHAN_SEL_OFFSET_MASK,
> > +
> SUN50I_H6_I2S_TX_CHAN_SEL_OFFSET(i2s->offset));
> > + }
> > +
> > +}
> > +
> > +static void sun50i_h6_i2s_set_rxchanoffset(const struct sun4i_i2s *i2s)
> > +{
> > + regmap_update_bits(i2s->regmap,
> > +SUN50I_H6_I2S_RX_CHAN_SEL_REG,
> > +SUN50I_H6_I2S_TX_CHAN_SEL_OFFSET_MASK,
> > +SUN50I_H6_I2S_TX_CHAN_SEL_OFFSET(i2s-
> >offset));
> > +}
> > +
> >  static void sun8i_i2s_set_txchanen(const struct sun4i_i2s *i2s, int output,
> > int channel)
> >  {
> > @@ -459,6 +493,26 @@ static void sun8i_i2s_set_rxchanen(const struct
> > sun4i_i2s *i2s, int channel) SUN8I_I2S_TX_CHAN_EN(channel));
> >  }
> >
> > +
> > +static void sun50i_h6_i2s_set_txchanen(const struct sun4i_i2s *i2s, int
> > output, +int channel)
> > +{
> > + if (output >= 0 && output < 4) {
> > + regmap_update_bits(i2s->regmap,
> > +SUN8I_I2S_TX_CHAN_SEL_REG +
> (output * 4),
> > +SUN50I_H6_I2S_TX_CHAN_EN_MASK,
> > +
> SUN50I_H6_I2S_TX_CHAN_EN(channel));
> > + }
> > +}
> > +
> > +static void sun50i_h6_i2s_set_rxchanen(const struct sun4i_i2s *i2s, int
> > channel) +{
> > + regmap_update_bits(i2s->regmap,
> > +SUN50I_H6_I2S_RX_CHAN_SEL_REG,
> > +SUN50I_H6_I2S_TX_CHAN_EN_MASK,
> > +SUN50I_H6_I2S_TX_CHAN_EN(channel));
> > +}
> > +
> >  static void sun4i_i2s_set_txchansel(const struct sun4i_i2s *i2s, int
> > output, int channel)
> >  {
> > @@ -495,6 +549,25 @@ static void sun8i_i2s_set_rxchansel(const struct
> > sun4i_i2s *i2s, int channel) SUN8I_I2S_TX_CHAN_SEL(channel));
> >  }
> >
> > +static void sun50i_h6_i2s_set_txchansel(const struct sun4i_i2s *i2s, int
> > output, +int channel)
> > +{
> > + if (output >= 0 && output < 4) {
> > + regmap_update_bits(i2s->regmap,
> > +SUN8I_I2S_TX_CHAN_SEL_REG +
> (output * 4),
> > +SUN50I_H6_I2S_TX_CHAN_SEL_MASK,
> > +
> SUN50I_H6_I2S_TX_CHAN_SEL(channel));
> > + }
> > +}
> > +
> > +static void sun50i_h6_i2s_set_rxchansel(const struct sun4i_i2s *i2s, int
> > channel) +{
> > + regmap_update_bits(i2s->regmap,
> > +SUN50I_H6_I2S_RX_CHAN_SEL_REG,
> > +SUN50I_H6_I2S_TX_CHAN_SEL_MASK,
> > +SUN50I_H6_I2S_TX_CHAN_SEL(channel));
> > +}
> > +
> >  static void sun4i_i2s_set_txchanmap(const struct sun4i_i2s *i2s, int
> > output, int channel)
> >  {
> > @@ -520,6 +593,20 @@ static void sun8i_i2s_set_rxchanmap(const struct
> > sun4i_i2s *i2s, int channel) regmap_write(i2s->regmap,
> > SUN8I_I2S_RX_CHAN_MAP_REG, channel);
> >  }
> >
> > +static v

Re: [linux-sunxi] [PATCH v5 15/15] ASoC: sun4i-i2s: Adjust regmap settings

2019-08-14 Thread Code Kipper
On Wed, 14 Aug 2019 at 10:38, Jernej Škrabec  wrote:
>
> Hi!
>
> Dne sreda, 14. avgust 2019 ob 08:08:54 CEST je codekip...@gmail.com
> napisal(a):
> > From: Marcus Cooper 
> >
> > Bypass the regmap cache when flushing the i2s FIFOs and modify the tables
> > to reflect this.
> >
> > Signed-off-by: Marcus Cooper 
> > ---
> >  sound/soc/sunxi/sun4i-i2s.c | 31 ++-
> >  1 file changed, 10 insertions(+), 21 deletions(-)
> >
> > diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
> > index d3c8789f70bb..ecfc1ed79379 100644
> > --- a/sound/soc/sunxi/sun4i-i2s.c
> > +++ b/sound/soc/sunxi/sun4i-i2s.c
> > @@ -876,9 +876,11 @@ static int sun4i_i2s_set_fmt(struct snd_soc_dai *dai,
> > unsigned int fmt) static void sun4i_i2s_start_capture(struct sun4i_i2s
> > *i2s)
> >  {
> >   /* Flush RX FIFO */
> > + regcache_cache_bypass(i2s->regmap, true);
> >   regmap_update_bits(i2s->regmap, SUN4I_I2S_FIFO_CTRL_REG,
> >  SUN4I_I2S_FIFO_CTRL_FLUSH_RX,
> >  SUN4I_I2S_FIFO_CTRL_FLUSH_RX);
> > + regcache_cache_bypass(i2s->regmap, false);
>
> Did you try with regmap_write_bits() instead? This function will
> unconditionally write bits so it's nicer solution, because you don't have to
> use regcache_cache_bypass().

I didn'twith all the rework I've avoided messing with this change.
Now that the dust
has settled, I can go back to look at this.
Thanks,
CK
>
> >
> >   /* Clear RX counter */
> >   regmap_write(i2s->regmap, SUN4I_I2S_RX_CNT_REG, 0);
> > @@ -897,9 +899,11 @@ static void sun4i_i2s_start_capture(struct sun4i_i2s
> > *i2s) static void sun4i_i2s_start_playback(struct sun4i_i2s *i2s)
> >  {
> >   /* Flush TX FIFO */
> > + regcache_cache_bypass(i2s->regmap, true);
> >   regmap_update_bits(i2s->regmap, SUN4I_I2S_FIFO_CTRL_REG,
> >  SUN4I_I2S_FIFO_CTRL_FLUSH_TX,
> >  SUN4I_I2S_FIFO_CTRL_FLUSH_TX);
> > + regcache_cache_bypass(i2s->regmap, false);
>
> Ditto.
>
> >
> >   /* Clear TX counter */
> >   regmap_write(i2s->regmap, SUN4I_I2S_TX_CNT_REG, 0);
> > @@ -1053,13 +1057,7 @@ static const struct snd_soc_component_driver
> > sun4i_i2s_component = {
> >
> >  static bool sun4i_i2s_rd_reg(struct device *dev, unsigned int reg)
> >  {
> > - switch (reg) {
> > - case SUN4I_I2S_FIFO_TX_REG:
> > - return false;
> > -
> > - default:
> > - return true;
> > - }
> > + return true;
>
> Why did you change this? Manual mentions that SUN4I_I2S_FIFO_TX_REG is write-
> only register. Even if it can be read, then it's better to remove whole
> function, which will automatically mean that all registers can be read.
>
>
> >  }
> >
> >  static bool sun4i_i2s_wr_reg(struct device *dev, unsigned int reg)
> > @@ -1078,6 +1076,8 @@ static bool sun4i_i2s_volatile_reg(struct device *dev,
> > unsigned int reg) {
> >   switch (reg) {
> >   case SUN4I_I2S_FIFO_RX_REG:
> > + case SUN4I_I2S_FIFO_TX_REG:
> > + case SUN4I_I2S_FIFO_STA_REG:
> >   case SUN4I_I2S_INT_STA_REG:
> >   case SUN4I_I2S_RX_CNT_REG:
> >   case SUN4I_I2S_TX_CNT_REG:
>
> SUN4I_I2S_FIFO_CTRL_REG should be put here, because it has two bits which
> returns to 0 immediately after they are set to 1.
>
> Best regards,
> Jernej
>
> > @@ -1088,23 +1088,12 @@ static bool sun4i_i2s_volatile_reg(struct device
> > *dev, unsigned int reg) }
> >  }
> >
> > -static bool sun8i_i2s_rd_reg(struct device *dev, unsigned int reg)
> > -{
> > - switch (reg) {
> > - case SUN8I_I2S_FIFO_TX_REG:
> > - return false;
> > -
> > - default:
> > - return true;
> > - }
> > -}
> > -
> >  static bool sun8i_i2s_volatile_reg(struct device *dev, unsigned int reg)
> >  {
> >   if (reg == SUN8I_I2S_INT_STA_REG)
> >   return true;
> >   if (reg == SUN8I_I2S_FIFO_TX_REG)
> > - return false;
> > + return true;
> >
> >   return sun4i_i2s_volatile_reg(dev, reg);
> >  }
> > @@ -1175,7 +1164,7 @@ static const struct regmap_config
> > sun8i_i2s_regmap_config = { .reg_defaults = sun8i_i2s_reg_defaults,
> >   .num_reg_defaults   = ARRAY_SIZE(sun8i_i2s_reg_defaults),
> >   .writeable_reg  = sun4i_i2s_wr_reg,
> > - .readable_reg   = sun8i_i2s_rd_reg,
> > + .readable_reg   = sun4i_i2s_rd_reg,
> >   .volatile_reg   = sun8i_i2s_volatile_reg,
> >  };
> >
> > @@ -1188,7 +1177,7 @@ static const struct regmap_config
> > sun50i_i2s_regmap_config = { .reg_defaults= sun50i_i2s_reg_defaults,
> >   .num_reg_defaults   = ARRAY_SIZE(sun50i_i2s_reg_defaults),
> >   .writeable_reg  = sun4i_i2s_wr_reg,
> > - .readable_reg   = sun8i_i2s_rd_reg,
> > + .readable_reg   = sun4i_i2s_rd_reg,
> >   .volatile_reg   = sun8i_i2s_volatile_reg,
> >  };
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe fro

Re: [linux-sunxi] [PATCH v5 14/15] ASoc: sun4i-i2s: Add 20, 24 and 32 bit support

2019-08-14 Thread Code Kipper
On Wed, 14 Aug 2019 at 10:28, Jernej Škrabec  wrote:
>
> Hi!
>
> Dne sreda, 14. avgust 2019 ob 08:08:53 CEST je codekip...@gmail.com
> napisal(a):
> > From: Marcus Cooper 
> >
> > Extend the functionality of the driver to include support of 20 and
> > 24 bits per sample for the earlier SoCs.
> >
> > Newer SoCs can also handle 32bit samples.
> >
> > Signed-off-by: Marcus Cooper 
> > ---
> >  sound/soc/sunxi/sun4i-i2s.c | 21 +++--
> >  1 file changed, 19 insertions(+), 2 deletions(-)
> >
> > diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
> > index a71969167053..d3c8789f70bb 100644
> > --- a/sound/soc/sunxi/sun4i-i2s.c
> > +++ b/sound/soc/sunxi/sun4i-i2s.c
> > @@ -690,6 +690,11 @@ static int sun4i_i2s_hw_params(struct snd_pcm_substream
> > *substream, case 16:
> >   width = DMA_SLAVE_BUSWIDTH_2_BYTES;
> >   break;
> > + case 20:
> > + case 24:
> > + case 32:
>
> params_physical_width() returns 32 also for 20 and 24-bit formats, so drop 20
> and 24.
ACK
>
> Best regards,
> Jernej
>
> > + width = DMA_SLAVE_BUSWIDTH_4_BYTES;
> > + break;
> >   default:
> >   dev_err(dai->dev, "Unsupported physical sample width:
> %d\n",
> >   params_physical_width(params));
> > @@ -1015,6 +1020,13 @@ static int sun4i_i2s_dai_probe(struct snd_soc_dai
> > *dai) return 0;
> >  }
> >
> > +#define SUN4I_FORMATS(SNDRV_PCM_FMTBIT_S16_LE | \
> > +  SNDRV_PCM_FMTBIT_S20_LE | \
> > +  SNDRV_PCM_FMTBIT_S24_LE)
> > +
> > +#define SUN8I_FORMATS(SUN4I_FORMATS | \
> > +  SNDRV_PCM_FMTBIT_S32_LE)
> > +
> >  static struct snd_soc_dai_driver sun4i_i2s_dai = {
> >   .probe = sun4i_i2s_dai_probe,
> >   .capture = {
> > @@ -1022,14 +1034,14 @@ static struct snd_soc_dai_driver sun4i_i2s_dai = {
> >   .channels_min = 2,
> >   .channels_max = 2,
> >   .rates = SNDRV_PCM_RATE_8000_192000,
> > - .formats = SNDRV_PCM_FMTBIT_S16_LE,
> > + .formats = SUN4I_FORMATS,
> >   },
> >   .playback = {
> >   .stream_name = "Playback",
> >   .channels_min = 2,
> >   .channels_max = 2,
> >   .rates = SNDRV_PCM_RATE_8000_192000,
> > - .formats = SNDRV_PCM_FMTBIT_S16_LE,
> > + .formats = SUN4I_FORMATS,
> >   },
> >   .ops = &sun4i_i2s_dai_ops,
> >   .symmetric_rates = 1,
> > @@ -1505,6 +1517,11 @@ static int sun4i_i2s_probe(struct platform_device
> > *pdev) goto err_pm_disable;
> >   }
> >
> > + if (i2s->variant->has_fmt_set_lrck_period) {
> > + soc_dai->playback.formats = SUN8I_FORMATS;
> > + soc_dai->capture.formats = SUN8I_FORMATS;
> > + }
> > +
> >   if (!of_property_read_u32(pdev->dev.of_node,
> > "allwinner,playback-channels",
> &val)) {
> >   if (val >= 2 && val <= 8)
>
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/CAEKpxBmsLKt_mKFC3%3DwR9n%2BhK9njhh7drLV2EMrzKahv%3Ds4dTw%40mail.gmail.com.


Re: [linux-sunxi] [PATCH v8 4/4] arm64: dts: allwinner: orange-pi-3: Enable HDMI output

2019-08-09 Thread Code Kipper
On Tue, 6 Aug 2019 at 17:57,  wrote:
>
> From: Ondrej Jirman 
>
> Orange Pi 3 has a DDC_CEC_EN signal connected to PH2, that enables the DDC
> I2C bus voltage shifter. Before EDID can be read, we need to pull PH2 high.
> This is realized by the ddc-en-gpios property.
Great work. Is there any chance you can move this to the
arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi.dtsi?, as all the H6
based orange-pi's have this feature.
BR,
CK
>
> Signed-off-by: Ondrej Jirman 
> ---
>  .../dts/allwinner/sun50i-h6-orangepi-3.dts| 26 +++
>  1 file changed, 26 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts 
> b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts
> index 2c6807b74ff6..01bb1bafe284 100644
> --- a/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h6-orangepi-3.dts
> @@ -22,6 +22,18 @@
> stdout-path = "serial0:115200n8";
> };
>
> +   connector {
> +   compatible = "hdmi-connector";
> +   ddc-en-gpios = <&pio 7 2 GPIO_ACTIVE_HIGH>; /* PH2 */
> +   type = "a";
> +
> +   port {
> +   hdmi_con_in: endpoint {
> +   remote-endpoint = <&hdmi_out_con>;
> +   };
> +   };
> +   };
> +
> leds {
> compatible = "gpio-leds";
>
> @@ -72,6 +84,10 @@
> cpu-supply = <®_dcdca>;
>  };
>
> +&de {
> +   status = "okay";
> +};
> +
>  &ehci0 {
> status = "okay";
>  };
> @@ -91,6 +107,16 @@
> status = "okay";
>  };
>
> +&hdmi {
> +   status = "okay";
> +};
> +
> +&hdmi_out {
> +   hdmi_out_con: endpoint {
> +   remote-endpoint = <&hdmi_con_in>;
> +   };
> +};
> +
>  &mdio {
> ext_rgmii_phy: ethernet-phy@1 {
> compatible = "ethernet-phy-ieee802.3-c22";
> --
> 2.22.0
>
> --
> You received this message because you are subscribed to the Google Groups 
> "linux-sunxi" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to linux-sunxi+unsubscr...@googlegroups.com.
> To view this discussion on the web, visit 
> https://groups.google.com/d/msgid/linux-sunxi/20190806155744.10263-5-megous%40megous.com.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/CAEKpxBn1nF0t-M34iRSy1yYEuUxgNMUXFBhtjXBY8Qk%2B43zbDQ%40mail.gmail.com.


Re: [linux-sunxi] [PATCH v4 3/9] ASoC: sun4i-i2s: Add regmap field to sign extend sample

2019-06-04 Thread Code Kipper
On Tue, 4 Jun 2019 at 09:53, Chen-Yu Tsai  wrote:
>
> On Tue, Jun 4, 2019 at 1:47 AM  wrote:
> >
> > From: Marcus Cooper 
> >
> > On the newer SoCs this is set by default to transfer a 0 after
> > each sample in each slot. However the platform that this driver
> > was developed on had the default setting where it padded the
> > audio gain with zeros. This isn't a problem whilst we have only
> > support for 16bit audio but with larger sample resolution rates
> > in the pipeline then it should be fixed to also pad. Without this
> > the audio gets distorted.
>
> Curious, both the A10 and A20 manuals say the default value for this
> field is 0, which means 0 padding.
>
> sun4i_i2s_reg_defaults[] also has that field set to 0.
>
> You're saying you are seeing the field set to 1?

On the newer SoCs (H3 onwards) this setting defaults to 3 which is
"Transfer 0 after each sample in each slot" which resulted in distortion.
Setting SEXT to 0 "Zeros or audio gain padding at LSB" alligns the
setup with that of the earlier block and fixed the issue we were hearing.
It's really noticeable with HDMI audio.
BR,
CK
>
> ChenYu
>
> > Signed-off-by: Marcus Cooper 
> > ---
> >  sound/soc/sunxi/sun4i-i2s.c | 15 +++
> >  1 file changed, 15 insertions(+)
> >
> > diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
> > index fd7c37596f21..e2961d8f6e8c 100644
> > --- a/sound/soc/sunxi/sun4i-i2s.c
> > +++ b/sound/soc/sunxi/sun4i-i2s.c
> > @@ -134,6 +134,7 @@
> >   * @field_fmt_bclk: regmap field to set clk polarity.
> >   * @field_fmt_lrclk: regmap field to set frame polarity.
> >   * @field_fmt_mode: regmap field to set the operational mode.
> > + * @field_fmt_sext: regmap field to set the sign extension.
> >   * @field_txchanmap: location of the tx channel mapping register.
> >   * @field_rxchanmap: location of the rx channel mapping register.
> >   * @field_txchansel: location of the tx channel select bit fields.
> > @@ -159,6 +160,7 @@ struct sun4i_i2s_quirks {
> > struct reg_fieldfield_fmt_bclk;
> > struct reg_fieldfield_fmt_lrclk;
> > struct reg_fieldfield_fmt_mode;
> > +   struct reg_fieldfield_fmt_sext;
> > struct reg_fieldfield_txchanmap;
> > struct reg_fieldfield_rxchanmap;
> > struct reg_fieldfield_txchansel;
> > @@ -183,6 +185,7 @@ struct sun4i_i2s {
> > struct regmap_field *field_fmt_bclk;
> > struct regmap_field *field_fmt_lrclk;
> > struct regmap_field *field_fmt_mode;
> > +   struct regmap_field *field_fmt_sext;
> > struct regmap_field *field_txchanmap;
> > struct regmap_field *field_rxchanmap;
> > struct regmap_field *field_txchansel;
> > @@ -342,6 +345,9 @@ static int sun4i_i2s_set_clk_rate(struct snd_soc_dai 
> > *dai,
> >SUN8I_I2S_FMT0_LRCK_PERIOD_MASK,
> >SUN8I_I2S_FMT0_LRCK_PERIOD(32));
> >
> > +   /* Set sign extension to pad out LSB with 0 */
> > +   regmap_field_write(i2s->field_fmt_sext, 0);
> > +
> > return 0;
> >  }
> >
> > @@ -887,6 +893,7 @@ static const struct sun4i_i2s_quirks 
> > sun4i_a10_i2s_quirks = {
> > .field_fmt_lrclk= REG_FIELD(SUN4I_I2S_FMT0_REG, 7, 7),
> > .has_slave_select_bit   = true,
> > .field_fmt_mode = REG_FIELD(SUN4I_I2S_FMT0_REG, 0, 1),
> > +   .field_fmt_sext = REG_FIELD(SUN4I_I2S_FMT1_REG, 8, 8),
> > .field_txchanmap= REG_FIELD(SUN4I_I2S_TX_CHAN_MAP_REG, 0, 
> > 31),
> > .field_rxchanmap= REG_FIELD(SUN4I_I2S_RX_CHAN_MAP_REG, 0, 
> > 31),
> > .field_txchansel= REG_FIELD(SUN4I_I2S_TX_CHAN_SEL_REG, 0, 
> > 2),
> > @@ -904,6 +911,7 @@ static const struct sun4i_i2s_quirks 
> > sun6i_a31_i2s_quirks = {
> > .field_fmt_lrclk= REG_FIELD(SUN4I_I2S_FMT0_REG, 7, 7),
> > .has_slave_select_bit   = true,
> > .field_fmt_mode = REG_FIELD(SUN4I_I2S_FMT0_REG, 0, 1),
> > +   .field_fmt_sext = REG_FIELD(SUN4I_I2S_FMT1_REG, 8, 8),
> > .field_txchanmap= REG_FIELD(SUN4I_I2S_TX_CHAN_MAP_REG, 0, 
> > 31),
> > .field_rxchanmap= REG_FIELD(SUN4I_I2S_RX_CHAN_MAP_REG, 0, 
> > 31),
> > .field_txchansel= REG_FIELD(SUN4I_I2S_TX_CHAN_SEL_REG, 0, 
> > 2),
> > @@ -944,6 +952,7 @@ static const struct sun4i_i2s_quirks 
> > sun8i_h3_i2s_quirks = {
> > .field_fmt_bclk = REG_FIELD(SUN4I_I2S_FMT0_REG, 7, 7),
> > .field_fmt_lrclk= REG_FIELD(SUN4I_I2S_FMT0_REG, 19, 19),
> > .field_fmt_mode = REG_FIELD(SUN4I_I2S_CTRL_REG, 4, 5),
> > +   .field_fmt_sext = REG_FIELD(SUN4I_I2S_FMT1_REG, 4, 5),
> > .field_txchanmap= REG_FIELD(SUN8I_I2S_TX_CHAN_MAP_REG, 0, 
> > 31),
> > .field_rxchanmap= RE

Re: [linux-sunxi] Re: [PATCH v4 6/9] ASoC: sun4i-i2s: Add multi-lane functionality

2019-06-04 Thread Code Kipper
On Tue, 4 Jun 2019 at 11:02, Christopher Obbard  wrote:
>
> On Tue, 4 Jun 2019 at 09:43, Code Kipper  wrote:
> >
> > On Tue, 4 Jun 2019 at 09:58, Maxime Ripard  
> > wrote:
> > >
> > > On Mon, Jun 03, 2019 at 07:47:32PM +0200, codekip...@gmail.com wrote:
> > > > From: Marcus Cooper 
> > > >
> > > > The i2s block supports multi-lane i2s output however this functionality
> > > > is only possible in earlier SoCs where the pins are exposed and for
> > > > the i2s block used for HDMI audio on the later SoCs.
> > > >
> > > > To enable this functionality, an optional property has been added to
> > > > the bindings.
> > > >
> > > > Signed-off-by: Marcus Cooper 
> > >
> > > I'd like to have Mark's input on this, but I'm really worried about
> > > the interaction with the proper TDM support.
> > >
> > > Our fundamental issue is that the controller can have up to 8
> > > channels, but either on 4 lines (instead of 1), or 8 channels on 1
> > > (like proper TDM) (or any combination between the two, but that should
> > > be pretty rare).
> >
> > I understand...maybe the TDM needs to be extended to support this to 
> > consider
> > channel mapping and multiple transfer lines. I was thinking about the later 
> > when
> > someone was requesting support on IIRC a while ago, I thought masking might
> > of been a solution. These can wait as the only consumer at the moment is
> > LibreELEC and we can patch it there.
>
> Hi Marcus,
>
> FWIW, the TI McASP driver has support for TDM & (i think?) multiple
> transfer lines which are called serializers.
> Maybe this can help with inspiration?
> see 
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/sound/soc/ti/davinci-mcasp.c
> sample DTS:
>
> &mcasp0 {
> #sound-dai-cells = <0>;
> status = "okay";
> pinctrl-names = "default";
> pinctrl-0 = <&mcasp0_pins>;
>
> op-mode = <0>;
> tdm-slots = <8>;
> serial-dir = <
> 2 0 1 0
> 0 0 0 0
> 0 0 0 0
> 0 0 0 0
> >;
> tx-num-evt = <1>;
> rx-num-evt = <1>;
> };
>
>
> Cheers!

Thanks, this looks good.
CK
>
> > Do you have any ideas Master?
> > CK
> > >
> > > You're trying to do the first one, and I'm trying to do the second one.
> > >
> > > There's a number of assumptions later on that will break the TDM case,
> > > see below for examples
> > >
> > > > ---
> > > >  sound/soc/sunxi/sun4i-i2s.c | 44 -
> > > >  1 file changed, 39 insertions(+), 5 deletions(-)
> > > >
> > > > diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
> > > > index bca73b3c0d74..75217fb52bfa 100644
> > > > --- a/sound/soc/sunxi/sun4i-i2s.c
> > > > +++ b/sound/soc/sunxi/sun4i-i2s.c
> > > > @@ -23,7 +23,7 @@
> > > >
> > > >  #define SUN4I_I2S_CTRL_REG   0x00
> > > >  #define SUN4I_I2S_CTRL_SDO_EN_MASK   GENMASK(11, 8)
> > > > -#define SUN4I_I2S_CTRL_SDO_EN(sdo)   BIT(8 + (sdo))
> > > > +#define SUN4I_I2S_CTRL_SDO_EN(lines) (((1 << lines) - 1) << 8)
> > > >  #define SUN4I_I2S_CTRL_MODE_MASK BIT(5)
> > > >  #define SUN4I_I2S_CTRL_MODE_SLAVE(1 << 5)
> > > >  #define SUN4I_I2S_CTRL_MODE_MASTER   (0 << 5)
> > > > @@ -355,14 +355,23 @@ static int sun4i_i2s_hw_params(struct 
> > > > snd_pcm_substream *substream,
> > > >   struct sun4i_i2s *i2s = snd_soc_dai_get_drvdata(dai);
> > > >   int sr, wss, channels;
> > > >   u32 width;
> > > > + int lines;
> > > >
> > > >   channels = params_channels(params);
> > > > - if (channels != 2) {
> > > > + if ((channels > dai->driver->playback.channels_max) ||
> > > > + (channels < dai->driver->playback.channels_min)) {
> > > >   dev_err(dai->dev, "Unsupported number of channels: %d\n",
> > > >   channels);
> > > >   return -EINVAL;
> > > >   }
> > > >
> > > > + lines = (channels + 1) / 2;
> > > > +
> > > > + 

[linux-sunxi] Re: [PATCH v4 4/9] ASoC: sun4i-i2s: Reduce quirks for sun8i-h3

2019-06-04 Thread Code Kipper
On Tue, 4 Jun 2019 at 09:46, Maxime Ripard  wrote:
>
> On Mon, Jun 03, 2019 at 07:47:30PM +0200, codekip...@gmail.com wrote:
> > From: Marcus Cooper 
> >
> > We have a number of flags used to identify the functionality
> > of the IP block found on the sun8i-h3 and later devices. As it
> > is only neccessary to identify this new block then replace
> > these flags with just one.
> >
> > Signed-off-by: Marcus Cooper 
>
> This carries exactly the same meaning than the compatible, so this is
> entirely redundant.
>
> The more I think of it, the more I fell like we should have function
> pointers instead, and have hooks to deal with these kind of things.
>
> I've been working a lot on that driver recently, and there's some many
> parameters and regmap_fields that it becomes pretty hard to work on.
Hi Maxime,
let's sync with what you're doing as you're more lightly to see it
through to delivery!
I was trying to clean up the driver as some of this seemed a bit unnecessary,
hooks sounds like the way forward,
CK
>
> Maxime
>
> --
> Maxime Ripard, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/CAEKpxBmP6UJkfzqP-AkW5sDzRcb6W9J6vM7C6DAqYVvpEKfxcQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Re: [PATCH v4 6/9] ASoC: sun4i-i2s: Add multi-lane functionality

2019-06-04 Thread Code Kipper
On Tue, 4 Jun 2019 at 09:58, Maxime Ripard  wrote:
>
> On Mon, Jun 03, 2019 at 07:47:32PM +0200, codekip...@gmail.com wrote:
> > From: Marcus Cooper 
> >
> > The i2s block supports multi-lane i2s output however this functionality
> > is only possible in earlier SoCs where the pins are exposed and for
> > the i2s block used for HDMI audio on the later SoCs.
> >
> > To enable this functionality, an optional property has been added to
> > the bindings.
> >
> > Signed-off-by: Marcus Cooper 
>
> I'd like to have Mark's input on this, but I'm really worried about
> the interaction with the proper TDM support.
>
> Our fundamental issue is that the controller can have up to 8
> channels, but either on 4 lines (instead of 1), or 8 channels on 1
> (like proper TDM) (or any combination between the two, but that should
> be pretty rare).

I understand...maybe the TDM needs to be extended to support this to consider
channel mapping and multiple transfer lines. I was thinking about the later when
someone was requesting support on IIRC a while ago, I thought masking might
of been a solution. These can wait as the only consumer at the moment is
LibreELEC and we can patch it there.
Do you have any ideas Master?
CK
>
> You're trying to do the first one, and I'm trying to do the second one.
>
> There's a number of assumptions later on that will break the TDM case,
> see below for examples
>
> > ---
> >  sound/soc/sunxi/sun4i-i2s.c | 44 -
> >  1 file changed, 39 insertions(+), 5 deletions(-)
> >
> > diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
> > index bca73b3c0d74..75217fb52bfa 100644
> > --- a/sound/soc/sunxi/sun4i-i2s.c
> > +++ b/sound/soc/sunxi/sun4i-i2s.c
> > @@ -23,7 +23,7 @@
> >
> >  #define SUN4I_I2S_CTRL_REG   0x00
> >  #define SUN4I_I2S_CTRL_SDO_EN_MASK   GENMASK(11, 8)
> > -#define SUN4I_I2S_CTRL_SDO_EN(sdo)   BIT(8 + (sdo))
> > +#define SUN4I_I2S_CTRL_SDO_EN(lines) (((1 << lines) - 1) << 8)
> >  #define SUN4I_I2S_CTRL_MODE_MASK BIT(5)
> >  #define SUN4I_I2S_CTRL_MODE_SLAVE(1 << 5)
> >  #define SUN4I_I2S_CTRL_MODE_MASTER   (0 << 5)
> > @@ -355,14 +355,23 @@ static int sun4i_i2s_hw_params(struct 
> > snd_pcm_substream *substream,
> >   struct sun4i_i2s *i2s = snd_soc_dai_get_drvdata(dai);
> >   int sr, wss, channels;
> >   u32 width;
> > + int lines;
> >
> >   channels = params_channels(params);
> > - if (channels != 2) {
> > + if ((channels > dai->driver->playback.channels_max) ||
> > + (channels < dai->driver->playback.channels_min)) {
> >   dev_err(dai->dev, "Unsupported number of channels: %d\n",
> >   channels);
> >   return -EINVAL;
> >   }
> >
> > + lines = (channels + 1) / 2;
> > +
> > + /* Enable the required output lines */
> > + regmap_update_bits(i2s->regmap, SUN4I_I2S_CTRL_REG,
> > +SUN4I_I2S_CTRL_SDO_EN_MASK,
> > +SUN4I_I2S_CTRL_SDO_EN(lines));
> > +
>
> This has the assumption that each line will have 2 channels, which is wrong.
>
> >   if (i2s->variant->is_h3_i2s_based) {
> >   regmap_update_bits(i2s->regmap, SUN8I_I2S_CHAN_CFG_REG,
> >  SUN8I_I2S_CHAN_CFG_TX_SLOT_NUM_MASK,
> > @@ -373,8 +382,19 @@ static int sun4i_i2s_hw_params(struct 
> > snd_pcm_substream *substream,
> >   }
> >
> >   /* Map the channels for playback and capture */
> > - regmap_field_write(i2s->field_txchanmap, 0x76543210);
> >   regmap_field_write(i2s->field_rxchanmap, 0x3210);
> > + regmap_field_write(i2s->field_txchanmap, 0x10);
> > + if (i2s->variant->is_h3_i2s_based) {
> > + if (channels > 2)
> > + regmap_write(i2s->regmap,
> > +  SUN8I_I2S_TX_CHAN_MAP_REG+4, 0x32);
> > + if (channels > 4)
> > + regmap_write(i2s->regmap,
> > +  SUN8I_I2S_TX_CHAN_MAP_REG+8, 0x54);
> > + if (channels > 6)
> > + regmap_write(i2s->regmap,
> > +  SUN8I_I2S_TX_CHAN_MAP_REG+12, 0x76);
> > + }
>
> And this creates a mapping matching that.
>
> >   /* Configure the channels */
> >   regmap_field_write(i2s->field_txchansel,
> > @@ -1057,9 +1077,10 @@ static int sun4i_i2s_init_regmap_fields(struct 
> > device *dev,
> >  static int sun4i_i2s_probe(struct platform_device *pdev)
> >  {
> >   struct sun4i_i2s *i2s;
> > + struct snd_soc_dai_driver *soc_dai;
> >   struct resource *res;
> >   void __iomem *regs;
> > - int irq, ret;
> > + int irq, ret, val;
> >
> >   i2s = devm_kzalloc(&pdev->dev, sizeof(*i2s), GFP_KERNEL);
> >   if (!i2s)
> > @@ -1126,6 +1147,19 @@ static int sun4i_i2s_probe(struct platform_device 
> > *pdev)
> >   i2s->capture_dma_data.addr

Re: [linux-sunxi] Re: [PATCH v4 1/9] ASoC: sun4i-i2s: Fix sun8i tx channel offset mask

2019-06-04 Thread Code Kipper
On Tue, 4 Jun 2019 at 09:39, Chen-Yu Tsai  wrote:
>
> On Tue, Jun 4, 2019 at 3:34 PM Maxime Ripard  
> wrote:
> >
> > On Mon, Jun 03, 2019 at 07:47:27PM +0200, codekip...@gmail.com wrote:
> > > From: Marcus Cooper 
> > >
> > > Although not causing any noticeable issues, the mask for the
> > > channel offset is covering too many bits.
> > >
> > > Signed-off-by: Marcus Cooper 
> >
> > Acked-by: Maxime Ripard 
>
> Would be nice to have
>
> Fixes: 7d2993811a1e ("ASoC: sun4i-i2s: Add support for H3")
ThanksI'll keep this in mind for future reference as jernej also
mention this to me.
BR,
CK
>
> But otherwise,
>
> Acked-by: Chen-Yu Tsai 

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
To view this discussion on the web, visit 
https://groups.google.com/d/msgid/linux-sunxi/CAEKpxBn-XX%2BGRrMuCccwcC9TFKXGYV4S2ZwX%2BjBV%3D%3D33RsW-aQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi] [PATCH v6] sun8i: h3: Add support for the Beelink-x2 STB

2019-05-29 Thread Code Kipper
On Wed, 29 May 2019 at 14:01, Jagan Teki  wrote:
>
> On Wed, May 29, 2019 at 5:25 PM  wrote:
> >
> > From: Marcus Cooper 
> >
> > The Beelink X2 is an STB based on the Allwinner H3 SoC with a uSD slot,
> > 2 USB ports( 1 * USB-2 Host, 1 USB OTG), a 10/100M ethernet port using the
> > SoC's integrated PHY, Wifi via an sdio wifi chip, HDMI, an IR receiver, a
> > dual colour LED and an optical S/PDIF connector.
>
> Please mentioned commit details about dts sync from Linux.
ACK
>
> >
> > Signed-off-by: Marcus Cooper 
> > ---
> >  arch/arm/dts/Makefile|   1 +
> >  arch/arm/dts/sun8i-h3-beelink-x2.dts | 216 +++
> >  board/sunxi/MAINTAINERS  |   6 +
> >  configs/beelink_x2_defconfig |  18 +++
> >  4 files changed, 241 insertions(+)
> >  create mode 100644 arch/arm/dts/sun8i-h3-beelink-x2.dts
> >  create mode 100644 configs/beelink_x2_defconfig
> >
> > diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
> > index 83058c4452..716108dd2e 100644
> > --- a/arch/arm/dts/Makefile
> > +++ b/arch/arm/dts/Makefile
> > @@ -472,6 +472,7 @@ dtb-$(CONFIG_MACH_SUN8I_H3) += \
> > sun8i-h2-plus-orangepi-r1.dtb \
> > sun8i-h2-plus-orangepi-zero.dtb \
> > sun8i-h3-bananapi-m2-plus.dtb \
> > +   sun8i-h3-beelink-x2.dtb \
> > sun8i-h3-libretech-all-h3-cc.dtb \
> > sun8i-h3-nanopi-m1.dtb \
> > sun8i-h3-nanopi-m1-plus.dtb \
> > diff --git a/arch/arm/dts/sun8i-h3-beelink-x2.dts 
> > b/arch/arm/dts/sun8i-h3-beelink-x2.dts
> > new file mode 100644
> > index 00..25540b7694
> > --- /dev/null
> > +++ b/arch/arm/dts/sun8i-h3-beelink-x2.dts
> > @@ -0,0 +1,216 @@
> > +/*
> > + * Copyright (C) 2017 Marcus Cooper 
> > + *
> > + * This file is dual-licensed: you can use it either under the terms
> > + * of the GPL or the X11 license, at your option. Note that this dual
> > + * licensing only applies to this file, and not this project as a
> > + * whole.
> > + *
> > + *  a) This file is free software; you can redistribute it and/or
> > + * modify it under the terms of the GNU General Public License as
> > + * published by the Free Software Foundation; either version 2 of the
> > + * License, or (at your option) any later version.
> > + *
> > + * This file is distributed in the hope that it will be useful,
> > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> > + * GNU General Public License for more details.
> > + *
> > + * Or, alternatively,
> > + *
> > + *  b) Permission is hereby granted, free of charge, to any person
> > + * obtaining a copy of this software and associated documentation
> > + * files (the "Software"), to deal in the Software without
> > + * restriction, including without limitation the rights to use,
> > + * copy, modify, merge, publish, distribute, sublicense, and/or
> > + * sell copies of the Software, and to permit persons to whom the
> > + * Software is furnished to do so, subject to the following
> > + * conditions:
> > + *
> > + * The above copyright notice and this permission notice shall be
> > + * included in all copies or substantial portions of the Software.
> > + *
> > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
> > + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
> > + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
> > + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
> > + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
> > + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> > + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
> > + * OTHER DEALINGS IN THE SOFTWARE.
> > + */
> > +
> > +/dts-v1/;
> > +#include "sun8i-h3.dtsi"
> > +#include "sunxi-common-regulators.dtsi"
> > +
> > +#include 
> > +#include 
> > +
> > +/ {
> > +   model = "Beelink X2";
> > +   compatible = "roofull,beelink-x2", "allwinner,sun8i-h3";
> > +
> > +   aliases {
> > +   serial0 = &uart0;
> > +   ethernet0 = &emac;
> > +   ethernet1 = &sdiowifi;
> > +   };
> > +
> > +   chosen {
> > +   stdout-path = "serial0:115200n8";
> > +   };
> > +
> > +   connector {
> > +   compatible = "hdmi-connector";
> > +   type = "a";
> > +
> > +   port {
> > +   hdmi_con_in: endpoint {
> > +   remote-endpoint = <&hdmi_out_con>;
> > +   };
> > +   };
> > +   };
> > +
> > +   leds {
> > +   compatible = "gpio-leds";
> > +
> > +   blue {
> > +   label = "beelink-x2:blue:pwr";
> > +   gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; /* PL10 */
> > +   default-state = "on";
> > 

[linux-sunxi] Re: [PATCH v6] sun8i: h3: Add support for the Beelink-x2 STB

2019-05-29 Thread Code Kipper
On Wed, 29 May 2019 at 13:55,  wrote:
>
> From: Marcus Cooper 
>
> The Beelink X2 is an STB based on the Allwinner H3 SoC with a uSD slot,
> 2 USB ports( 1 * USB-2 Host, 1 USB OTG), a 10/100M ethernet port using the
> SoC's integrated PHY, Wifi via an sdio wifi chip, HDMI, an IR receiver, a
> dual colour LED and an optical S/PDIF connector.
>
> Signed-off-by: Marcus Cooper 
Ooops...thought I was doing a dry-run...here is the version steps
---
Changes in v6:
- Added myself as dts file maintainer

Changes in v5:
- Corrected DRAM Clock to what is reported on Android boot
- Removed support for SY8106A regulator
- Set CONFIG_SPL_TEXT_BASE which is now required.

Changes in v4:
- updated dts to reflex current linux kernel status

Changes in v3:
- Removed incorrect commit author
- Included v1-v2 change info

Changes in v2:
- updated dts to reflex current linux kernel status



> ---
>  arch/arm/dts/Makefile|   1 +
>  arch/arm/dts/sun8i-h3-beelink-x2.dts | 216 +++
>  board/sunxi/MAINTAINERS  |   6 +
>  configs/beelink_x2_defconfig |  18 +++
>  4 files changed, 241 insertions(+)
>  create mode 100644 arch/arm/dts/sun8i-h3-beelink-x2.dts
>  create mode 100644 configs/beelink_x2_defconfig
>
> diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
> index 83058c4452..716108dd2e 100644
> --- a/arch/arm/dts/Makefile
> +++ b/arch/arm/dts/Makefile
> @@ -472,6 +472,7 @@ dtb-$(CONFIG_MACH_SUN8I_H3) += \
> sun8i-h2-plus-orangepi-r1.dtb \
> sun8i-h2-plus-orangepi-zero.dtb \
> sun8i-h3-bananapi-m2-plus.dtb \
> +   sun8i-h3-beelink-x2.dtb \
> sun8i-h3-libretech-all-h3-cc.dtb \
> sun8i-h3-nanopi-m1.dtb \
> sun8i-h3-nanopi-m1-plus.dtb \
> diff --git a/arch/arm/dts/sun8i-h3-beelink-x2.dts 
> b/arch/arm/dts/sun8i-h3-beelink-x2.dts
> new file mode 100644
> index 00..25540b7694
> --- /dev/null
> +++ b/arch/arm/dts/sun8i-h3-beelink-x2.dts
> @@ -0,0 +1,216 @@
> +/*
> + * Copyright (C) 2017 Marcus Cooper 
> + *
> + * This file is dual-licensed: you can use it either under the terms
> + * of the GPL or the X11 license, at your option. Note that this dual
> + * licensing only applies to this file, and not this project as a
> + * whole.
> + *
> + *  a) This file is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation; either version 2 of the
> + * License, or (at your option) any later version.
> + *
> + * This file is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * Or, alternatively,
> + *
> + *  b) Permission is hereby granted, free of charge, to any person
> + * obtaining a copy of this software and associated documentation
> + * files (the "Software"), to deal in the Software without
> + * restriction, including without limitation the rights to use,
> + * copy, modify, merge, publish, distribute, sublicense, and/or
> + * sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following
> + * conditions:
> + *
> + * The above copyright notice and this permission notice shall be
> + * included in all copies or substantial portions of the Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
> + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
> + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
> + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
> + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
> + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
> + * OTHER DEALINGS IN THE SOFTWARE.
> + */
> +
> +/dts-v1/;
> +#include "sun8i-h3.dtsi"
> +#include "sunxi-common-regulators.dtsi"
> +
> +#include 
> +#include 
> +
> +/ {
> +   model = "Beelink X2";
> +   compatible = "roofull,beelink-x2", "allwinner,sun8i-h3";
> +
> +   aliases {
> +   serial0 = &uart0;
> +   ethernet0 = &emac;
> +   ethernet1 = &sdiowifi;
> +   };
> +
> +   chosen {
> +   stdout-path = "serial0:115200n8";
> +   };
> +
> +   connector {
> +   compatible = "hdmi-connector";
> +   type = "a";
> +
> +   port {
> +   hdmi_con_in: endpoint {
> +   remote-endpoint = <&hdmi_out_con>;
> +   };
> +   };
> +   };
> +
> +   leds {
> +   compatible = "gpio-leds";
> +
> +   blue {
> +   label = "beeli

Re: [linux-sunxi] [PATCH v5] sun8i: h3: Add support for the Beelink-x2 STB

2019-05-27 Thread Code Kipper
On Mon, 27 May 2019 at 09:30, Clément Péron  wrote:
>
> Hi Marcus,
>
> On Sun, 26 May 2019 at 16:57,  wrote:
> >
> > From: Marcus Cooper 
> >
> > The Beelink X2 is an STB based on the Allwinner H3 SoC with a uSD slot,
> > 2 USB ports( 1 * USB-2 Host, 1 USB OTG), a 10/100M ethernet port using the
> > SoC's integrated PHY, Wifi via an sdio wifi chip, HDMI, an IR receiver, a
> > dual colour LED and an optical S/PDIF connector.
> >
> > Signed-off-by: Marcus Cooper 
> > ---
> > Changes in v5:
> > - Corrected DRAM Clock to what is reported on Android boot
> > - Removed support for SY8106A regulator
> > - Set CONFIG_SPL_TEXT_BASE which is now required.
> >
> > Changes in v4:
> > - updated dts to reflex current linux kernel status
> >
> > Changes in v3:
> > - Removed incorrect commit author
> > - Included v1-v2 change info
> >
> > Changes in v2:
> > - updated dts to reflex current linux kernel status
> > ---
> >  arch/arm/dts/Makefile|   1 +
> >  arch/arm/dts/sun8i-h3-beelink-x2.dts | 216 +++
> >  board/sunxi/MAINTAINERS  |   5 +
> >  configs/beelink_x2_defconfig |  18 +++
> >  4 files changed, 240 insertions(+)
> >  create mode 100644 arch/arm/dts/sun8i-h3-beelink-x2.dts
> >  create mode 100644 configs/beelink_x2_defconfig
> >
> > diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
> > index 83058c4452..716108dd2e 100644
> > --- a/arch/arm/dts/Makefile
> > +++ b/arch/arm/dts/Makefile
> > @@ -472,6 +472,7 @@ dtb-$(CONFIG_MACH_SUN8I_H3) += \
> > sun8i-h2-plus-orangepi-r1.dtb \
> > sun8i-h2-plus-orangepi-zero.dtb \
> > sun8i-h3-bananapi-m2-plus.dtb \
> > +   sun8i-h3-beelink-x2.dtb \
> > sun8i-h3-libretech-all-h3-cc.dtb \
> > sun8i-h3-nanopi-m1.dtb \
> > sun8i-h3-nanopi-m1-plus.dtb \
> > diff --git a/arch/arm/dts/sun8i-h3-beelink-x2.dts 
> > b/arch/arm/dts/sun8i-h3-beelink-x2.dts
> > new file mode 100644
> > index 00..25540b7694
> > --- /dev/null
> > +++ b/arch/arm/dts/sun8i-h3-beelink-x2.dts
> > @@ -0,0 +1,216 @@
> > +/*
> > + * Copyright (C) 2017 Marcus Cooper 
> > + *
> > + * This file is dual-licensed: you can use it either under the terms
> > + * of the GPL or the X11 license, at your option. Note that this dual
> > + * licensing only applies to this file, and not this project as a
> > + * whole.
> > + *
> > + *  a) This file is free software; you can redistribute it and/or
> > + * modify it under the terms of the GNU General Public License as
> > + * published by the Free Software Foundation; either version 2 of the
> > + * License, or (at your option) any later version.
> > + *
> > + * This file is distributed in the hope that it will be useful,
> > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> > + * GNU General Public License for more details.
> > + *
> > + * Or, alternatively,
> > + *
> > + *  b) Permission is hereby granted, free of charge, to any person
> > + * obtaining a copy of this software and associated documentation
> > + * files (the "Software"), to deal in the Software without
> > + * restriction, including without limitation the rights to use,
> > + * copy, modify, merge, publish, distribute, sublicense, and/or
> > + * sell copies of the Software, and to permit persons to whom the
> > + * Software is furnished to do so, subject to the following
> > + * conditions:
> > + *
> > + * The above copyright notice and this permission notice shall be
> > + * included in all copies or substantial portions of the Software.
> > + *
> > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
> > + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
> > + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
> > + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
> > + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
> > + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> > + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
> > + * OTHER DEALINGS IN THE SOFTWARE.
> > + */
> > +
> > +/dts-v1/;
> > +#include "sun8i-h3.dtsi"
> > +#include "sunxi-common-regulators.dtsi"
> > +
> > +#include 
> > +#include 
> > +
> > +/ {
> > +   model = "Beelink X2";
> > +   compatible = "roofull,beelink-x2", "allwinner,sun8i-h3";
> > +
> > +   aliases {
> > +   serial0 = &uart0;
> > +   ethernet0 = &emac;
> > +   ethernet1 = &sdiowifi;
> > +   };
> > +
> > +   chosen {
> > +   stdout-path = "serial0:115200n8";
> > +   };
> > +
> > +   connector {
> > +   compatible = "hdmi-connector";
> > +   type = "a";
> > +
> > +   port {
> > +   hdmi_con_in: endpoint {
> > +   remote-endpoi

Re: [linux-sunxi] [PATCH v4] sun8i: h3: Add support for the Beelink-x2 STB

2019-05-26 Thread Code Kipper
On Sun, 26 May 2019 at 14:13, Jernej Škrabec  wrote:
>
> Hi!
>
> Dne nedelja, 26. maj 2019 ob 08:28:41 CEST je codekip...@gmail.com napisal(a):
> > From: Marcus Cooper 
> >
> > The Beelink X2 is an STB based on the Allwinner H3 SoC with a uSD slot,
> > 2 USB ports( 1 * USB-2 Host, 1 USB OTG), a 10/100M ethernet port using the
> > SoC's integrated PHY, Wifi via an sdio wifi chip, HDMI, an IR receiver, a
> > dual colour LED and an optical S/PDIF connector.
> >
> > Signed-off-by: Marcus Cooper 
> > ---
> > Changes in v4:
> > - updated dts to reflex current linux kernel status
> >
> > Changes in v3:
> > - Removed incorrect commit author
> > - Included v1-v2 change info
> >
> > Changes in v2:
> > - updated dts to reflex current linux kernel status
> > ---
> >  arch/arm/dts/Makefile|   1 +
> >  arch/arm/dts/sun8i-h3-beelink-x2.dts | 216 +++
> >  board/sunxi/MAINTAINERS  |   5 +
> >  configs/beelink_x2_defconfig |  19 +++
> >  4 files changed, 241 insertions(+)
> >  create mode 100644 arch/arm/dts/sun8i-h3-beelink-x2.dts
> >  create mode 100644 configs/beelink_x2_defconfig
> >
> > diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
> > index 83058c4452..716108dd2e 100644
> > --- a/arch/arm/dts/Makefile
> > +++ b/arch/arm/dts/Makefile
> > @@ -472,6 +472,7 @@ dtb-$(CONFIG_MACH_SUN8I_H3) += \
> >   sun8i-h2-plus-orangepi-r1.dtb \
> >   sun8i-h2-plus-orangepi-zero.dtb \
> >   sun8i-h3-bananapi-m2-plus.dtb \
> > + sun8i-h3-beelink-x2.dtb \
> >   sun8i-h3-libretech-all-h3-cc.dtb \
> >   sun8i-h3-nanopi-m1.dtb \
> >   sun8i-h3-nanopi-m1-plus.dtb \
> > diff --git a/arch/arm/dts/sun8i-h3-beelink-x2.dts
> > b/arch/arm/dts/sun8i-h3-beelink-x2.dts new file mode 100644
> > index 00..25540b7694
> > --- /dev/null
> > +++ b/arch/arm/dts/sun8i-h3-beelink-x2.dts
> > @@ -0,0 +1,216 @@
> > +/*
> > + * Copyright (C) 2017 Marcus Cooper 
> > + *
> > + * This file is dual-licensed: you can use it either under the terms
> > + * of the GPL or the X11 license, at your option. Note that this dual
> > + * licensing only applies to this file, and not this project as a
> > + * whole.
> > + *
> > + *  a) This file is free software; you can redistribute it and/or
> > + * modify it under the terms of the GNU General Public License as
> > + * published by the Free Software Foundation; either version 2 of the
> > + * License, or (at your option) any later version.
> > + *
> > + * This file is distributed in the hope that it will be useful,
> > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> > + * GNU General Public License for more details.
> > + *
> > + * Or, alternatively,
> > + *
> > + *  b) Permission is hereby granted, free of charge, to any person
> > + * obtaining a copy of this software and associated documentation
> > + * files (the "Software"), to deal in the Software without
> > + * restriction, including without limitation the rights to use,
> > + * copy, modify, merge, publish, distribute, sublicense, and/or
> > + * sell copies of the Software, and to permit persons to whom the
> > + * Software is furnished to do so, subject to the following
> > + * conditions:
> > + *
> > + * The above copyright notice and this permission notice shall be
> > + * included in all copies or substantial portions of the Software.
> > + *
> > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
> > + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
> > + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
> > + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
> > + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
> > + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> > + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
> > + * OTHER DEALINGS IN THE SOFTWARE.
> > + */
> > +
> > +/dts-v1/;
> > +#include "sun8i-h3.dtsi"
> > +#include "sunxi-common-regulators.dtsi"
> > +
> > +#include 
> > +#include 
> > +
> > +/ {
> > + model = "Beelink X2";
> > + compatible = "roofull,beelink-x2", "allwinner,sun8i-h3";
> > +
> > + aliases {
> > + serial0 = &uart0;
> > + ethernet0 = &emac;
> > + ethernet1 = &sdiowifi;
> > + };
> > +
> > + chosen {
> > + stdout-path = "serial0:115200n8";
> > + };
> > +
> > + connector {
> > + compatible = "hdmi-connector";
> > + type = "a";
> > +
> > + port {
> > + hdmi_con_in: endpoint {
> > + remote-endpoint = <&hdmi_out_con>;
> > + };
> > + };
> > + };
> > +
> > + leds {
> > + compatible = "gpio-leds";
> > +
> > + blue {
> > +

Re: [linux-sunxi] [PATCH v4] sun8i: h3: Add support for the Beelink-x2 STB

2019-05-26 Thread Code Kipper
On Sun, 26 May 2019 at 08:42, Jernej Škrabec  wrote:
>
> Hi!
>
> Dne nedelja, 26. maj 2019 ob 08:28:41 CEST je codekip...@gmail.com napisal(a):
> > From: Marcus Cooper 
> >
> > The Beelink X2 is an STB based on the Allwinner H3 SoC with a uSD slot,
> > 2 USB ports( 1 * USB-2 Host, 1 USB OTG), a 10/100M ethernet port using the
> > SoC's integrated PHY, Wifi via an sdio wifi chip, HDMI, an IR receiver, a
> > dual colour LED and an optical S/PDIF connector.
> >
> > Signed-off-by: Marcus Cooper 
> > ---
> > Changes in v4:
> > - updated dts to reflex current linux kernel status
> >
> > Changes in v3:
> > - Removed incorrect commit author
> > - Included v1-v2 change info
> >
> > Changes in v2:
> > - updated dts to reflex current linux kernel status
> > ---
> >  arch/arm/dts/Makefile|   1 +
> >  arch/arm/dts/sun8i-h3-beelink-x2.dts | 216 +++
> >  board/sunxi/MAINTAINERS  |   5 +
> >  configs/beelink_x2_defconfig |  19 +++
> >  4 files changed, 241 insertions(+)
> >  create mode 100644 arch/arm/dts/sun8i-h3-beelink-x2.dts
> >  create mode 100644 configs/beelink_x2_defconfig
> >
> > diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
> > index 83058c4452..716108dd2e 100644
> > --- a/arch/arm/dts/Makefile
> > +++ b/arch/arm/dts/Makefile
> > @@ -472,6 +472,7 @@ dtb-$(CONFIG_MACH_SUN8I_H3) += \
> >   sun8i-h2-plus-orangepi-r1.dtb \
> >   sun8i-h2-plus-orangepi-zero.dtb \
> >   sun8i-h3-bananapi-m2-plus.dtb \
> > + sun8i-h3-beelink-x2.dtb \
> >   sun8i-h3-libretech-all-h3-cc.dtb \
> >   sun8i-h3-nanopi-m1.dtb \
> >   sun8i-h3-nanopi-m1-plus.dtb \
> > diff --git a/arch/arm/dts/sun8i-h3-beelink-x2.dts
> > b/arch/arm/dts/sun8i-h3-beelink-x2.dts new file mode 100644
> > index 00..25540b7694
> > --- /dev/null
> > +++ b/arch/arm/dts/sun8i-h3-beelink-x2.dts
> > @@ -0,0 +1,216 @@
> > +/*
> > + * Copyright (C) 2017 Marcus Cooper 
> > + *
> > + * This file is dual-licensed: you can use it either under the terms
> > + * of the GPL or the X11 license, at your option. Note that this dual
> > + * licensing only applies to this file, and not this project as a
> > + * whole.
> > + *
> > + *  a) This file is free software; you can redistribute it and/or
> > + * modify it under the terms of the GNU General Public License as
> > + * published by the Free Software Foundation; either version 2 of the
> > + * License, or (at your option) any later version.
> > + *
> > + * This file is distributed in the hope that it will be useful,
> > + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> > + * GNU General Public License for more details.
> > + *
> > + * Or, alternatively,
> > + *
> > + *  b) Permission is hereby granted, free of charge, to any person
> > + * obtaining a copy of this software and associated documentation
> > + * files (the "Software"), to deal in the Software without
> > + * restriction, including without limitation the rights to use,
> > + * copy, modify, merge, publish, distribute, sublicense, and/or
> > + * sell copies of the Software, and to permit persons to whom the
> > + * Software is furnished to do so, subject to the following
> > + * conditions:
> > + *
> > + * The above copyright notice and this permission notice shall be
> > + * included in all copies or substantial portions of the Software.
> > + *
> > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
> > + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
> > + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
> > + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
> > + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
> > + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> > + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
> > + * OTHER DEALINGS IN THE SOFTWARE.
> > + */
> > +
> > +/dts-v1/;
> > +#include "sun8i-h3.dtsi"
> > +#include "sunxi-common-regulators.dtsi"
> > +
> > +#include 
> > +#include 
> > +
> > +/ {
> > + model = "Beelink X2";
> > + compatible = "roofull,beelink-x2", "allwinner,sun8i-h3";
> > +
> > + aliases {
> > + serial0 = &uart0;
> > + ethernet0 = &emac;
> > + ethernet1 = &sdiowifi;
> > + };
> > +
> > + chosen {
> > + stdout-path = "serial0:115200n8";
> > + };
> > +
> > + connector {
> > + compatible = "hdmi-connector";
> > + type = "a";
> > +
> > + port {
> > + hdmi_con_in: endpoint {
> > + remote-endpoint = <&hdmi_out_con>;
> > + };
> > + };
> > + };
> > +
> > + leds {
> > + compatible = "gpio-leds";
> > +
> > + blue {
> > +

Re: [linux-sunxi] Re: Stable Kernel 4.20.1 (NanoPi A64 / BananaPi M64)

2019-01-13 Thread Code Kipper
On Sun, 13 Jan 2019 at 18:42, @lex  wrote:
>
> Hmm, i thought you would know about the wrong size, or where to look for.
> The patches are maybe from Icenowy, Jagan and some others, maybe they can 
> give some directions.
> I have seen a showcase of Pine64SO with sound working but have yet to see a 
> public DTS for kernel 4.20 as i have provided here, but if someone can point 
> me to a complete DTS and dtsi please do so.
the changes have now made it into linux-next
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/log/arch/arm64/boot/dts/allwinner?h=next-20190111

>
> my little understanding is that A64 has 2 sensors, it is certainly not 0 in 
> #thermal-sensor-cells.
>
> Thermal sensor devices are nodes providing temperature sensing capabilities on
> thermal zones. Typical devices are I2C ADC converters and bandgaps. These are
> nodes providing temperature data to thermal zones. Thermal sensor devices may
> control one or more internal sensors.
>
> Required property:
> - #thermal-sensor-cells: Used to provide sensor device specific information
>   Type: unsigned while referring to it. Typically 0 on thermal sensor
>   Size: one cell nodes with only one sensor, and at least 1 on nodes
> with several internal sensors, in order
> to identify uniquely the sensor instances within
> the IC. See thermal zone binding for more details
> on how consumers refer to sensor devices.
>
>
> /*
> * An IC with several temperature sensor.
> */
> adc_dummy: sensor@50 {
> ...
> #thermal-sensor-cells = <1>; /* sensor internal ID */
> };
>
>
> Thanks
>
> On Sunday, January 13, 2019 at 12:48:43 PM UTC-2, CodeKipper wrote:
>>
>> On Sun, 13 Jan 2019 at 13:35, @lex  wrote:
>> >
>> > Hi Marcus,
>> > Thank you for the input.
>> >
>> > The patch seems to be verbatim.
>> > The message is clear about the size mismatch, but where it should be fixed?
>> >
>> > #thermal-sensor-cells = <2>; <= this gives the warning about the wronng 
>> > size
>> >
>> > The bootlog below is when #thermal-sensor-cells = <1>;  and no ths 
>> > calibration.
>> >
>> > Here i provide the complete DTS for the NanoPi A4 / BananaPi M64.
>> > Tested on NanoPi A64 with the following working:
>> > * ethernet
>> > * wifi
>> > * mali (3D)
>> > * hdmi
>> >
>> > Not tested yet:
>> > sunxi_cedrus
>> >
>> > Not working (yet I presume):
>> > * sound
>> > * thermal
>> just doing a comparison with a fresh armbian install. Audio doesn't
>> seem to work for you as sun8i-codec, sun4i-i2s, sun50i_codec_analog
>> and sun8i_adda_pr_regmap haven't been probed. They all seem to be in
>> the config file so should be available to you.
>> Not sure about the thermal side but the Documentation states that
>> thernal-sensor-cells should be 0. The patchset that you've
>> cherry-picked had a lot of comments, maybe contact the author to see
>> if he's updated it.
>> BR,
>> CK
>> > Modules loaded
>> > https://gist.github.com/avafinger/59a44d3429627939ac026268b8f2fef3
>> >
>> > .config
>> > https://gist.github.com/avafinger/b86ab9474401991796d2d6f3be447cc6
>> >
>> > boot log
>> > https://gist.github.com/avafinger/e50e084c09124b567f9ba66fb35903f7
>> >
>> > DTS
>> > https://gist.github.com/avafinger/c326ebf61d5bb87423a9541f785b77c6
>> >
>> > Thanks
>> >
>> > On Sunday, January 13, 2019 at 7:10:41 AM UTC-2, CodeKipper wrote:
>> >>
>> >> s
>> >> s
>> >>
>> >> On Sat, 12 Jan 2019 at 20:33, @lex  wrote:
>> >> >
>> >> > I've tried to apply this patch in a hope to get the thermal sensor 
>> >> > working but things got hairy, can anyone please explain what is wrong 
>> >> > with this patch:
>> >> > https://patchwork.kernel.org/patch/10555615/
>> >> Hi Alex,
>> >> check the patch after applying git show BLAH to check that it lsooks
>> >> the same as the original. For debugging the below and also the sound
>> >> card could you paste the following somewhere
>> >> arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts
>> >> arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts
>> >> arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
>> >> .config
>> >> serial console/dmesg
>> >> BR,
>> >> CK
>> >> >
>> >> > Warnings:
>> >> >
>> >> >  DTC arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dtb
>> >> > arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dtb: Warning 
>> >> > (reg_format): /soc/eeprom@1c14000/calib@234:reg: property has invalid 
>> >> > length (8 bytes) (#address-cells == 2, #size-cells == 1)
>> >> > arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dtb: Warning 
>> >> > (pci_device_bus_num): Failed prerequisite 'reg_format'
>> >> > arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dtb: Warning 
>> >> > (simple_bus_reg): Failed prerequisite 'reg_format'
>> >> > arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dtb: Warning 
>> >> > (i2c_bus_reg): Failed prerequisite 'reg_format'
>> >> > arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dtb: Warning 
>> >> > (spi_bus_reg): Failed prerequisite 'reg_format'
>> >> > arch/arm64/boot/dts/allwinner/s

Re: [linux-sunxi] Re: Stable Kernel 4.20.1 (NanoPi A64 / BananaPi M64)

2019-01-13 Thread Code Kipper
On Sun, 13 Jan 2019 at 13:35, @lex  wrote:
>
> Hi Marcus,
> Thank you for the input.
>
> The patch seems to be verbatim.
> The message is clear about the size mismatch, but where it should be fixed?
>
> #thermal-sensor-cells = <2>; <= this gives the warning about the wronng size
>
> The bootlog below is when #thermal-sensor-cells = <1>;  and no ths 
> calibration.
>
> Here i provide the complete DTS for the NanoPi A4 / BananaPi M64.
> Tested on NanoPi A64 with the following working:
> * ethernet
> * wifi
> * mali (3D)
> * hdmi
>
> Not tested yet:
> sunxi_cedrus
>
> Not working (yet I presume):
> * sound
> * thermal
just doing a comparison with a fresh armbian install. Audio doesn't
seem to work for you as sun8i-codec, sun4i-i2s, sun50i_codec_analog
and sun8i_adda_pr_regmap haven't been probed. They all seem to be in
the config file so should be available to you.
Not sure about the thermal side but the Documentation states that
thernal-sensor-cells should be 0. The patchset that you've
cherry-picked had a lot of comments, maybe contact the author to see
if he's updated it.
BR,
CK
> Modules loaded
> https://gist.github.com/avafinger/59a44d3429627939ac026268b8f2fef3
>
> .config
> https://gist.github.com/avafinger/b86ab9474401991796d2d6f3be447cc6
>
> boot log
> https://gist.github.com/avafinger/e50e084c09124b567f9ba66fb35903f7
>
> DTS
> https://gist.github.com/avafinger/c326ebf61d5bb87423a9541f785b77c6
>
> Thanks
>
> On Sunday, January 13, 2019 at 7:10:41 AM UTC-2, CodeKipper wrote:
>>
>> s
>> s
>>
>> On Sat, 12 Jan 2019 at 20:33, @lex  wrote:
>> >
>> > I've tried to apply this patch in a hope to get the thermal sensor working 
>> > but things got hairy, can anyone please explain what is wrong with this 
>> > patch:
>> > https://patchwork.kernel.org/patch/10555615/
>> Hi Alex,
>> check the patch after applying git show BLAH to check that it lsooks
>> the same as the original. For debugging the below and also the sound
>> card could you paste the following somewhere
>> arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts
>> arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts
>> arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
>> .config
>> serial console/dmesg
>> BR,
>> CK
>> >
>> > Warnings:
>> >
>> >  DTC arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dtb
>> > arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dtb: Warning 
>> > (reg_format): /soc/eeprom@1c14000/calib@234:reg: property has invalid 
>> > length (8 bytes) (#address-cells == 2, #size-cells == 1)
>> > arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dtb: Warning 
>> > (pci_device_bus_num): Failed prerequisite 'reg_format'
>> > arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dtb: Warning 
>> > (simple_bus_reg): Failed prerequisite 'reg_format'
>> > arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dtb: Warning 
>> > (i2c_bus_reg): Failed prerequisite 'reg_format'
>> > arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dtb: Warning 
>> > (spi_bus_reg): Failed prerequisite 'reg_format'
>> > arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dtb: Warning 
>> > (avoid_default_addr_size): /soc/eeprom@1c14000/calib@234: Relying on 
>> > default #address-cells value
>> > arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dtb: Warning 
>> > (avoid_default_addr_size): /soc/eeprom@1c14000/calib@234: Relying on 
>> > default #size-cells value
>> > arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dtb: Warning 
>> > (thermal_sensors_property): /thermal-zones/cpu0-thermal:thermal-sensors: 
>> > property size (8) too small for cell size 2
>> > arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dtb: Warning 
>> > (thermal_sensors_property): /thermal-zones/gpu0-thermal:thermal-sensors: 
>> > property size (8) too small for cell size 2
>> > arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dtb: Warning 
>> > (thermal_sensors_property): /thermal-zones/gpu1-thermal:thermal-sensors: 
>> > property size (8) too small for cell size 2
>> >   DTC arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dtb
>> > arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dtb: Warning 
>> > (reg_format): /soc/eeprom@1c14000/calib@234:reg: property has invalid 
>> > length (8 bytes) (#address-cells == 2, #size-cells == 1)
>> > arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dtb: Warning 
>> > (pci_device_bus_num): Failed prerequisite 'reg_format'
>> > arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dtb: Warning 
>> > (simple_bus_reg): Failed prerequisite 'reg_format'
>> > arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dtb: Warning 
>> > (i2c_bus_reg): Failed prerequisite 'reg_format'
>> > arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dtb: Warning 
>> > (spi_bus_reg): Failed prerequisite 'reg_format'
>> > arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dtb: Warning 
>> > (avoid_default_addr_size): /soc/eeprom@1c14000/calib@234: Relying on 
>> > default #address-cells value
>> > arch/arm64/boot/dts/allwinner

Re: [linux-sunxi] Re: Stable Kernel 4.20.1 (NanoPi A64 / BananaPi M64)

2019-01-13 Thread Code Kipper
s
s

On Sat, 12 Jan 2019 at 20:33, @lex  wrote:
>
> I've tried to apply this patch in a hope to get the thermal sensor working 
> but things got hairy, can anyone please explain what is wrong with this patch:
> https://patchwork.kernel.org/patch/10555615/
Hi Alex,
check the patch after applying git show BLAH to check that it lsooks
the same as the original. For debugging the below and also the sound
card could you paste the following somewhere
arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts
arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts
arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
.config
serial console/dmesg
BR,
CK
>
> Warnings:
>
>  DTC arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dtb
> arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dtb: Warning 
> (reg_format): /soc/eeprom@1c14000/calib@234:reg: property has invalid length 
> (8 bytes) (#address-cells == 2, #size-cells == 1)
> arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dtb: Warning 
> (pci_device_bus_num): Failed prerequisite 'reg_format'
> arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dtb: Warning 
> (simple_bus_reg): Failed prerequisite 'reg_format'
> arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dtb: Warning 
> (i2c_bus_reg): Failed prerequisite 'reg_format'
> arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dtb: Warning 
> (spi_bus_reg): Failed prerequisite 'reg_format'
> arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dtb: Warning 
> (avoid_default_addr_size): /soc/eeprom@1c14000/calib@234: Relying on default 
> #address-cells value
> arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dtb: Warning 
> (avoid_default_addr_size): /soc/eeprom@1c14000/calib@234: Relying on default 
> #size-cells value
> arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dtb: Warning 
> (thermal_sensors_property): /thermal-zones/cpu0-thermal:thermal-sensors: 
> property size (8) too small for cell size 2
> arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dtb: Warning 
> (thermal_sensors_property): /thermal-zones/gpu0-thermal:thermal-sensors: 
> property size (8) too small for cell size 2
> arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dtb: Warning 
> (thermal_sensors_property): /thermal-zones/gpu1-thermal:thermal-sensors: 
> property size (8) too small for cell size 2
>   DTC arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dtb
> arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dtb: Warning 
> (reg_format): /soc/eeprom@1c14000/calib@234:reg: property has invalid length 
> (8 bytes) (#address-cells == 2, #size-cells == 1)
> arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dtb: Warning 
> (pci_device_bus_num): Failed prerequisite 'reg_format'
> arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dtb: Warning 
> (simple_bus_reg): Failed prerequisite 'reg_format'
> arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dtb: Warning 
> (i2c_bus_reg): Failed prerequisite 'reg_format'
> arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dtb: Warning 
> (spi_bus_reg): Failed prerequisite 'reg_format'
> arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dtb: Warning 
> (avoid_default_addr_size): /soc/eeprom@1c14000/calib@234: Relying on default 
> #address-cells value
> arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dtb: Warning 
> (avoid_default_addr_size): /soc/eeprom@1c14000/calib@234: Relying on default 
> #size-cells value
> arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dtb: Warning 
> (thermal_sensors_property): /thermal-zones/cpu0-thermal:thermal-sensors: 
> property size (8) too small for cell size 2
> arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dtb: Warning 
> (thermal_sensors_property): /thermal-zones/gpu0-thermal:thermal-sensors: 
> property size (8) too small for cell size 2
> arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dtb: Warning 
> (thermal_sensors_property): /thermal-zones/gpu1-thermal:thermal-sensors: 
> property size (8) too small for cell size 2
>
>
>
> On Friday, January 11, 2019 at 6:38:05 PM UTC-2, @lex wrote:
>>
>> Hi,
>> I am running stable kernel 4.20.1 on NanoPi A64 with the linux-sunxi 
>> community patches and it works really well thanks for the hard work however 
>> i am struggling to get the sound card (any) detected and the upper USB 
>> receptacle is not working (for some reason).
>>
>> Regarding the USB upper slot i have in my dtsi:
>>
>>  usbphy: phy@1c19400 {
>>  compatible = "allwinner,sun50i-a64-usb-phy";
>>  reg = <0x01c19400 0x14>,
>><0x01c1a800 0x4>,
>><0x01c1b800 0x4>;
>>  reg-names = "phy_ctrl",
>>  "pmu0",
>>  "pmu1";
>>  clocks = <&ccu CLK_USB_PHY0>,
>>  <&ccu CLK_USB_PHY1>;
>>  clock-names = "usb0_phy",
>>"usb1_phy";
>>  resets = <&ccu RST_USB_PHY0>,
>>  <&ccu RST_USB_PHY1>;
>>  reset-names = "usb0_reset",
>>"usb1_reset";
>>  status = "disabled";
>>  #phy-cells = <1>;
>>  };
>>
>>
>>  ehci0: usb@1c1a000 {
>>  compatible = "allwinner,sun50i-a64-ehci", "generic-eh

Re: [linux-sunxi] [BUG] On Allwinner A20 Board Cubietruck distorted SPDIF opical output

2018-05-23 Thread Code Kipper
Hi All,
I can see that the problem was introduced somewhere here

DOESN'T WORK
ffc3eb6f3a83 Merge tag 'sunxi-clk-for-4.15' of
https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux into
clk-next
ae74ac082886 Merge tag 'clk-v4.15-exynos-pm' of
git://git.kernel.org/pub/scm/linux/kernel/git/snawrocki/clk into
clk-next
faa865f18cb7 Merge tag 'clk-v4.15-samsung' of
git://git.kernel.org/pub/scm/linux/kernel/git/snawrocki/clk into
clk-next
f09a6b86fdae Merge tag 'clk-renesas-for-v4.15-tag1' of
git://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-drivers
into clk-next
4328a2186e51 clk: sunxi-ng: sun4i: Export video PLLs
553c7d5ba2fe clk: sunxi-ng: Add A83T display clocks
7679eb20353d clk: samsung: Add a separate driver for Exynos4412 ISP clocks
8ca8ac102484 clk: samsung: Add dt bindings for Exynos4412 ISP clock controller
75920aac275a clk: samsung: Instantiate Exynos4412 ISP clocks only when available
24ea78a09f89 clk: sunxi-ng: sun8i: a23: Use sigma-delta modulation for audio PLL
ee6501d69217 clk: sunxi-ng: sun6i: Use sigma-delta modulation for audio PLL
042f7f8f9715 clk: sunxi-ng: sun5i: Use sigma-delta modulation for audio PLL
de3448519194 clk: sunxi-ng: sun4i: Use sigma-delta modulation for audio PLL
a5e3e2b2ef85 clk: sunxi-ng: sun8i: h3: Use sigma-delta modulation for audio PLL
392ba5fafcdf clk: sunxi-ng: nm: Add support for sigma-delta modulation
05d2eaac96d4 clk: sunxi-ng: Add sigma-delta modulation support
4cdbc40d64d4 clk: sunxi-ng: nm: Check if requested rate is supported
by fractional clock
d51fe3ba9773 clk: sunxi-ng: sun5i: Fix bit offset of audio PLL post-divider
4e8975cbb516 clk: samsung: exynos5433: mark PM functions as __maybe_unused
a4f21e9ceb5c clk: samsung: Remove obsolete clkdev alias support
45d882daf88a clk: samsung: Add explicit MPLL, EPLL clkdev aliases in
S3C2443 driver
cd05417f728b clk: samsung: Rework clkdev alias handling in S3C2443 driver
efea8d377184 clk: samsung: Rework clkdev alias handling in Exynos5440 driver
36ba48240b19 clk: samsung: Drop useless alias in Exynos5420 clk driver
29964890f31c clk: samsung: Remove clkdev alias support in Exynos5250 clk driver
6de08891c896 clk: samsung: Remove double assignment of CLK_ARM_CLK in
Exynos4 driver
58f4a5ff3a62 clk: samsung: Remove clkdev alias support in Exynos4 clk driver
c9194fb623b0 clk: samsung: Remove support for obsolete Exynos4212 CPU clock
d5cd103b06f9 clk: samsung: Remove support for Exynos4212 SoCs in
Exynos CLKOUT driver
7c4f63ec94a1 clk: sunxi-ng: a83t: Fix invalid csi-mclk mux offset
WORKS
0a4e632b6f9d Merge branch 'clk-fixes' into clk-next

BR,
CK


On 22 May 2018 at 21:27, Code Kipper  wrote:
> Hi Markus,
> I've been able to reproduce this on my A31 board with linux-next(plays
> at 44100 but not at 96K)so it is an issue. I also tested the same code
> on my A64 and it worked fine, The blocks are very similar so it maybe
> a clocking issue, I'll look into this.
> BR,
> CK
>
> On 21 May 2018 at 20:17, Markus Mitsch  wrote:
>> 2018-05-21 15:17 GMT+02:00 Maxime Ripard :
>>> On Mon, May 21, 2018 at 02:43:55PM +0200, Markus Mitsch wrote:
>>>> 2018-05-21 11:43 GMT+02:00 Markus Mitsch :
>>>> >>> Hello,
>>>> >>>
>>>> >>> i have a new problem. if i want to output sound from optical i get
>>>> >>> distorted sound. At 44.1 khz its like an old vinly, but at 48 khz and
>>>> >>> higher it is very bad. thanks in advance for your time.
>>>> >
>>>> >> Hi Markus,
>>>> >> I haven't tested it for a while but when I did it worked as high as
>>>> >> 96K with no issues. Does it work ok with the original cubietruck
>>>> >> software?,
>>>> >> CK
>>>> >
>>>> > Hello,
>>>> > i am using arch linux with mainline kernel 4.16.8. parhaps i can try
>>>> > today with official image.
>>>> > mfg
>>>>
>>>> Hi.
>>>> So, with debian image from 2014 with 3.4.79 kernel the sound is clear
>>>> up to 96 khz.
>>>
>>> You said that it is a new problem, when was it introduced? Could you
>>> bisect the issue?
>>>
>>> Maxime
>>
>> Hello.
>> I dont know since when this problem appears. When saying "new" i
>> refered to my older post. I tried to look into the dts file and the
>> code
>> but i am afraid this is a bit too high for me. I can say that the
>> analog output works, even at high sampling rates.
>> And I have read something about a clock source could be the problem.
>> I'm sorry I can't tell you any more.
>>
>> mfg
>> Markus

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi] [BUG] On Allwinner A20 Board Cubietruck distorted SPDIF opical output

2018-05-22 Thread Code Kipper
Hi Markus,
I've been able to reproduce this on my A31 board with linux-next(plays
at 44100 but not at 96K)so it is an issue. I also tested the same code
on my A64 and it worked fine, The blocks are very similar so it maybe
a clocking issue, I'll look into this.
BR,
CK

On 21 May 2018 at 20:17, Markus Mitsch  wrote:
> 2018-05-21 15:17 GMT+02:00 Maxime Ripard :
>> On Mon, May 21, 2018 at 02:43:55PM +0200, Markus Mitsch wrote:
>>> 2018-05-21 11:43 GMT+02:00 Markus Mitsch :
>>> >>> Hello,
>>> >>>
>>> >>> i have a new problem. if i want to output sound from optical i get
>>> >>> distorted sound. At 44.1 khz its like an old vinly, but at 48 khz and
>>> >>> higher it is very bad. thanks in advance for your time.
>>> >
>>> >> Hi Markus,
>>> >> I haven't tested it for a while but when I did it worked as high as
>>> >> 96K with no issues. Does it work ok with the original cubietruck
>>> >> software?,
>>> >> CK
>>> >
>>> > Hello,
>>> > i am using arch linux with mainline kernel 4.16.8. parhaps i can try
>>> > today with official image.
>>> > mfg
>>>
>>> Hi.
>>> So, with debian image from 2014 with 3.4.79 kernel the sound is clear
>>> up to 96 khz.
>>
>> You said that it is a new problem, when was it introduced? Could you
>> bisect the issue?
>>
>> Maxime
>
> Hello.
> I dont know since when this problem appears. When saying "new" i
> refered to my older post. I tried to look into the dts file and the
> code
> but i am afraid this is a bit too high for me. I can say that the
> analog output works, even at high sampling rates.
> And I have read something about a clock source could be the problem.
> I'm sorry I can't tell you any more.
>
> mfg
> Markus

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi] [BUG] On Allwinner A20 Board Cubietruck distorted SPDIF opical output

2018-05-20 Thread Code Kipper
On 20 May 2018 at 14:23, 'Markus Mitsch' via linux-sunxi
 wrote:
> Hello,
>
> i have a new problem. if i want to output sound from optical i get
> distorted sound. At 44.1 khz its like an old vinly, but at 48 khz and
> higher it is very bad. thanks in advance for your time.
Hi Markus,
I haven't tested it for a while but when I did it worked as high as
96K with no issues. Does it work ok with the original cubietruck
software?,
CK
>
> mfg
>
> --
> You received this message because you are subscribed to the Google Groups 
> "linux-sunxi" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to linux-sunxi+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Re: [PATCH v2 4/6] ASoC: sun4i-i2s: Add multi-lane functionality

2018-03-13 Thread Code Kipper
On 13 March 2018 at 09:23, Maxime Ripard  wrote:
> On Tue, Mar 13, 2018 at 09:15:49AM +0100, Code Kipper wrote:
>> On 13 March 2018 at 09:00, Maxime Ripard  wrote:
>> > On Mon, Mar 12, 2018 at 04:57:51PM +0100, codekip...@gmail.com wrote:
>> >> From: Marcus Cooper 
>> >>
>> >> The i2s block supports multi-lane i2s output however this functionality
>> >> is only possible in earlier SoCs where the pins are exposed and for
>> >> the i2s block used for HDMI audio on the later SoCs.
>> >>
>> >> To enable this functionality, an optional property has been added to
>> >> the bindings.
>> >>
>> >> Signed-off-by: Marcus Cooper 
>> >> ---
>> >>  .../devicetree/bindings/sound/sun4i-i2s.txt|  3 ++
>> >>  sound/soc/sunxi/sun4i-i2s.c| 48 
>> >> +-
>> >>  2 files changed, 41 insertions(+), 10 deletions(-)
>> >>
>> >> diff --git a/Documentation/devicetree/bindings/sound/sun4i-i2s.txt 
>> >> b/Documentation/devicetree/bindings/sound/sun4i-i2s.txt
>> >> index 48addef65b8f..3f966ac61b9e 100644
>> >> --- a/Documentation/devicetree/bindings/sound/sun4i-i2s.txt
>> >> +++ b/Documentation/devicetree/bindings/sound/sun4i-i2s.txt
>> >> @@ -33,6 +33,9 @@ Optional properties:
>> >>   configured to extend the slot width to the
>> >>   value specified. Min 8, Max 32.
>> >>
>> >> +- allwinner,playback-channels:  if this property is present then the 
>> >> number
>> >> + of available channels is extended and the
>> >> + outputs enabled.
>> >
>> > Isn't it something that is fixed for each generation of SoCs? Can't we
>> > attach it to the compatible?
>>
>> I'm not sure as the documentation is pretty poor. It looks like it is
>> supported by all of the variations that we've seen but only exposed as
>> pins on A10 and A20. I'm also not sure who would ever use it with
>> external devices.
>
> Well, you were saying that it was the case on the older SoCs in your
> commit log, so this needs to be figured out.
>
>> The reason why I've added it is that it is required by HDMI for
>> supporting surround sound on the newer SoCs.
>
> Why isn't that mentionned in your commit log?
>
> Can you post the whole set of changes needed for HDMI audio? this
> would make things much easier to see where you're going.

Maybe we should drop this change for now as basic HDMI audio for two
channels doesn't require it. I've also not tested multi-channel audio
yet.

To get HDMI audio working the following patches are required for the dts
https://github.com/codekipper/linux-sunxi/commit/997c622ae10ef136bae0a35a0e9bf9c6dd27910a
and
https://github.com/codekipper/linux-sunxi/commit/4a81676d30a0262c57ffc0827e46c7934fb3b358

they don't need this patch but do need the slot-width-override patch.

CK
>
> Maxime
>
> --
> Maxime Ripard, Bootlin (formerly Free Electrons)
> Embedded Linux and Kernel engineering
> https://bootlin.com

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Re: [PATCH v2 4/6] ASoC: sun4i-i2s: Add multi-lane functionality

2018-03-13 Thread Code Kipper
On 13 March 2018 at 09:00, Maxime Ripard  wrote:
> On Mon, Mar 12, 2018 at 04:57:51PM +0100, codekip...@gmail.com wrote:
>> From: Marcus Cooper 
>>
>> The i2s block supports multi-lane i2s output however this functionality
>> is only possible in earlier SoCs where the pins are exposed and for
>> the i2s block used for HDMI audio on the later SoCs.
>>
>> To enable this functionality, an optional property has been added to
>> the bindings.
>>
>> Signed-off-by: Marcus Cooper 
>> ---
>>  .../devicetree/bindings/sound/sun4i-i2s.txt|  3 ++
>>  sound/soc/sunxi/sun4i-i2s.c| 48 
>> +-
>>  2 files changed, 41 insertions(+), 10 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/sound/sun4i-i2s.txt 
>> b/Documentation/devicetree/bindings/sound/sun4i-i2s.txt
>> index 48addef65b8f..3f966ac61b9e 100644
>> --- a/Documentation/devicetree/bindings/sound/sun4i-i2s.txt
>> +++ b/Documentation/devicetree/bindings/sound/sun4i-i2s.txt
>> @@ -33,6 +33,9 @@ Optional properties:
>>   configured to extend the slot width to the
>>   value specified. Min 8, Max 32.
>>
>> +- allwinner,playback-channels:  if this property is present then the number
>> + of available channels is extended and the
>> + outputs enabled.
>
> Isn't it something that is fixed for each generation of SoCs? Can't we
> attach it to the compatible?

I'm not sure as the documentation is pretty poor. It looks like it is
supported by all of the variations that we've seen but only exposed as
pins on A10 and A20. I'm also not sure who would ever use it with
external devices.
The reason why I've added it is that it is required by HDMI for
supporting surround sound on the newer SoCs.
CK

>
> Maxime
>
> --
> Maxime Ripard, Bootlin (formerly Free Electrons)
> Embedded Linux and Kernel engineering
> https://bootlin.com

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi][PATCH] ARM: dts: sun7i: Enable HDMI support on the Olimex EVB

2018-01-31 Thread Code Kipper
On 31 January 2018 at 16:34, Maxime Ripard
 wrote:
> On Tue, Jan 30, 2018 at 08:50:54AM +0100, codekip...@gmail.com wrote:
>> From: Marcus Cooper 
>>
>> Enable the display pipeline and HDMI output on the Olimex
>> A20-SOM-EVB.
>>
>> Signed-off-by: Marcus Cooper 
>> ---
>>  arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts | 25 
>> +
>>  1 file changed, 25 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts 
>> b/arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts
>> index 64c8ef9a2756..07906d4f8758 100644
>> --- a/arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts
>> +++ b/arch/arm/boot/dts/sun7i-a20-olimex-som-evb.dts
>> @@ -61,6 +61,17 @@
>>   stdout-path = "serial0:115200n8";
>>   };
>>
>> + hdmi-connector {
>> + compatible = "hdmi-connector";
>> + type = "a";
>> +
>> + port {
>> + hdmi_con_in: endpoint {
>> + remote-endpoint = <&hdmi_out_con>;
>> + };
>> + };
>> + };
>> +
>>   leds {
>>   compatible = "gpio-leds";
>>   pinctrl-names = "default";
>> @@ -79,6 +90,10 @@
>>   status = "okay";
>>  };
>>
>> +&de {
>> + status = "okay";
>> +};
>> +
>>  &ehci0 {
>>   status = "okay";
>>  };
>> @@ -107,6 +122,16 @@
>>   };
>>  };
>>
>> +&hdmi {
>> + status = "okay";
>> +};
>> +
>> +&hdmi_out {
>> + hdmi_out_con: endpoint {
>> + remote-endpoint = <&hdmi_con_in>;
>> + };
>> +};
>> +
>
> The indentation is not correct here.
ACK
>
> Maxime
>
> --
> Maxime Ripard, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi][PATCH] ARM: sun6i: a31: Enable HDMI support on the Mele I7

2018-01-31 Thread Code Kipper
On 31 January 2018 at 16:32, Maxime Ripard
 wrote:
> On Tue, Jan 30, 2018 at 07:33:27PM +0100, codekip...@gmail.com wrote:
>> From: Marcus Cooper 
>>
>> The Mele I7 has an HDMI connector wired to the HDMI pins
>> on the SoC. Enable the display pipeline and HDMI output.
>>
>> Signed-off-by: Marcus Cooper 
>
> Chen-Yu is missing from the recipients...
ACK...I'll update my git config for this repo.
>
>> ---
>>  arch/arm/boot/dts/sun6i-a31-i7.dts | 29 +
>>  1 file changed, 29 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/sun6i-a31-i7.dts 
>> b/arch/arm/boot/dts/sun6i-a31-i7.dts
>> index 010a84c7c012..4f69be4988a5 100644
>> --- a/arch/arm/boot/dts/sun6i-a31-i7.dts
>> +++ b/arch/arm/boot/dts/sun6i-a31-i7.dts
>> @@ -58,6 +58,17 @@
>>   stdout-path = "serial0:115200n8";
>>   };
>>
>> + hdmi-connector {
>> + compatible = "hdmi-connector";
>> + type = "a";
>> +
>> + port {
>> + hdmi_con_in: endpoint {
>> + remote-endpoint = <&hdmi_out_con>;
>> + };
>> + };
>> + };
>> +
>>   leds {
>>   compatible = "gpio-leds";
>>   pinctrl-names = "default";
>> @@ -93,6 +104,10 @@
>>   status = "okay";
>>  };
>>
>> +&de {
>> + status = "okay";
>> +};
>> +
>>  &ehci0 {
>>   status = "okay";
>>  };
>> @@ -101,6 +116,16 @@
>>   status = "okay";
>>  };
>>
>> +&hdmi {
>> + status = "okay";
>> +};
>> +
>> +&hdmi_out {
>> + hdmi_out_con: endpoint {
>> + remote-endpoint = <&hdmi_con_in>;
>> + };
>> +};
>> +
>>  &gmac {
>
> And this is not ordered alphabetically.
ACKarrgghhh
Will fix and repush soon.
BR,
CK
>
> maxime
>
> --
> Maxime Ripard, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi][PATCH] ARM: dts: sunxi: h3/h5: Add DAI node for HDMI

2018-01-31 Thread Code Kipper
On 31 January 2018 at 08:16, maxime ripard
 wrote:
> On Mon, Jan 29, 2018 at 11:35:27AM +0100, Jernej Škrabec wrote:
>> Hi Maxime,
>>
>> (previously I respond only to linux-sunxi mailing list)
>>
>> >On Mon, Jan 29, 2018 at 10:22:23AM +0100, codekip...@gmail.com wrote:
>> >> From: Marcus Cooper 
>> >>
>> >> Add the new DAI block for I2S2 which is used for HDMI audio.
>> >>
>> >> Signed-off-by: Marcus Cooper 
>> >
>> >queued for 4.17, thanks!
>> >Maxime
>>
>> Please note that HDMI I2S has usable 4 I2S lanes, since HDMI
>> supports 8 channel audio. As Marcus said, other blocks probably
>> support them too, they are just not wired out on pins.
>
> I've dropped those patches for now.
>
>> Should we change compatible for HDMI?
>
> I guess, another way of doing things if they are strictly identical
> but for the number of lanes they support would be to add a DT property
> for that number of lanes.
>
That's fine...I'll look into adding a dt property and how we would map
channels to lanes.
Do you know of any examples?,
BR,
CK
> Maxime
>
> --
> Maxime Ripard, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi] [PATCH 1/3] ASoC: sun4i-i2s: Add set_tdm_slot functionality

2018-01-29 Thread Code Kipper
On 29 January 2018 at 12:32, Mark Brown  wrote:
> On Mon, Jan 29, 2018 at 08:34:00AM +0100, Code Kipper wrote:
>
>> I'm not sure..I was looking for a clean example of being able to
>> override the number of bclks in the lrclk width and some other
>> devices(Rpi) were doing it this way.  I open to suggestions,
>
> You're looking for set_bclk_ratio() I think.
Hi Mark,
I'm looking for a mechanism to be able to override the bclk width
(usually it's based on param_width) from the device tree. The tdm slot
functionality looked just what I needed.
BR,
CK

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi][PATCH] ARM: dts: sunxi: h3/h5: Add DAI node for HDMI

2018-01-29 Thread Code Kipper
On 29 January 2018 at 10:35, Jernej Skrabec  wrote:
> Hi,
>
> Dne ponedeljek, 29. januar 2018 10.22.27 UTC+1 je oseba CodeKipper napisala:
>>
>> From: Marcus Cooper 
>>
>> Add the new DAI block for I2S2 which is used for HDMI audio.
>>
>> Signed-off-by: Marcus Cooper 
>> ---
>>  arch/arm/boot/dts/sunxi-h3-h5.dtsi | 13 +
>>  1 file changed, 13 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/sunxi-h3-h5.dtsi
>> b/arch/arm/boot/dts/sunxi-h3-h5.dtsi
>> index 7a83b15225c7..238e7007d5b9 100644
>> --- a/arch/arm/boot/dts/sunxi-h3-h5.dtsi
>> +++ b/arch/arm/boot/dts/sunxi-h3-h5.dtsi
>> @@ -568,6 +568,19 @@
>>  status = "disabled";
>>  };
>>
>> +i2s2: i2s@1c22800 {
>> +#sound-dai-cells = <0>;
>> +compatible = "allwinner,sun8i-h3-i2s";
>
>
> I think we should use separate compatible for HDMI I2S, since it supports 4
> I2S lanes
> contrary to i2s0 and i2s1, which support only one.
>
> Same goes for A64 HDMI I2S.
No worries...I just had an upstream urge. I do think the other blocks
support the 4 lanes(suspicious blanking in the user manual) it just
doesn't have the pins connected.
Thanks,
CK
ps: kudos with the libreelec work...the Orange Pi 2 build that I put
together worked pretty well...I've been dreaming of this day!
>
> Best regards,
> Jernej
>
>>
>> +reg = <0x01c22800 0x400>;
>> +interrupts = ;
>> +clocks = <&ccu CLK_BUS_I2S2>, <&ccu CLK_I2S2>;
>> +clock-names = "apb", "mod";
>> +dmas = <&dma 27>;
>> +resets = <&ccu RST_BUS_I2S2>;
>> +dma-names = "tx";
>> +status = "disabled";
>> +};
>> +
>>  codec: codec@1c22c00 {
>>  #sound-dai-cells = <0>;
>>  compatible = "allwinner,sun8i-h3-codec";
>> --
>> 2.16.1
>>
> --
> You received this message because you are subscribed to the Google Groups
> "linux-sunxi" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to linux-sunxi+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi] [PATCH 1/3] ASoC: sun4i-i2s: Add set_tdm_slot functionality

2018-01-28 Thread Code Kipper
On 29 January 2018 at 08:38, Chen-Yu Tsai  wrote:
> On Mon, Jan 29, 2018 at 3:34 PM, Code Kipper  wrote:
>> On 29 January 2018 at 02:50, Chen-Yu Tsai  wrote:
>>> On Wed, Jan 24, 2018 at 10:10 PM,   wrote:
>>>> From: Marcus Cooper 
>>>>
>>>> Some codecs require a different amount of a bit clocks per frame than
>>>> what is calculated by the sample width. Use the tdm slot bindings to
>>>> provide this mechanism.
>>>>
>>>> Signed-off-by: Marcus Cooper 
>>>> ---
>>>>  sound/soc/sunxi/sun4i-i2s.c | 23 +--
>>>>  1 file changed, 21 insertions(+), 2 deletions(-)
>>>>
>>>> diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
>>>> index dca1143c1150..d7a9141514cf 100644
>>>> --- a/sound/soc/sunxi/sun4i-i2s.c
>>>> +++ b/sound/soc/sunxi/sun4i-i2s.c
>>>> @@ -96,6 +96,7 @@
>>>>  #define SUN8I_I2S_CTRL_BCLK_OUTBIT(18)
>>>>  #define SUN8I_I2S_CTRL_LRCK_OUTBIT(17)
>>>>
>>>> +#define SUN8I_I2S_FMT0_LRCK_MAX_PERIOD (GENMASK(17, 8) >> 8)
>>>>  #define SUN8I_I2S_FMT0_LRCK_PERIOD_MASKGENMASK(17, 8)
>>>>  #define SUN8I_I2S_FMT0_LRCK_PERIOD(period) ((period - 1) << 8)
>>>>
>>>> @@ -193,6 +194,9 @@ struct sun4i_i2s {
>>>> struct regmap_field *field_rxchansel;
>>>>
>>>> const struct sun4i_i2s_quirks   *variant;
>>>> +
>>>> +   unsigned inttdm_slots;
>>>> +   unsigned intslot_width;
>>>>  };
>>>>
>>>>  struct sun4i_i2s_clk_div {
>>>> @@ -344,7 +348,7 @@ static int sun4i_i2s_set_clk_rate(struct snd_soc_dai 
>>>> *dai,
>>>> if (i2s->variant->has_fmt_set_lrck_period)
>>>> regmap_update_bits(i2s->regmap, SUN4I_I2S_FMT0_REG,
>>>>SUN8I_I2S_FMT0_LRCK_PERIOD_MASK,
>>>> -  SUN8I_I2S_FMT0_LRCK_PERIOD(32));
>>>> +  SUN8I_I2S_FMT0_LRCK_PERIOD(word_size));
>>>>
>>>> return 0;
>>>>  }
>>>> @@ -418,7 +422,8 @@ static int sun4i_i2s_hw_params(struct 
>>>> snd_pcm_substream *substream,
>>>>sr + i2s->variant->fmt_offset);
>>>>
>>>> return sun4i_i2s_set_clk_rate(dai, params_rate(params),
>>>> - params_width(params));
>>>> + i2s->tdm_slots ?
>>>> + i2s->slot_width : 
>>>> params_width(params));
>>>>  }
>>>>
>>>>  static int sun4i_i2s_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
>>>> @@ -691,6 +696,19 @@ static int sun4i_i2s_set_sysclk(struct snd_soc_dai 
>>>> *dai, int clk_id,
>>>> return 0;
>>>>  }
>>>>
>>>> +static int sun4i_i2s_set_dai_tdm_slot(struct snd_soc_dai *dai,
>>>> +   unsigned int tx_mask, unsigned int rx_mask,
>>>> +   int slots, int width)
>>>> +{
>>>> +   struct sun4i_i2s *i2s = snd_soc_dai_get_drvdata(dai);
>>>> +
>>>> +   i2s->tdm_slots = slots;
>>>> +
>>>> +   i2s->slot_width = width;
>>>> +
>>>> +   return 0;
>>>> +}
>>>> +
>>>
>>> IIRC some of the DAI controllers actually support TDM. Would this
>>> change conflict with that in the future?
>>
>> Hi Wens,
>> I'm not sure..I was looking for a clean example of being able to
>> override the number of bclks in the lrclk width and some other
>> devices(Rpi) were doing it this way.  I open to suggestions,
>
> I'm not familiar with the issue either. If Mark doesn't have any
> objections, we could merge it for now, and fix it later if there
> are any complications.
>
> BTW, you didn't provide a device tree example (if any) for how
> to use this.

Hi Wens,

here is an example that I use for the Pine64 audio hat.
https://github.com/codekipper/linux-sunxi/commit/faa9dfba955bf71ca23b089b1cb678a14443216f#diff-1473a38b339685d191c5a87aab9c0fdfR80

I've done the same on the A64 for HDMI and analog audio which both use
the i2s and seem to require 32bit LRCK width.

BR,
CK

>
> ChenYu
>
>> BR,
>> CK
>

Re: [linux-sunxi] [PATCH 1/3] ASoC: sun4i-i2s: Add set_tdm_slot functionality

2018-01-28 Thread Code Kipper
On 29 January 2018 at 02:50, Chen-Yu Tsai  wrote:
> On Wed, Jan 24, 2018 at 10:10 PM,   wrote:
>> From: Marcus Cooper 
>>
>> Some codecs require a different amount of a bit clocks per frame than
>> what is calculated by the sample width. Use the tdm slot bindings to
>> provide this mechanism.
>>
>> Signed-off-by: Marcus Cooper 
>> ---
>>  sound/soc/sunxi/sun4i-i2s.c | 23 +--
>>  1 file changed, 21 insertions(+), 2 deletions(-)
>>
>> diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
>> index dca1143c1150..d7a9141514cf 100644
>> --- a/sound/soc/sunxi/sun4i-i2s.c
>> +++ b/sound/soc/sunxi/sun4i-i2s.c
>> @@ -96,6 +96,7 @@
>>  #define SUN8I_I2S_CTRL_BCLK_OUTBIT(18)
>>  #define SUN8I_I2S_CTRL_LRCK_OUTBIT(17)
>>
>> +#define SUN8I_I2S_FMT0_LRCK_MAX_PERIOD (GENMASK(17, 8) >> 8)
>>  #define SUN8I_I2S_FMT0_LRCK_PERIOD_MASKGENMASK(17, 8)
>>  #define SUN8I_I2S_FMT0_LRCK_PERIOD(period) ((period - 1) << 8)
>>
>> @@ -193,6 +194,9 @@ struct sun4i_i2s {
>> struct regmap_field *field_rxchansel;
>>
>> const struct sun4i_i2s_quirks   *variant;
>> +
>> +   unsigned inttdm_slots;
>> +   unsigned intslot_width;
>>  };
>>
>>  struct sun4i_i2s_clk_div {
>> @@ -344,7 +348,7 @@ static int sun4i_i2s_set_clk_rate(struct snd_soc_dai 
>> *dai,
>> if (i2s->variant->has_fmt_set_lrck_period)
>> regmap_update_bits(i2s->regmap, SUN4I_I2S_FMT0_REG,
>>SUN8I_I2S_FMT0_LRCK_PERIOD_MASK,
>> -  SUN8I_I2S_FMT0_LRCK_PERIOD(32));
>> +  SUN8I_I2S_FMT0_LRCK_PERIOD(word_size));
>>
>> return 0;
>>  }
>> @@ -418,7 +422,8 @@ static int sun4i_i2s_hw_params(struct snd_pcm_substream 
>> *substream,
>>sr + i2s->variant->fmt_offset);
>>
>> return sun4i_i2s_set_clk_rate(dai, params_rate(params),
>> - params_width(params));
>> + i2s->tdm_slots ?
>> + i2s->slot_width : 
>> params_width(params));
>>  }
>>
>>  static int sun4i_i2s_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
>> @@ -691,6 +696,19 @@ static int sun4i_i2s_set_sysclk(struct snd_soc_dai 
>> *dai, int clk_id,
>> return 0;
>>  }
>>
>> +static int sun4i_i2s_set_dai_tdm_slot(struct snd_soc_dai *dai,
>> +   unsigned int tx_mask, unsigned int rx_mask,
>> +   int slots, int width)
>> +{
>> +   struct sun4i_i2s *i2s = snd_soc_dai_get_drvdata(dai);
>> +
>> +   i2s->tdm_slots = slots;
>> +
>> +   i2s->slot_width = width;
>> +
>> +   return 0;
>> +}
>> +
>
> IIRC some of the DAI controllers actually support TDM. Would this
> change conflict with that in the future?

Hi Wens,
I'm not sure..I was looking for a clean example of being able to
override the number of bclks in the lrclk width and some other
devices(Rpi) were doing it this way.  I open to suggestions,
BR,
CK
>
> Thanks
> ChenYu
>
>>  static const struct snd_soc_dai_ops sun4i_i2s_dai_ops = {
>> .hw_params  = sun4i_i2s_hw_params,
>> .set_fmt= sun4i_i2s_set_fmt,
>> @@ -698,6 +716,7 @@ static const struct snd_soc_dai_ops sun4i_i2s_dai_ops = {
>> .shutdown   = sun4i_i2s_shutdown,
>> .startup= sun4i_i2s_startup,
>> .trigger= sun4i_i2s_trigger,
>> +   .set_tdm_slot   = sun4i_i2s_set_dai_tdm_slot,
>>  };
>>
>>  static int sun4i_i2s_dai_probe(struct snd_soc_dai *dai)
>> --
>> 2.16.0
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "linux-sunxi" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to linux-sunxi+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi][PATCH 5/5] arm64: allwinner: a64: Add DAI nodes

2018-01-25 Thread Code Kipper
On 25 January 2018 at 09:29, Maxime Ripard
 wrote:
> On Wed, Jan 24, 2018 at 12:39:31PM +0100, Code Kipper wrote:
>> On 24 January 2018 at 12:02, Maxime Ripard
>>  wrote:
>> > Hi,
>> >
>> > On Wed, Jan 24, 2018 at 11:39:43AM +0100, codekip...@gmail.com wrote:
>> >> From: Marcus Cooper 
>> >>
>> >> Add the DAI blocks to the device tree. I2S0 and I2S1 are for
>> >> connecting to an external codec.
>> >>
>> >> Signed-off-by: Marcus Cooper 
>> >> ---
>> >>  arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 26 
>> >> ++
>> >>  1 file changed, 26 insertions(+)
>> >>
>> >> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi 
>> >> b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
>> >> index f060a58f374c..f3354f8c2026 100644
>> >> --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
>> >> +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
>> >> @@ -419,6 +419,32 @@
>> >>   status = "disabled";
>> >>   };
>> >>
>> >> + i2s0: i2s@1c22000 {
>> >> + #sound-dai-cells = <0>;
>> >> + compatible = "allwinner,sun8i-h3-i2s";
>> >
>> > Same remark than for the spdif, please add a soc-specific compatible.
>>
>> Is that really necessary?..
>
> Yes.
>
>> for example on the a20 the functionality of the i2s is the same as
>> the a10 so it is down as "allwinner,sun4i-a10-i2s", likewise here
>> it's the same as the changes required for the H3. I was planning on
>> using the compatible "allwinner,sun50i-a64-i2s" for the audio codec
>> as there are some quirks that need to be addressed.
>
> And this is exactly why it is necessary. If we ever find a quirk in
> the future, supporting that quirk will be smooth if we already have a
> compatible for that SoC in the DT, and a pain if we don't.
Hi Maxime,
so just to comfirm. I'll make this change
compatible = "allwinner,sun50i-a64-i2s", "allwinner,sun8i-h3-i2s"; to the dtsi
and later will add to the i2s driver the compatible
"allwinner,sun50i-a64-i2s-audio-codec"(or something other than
allwinner,sun50i-a64-i2s) for the quirks required for the i2s block
used for the audio codec.
BR,
CK

>
> Maxime
>
> --
> Maxime Ripard, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi][PATCH 5/5] arm64: allwinner: a64: Add DAI nodes

2018-01-25 Thread Code Kipper
On 25 January 2018 at 09:29, Maxime Ripard
 wrote:
> On Wed, Jan 24, 2018 at 12:39:31PM +0100, Code Kipper wrote:
>> On 24 January 2018 at 12:02, Maxime Ripard
>>  wrote:
>> > Hi,
>> >
>> > On Wed, Jan 24, 2018 at 11:39:43AM +0100, codekip...@gmail.com wrote:
>> >> From: Marcus Cooper 
>> >>
>> >> Add the DAI blocks to the device tree. I2S0 and I2S1 are for
>> >> connecting to an external codec.
>> >>
>> >> Signed-off-by: Marcus Cooper 
>> >> ---
>> >>  arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 26 
>> >> ++
>> >>  1 file changed, 26 insertions(+)
>> >>
>> >> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi 
>> >> b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
>> >> index f060a58f374c..f3354f8c2026 100644
>> >> --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
>> >> +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
>> >> @@ -419,6 +419,32 @@
>> >>   status = "disabled";
>> >>   };
>> >>
>> >> + i2s0: i2s@1c22000 {
>> >> + #sound-dai-cells = <0>;
>> >> + compatible = "allwinner,sun8i-h3-i2s";
>> >
>> > Same remark than for the spdif, please add a soc-specific compatible.
>>
>> Is that really necessary?..
>
> Yes.
>
>> for example on the a20 the functionality of the i2s is the same as
>> the a10 so it is down as "allwinner,sun4i-a10-i2s", likewise here
>> it's the same as the changes required for the H3. I was planning on
>> using the compatible "allwinner,sun50i-a64-i2s" for the audio codec
>> as there are some quirks that need to be addressed.
>
> And this is exactly why it is necessary. If we ever find a quirk in
> the future, supporting that quirk will be smooth if we already have a
> compatible for that SoC in the DT, and a pain if we don't.
ACK, but is there any reason why we're not doing this for i2c?
BR,
CK
>
> Maxime
>
> --
> Maxime Ripard, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Re: [PATCH 3/3] ASoC: sun4i-i2s: Add regmap field to sign extend sample

2018-01-25 Thread Code Kipper
On 25 January 2018 at 09:41, Maxime Ripard
 wrote:
> Hi,
>
> On Wed, Jan 24, 2018 at 03:11:01PM +0100, codekip...@gmail.com wrote:
>> From: Marcus Cooper 
>>
>> On the newer SoCs this is set by default to transfer a 0 after
>> each sample in each slot. Add the regmap field to configure this
>> and set it so that it pads the sample with 0s.
>>
>> Signed-off-by: Marcus Cooper 
>> ---
>>  sound/soc/sunxi/sun4i-i2s.c | 15 +++
>>  1 file changed, 15 insertions(+)
>>
>> diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
>> index 626679057d0f..9fda1240b717 100644
>> --- a/sound/soc/sunxi/sun4i-i2s.c
>> +++ b/sound/soc/sunxi/sun4i-i2s.c
>> @@ -139,6 +139,7 @@
>>   * @field_fmt_bclk: regmap field to set clk polarity.
>>   * @field_fmt_lrclk: regmap field to set frame polarity.
>>   * @field_fmt_mode: regmap field to set the operational mode.
>> + * @field_fmt_sext: regmap field to set the sign extension.
>>   * @field_txchanmap: location of the tx channel mapping register.
>>   * @field_rxchanmap: location of the rx channel mapping register.
>>   * @field_txchansel: location of the tx channel select bit fields.
>> @@ -164,6 +165,7 @@ struct sun4i_i2s_quirks {
>>   struct reg_fieldfield_fmt_bclk;
>>   struct reg_fieldfield_fmt_lrclk;
>>   struct reg_fieldfield_fmt_mode;
>> + struct reg_fieldfield_fmt_sext;
>>   struct reg_fieldfield_txchanmap;
>>   struct reg_fieldfield_rxchanmap;
>>   struct reg_fieldfield_txchansel;
>> @@ -188,6 +190,7 @@ struct sun4i_i2s {
>>   struct regmap_field *field_fmt_bclk;
>>   struct regmap_field *field_fmt_lrclk;
>>   struct regmap_field *field_fmt_mode;
>> + struct regmap_field *field_fmt_sext;
>>   struct regmap_field *field_txchanmap;
>>   struct regmap_field *field_rxchanmap;
>>   struct regmap_field *field_txchansel;
>> @@ -358,6 +361,9 @@ static int sun4i_i2s_set_clk_rate(struct snd_soc_dai 
>> *dai,
>>  SUN8I_I2S_FMT0_LRCK_PERIOD_MASK,
>>  SUN8I_I2S_FMT0_LRCK_PERIOD(word_size));
>>
>> + /* Set sign extension to pad out LSB with 0 */
>> + regmap_field_write(i2s->field_fmt_sext, 0);
>> +
>
> Your commit log seems to suggest that it's only relevant for the newer
> SoCs (which ones?), yet you enable it for all the supported
> ones. Either the code or the commit log should be adjusted to be
> consistent with the other.
ACK
Thanks,
CK
>
> Maxime
>
> --
> Maxime Ripard, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Re: Re: [linux-sunxi] how to build an linux image for A31S

2018-01-24 Thread Code Kipper
On 24 January 2018 at 18:18, Phil  wrote:
> Hi CodeKipper,
>
> I know that this thread is old but I'll take a chance.
>
> I have an old VidOn Box that is collecting dust in my closet.
>
> I want to use it again and install linux and wipe completely Android.
>
> I was able to root my box a while ago and it is still rooted. Does it have
> any values since its rooted if you need info on how to enable FEL mode?
>
> I don't have many spare time but I'm willing to help.
Hi Philippe,
this is on my todo lists to play with(but close to the bottom)I
think the easiest thing to do would be to solder a sdcard holder onto
the exposed PCB mounts and boot from that. If you can get it into FEL
mode using the uart connection then that would be a start.
BR,
CK

>
> On Monday, March 9, 2015 at 1:29:01 AM UTC-4, CodeKipper wrote:
>>
>> On 9 March 2015 at 03:56, li  wrote:
>> > Hi pere canadell,
>> >
>> > the device is http://linux-sunxi.org/VidOn_Box, but i can't find the
>> > image
>> > for it.
>> > Best Regards,
>> > stone
>> Hi Stone
>> I don't think you'll have any chance of getting anything other than
>> VidOn's
>> firmware onto this device without doing some serious hardware
>> modifications.
>> There is no sdcard to boot from or OTG to get the device into fel mode.
>> I have this hardware and I'm still trying to find a way to get it to boot
>> into
>> fel mode. For now only serial debug is possible.
>> BR,
>> CK
>
> --
> You received this message because you are subscribed to the Google Groups
> "linux-sunxi" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to linux-sunxi+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Re: [PATCH 3/3] ASoC: sun4i-i2s: Add regmap field to sign extend sample

2018-01-24 Thread Code Kipper
On 24 January 2018 at 15:11,   wrote:
> From: Marcus Cooper 
>
> On the newer SoCs this is set by default to transfer a 0 after
> each sample in each slot. Add the regmap field to configure this
> and set it so that it pads the sample with 0s.
>
> Signed-off-by: Marcus Cooper 
NACK missing regmap field from A83t.
CK
> ---
>  sound/soc/sunxi/sun4i-i2s.c | 15 +++
>  1 file changed, 15 insertions(+)
>
> diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
> index 626679057d0f..9fda1240b717 100644
> --- a/sound/soc/sunxi/sun4i-i2s.c
> +++ b/sound/soc/sunxi/sun4i-i2s.c
> @@ -139,6 +139,7 @@
>   * @field_fmt_bclk: regmap field to set clk polarity.
>   * @field_fmt_lrclk: regmap field to set frame polarity.
>   * @field_fmt_mode: regmap field to set the operational mode.
> + * @field_fmt_sext: regmap field to set the sign extension.
>   * @field_txchanmap: location of the tx channel mapping register.
>   * @field_rxchanmap: location of the rx channel mapping register.
>   * @field_txchansel: location of the tx channel select bit fields.
> @@ -164,6 +165,7 @@ struct sun4i_i2s_quirks {
> struct reg_fieldfield_fmt_bclk;
> struct reg_fieldfield_fmt_lrclk;
> struct reg_fieldfield_fmt_mode;
> +   struct reg_fieldfield_fmt_sext;
> struct reg_fieldfield_txchanmap;
> struct reg_fieldfield_rxchanmap;
> struct reg_fieldfield_txchansel;
> @@ -188,6 +190,7 @@ struct sun4i_i2s {
> struct regmap_field *field_fmt_bclk;
> struct regmap_field *field_fmt_lrclk;
> struct regmap_field *field_fmt_mode;
> +   struct regmap_field *field_fmt_sext;
> struct regmap_field *field_txchanmap;
> struct regmap_field *field_rxchanmap;
> struct regmap_field *field_txchansel;
> @@ -358,6 +361,9 @@ static int sun4i_i2s_set_clk_rate(struct snd_soc_dai *dai,
>SUN8I_I2S_FMT0_LRCK_PERIOD_MASK,
>SUN8I_I2S_FMT0_LRCK_PERIOD(word_size));
>
> +   /* Set sign extension to pad out LSB with 0 */
> +   regmap_field_write(i2s->field_fmt_sext, 0);
> +
> return 0;
>  }
>
> @@ -929,6 +935,7 @@ static const struct sun4i_i2s_quirks sun4i_a10_i2s_quirks 
> = {
> .field_fmt_lrclk= REG_FIELD(SUN4I_I2S_FMT0_REG, 7, 7),
> .has_slave_select_bit   = true,
> .field_fmt_mode = REG_FIELD(SUN4I_I2S_FMT0_REG, 0, 1),
> +   .field_fmt_sext = REG_FIELD(SUN4I_I2S_FMT1_REG, 8, 8),
> .field_txchanmap= REG_FIELD(SUN4I_I2S_TX_CHAN_MAP_REG, 0, 31),
> .field_rxchanmap= REG_FIELD(SUN4I_I2S_RX_CHAN_MAP_REG, 0, 31),
> .field_txchansel= REG_FIELD(SUN4I_I2S_TX_CHAN_SEL_REG, 0, 2),
> @@ -946,6 +953,7 @@ static const struct sun4i_i2s_quirks sun6i_a31_i2s_quirks 
> = {
> .field_fmt_lrclk= REG_FIELD(SUN4I_I2S_FMT0_REG, 7, 7),
> .has_slave_select_bit   = true,
> .field_fmt_mode = REG_FIELD(SUN4I_I2S_FMT0_REG, 0, 1),
> +   .field_fmt_sext = REG_FIELD(SUN4I_I2S_FMT1_REG, 8, 8),
> .field_txchanmap= REG_FIELD(SUN4I_I2S_TX_CHAN_MAP_REG, 0, 31),
> .field_rxchanmap= REG_FIELD(SUN4I_I2S_RX_CHAN_MAP_REG, 0, 31),
> .field_txchansel= REG_FIELD(SUN4I_I2S_TX_CHAN_SEL_REG, 0, 2),
> @@ -986,6 +994,7 @@ static const struct sun4i_i2s_quirks sun8i_h3_i2s_quirks 
> = {
> .field_fmt_bclk = REG_FIELD(SUN4I_I2S_FMT0_REG, 7, 7),
> .field_fmt_lrclk= REG_FIELD(SUN4I_I2S_FMT0_REG, 19, 19),
> .field_fmt_mode = REG_FIELD(SUN4I_I2S_CTRL_REG, 4, 5),
> +   .field_fmt_sext = REG_FIELD(SUN4I_I2S_FMT1_REG, 4, 5),
> .field_txchanmap= REG_FIELD(SUN8I_I2S_TX_CHAN_MAP_REG, 0, 31),
> .field_rxchanmap= REG_FIELD(SUN8I_I2S_RX_CHAN_MAP_REG, 0, 31),
> .field_txchansel= REG_FIELD(SUN8I_I2S_TX_CHAN_SEL_REG, 0, 2),
> @@ -1031,6 +1040,12 @@ static int sun4i_i2s_init_regmap_fields(struct device 
> *dev,
> if (IS_ERR(i2s->field_fmt_mode))
> return PTR_ERR(i2s->field_fmt_mode);
>
> +   i2s->field_fmt_sext =
> +   devm_regmap_field_alloc(dev, i2s->regmap,
> +   i2s->variant->field_fmt_sext);
> +   if (IS_ERR(i2s->field_fmt_sext))
> +   return PTR_ERR(i2s->field_fmt_sext);
> +
> i2s->field_txchanmap =
> devm_regmap_field_alloc(dev, i2s->regmap,
> 
> i2s->variant->field_txchanmap);
> --
> 2.16.0
>

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googleg

Re: [linux-sunxi][PATCH 4/5] arm64: allwinner: a64: Add SPDIF to the Pine64

2018-01-24 Thread Code Kipper
On 24 January 2018 at 11:39,   wrote:
> From: Marcus Cooper 
>
NACK.just noticed the lack of commit message...
BR,
CK
> ---
>  arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts | 7 +++
>  1 file changed, 7 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts 
> b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
> index 604cdaedac38..70e8ff9a1f38 100644
> --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts
> @@ -230,6 +230,13 @@
> regulator-name = "vcc-rtc";
>  };
>
> +/* On Euler connector */
> +&spdif {
> +   pinctrl-names = "default";
> +   pinctrl-0 = <&spdif_tx_pins_a>;
> +   status = "disabled";
> +};
> +
>  /* On Exp and Euler connectors */
>  &uart0 {
> pinctrl-names = "default";
> --
> 2.16.0
>

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi][PATCH 2/5] arm64: allwinner: a64: Add SPDIF TX pin to the A64

2018-01-24 Thread Code Kipper
On 24 January 2018 at 12:02, Chen-Yu Tsai  wrote:
> On Wed, Jan 24, 2018 at 7:00 PM, Maxime Ripard
>  wrote:
>> On Wed, Jan 24, 2018 at 11:39:40AM +0100, codekip...@gmail.com wrote:
>>> From: Marcus Cooper 
>>>
>>> Add the SPDIF TX pin to the A64 dtsi.
>>>
>>> Signed-off-by: Marcus Cooper 
>>> ---
>>>  arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 5 +
>>>  1 file changed, 5 insertions(+)
>>>
>>> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi 
>>> b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
>>> index c82979038b0b..db1694ec3ee4 100644
>>> --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
>>> +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
>>> @@ -336,6 +336,11 @@
>>>   drive-strength = <40>;
>>>   };
>>>
>>> + spdif_tx_pins_a: spdif@0 {
>>
>> This will generate a dtc warning, you should use a syntax similar to
>> the other nodes there (ie. spdif if that's the only muxing option, or
>> spdif-0).
>
> Furthermore, if this is the only option, you should set it as the
> default in the .dtsi, so boards don't have to, and possibly squash
> this patch into the first one.
ACK
Thanks,
CK
>
> ChenYu

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi][PATCH 3/5] arm64: allwinner: a64: Add SPDIF to the A64

2018-01-24 Thread Code Kipper
On 24 January 2018 at 12:01, Maxime Ripard
 wrote:
> On Wed, Jan 24, 2018 at 11:39:41AM +0100, codekip...@gmail.com wrote:
>> From: Marcus Cooper 
>>
>> Add the device tree sound bindings for the S/PDIF block.
>>
>> Signed-off-by: Marcus Cooper 
>> ---
>>  arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 19 +++
>>  1 file changed, 19 insertions(+)
>>
>> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi 
>> b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
>> index db1694ec3ee4..f060a58f374c 100644
>> --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
>> +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
>> @@ -112,6 +112,25 @@
>>   method = "smc";
>>   };
>>
>> +
>> + sound_spdif {
>
> Nit: You should drop the extra blank line here.
ACK
Thanks,
CK
>
> Maxime
>
> --
> Maxime Ripard, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi][PATCH 5/5] arm64: allwinner: a64: Add DAI nodes

2018-01-24 Thread Code Kipper
On 24 January 2018 at 12:02, Maxime Ripard
 wrote:
> Hi,
>
> On Wed, Jan 24, 2018 at 11:39:43AM +0100, codekip...@gmail.com wrote:
>> From: Marcus Cooper 
>>
>> Add the DAI blocks to the device tree. I2S0 and I2S1 are for
>> connecting to an external codec.
>>
>> Signed-off-by: Marcus Cooper 
>> ---
>>  arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 26 
>> ++
>>  1 file changed, 26 insertions(+)
>>
>> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi 
>> b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
>> index f060a58f374c..f3354f8c2026 100644
>> --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
>> +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
>> @@ -419,6 +419,32 @@
>>   status = "disabled";
>>   };
>>
>> + i2s0: i2s@1c22000 {
>> + #sound-dai-cells = <0>;
>> + compatible = "allwinner,sun8i-h3-i2s";
>
> Same remark than for the spdif, please add a soc-specific compatible.

Is that really necessary?..for example on the a20 the functionality of
the i2s is the same as the a10 so it is down as
"allwinner,sun4i-a10-i2s", likewise here it's the same as the changes
required for the H3. I was planning on using the compatible
"allwinner,sun50i-a64-i2s" for the audio codec as there are some
quirks that need to be addressed.

Thanks,
CK
>
> Thanks!
> Maxime
>
> --
> Maxime Ripard, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Re: [PATCH] sunxi: Add support for the Beelink-x2 STB

2018-01-22 Thread Code Kipper
On 22 January 2018 at 09:04, Maxime Ripard
 wrote:
> Hi,
>
> On Sun, Jan 21, 2018 at 07:06:49PM +0100, codekip...@gmail.com wrote:
>> From: Marcus Cooper 
>>
>> The Beelink X2 is an STB based on the Allwinner H3 SoC with a uSD slot,
>> 2 USB ports( 1 * USB-2 Host, 1 USB OTG), a 10/100M ethernet port using
>> the SoC's integrated PHY, Wifi via an sdio wifi chip, HDMI, a dual
>> colour LED, an IR receiver and an optical S/PDIF connector.
>>
>> Signed-off-by: Marcus Cooper 
>> ---
>>  arch/arm/dts/Makefile|   1 +
>>  arch/arm/dts/sun8i-h3-beelink-x2.dts | 155 
>> +++
>>  board/sunxi/MAINTAINERS  |   5 ++
>>  configs/beelink_x2_defconfig |  18 
>>  4 files changed, 179 insertions(+)
>>  create mode 100644 arch/arm/dts/sun8i-h3-beelink-x2.dts
>>  create mode 100644 configs/beelink_x2_defconfig
>>
>> diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile
>> index 9540ba4313..f899cef7ac 100644
>> --- a/arch/arm/dts/Makefile
>> +++ b/arch/arm/dts/Makefile
>> @@ -335,6 +335,7 @@ dtb-$(CONFIG_MACH_SUN8I_A83T) += \
>>  dtb-$(CONFIG_MACH_SUN8I_H3) += \
>>   sun8i-h2-plus-orangepi-zero.dtb \
>>   sun8i-h3-bananapi-m2-plus.dtb \
>> + sun8i-h3-beelink-x2.dtb \
>>   sun8i-h3-libretech-all-h3-cc.dtb \
>>   sun8i-h3-orangepi-2.dtb \
>>   sun8i-h3-orangepi-lite.dtb \
>> diff --git a/arch/arm/dts/sun8i-h3-beelink-x2.dts 
>> b/arch/arm/dts/sun8i-h3-beelink-x2.dts
>> new file mode 100644
>> index 00..43f67eb8db
>> --- /dev/null
>> +++ b/arch/arm/dts/sun8i-h3-beelink-x2.dts
>> @@ -0,0 +1,155 @@
>> +/*
>> + * Copyright (C) 2017 Marcus Cooper 
>> + *
>> + * This file is dual-licensed: you can use it either under the terms
>> + * of the GPL or the X11 license, at your option. Note that this dual
>> + * licensing only applies to this file, and not this project as a
>> + * whole.
>> + *
>> + *  a) This file is free software; you can redistribute it and/or
>> + * modify it under the terms of the GNU General Public License as
>> + * published by the Free Software Foundation; either version 2 of the
>> + * License, or (at your option) any later version.
>> + *
>> + * This file is distributed in the hope that it will be useful,
>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>> + * GNU General Public License for more details.
>> + *
>> + * Or, alternatively,
>> + *
>> + *  b) Permission is hereby granted, free of charge, to any person
>> + * obtaining a copy of this software and associated documentation
>> + * files (the "Software"), to deal in the Software without
>> + * restriction, including without limitation the rights to use,
>> + * copy, modify, merge, publish, distribute, sublicense, and/or
>> + * sell copies of the Software, and to permit persons to whom the
>> + * Software is furnished to do so, subject to the following
>> + * conditions:
>> + *
>> + * The above copyright notice and this permission notice shall be
>> + * included in all copies or substantial portions of the Software.
>> + *
>> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
>> + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
>> + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
>> + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
>> + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
>> + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
>> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
>> + * OTHER DEALINGS IN THE SOFTWARE.
>> + */
>> +
>> +/dts-v1/;
>> +#include "sun8i-h3.dtsi"
>> +#include "sunxi-common-regulators.dtsi"
>> +
>> +#include 
>> +#include 
>> +
>> +/ {
>> + model = "Beelink X2";
>> + compatible = "roofull,beelink-x2", "allwinner,sun8i-h3";
>> +
>> + aliases {
>> + serial0 = &uart0;
>> + /* ethernet0 is the H3 emac, defined in sun8i-h3.dtsi */
>> + ethernet1 = &sdiowifi;
>> + };
>> +
>> + chosen {
>> + stdout-path = "serial0:115200n8";
>> + };
>> +
>> + leds {
>> + compatible = "gpio-leds";
>> +
>> + blue {
>> + label = "beelink-x2:blue:pwr";
>> + gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; /* PL10 */
>> + default-state = "on";
>> + };
>> +
>> + red {
>> + label = "beelink-x2:red:standby";
>> + gpios = <&pio 0 15 GPIO_ACTIVE_HIGH>; /* PA15 */
>> + };
>> + };
>> +
>> + wifi_pwrseq: wifi_pwrseq {
>> + compatible = "mmc-pwrseq-simple";
>> + reset-gpios = <&r_pio 0 7 GPIO_ACTIVE_LOW>; /* PL7 */
>> + };
>> +};
>> +
>> +&ehci1 {
>> + status = "okay";
>> +};
>> +
>> +&emac {
>> + phy = <

Re: [linux-sunxi] How to enable S/PDIF output on cubieboard2?

2018-01-16 Thread Code Kipper
On 16 January 2018 at 09:00, Kai  wrote:
> I found I've tried not very long ago, but the obstacle was that I could not
> compile it successfully.
> "make dtbs" did not generate any *.dtb file (seems it builds related tools
> like dtc),
> while,
> "dtc -I dts -O dtb xxx" warned as:
>>
>> Error: arch/arm/boot/dts/sun7i-a20-cubieboard2.dts:46.1-9 syntax error
>> FATAL ERROR: Unable to parse input tree
>
> even when nothing is changed to the source code, that is newly updated.
>
> What steps am I missing to compile it?
Add the configs mentioned earlier to arch/arm/configs/sunxi_defconfig then
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- sunxi_defconfig
then
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- dtbs to generate new dtb files

Simplest way would be to use latest armbian image and then add the
spdif overlay (sun7i-a20-spdif-out)
to the boot environment https://docs.armbian.com/Hardware_Allwinner_overlays/
CK
>
> --
> You received this message because you are subscribed to the Google Groups
> "linux-sunxi" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to linux-sunxi+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi] How to enable S/PDIF output on cubieboard2?

2018-01-10 Thread Code Kipper
On 11 January 2018 at 03:34, Kai  wrote:
> Cubieboard2 exposes SPDIF interface on GPIO (pin 64 regarding to the
> diagram).
> On a legacy kernel, to enable it, script.fex is used, however mainline
> kernel uses dts.
> Both using A20, cubietruck exported SPDIF by default, but I cannot use it on
> cb2.
>
> Would someone help providing a SPDIF-enabled dts patch for cubieboard2?

Hi Kai,

you need a patch like this
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?h=next-20180111&id=be0f167a85765e9f559785745d85364022b8395c
and have these
CONFIG_SND_SIMPLE_CARD, CONFIG_SND_SOC_SPDIF, CONFIG_SND_SUN4I_SPDIF
enabled in your config

BR,
CK
> --
> You received this message because you are subscribed to the Google Groups
> "linux-sunxi" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to linux-sunxi+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi] H5 I2S status

2017-12-15 Thread Code Kipper
On 16 December 2017 at 02:03, Matt Flax  wrote:
>
>
> On 16/12/17 06:47, Code Kipper wrote:
>>
>> On 15 December 2017 at 20:05, Chris Obbard  wrote:
>>>
>>> Thanks Chen-Yu, that patch was literally what I was about to write myself
>>> (but in a more spagetti-like way).
>>>
>>>> root@orangepi:~# speaker-test -D hw:1 -c 2
>>>> speaker-test 1.1.3
>>>> Playback device is hw:1
>>>> Stream parameters are 48000Hz, S16_LE, 2 channels
>>>> Using 16 octaves of pink noise
>>>> Rate set to 48000Hz (requested 48000Hz)
>>>> Buffer size range from 128 to 131072
>>>> Period size range from 64 to 16384
>>>> Using max buffer size 131072
>>>> Periods = 4
>>>> Unable to set hw params for playback: Invalid argument
>>>> Setting of hwparams failed: Invalid argument
>>>
>>>
>>>
>>> dmesg:
>>>>
>>>> [  395.364594] sun4i-i2s 1c22000.i2s: Unsupported oversample rate: 2083
>>>> [  395.370978] sun4i-i2s 1c22000.i2s: ASoC: can't set 1c22000.i2s hw
>>>> params: -22
>>>
>>>
>>>
>>> cheers!
>>
>> Hi Chris,
>> I've just retired from playing with my audio injector..it's no longer
>> barfing but nothing is playing at the moment. Do you see any clocking
>> on the BLCK or LRCLK?, I've yet to see anything coming off the pins.
>> I'll have another play tomorrow but at the moment all that I've really
>> changed is that I not longer do the mclk and blck div calculations in
>> sun4i_i2s_set_clk_rate as this is for the internal pll.
>> CK
>
>
> Just wanted to see if it were possible to setup as codec master, which would
> generate the clocks from the wm8731 chip.
> This is done here :
> https://github.com/raspberrypi/linux/blob/rpi-4.9.y/sound/soc/bcm/audioinjector-pi-soundcard.c#L84
>
> snd_soc_dai_set_sysclk(rtd->codec_dai, WM8731_SYSCLK_XTAL, 1200,
> SND_SOC_CLOCK_IN);
Hi Max,
yeah I've seen this example before and was in the process of adding
some debugging in the wm8731 driver.
>
> The flag WM8731_SYSCLK_XTAL sets the wm8731->sysclk_type variable here :
> https://github.com/raspberrypi/linux/blob/rpi-4.9.y/sound/soc/codecs/wm8731.c#L396
>
> Which returns true in wm8731_check_osc:
> https://github.com/raspberrypi/linux/blob/rpi-4.9.y/sound/soc/codecs/wm8731.c#L220
>
> Which enables the osc in the dapm route :
> https://github.com/raspberrypi/linux/blob/rpi-4.9.y/sound/soc/codecs/wm8731.c#L224
>
>
> You will notice that WM8731_SYSCLK_XTAL == 1 here :
> https://github.com/raspberrypi/linux/blob/rpi-4.9.y/sound/soc/codecs/wm8731.h#L34
>
> Has this been correctly set in your simple card device tree ?
I'll have a look later today, thanks for the description of the clock setups.

My board is plugged directly into the header for the Orange Pi 2(looks
to be pin compatible with the RPi2 header), other than the i2s and
power pins what pins are used by your board?
BR,
CK
>
> Matt
>
>
>>> On 14 December 2017 at 07:34, Chen-Yu Tsai  wrote:
>>>>
>>>> On Thu, Dec 14, 2017 at 3:22 PM, Chris Obbard  wrote:
>>>>>
>>>>> Had a tiny bit of time this morning, had to give it a go. But no joy.
>>>>>
>>>>>> root@orangepi:~# speaker-test --device hw:1 --channels 2
>>>>>> speaker-test 1.1.3
>>>>>> Playback device is hw:1
>>>>>> Stream parameters are 48000Hz, S16_LE, 2 channels
>>>>>> Using 16 octaves of pink noise
>>>>>> Rate set to 48000Hz (requested 48000Hz)
>>>>>> Buffer size range from 128 to 131072
>>>>>> Period size range from 64 to 16384
>>>>>> Using max buffer size 131072
>>>>>> Periods = 4
>>>>>> Unable to set hw params for playback: Invalid argument
>>>>>> Setting of hwparams failed: Invalid argument
>>>>>
>>>>>
>>>>> Will start delving into the I2S driver later this eve...
>>>>
>>>> Could you try applying the patch I just sent:
>>>>
>>>> https://patchwork.kernel.org/patch/10111589/
>>>>
>>>> This should give you some information about why "set hw params" failed.
>>>>
>>>> ChenYu
>>>>
>>>>> Cheers!
>>>>>
>>>>>
>>>>> On 14 December 2017 at 06:46, Code Kipper  wrote:
>>>>>>
>>>>>> On 13 December 2017 at 21:51, Chri

Re: [linux-sunxi] H5 I2S status

2017-12-15 Thread Code Kipper
On 15 December 2017 at 20:05, Chris Obbard  wrote:
> Thanks Chen-Yu, that patch was literally what I was about to write myself
> (but in a more spagetti-like way).
>
>> root@orangepi:~# speaker-test -D hw:1 -c 2
>> speaker-test 1.1.3
>> Playback device is hw:1
>> Stream parameters are 48000Hz, S16_LE, 2 channels
>> Using 16 octaves of pink noise
>> Rate set to 48000Hz (requested 48000Hz)
>> Buffer size range from 128 to 131072
>> Period size range from 64 to 16384
>> Using max buffer size 131072
>> Periods = 4
>> Unable to set hw params for playback: Invalid argument
>> Setting of hwparams failed: Invalid argument
>
>
>
> dmesg:
>>
>> [  395.364594] sun4i-i2s 1c22000.i2s: Unsupported oversample rate: 2083
>> [  395.370978] sun4i-i2s 1c22000.i2s: ASoC: can't set 1c22000.i2s hw
>> params: -22
>
>
>
> cheers!
Hi Chris,
I've just retired from playing with my audio injector..it's no longer
barfing but nothing is playing at the moment. Do you see any clocking
on the BLCK or LRCLK?, I've yet to see anything coming off the pins.
I'll have another play tomorrow but at the moment all that I've really
changed is that I not longer do the mclk and blck div calculations in
sun4i_i2s_set_clk_rate as this is for the internal pll.
CK
>
> On 14 December 2017 at 07:34, Chen-Yu Tsai  wrote:
>>
>> On Thu, Dec 14, 2017 at 3:22 PM, Chris Obbard  wrote:
>> > Had a tiny bit of time this morning, had to give it a go. But no joy.
>> >
>> >>
>> >> root@orangepi:~# speaker-test --device hw:1 --channels 2
>> >> speaker-test 1.1.3
>> >> Playback device is hw:1
>> >> Stream parameters are 48000Hz, S16_LE, 2 channels
>> >> Using 16 octaves of pink noise
>> >> Rate set to 48000Hz (requested 48000Hz)
>> >> Buffer size range from 128 to 131072
>> >> Period size range from 64 to 16384
>> >> Using max buffer size 131072
>> >> Periods = 4
>> >> Unable to set hw params for playback: Invalid argument
>> >> Setting of hwparams failed: Invalid argument
>> >
>> >
>> > Will start delving into the I2S driver later this eve...
>>
>> Could you try applying the patch I just sent:
>>
>>https://patchwork.kernel.org/patch/10111589/
>>
>> This should give you some information about why "set hw params" failed.
>>
>> ChenYu
>>
>> > Cheers!
>> >
>> >
>> > On 14 December 2017 at 06:46, Code Kipper  wrote:
>> >>
>> >> On 13 December 2017 at 21:51, Chris Obbard  wrote:
>> >> > Hi CK,
>> >> >
>> >> > That worked! Thanks.
>> >> >
>> >> > Here's the desg output now, all looks OK:
>> >> >>
>> >> >> [5.364112] wm8731 0-001a: Assuming static MCLK
>> >> >> [5.368716] wm8731 0-001a: 0-001a supply AVDD not found, using
>> >> >> dummy
>> >> >> regulator
>> >> >> [5.376037] wm8731 0-001a: 0-001a supply HPVDD not found, using
>> >> >> dummy
>> >> >> regulator
>> >> >> [5.383089] sun4i-codec 1c22c00.codec: ASoC: codec-analog@1f015c0
>> >> >> not
>> >> >> registered
>> >> >> [5.383098] sun4i-codec 1c22c00.codec: Failed to register our
>> >> >> card
>> >> >> [5.397183] wm8731 0-001a: 0-001a supply DCVDD not found, using
>> >> >> dummy
>> >> >> regulator
>> >> >> [5.404775] wm8731 0-001a: 0-001a supply DBVDD not found, using
>> >> >> dummy
>> >> >> regulator
>> >> >> [5.413332] sun4i-codec 1c22c00.codec: Codec <-> 1c22c00.codec
>> >> >> mapping
>> >> >> ok
>> >> >> [5.420312] sun4i-codec 1c22c00.codec: ASoC: no DMI vendor name!
>> >> >> [5.445524] asoc-simple-card sound: wm8731-hifi <-> 1c22000.i2s
>> >> >> mapping
>> >> >> ok
>> >> >> [5.452773] asoc-simple-card sound: ASoC: no DMI vendor name!
>> >> >
>> >> >
>> >> > The card is now detected by alsa (I also have a USB card plugged in):
>> >> >>
>> >> >> root@orangepi:~# aplay -l
>> >> >>
>> >> >>  List of PLAYBACK Hardware Devices 
>> >> >> card 0: Codec [H3 Audio Codec], device

[linux-sunxi] Re: [PATCH] ASoC: sun4i-i2s: Show detailed error when DAI configuration callbacks fail

2017-12-14 Thread Code Kipper
On 14 December 2017 at 08:29, Chen-Yu Tsai  wrote:
> When any of the DAI hardware configuration callbacks (.hw_param,
> .set_fmt, .set_sysclk) fails, there is no explanation about why it
> failed. This is particularly confusing for .hw_param, which covers
> many parameters of the DAI. Telling the users what parameter isn't
> supported, and what the requested value was goes a long way for
> developers trying to combine sun4i-i2s with external codecs.
>
> This patch adds dev_err calls explaining what isn't supported or
> failed, and what the value was. sun4i_i2s_set_clk_rate()'s first
> parameter was changed to a struct snd_soc_dai *dai, so we can
> get the underlying device.
>
> Signed-off-by: Chen-Yu Tsai 

Acked-by: Marcus Cooper 

Thanks...I can get rid of shit loads of my debugging now.

> ---
>  sound/soc/sunxi/sun4i-i2s.c | 36 ++--
>  1 file changed, 30 insertions(+), 6 deletions(-)
>
> diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
> index 13d7ecabe1b6..dca1143c1150 100644
> --- a/sound/soc/sunxi/sun4i-i2s.c
> +++ b/sound/soc/sunxi/sun4i-i2s.c
> @@ -269,10 +269,11 @@ static bool sun4i_i2s_oversample_is_valid(unsigned int 
> oversample)
> return false;
>  }
>
> -static int sun4i_i2s_set_clk_rate(struct sun4i_i2s *i2s,
> +static int sun4i_i2s_set_clk_rate(struct snd_soc_dai *dai,
>   unsigned int rate,
>   unsigned int word_size)
>  {
> +   struct sun4i_i2s *i2s = snd_soc_dai_get_drvdata(dai);
> unsigned int oversample_rate, clk_rate;
> int bclk_div, mclk_div;
> int ret;
> @@ -300,6 +301,7 @@ static int sun4i_i2s_set_clk_rate(struct sun4i_i2s *i2s,
> break;
>
> default:
> +   dev_err(dai->dev, "Unsupported sample rate: %u\n", rate);
> return -EINVAL;
> }
>
> @@ -308,18 +310,25 @@ static int sun4i_i2s_set_clk_rate(struct sun4i_i2s *i2s,
> return ret;
>
> oversample_rate = i2s->mclk_freq / rate;
> -   if (!sun4i_i2s_oversample_is_valid(oversample_rate))
> +   if (!sun4i_i2s_oversample_is_valid(oversample_rate)) {
> +   dev_err(dai->dev, "Unsupported oversample rate: %d\n",
> +   oversample_rate);
> return -EINVAL;
> +   }
>
> bclk_div = sun4i_i2s_get_bclk_div(i2s, oversample_rate,
>   word_size);
> -   if (bclk_div < 0)
> +   if (bclk_div < 0) {
> +   dev_err(dai->dev, "Unsupported BCLK divider: %d\n", bclk_div);
> return -EINVAL;
> +   }
>
> mclk_div = sun4i_i2s_get_mclk_div(i2s, oversample_rate,
>   clk_rate, rate);
> -   if (mclk_div < 0)
> +   if (mclk_div < 0) {
> +   dev_err(dai->dev, "Unsupported MCLK divider: %d\n", mclk_div);
> return -EINVAL;
> +   }
>
> /* Adjust the clock division values if needed */
> bclk_div += i2s->variant->bclk_offset;
> @@ -349,8 +358,11 @@ static int sun4i_i2s_hw_params(struct snd_pcm_substream 
> *substream,
> u32 width;
>
> channels = params_channels(params);
> -   if (channels != 2)
> +   if (channels != 2) {
> +   dev_err(dai->dev, "Unsupported number of channels: %d\n",
> +   channels);
> return -EINVAL;
> +   }
>
> if (i2s->variant->has_chcfg) {
> regmap_update_bits(i2s->regmap, SUN8I_I2S_CHAN_CFG_REG,
> @@ -382,6 +394,8 @@ static int sun4i_i2s_hw_params(struct snd_pcm_substream 
> *substream,
> width = DMA_SLAVE_BUSWIDTH_2_BYTES;
> break;
> default:
> +   dev_err(dai->dev, "Unsupported physical sample width: %d\n",
> +   params_physical_width(params));
> return -EINVAL;
> }
> i2s->playback_dma_data.addr_width = width;
> @@ -393,6 +407,8 @@ static int sun4i_i2s_hw_params(struct snd_pcm_substream 
> *substream,
> break;
>
> default:
> +   dev_err(dai->dev, "Unsupported sample width: %d\n",
> +   params_width(params));
> return -EINVAL;
> }
>
> @@ -401,7 +417,7 @@ static int sun4i_i2s_hw_params(struct snd_pcm_substream 
> *substream,
> regmap_field_write(i2s->field_fmt_sr,
>sr + i2s->variant->fmt_offset);
>
> -   return sun4i_i2s_set_clk_rate(i2s, params_rate(params),
> +   return sun4i_i2s_set_clk_rate(dai, params_rate(params),
>   params_width(params));
>  }
>
> @@ -426,6 +442,8 @@ static int sun4i_i2s_set_fmt(struct snd_soc_dai *dai, 
> unsigned int fmt)
> val = SUN4I_I2S_FMT0_FMT_RIGHT_J;
> break;
> default:
> +   dev_err(dai->dev, "Unsupported format: %d\n",
> +

Re: [linux-sunxi] H5 I2S status

2017-12-13 Thread Code Kipper
On 13 December 2017 at 21:51, Chris Obbard  wrote:
> Hi CK,
>
> That worked! Thanks.
>
> Here's the desg output now, all looks OK:
>>
>> [5.364112] wm8731 0-001a: Assuming static MCLK
>> [5.368716] wm8731 0-001a: 0-001a supply AVDD not found, using dummy
>> regulator
>> [5.376037] wm8731 0-001a: 0-001a supply HPVDD not found, using dummy
>> regulator
>> [5.383089] sun4i-codec 1c22c00.codec: ASoC: codec-analog@1f015c0 not
>> registered
>> [5.383098] sun4i-codec 1c22c00.codec: Failed to register our card
>> [5.397183] wm8731 0-001a: 0-001a supply DCVDD not found, using dummy
>> regulator
>> [5.404775] wm8731 0-001a: 0-001a supply DBVDD not found, using dummy
>> regulator
>> [5.413332] sun4i-codec 1c22c00.codec: Codec <-> 1c22c00.codec mapping
>> ok
>> [5.420312] sun4i-codec 1c22c00.codec: ASoC: no DMI vendor name!
>> [5.445524] asoc-simple-card sound: wm8731-hifi <-> 1c22000.i2s mapping
>> ok
>> [5.452773] asoc-simple-card sound: ASoC: no DMI vendor name!
>
>
> The card is now detected by alsa (I also have a USB card plugged in):
>>
>> root@orangepi:~# aplay -l
>>
>>  List of PLAYBACK Hardware Devices 
>> card 0: Codec [H3 Audio Codec], device 0: CDC PCM Codec-0 []
>>   Subdevices: 1/1
>>   Subdevice #0: subdevice #0
>> card 1: audio [AudioInjector audio], device 0: 1c22000.i2s-wm8731-hifi
>> wm8731-hifi-0 []
>>   Subdevices: 1/1
>>   Subdevice #0: subdevice #0
>> card 2: CODEC [USB AUDIO  CODEC], device 0: USB Audio [USB Audio]
>>   Subdevices: 1/1
>>   Subdevice #0: subdevice #0
>
>
> & I can access Alsamixer to set settings over the already connected I2C bus.
>
> But when it comes to playing a media file fails (seems to work OK with USB
> card):
>>
>> root@orangepi:~# speaker-test --device hw:1
>>
>>
>> speaker-test 1.1.3
>>
>>
>> Playback device is hw:1
>>
>> Stream parameters are 48000Hz, S16_LE, 1 channels
>>
>> Using 16 octaves of pink noise
>>
>> Channels count (1) not available for playbacks: Invalid argument
>>
>> Setting of hwparams failed: Invalid argument

you will need to use speaker-test --device hw:1 -c 2

>
>
> I will look tomorrow (with a scope) for any sign of twiddling on the I2S
> pins, but I doubt it...

Have hope?...if you don't hear anything initially can you change what
is being written to SUN8I_I2S_FMT0_LRCK_PERIOD to 125.
CK
>
>
> Here's my DTS entry (copied from your WIP branch):
>>
>> sound {
>> compatible = "simple-audio-card";
>> simple-audio-card,name = "AudioInjector audio";
>> simple-audio-card,format = "i2s";
>> simple-audio-card,bitclock-master = <&codec_master>;
>> simple-audio-card,frame-master = <&codec_master>;
>> simple-audio-card,widgets =
>> "Headphone", "Headphone Jack",
>> "Microphone", "Microphone Jack",
>> "Line", "Line Jack";
>> simple-audio-card,routing =
>> "Headphone Jack", "RHPOUT",
>> "Headphone Jack", "LHPOUT",
>> "LLINEIN", "Line Jack",
>> "MICIN", "Mic Bias",
>> "Mic Bias", "Microphone Jack";
>> simple-audio-card,cpu {
>> sound-dai = <&i2s0>;
>> };
>> codec_master: simple-audio-card,codec {
>> sound-dai = <&wm8731>;
>> system-clock-frequency = <1200>;
>> };
>> };
>
>
>
> Cheers!
>
>
>
>
> On 13 December 2017 at 09:57, Code Kipper  wrote:
>>
>> is CONFIG_DMA_SUN6I=y set in the .config(It isn't by default)?
>> CK
>>
>> On 12 December 2017 at 20:11, Chris Obbard  wrote:
>> > So finally tonight I managed to connect up the Audioinjector to the
>> > correct
>> > pins on the Orangepi PC2.
>> >
>> > It seems to be talking over i2c to the wm8731 OK, but fails to set

Re: [linux-sunxi] H5 I2S status

2017-12-13 Thread Code Kipper
is CONFIG_DMA_SUN6I=y set in the .config(It isn't by default)?
CK

On 12 December 2017 at 20:11, Chris Obbard  wrote:
> So finally tonight I managed to connect up the Audioinjector to the correct
> pins on the Orangepi PC2.
>
> It seems to be talking over i2c to the wm8731 OK, but fails to setup using
> DMAEngine?
>
> Here's the relevant parts of dmesg:
>
>> [0.00] Linux version 4.15.0-rc2-gbd0835a69-dirty
>> (chris@sunxi-build) (gcc version 7.2.0 (Debian 7.2.0-11)) #5 SMP PREEMPT Mon
>> Dec 11 18:35:03 GMT 2017
>> [0.00] Machine model: Xunlong Orange Pi PC 2
>> [2.001533] ALSA device list:
>> [2.004504]   No soundcards found.
>> [7.954144] sun4i-i2s 1c22000.i2s: Could not register PCM
>> [7.972456] sun4i-codec 1c22c00.codec: Failed to register against
>> DMAEngine
>> [8.000740] wm8731 0-001a: Assuming static MCLK
>> [8.005336] wm8731 0-001a: 0-001a supply AVDD not found, using dummy
>> regulator
>> [8.012660] wm8731 0-001a: 0-001a supply HPVDD not found, using dummy
>> regulator
>> [8.020087] wm8731 0-001a: 0-001a supply DCVDD not found, using dummy
>> regulator
>> [8.020157] sun4i-i2s 1c22000.i2s: Could not register PCM
>> [8.021684] sun4i-codec 1c22c00.codec: Failed to register against
>> DMAEngine
>> [8.039901] wm8731 0-001a: 0-001a supply DBVDD not found, using dummy
>> regulator
>> [8.051789] sun4i-i2s 1c22000.i2s: Could not register PCM
>> [8.059306] sun4i-codec 1c22c00.codec: Failed to register against
>> DMAEngine
>> [8.697652] sun4i-i2s 1c22000.i2s: Could not register PCM
>> [    8.708108] sun4i-codec 1c22c00.codec: Failed to register against
>> DMAEngine
>> [8.718261] sun4i-i2s 1c22000.i2s: Could not register PCM
>
>
> On 12 December 2017 at 06:23, Code Kipper  wrote:
>>
>> I don't understand why they changed the header on the newer boards
>> away from something that was raspberry pi compatible, the only thing
>> in common now is that they are 40 pins. I have a audio injector in the
>> post on its way to me; but I'm pretty sure as it generates the clocks
>> that there will need to be some work to get it working.
>>
>> CK
>>
>> On 11 December 2017 at 20:41, Chris Obbard  wrote:
>> > Hi CK,
>> >
>> > I have added the simple-soundcard node and the other relevant stuff in
>> > the
>> > DTS and all seems to be OK.
>> >
>> > Looks like the GPIO header on Orange Pi PC2 doesn't have access to
>> > PCM0_DOUT
>> > (or PCM0_MCLK, but that doesn't matter so much), so I'm at a stand-still
>> > until I can de-solder the resistor attached to the status LED.
>> >
>> >
>> > I am testing with the AudioInjector Stereo, I was hoping it would be a
>> > simple case of just plugging the Pi HAT in, but it never seems to be as
>> > simple as that :-).
>> >
>> >
>> > Will keep you updated with progress.
>> >
>> > Cheers!
>> >
>> >
>> > On 11 December 2017 at 13:16, Code Kipper  wrote:
>> >>
>> >> Hi Chris.
>> >> H5 support went in with the H3 so it should work. You will need to
>> >> make dts changes or overlays for the devices that you're using.
>> >> CK
>> >>
>> >> On 11 December 2017 at 12:41, Chris Obbard  wrote:
>> >> > Hey
>> >> >
>> >> > I am looking into the H5 i2s mainline support, can anyone update me
>> >> > on
>> >> > the
>> >> > status of this, point me to a wip branch or patch?
>> >> >
>> >> >
>> >> > Cheers!
>> >> >
>> >> > --
>> >> > You received this message because you are subscribed to the Google
>> >> > Groups
>> >> > "linux-sunxi" group.
>> >> > To unsubscribe from this group and stop receiving emails from it,
>> >> > send
>> >> > an
>> >> > email to linux-sunxi+unsubscr...@googlegroups.com.
>> >> > For more options, visit https://groups.google.com/d/optout.
>> >
>> >
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi] H5 I2S status

2017-12-11 Thread Code Kipper
I don't understand why they changed the header on the newer boards
away from something that was raspberry pi compatible, the only thing
in common now is that they are 40 pins. I have a audio injector in the
post on its way to me; but I'm pretty sure as it generates the clocks
that there will need to be some work to get it working.

CK

On 11 December 2017 at 20:41, Chris Obbard  wrote:
> Hi CK,
>
> I have added the simple-soundcard node and the other relevant stuff in the
> DTS and all seems to be OK.
>
> Looks like the GPIO header on Orange Pi PC2 doesn't have access to PCM0_DOUT
> (or PCM0_MCLK, but that doesn't matter so much), so I'm at a stand-still
> until I can de-solder the resistor attached to the status LED.
>
>
> I am testing with the AudioInjector Stereo, I was hoping it would be a
> simple case of just plugging the Pi HAT in, but it never seems to be as
> simple as that :-).
>
>
> Will keep you updated with progress.
>
> Cheers!
>
>
> On 11 December 2017 at 13:16, Code Kipper  wrote:
>>
>> Hi Chris.
>> H5 support went in with the H3 so it should work. You will need to
>> make dts changes or overlays for the devices that you're using.
>> CK
>>
>> On 11 December 2017 at 12:41, Chris Obbard  wrote:
>> > Hey
>> >
>> > I am looking into the H5 i2s mainline support, can anyone update me on
>> > the
>> > status of this, point me to a wip branch or patch?
>> >
>> >
>> > Cheers!
>> >
>> > --
>> > You received this message because you are subscribed to the Google
>> > Groups
>> > "linux-sunxi" group.
>> > To unsubscribe from this group and stop receiving emails from it, send
>> > an
>> > email to linux-sunxi+unsubscr...@googlegroups.com.
>> > For more options, visit https://groups.google.com/d/optout.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi] H5 I2S status

2017-12-11 Thread Code Kipper
Hi Chris.
H5 support went in with the H3 so it should work. You will need to
make dts changes or overlays for the devices that you're using.
CK

On 11 December 2017 at 12:41, Chris Obbard  wrote:
> Hey
>
> I am looking into the H5 i2s mainline support, can anyone update me on the
> status of this, point me to a wip branch or patch?
>
>
> Cheers!
>
> --
> You received this message because you are subscribed to the Google Groups
> "linux-sunxi" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to linux-sunxi+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi][PATCH] ARM: dts: sunxi: h3/h5 :Add DAI nodes

2017-09-04 Thread Code Kipper
On 3 September 2017 at 18:35, Jernej Škrabec  wrote:
> Hi Marcus!
>
> Dne nedelja, 03. september 2017 ob 17:08:06 CEST je codekip...@gmail.com
> napisal(a):
>> From: Marcus Cooper 
>>
>> Add the new DAI blocks to the device tree. I2S0 and I2S1 are for
>> connecting to an external codec whereas I2S2 is used for HDMI
>> audio.
>>
>> Signed-off-by: Marcus Cooper 
>> ---
>>  arch/arm/boot/dts/sunxi-h3-h5.dtsi | 39
>> ++ 1 file changed, 39 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/sunxi-h3-h5.dtsi
>> b/arch/arm/boot/dts/sunxi-h3-h5.dtsi index 11240a8313c2..cf6fcc857324
>> 100644
>> --- a/arch/arm/boot/dts/sunxi-h3-h5.dtsi
>> +++ b/arch/arm/boot/dts/sunxi-h3-h5.dtsi
>> @@ -450,6 +450,45 @@
>>   status = "disabled";
>>   };
>>
>> + i2s0: i2s@01c22000 {
>> + #sound-dai-cells = <0>;
>> + compatible = "allwinner,sun8i-h3-i2s";
>> + reg = <0x01c22000 0x400>;
>> + interrupts = ;
>> + clocks = <&ccu CLK_BUS_I2S0>, <&ccu CLK_I2S0>;
>> + clock-names = "apb", "mod";
>> + dmas = <&dma 3>, <&dma 3>;
>> + resets = <&ccu RST_BUS_I2S0>;
>> + dma-names = "rx", "tx";
>> + status = "disabled";
>> + };
>> +
>> + i2s1: i2s@01c22400 {
>> + #sound-dai-cells = <0>;
>> + compatible = "allwinner,sun8i-h3-i2s";
>> + reg = <0x01c22400 0x400>;
>> + interrupts = ;
>> + clocks = <&ccu CLK_BUS_I2S1>, <&ccu CLK_I2S1>;
>> + clock-names = "apb", "mod";
>> + dmas = <&dma 4>, <&dma 4>;
>> + resets = <&ccu RST_BUS_I2S1>;
>> + dma-names = "rx", "tx";
>> + status = "disabled";
>> + };
>> +
>> + i2s2: i2s@01c22800 {
>> + #sound-dai-cells = <0>;
>> + compatible = "allwinner,sun8i-h3-i2s";
>> + reg = <0x01c22800 0x400>;
>> + interrupts = ;
>> + clocks = <&ccu CLK_BUS_I2S2>, <&ccu CLK_I2S2>;
>> + clock-names = "apb", "mod";
>> + dmas = <&dma 5>, <&dma 5>;
>> + resets = <&ccu RST_BUS_I2S2>;
>> + dma-names = "rx", "tx";
>> + status = "disabled";
>> + };
>> +
>
> I don't want to be a pain, but shouldn't we skip this one for now? It is only
> for HDMI and has different capabilities (8 channels supported and slighlty
> different formula to calculate oversample rate.
I'll have a look into this..maybe this can be handled by the
simple-audio-card binding that we use. The other thing with the
padding which you mentioned I can add a field for. Maxime, what's your
thoughts on this?..I can re-submit without i2s2.
BR,
CK
>
> Best regards,
> Jernej

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi][PATCH] ARM: dts: sun6i: a31: Add DAI nodes

2017-09-03 Thread Code Kipper
On 3 September 2017 at 17:08,   wrote:
> From: Marcus Cooper 
>
> Add the new DAI blocks to the device tree.
>
> Signed-off-by: Marcus Cooper 
Hi all,
I haven't got a dev board for this SoC but was able to confirm that
this worked by setting the loopback bit and recording the playback.
BR,
CK
> ---
>  arch/arm/boot/dts/sun6i-a31.dtsi | 26 ++
>  1 file changed, 26 insertions(+)
>
> diff --git a/arch/arm/boot/dts/sun6i-a31.dtsi 
> b/arch/arm/boot/dts/sun6i-a31.dtsi
> index b147cb0dc14b..f3d74dc5b292 100644
> --- a/arch/arm/boot/dts/sun6i-a31.dtsi
> +++ b/arch/arm/boot/dts/sun6i-a31.dtsi
> @@ -662,6 +662,32 @@
> status = "disabled";
> };
>
> +   i2s0: i2s@01c22000 {
> +   #sound-dai-cells = <0>;
> +   compatible = "allwinner,sun6i-a31-i2s";
> +   reg = <0x01c22000 0x400>;
> +   interrupts = ;
> +   clocks = <&ccu CLK_APB1_DAUDIO0>, <&ccu CLK_DAUDIO0>;
> +   resets = <&ccu RST_APB1_DAUDIO0>;
> +   clock-names = "apb", "mod";
> +   dmas = <&dma 3>, <&dma 3>;
> +   dma-names = "rx", "tx";
> +   status = "disabled";
> +   };
> +
> +   i2s1: i2s@01c22400 {
> +   #sound-dai-cells = <0>;
> +   compatible = "allwinner,sun6i-a31-i2s";
> +   reg = <0x01c22400 0x400>;
> +   interrupts = ;
> +   clocks = <&ccu CLK_APB1_DAUDIO1>, <&ccu CLK_DAUDIO1>;
> +   resets = <&ccu RST_APB1_DAUDIO1>;
> +   clock-names = "apb", "mod";
> +   dmas = <&dma 4>, <&dma 4>;
> +   dma-names = "rx", "tx";
> +   status = "disabled";
> +   };
> +
> lradc: lradc@01c22800 {
> compatible = "allwinner,sun4i-a10-lradc-keys";
> reg = <0x01c22800 0x100>;
> --
> 2.14.1
>

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi] Re: [PATCH 3/3] dmaengine: sun6i: Add support for Allwinner A64

2017-08-31 Thread Code Kipper
On 31 August 2017 at 16:52, Maxime Ripard
 wrote:
> On Thu, Aug 31, 2017 at 01:36:09AM +0200, Stefan Brüns wrote:
>> The A64 SoC has the same dma engine as the H3 (sun8i), with a
>> reduced amount of physical channels. Add the proper config data
>> and compatible string to support it.
>>
>> Signed-off-by: Stefan Brüns 
>> ---
>>  arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 4 
>>  drivers/dma/sun6i-dma.c   | 7 +++
>>  2 files changed, 11 insertions(+)
>
> With what device did you test this? As far as I know, the SPI driver
> doesn't use DMA at all.
>
Hi Maxime,
I've tested this on spdif and i2s on the Pine64.
BR,
CK
> Maxime
>
> --
> Maxime Ripard, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com
>
> --
> You received this message because you are subscribed to the Google Groups 
> "linux-sunxi" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to linux-sunxi+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Re: [PATCH v5 0/8] ASoC: Add I2S support for Allwinner H3 SoCs

2017-08-31 Thread Code Kipper
On 31 August 2017 at 13:50, Code Kipper  wrote:
> Hi Mark,
>
> Wens has given this patch series his blessing so it's good to go.
>
> Let us know if you need me to resubmit,
I take that back as I can see that's all been submitted.
Thanks,
CK

>
> BR,
> CK
> On 19 August 2017 at 14:48,   wrote:
>> From: Marcus Cooper 
>>
>> Hi All,
>> please find attached a series of patches to bring i2s support to the
>> Allwinner H3 SoC. This has been tested with the following setups:
>>
>> A20 Olimex EVB connected to a pcm5102
>> Orange Pi 2 connected to a uda1380
>> Orange Pi 2 hdmi audio playback
>> Pine 64 connected to the audio DAC board
>>
>> To get i2s working some additional patches are required which will be
>> delivered later. For now they have been pushed here
>>
>> https://github.com/codekipper/linux-sunxi/commits/sunxi-audio-h3
>>
>> I don't own a A33 device which uses the i2s block for the audio codec
>> so if someone could test against that it would be much appreciated.
>>
>> I'm also wondering if there is a preferred way of setting the lrclk
>> size in the dts?..currently it is set to the sample width but for example
>> the pcm5102a wants it to be 32 bits whatever the sample rate.
>>
>> Thanks in advance,
>> CK
>>
>> ---
>>
>> v5 changes compared to v4 are:
>> - fixed bad logic in fmt0 set LRCK period define.
>> - fixed PTR_ERR checks in init of regmap fields
>> - added reviewed-by to commit messages
>> - removed delivered patches
>>
>> v4 changes compared to v3 are:
>> - moved clkdiv variant adjustment out of function
>> - used PTR_ERR_OR_ZERO for checks
>> - tidy up of extra lines and lines over 80 chars.
>> - reduced names of polarity, wss and sr reg fields.
>> - added reviewed-by to commit messages
>> - added comments for functionality that hasn't been implemented yet.
>> - removed delivered patches
>>
>> v3 changes compared to v2 are:
>> - initial changes to prepare driver for newer SoCs has been broken down
>>   into smaller patches
>> - reduce use of regmap fields to where just needed.
>> - clkdiv expansion will be delivered later.
>> - defines for H3 variant segregated.
>> - fixed regmap config issue with SUN8I_I2S_FIFO_TX_REG.
>>
>> v2 changes compared to v1 are:
>>  - massive refactoring to remove duplicate code making use of regmap_fields.
>>  - extending the clock divisors.
>>  - removed code that should be delivered when we support 20/24bits
>>
>> ---
>>
>> Marcus Cooper (8):
>>   ASoC: sun4i-i2s: Add regmap fields for channels
>>   ASoC: sun4i-i2s: Add regfields for word size select and sample
>> resolution
>>   ASoC: sun4i-i2s: bclk and lrclk polarity tidyup
>>   ASoC: sun4i-i2s: Add mclk enable regmap field
>>   ASoC: sun4i-i2s: Add regmap field to set DAI format
>>   ASoC: sun4i-i2s: Check for slave select bit
>>   ASoC: sun4i-i2s: Update global enable with bitmask
>>   ASoC: sun4i-i2s: Add support for H3
>>
>>  .../devicetree/bindings/sound/sun4i-i2s.txt|   2 +
>>  sound/soc/sunxi/sun4i-i2s.c| 406 
>> ++---
>>  2 files changed, 357 insertions(+), 51 deletions(-)
>>
>> --
>> 2.14.1
>>

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Re: [PATCH v5 0/8] ASoC: Add I2S support for Allwinner H3 SoCs

2017-08-31 Thread Code Kipper
Hi Mark,

Wens has given this patch series his blessing so it's good to go.

Let us know if you need me to resubmit,

BR,
CK
On 19 August 2017 at 14:48,   wrote:
> From: Marcus Cooper 
>
> Hi All,
> please find attached a series of patches to bring i2s support to the
> Allwinner H3 SoC. This has been tested with the following setups:
>
> A20 Olimex EVB connected to a pcm5102
> Orange Pi 2 connected to a uda1380
> Orange Pi 2 hdmi audio playback
> Pine 64 connected to the audio DAC board
>
> To get i2s working some additional patches are required which will be
> delivered later. For now they have been pushed here
>
> https://github.com/codekipper/linux-sunxi/commits/sunxi-audio-h3
>
> I don't own a A33 device which uses the i2s block for the audio codec
> so if someone could test against that it would be much appreciated.
>
> I'm also wondering if there is a preferred way of setting the lrclk
> size in the dts?..currently it is set to the sample width but for example
> the pcm5102a wants it to be 32 bits whatever the sample rate.
>
> Thanks in advance,
> CK
>
> ---
>
> v5 changes compared to v4 are:
> - fixed bad logic in fmt0 set LRCK period define.
> - fixed PTR_ERR checks in init of regmap fields
> - added reviewed-by to commit messages
> - removed delivered patches
>
> v4 changes compared to v3 are:
> - moved clkdiv variant adjustment out of function
> - used PTR_ERR_OR_ZERO for checks
> - tidy up of extra lines and lines over 80 chars.
> - reduced names of polarity, wss and sr reg fields.
> - added reviewed-by to commit messages
> - added comments for functionality that hasn't been implemented yet.
> - removed delivered patches
>
> v3 changes compared to v2 are:
> - initial changes to prepare driver for newer SoCs has been broken down
>   into smaller patches
> - reduce use of regmap fields to where just needed.
> - clkdiv expansion will be delivered later.
> - defines for H3 variant segregated.
> - fixed regmap config issue with SUN8I_I2S_FIFO_TX_REG.
>
> v2 changes compared to v1 are:
>  - massive refactoring to remove duplicate code making use of regmap_fields.
>  - extending the clock divisors.
>  - removed code that should be delivered when we support 20/24bits
>
> ---
>
> Marcus Cooper (8):
>   ASoC: sun4i-i2s: Add regmap fields for channels
>   ASoC: sun4i-i2s: Add regfields for word size select and sample
> resolution
>   ASoC: sun4i-i2s: bclk and lrclk polarity tidyup
>   ASoC: sun4i-i2s: Add mclk enable regmap field
>   ASoC: sun4i-i2s: Add regmap field to set DAI format
>   ASoC: sun4i-i2s: Check for slave select bit
>   ASoC: sun4i-i2s: Update global enable with bitmask
>   ASoC: sun4i-i2s: Add support for H3
>
>  .../devicetree/bindings/sound/sun4i-i2s.txt|   2 +
>  sound/soc/sunxi/sun4i-i2s.c| 406 
> ++---
>  2 files changed, 357 insertions(+), 51 deletions(-)
>
> --
> 2.14.1
>

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Re: [PATCH 3/3] dmaengine: sun6i: Add support for Allwinner A64

2017-08-31 Thread Code Kipper
On 31 August 2017 at 01:36, Stefan Brüns  wrote:
> The A64 SoC has the same dma engine as the H3 (sun8i), with a
> reduced amount of physical channels. Add the proper config data
> and compatible string to support it.
>
> Signed-off-by: Stefan Brüns 
> ---
>  arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 4 
>  drivers/dma/sun6i-dma.c   | 7 +++
>  2 files changed, 11 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi 
> b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> index f96287d3043a..b86019238b77 100644
> --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
> @@ -494,6 +494,8 @@
> interrupts = ;
> clocks = <&ccu CLK_BUS_SPI0>, <&ccu CLK_SPI0>;
> clock-names = "ahb", "mod";
> +   dmas = <&dma 23>, <&dma 23>;
> +   dma-names = "rx", "tx";
Hi Stefan,
the dtsi parts should be in a separate patch

> pinctrl-names = "default";
> pinctrl-0 = <&spi0_pins>;
> resets = <&ccu RST_BUS_SPI0>;
> @@ -509,6 +511,8 @@
> interrupts = ;
> clocks = <&ccu CLK_BUS_SPI1>, <&ccu CLK_SPI1>;
> clock-names = "ahb", "mod";
> +   dmas = <&dma 24>, <&dma 24>;
> +   dma-names = "rx", "tx";
> pinctrl-names = "default";
> pinctrl-0 = <&spi1_pins>;
> resets = <&ccu RST_BUS_SPI1>;
> diff --git a/drivers/dma/sun6i-dma.c b/drivers/dma/sun6i-dma.c
> index 5f4eee4513e5..6a17c5d63582 100644
> --- a/drivers/dma/sun6i-dma.c
> +++ b/drivers/dma/sun6i-dma.c
> @@ -1068,6 +1068,12 @@ static struct sun6i_dma_config sun8i_h3_dma_cfg = {
> .nr_max_vchans   = 34,
> .dmac_variant= DMAC_VARIANT_H3,
>  };
> +
> +static struct sun6i_dma_config sun50i_a64_dma_cfg = {
> +   .nr_max_channels = 8,
> +   .nr_max_requests = 27,
> +   .nr_max_vchans   = 38,
> +   .dmac_variant= DMAC_VARIANT_H3,
>  };
>
>  static const struct of_device_id sun6i_dma_match[] = {
> @@ -1075,6 +1081,7 @@ static const struct of_device_id sun6i_dma_match[] = {
> { .compatible = "allwinner,sun8i-a23-dma", .data = &sun8i_a23_dma_cfg 
> },
> { .compatible = "allwinner,sun8i-a83t-dma", .data = 
> &sun8i_a83t_dma_cfg },
> { .compatible = "allwinner,sun8i-h3-dma", .data = &sun8i_h3_dma_cfg },
> +   { .compatible = "allwinner,sun50i-a64-dma", .data = 
> &sun50i_a64_dma_cfg },
This all looks fine...it's similar to my patch here
https://github.com/codekipper/linux-sunxi/commit/8c54d9852dfad6ceb478c579a1213f38fb12fa80
which I've been too lazy to post. I think the binding documentation
should go with this patch and this should also be the 1st patch in the
series, followed by the dtsi changes.
BR,
CK
> { /* sentinel */ }
>  };
>  MODULE_DEVICE_TABLE(of, sun6i_dma_match);
> --
> 2.14.1
>

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Re: [PATCH v2] arm64: allwinner: h5: add support for NanoPi NEO Plus 2

2017-08-25 Thread Code Kipper
On 25 August 2017 at 12:32, Antony Antony  wrote:
> Add initial DT support for NanoPi NEO Plus 2 by FriendlyELEC
> Allwinner quad core H5 Cortex A53 with an ARM Mali-450MP GPU
> 1 GB DDR3 RAM
> 8GB eMMC flash (Samsung KLM8G1WEPD-B031)
> micro SD card slot
> Gigabit Ethernet (external RTL8211E-VB-CG chip)
> 802.11 b/g/n WiFi, Bluetooth 4.0 (Ampak AP6212A module)
> 2x USB 2.0 host ports & 2x USB via headers
>
> The DTS is based on OrangePi PC 2, sun50i-h5-orangepi-pc2
> Added dwmac-sun8i Gigabit Ethernet support based on
> Nano Pi Neo2 DT and the schematics.
>
> Signed-off-by: Antony Antony 
> ---
>  arch/arm64/boot/dts/allwinner/Makefile |   1 +
>  .../dts/allwinner/sun50i-h5-nanopi-neo-plus2.dts   | 341 
> +
>  2 files changed, 342 insertions(+)
>  create mode 100644 
> arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-neo-plus2.dts
>
> diff --git a/arch/arm64/boot/dts/allwinner/Makefile 
> b/arch/arm64/boot/dts/allwinner/Makefile
> index 108f12c..e6810c8 100644
> --- a/arch/arm64/boot/dts/allwinner/Makefile
> +++ b/arch/arm64/boot/dts/allwinner/Makefile
> @@ -6,6 +6,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-pc2.dtb
>  dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-prime.dtb
>  dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-orangepi-zero-plus2.dtb
>  dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-nanopi-neo2.dtb
> +dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-nanopi-neo-plus2.dtb
>
>  always := $(dtb-y)
>  subdir-y   := $(dts-dirs)
> diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-neo-plus2.dts 
> b/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-neo-plus2.dts
> new file mode 100644
> index 000..d279ad8
> --- /dev/null
> +++ b/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-neo-plus2.dts
> @@ -0,0 +1,341 @@
> +/*
> + * Copyright (C) 2017 Antony Antony 
> + * Copyright (C) 2016 ARM Ltd.
> + *
> + * This file is dual-licensed: you can use it either under the terms
> + * of the GPL or the X11 license, at your option. Note that this dual
> + * licensing only applies to this file, and not this project as a
> + * whole.
> + *
> + *  a) This file is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation; either version 2 of the
> + * License, or (at your option) any later version.
> + *
> + * This file is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * Or, alternatively,
> + *
> + *  b) Permission is hereby granted, free of charge, to any person
> + * obtaining a copy of this software and associated documentation
> + * files (the "Software"), to deal in the Software without
> + * restriction, including without limitation the rights to use,
> + * copy, modify, merge, publish, distribute, sublicense, and/or
> + * sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following
> + * conditions:
> + *
> + * The above copyright notice and this permission notice shall be
> + * included in all copies or substantial portions of the Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
> + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
> + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
> + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
> + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
> + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
> + * OTHER DEALINGS IN THE SOFTWARE.
> + */
> +
> +/dts-v1/;
> +#include "sun50i-h5.dtsi"
> +
> +#include 
> +#include 
> +#include 
> +
> +/ {
> +   model = "FriendlyARM NanoPi NEO Plus2";
> +   compatible = "friendlyarm,nanopi-neo-pus2", "allwinner,sun50i-h5";
Hi,
s/pus/plus
> +
> +   reg_vcc3v3: vcc3v3 {
> +   compatible = "regulator-fixed";
> +   regulator-name = "vcc3v3";
> +   regulator-min-microvolt = <330>;
> +   regulator-max-microvolt = <330>;
> +   };
> +
> +   aliases {
> +   ethernet0 = &emac;
> +   serial0 = &uart0;
> +   };
> +
> +   chosen {
> +   stdout-path = "serial0:115200n8";
> +   };
> +
> +   leds {
> +   compatible = "gpio-leds";
> +
> +   pwr {
> +   label = "orangepi:green:pwr";
> +   gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>;
> +   default-state = "on";
> + 

Re: [linux-sunxi] [PATCH v3 11/11] ASoC: sun4i-i2s: Add support for H3

2017-08-15 Thread Code Kipper
On 12 August 2017 at 14:27, Chen-Yu Tsai  wrote:
> On Sat, Aug 12, 2017 at 7:00 PM,   wrote:
>> From: Marcus Cooper 
>>
>> The sun8i-h3 introduces a lot of changes to the i2s block such
>> as different register locations, extended clock division and
>> more operational modes. As we have to consider the earlier
>> implementation then these changes need to be isolated.
>>
>> None of the new functionality has been implemented yet, the
>> driver has just been expanded to allow it work on the H3 SoC.
>>
>> Signed-off-by: Marcus Cooper 
>> ---
>>  .../devicetree/bindings/sound/sun4i-i2s.txt|   2 +
>>  sound/soc/sunxi/sun4i-i2s.c| 176 
>> -
>>  2 files changed, 176 insertions(+), 2 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/sound/sun4i-i2s.txt 
>> b/Documentation/devicetree/bindings/sound/sun4i-i2s.txt
>> index ee21da865771..fc5da6080759 100644
>> --- a/Documentation/devicetree/bindings/sound/sun4i-i2s.txt
>> +++ b/Documentation/devicetree/bindings/sound/sun4i-i2s.txt
>> @@ -8,6 +8,7 @@ Required properties:
>>  - compatible: should be one of the following:
>> - "allwinner,sun4i-a10-i2s"
>> - "allwinner,sun6i-a31-i2s"
>> +   - "allwinner,sun8i-h3-i2s"
>>  - reg: physical base address of the controller and length of memory mapped
>>region.
>>  - interrupts: should contain the I2S interrupt.
>> @@ -22,6 +23,7 @@ Required properties:
>>
>>  Required properties for the following compatibles:
>> - "allwinner,sun6i-a31-i2s"
>> +   - "allwinner,sun8i-h3-i2s"
>>  - resets: phandle to the reset line for this codec
>>
>>  Example:
>> diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
>> index a6b464c8cc6c..b6faa95d972a 100644
>> --- a/sound/soc/sunxi/sun4i-i2s.c
>> +++ b/sound/soc/sunxi/sun4i-i2s.c
>> @@ -92,11 +92,41 @@
>>  #define SUN4I_I2S_RX_CHAN_SEL_REG  0x38
>>  #define SUN4I_I2S_RX_CHAN_MAP_REG  0x3c
>>
>> +/* Defines required for sun8i-h3 support */
>> +#define SUN8I_I2S_CTRL_BCLK_OUTBIT(18)
>> +#define SUN8I_I2S_CTRL_LRCK_OUTBIT(17)
>> +
>> +#define SUN8I_I2S_FMT0_LRCK_PERIOD_MASKGENMASK(17, 8)
>> +#define SUN8I_I2S_FMT0_LRCK_PERIOD(period) ((period << 8) - 1)
>
> I'm pretty sure this should be ((period - 1) << 8).
>
> Once fixed,
>
> Reviewed-by: Chen-Yu Tsai 
>
> P.S. the version tag for this series in the subject is wrong.

Hi Wens,
thanks for the reviews..I've ack'd them all and will push again once tested.
BR,
CK

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi] [PATCH v3 05/12] ASoC: sun4i-i2s: Add regmap fields for channels

2017-08-07 Thread Code Kipper
On 1 August 2017 at 10:31, Chen-Yu Tsai  wrote:
> On Sat, Jul 29, 2017 at 10:17 PM,   wrote:
>> From: Marcus Cooper 
>>
>> On the original i2s block the channel mapping and selection were
>> configured for stereo audio by default: This is not the case with
>> the newer SoCs and they are also located at different offsets.
>>
>> To support the newer SoC then regmap fields have been added to the
>> quirks and these are initialised to their correct settings during
>> probing.
>>
>> Signed-off-by: Marcus Cooper 
>> ---
>>  sound/soc/sunxi/sun4i-i2s.c | 80 
>> -
>>  1 file changed, 72 insertions(+), 8 deletions(-)
>>
>> diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
>> index 2a25df22c2f8..120f797a38e8 100644
>> --- a/sound/soc/sunxi/sun4i-i2s.c
>> +++ b/sound/soc/sunxi/sun4i-i2s.c
>> @@ -82,7 +82,7 @@
>>  #define SUN4I_I2S_TX_CNT_REG   0x2c
>>
>>  #define SUN4I_I2S_TX_CHAN_SEL_REG  0x30
>> -#define SUN4I_I2S_TX_CHAN_SEL(num_chan)(((num_chan) - 1) << 
>> 0)
>> +#define SUN4I_I2S_CHAN_SEL(num_chan)   (((num_chan) - 1) << 0)
>>
>>  #define SUN4I_I2S_TX_CHAN_MAP_REG  0x34
>>  #define SUN4I_I2S_TX_CHAN_MAP(chan, sample)((sample) << (chan << 2))
>> @@ -98,6 +98,10 @@
>>   * @sun4i_i2s_regmap: regmap config to use.
>>   * @mclk_offset: Value by which mclkdiv needs to be adjusted.
>>   * @bclk_offset: Value by which bclkdiv needs to be adjusted.
>> + * @field_txchanmap: location of the tx channel mapping register.
>> + * @field_rxchanmap: location of the rx channel mapping register.
>> + * @field_txchansel: location of the tx channel select bit fields.
>> + * @field_rxchansel: location of the rx channel select bit fields.
>>   */
>>  struct sun4i_i2s_quirks {
>> boolhas_reset;
>> @@ -105,6 +109,12 @@ struct sun4i_i2s_quirks {
>> const struct regmap_config  *sun4i_i2s_regmap;
>> unsigned intmclk_offset;
>> unsigned intbclk_offset;
>> +
>> +   /* Register fields for i2s */
>> +   struct reg_fieldfield_txchanmap;
>> +   struct reg_fieldfield_rxchanmap;
>> +   struct reg_fieldfield_txchansel;
>> +   struct reg_fieldfield_rxchansel;
>>  };
>>
>>  struct sun4i_i2s {
>> @@ -118,6 +128,12 @@ struct sun4i_i2s {
>> struct snd_dmaengine_dai_dma_data   capture_dma_data;
>> struct snd_dmaengine_dai_dma_data   playback_dma_data;
>>
>> +   /* Register fields for i2s */
>> +   struct regmap_field *field_txchanmap;
>> +   struct regmap_field *field_rxchanmap;
>> +   struct regmap_field *field_txchansel;
>> +   struct regmap_field *field_rxchansel;
>> +
>> const struct sun4i_i2s_quirks   *variant;
>>  };
>>
>> @@ -264,6 +280,18 @@ static int sun4i_i2s_hw_params(struct snd_pcm_substream 
>> *substream,
>> if (params_channels(params) != 2)
>> return -EINVAL;
>>
>> +   /* Map the channels for playback and capture */
>> +   regmap_field_write(i2s->field_txchanmap, 0x76543210);
>> +   regmap_field_write(i2s->field_rxchanmap, 0x3210);
>> +
>> +   /* Configure the channels */
>> +   regmap_field_write(i2s->field_txchansel,
>> +  SUN4I_I2S_CHAN_SEL(params_channels(params)));
>> +
>> +   regmap_field_write(i2s->field_rxchansel,
>> +  SUN4I_I2S_CHAN_SEL(params_channels(params)));
>> +
>> +
>
> Checkpatch says don't use multiple blank lines.
>
>> switch (params_physical_width(params)) {
>> case 16:
>> width = DMA_SLAVE_BUSWIDTH_2_BYTES;
>> @@ -486,13 +514,6 @@ static int sun4i_i2s_startup(struct snd_pcm_substream 
>> *substream,
>>SUN4I_I2S_CTRL_SDO_EN_MASK,
>>SUN4I_I2S_CTRL_SDO_EN(0));
>>
>> -   /* Enable the first two channels */
>> -   regmap_write(i2s->regmap, SUN4I_I2S_TX_CHAN_SEL_REG,
>> -SUN4I_I2S_TX_CHAN_SEL(2));
>> -
>> -   /* Map them to the two first samples coming in */
>> -   regmap_write(i2s->regmap, SUN4I_I2S_TX_CHAN_MAP_REG,
>> -SUN4I_I2S_TX_CHAN_MAP(0, 0) | SUN4I_I2S_TX_CHAN_MAP(1, 
>> 1));
>>
>> return clk_prepare_enable(i2s->mod_clk);
>>  }
>> @@ -677,14 +698,51 @@ static const struct sun4i_i2s_quirks 
>> sun4i_a10_i2s_quirks = {
>> .has_reset  = false,
>> .reg_offset_txdata  = SUN4I_I2S_FIFO_TX_REG,
>> .sun4i_i2s_regmap   = &sun4i_i2s_regmap_config,
>> +   .field_txchanmap= REG_FIELD(SUN4I_I2S_TX_CHAN_MAP_REG, 0, 
>> 31),
>> +   .field_rxchanmap= REG_FIELD(SUN4I_I2S_RX_CHAN_MAP_REG, 0, 
>> 31),
>> +   .field_txchansel= REG_FIELD(SUN4I_I2S_TX_CHAN_SEL_REG, 0, 2),
>> +   .field_rxchansel= REG_FIELD(SUN4I_I2S_RX_CHAN_SEL_REG, 0, 2),

Re: [linux-sunxi] [PATCH v3 02/12] ASoC: sun4i-i2s: Add clkdiv offsets to quirks

2017-08-06 Thread Code Kipper
On 1 August 2017 at 04:55, Chen-Yu Tsai  wrote:
> On Sat, Jul 29, 2017 at 10:17 PM,   wrote:
>> From: Marcus Cooper 
>>
>> 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 
>> ---
>>  sound/soc/sunxi/sun4i-i2s.c | 8 ++--
>>  1 file changed, 6 insertions(+), 2 deletions(-)
>>
>> diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
>> index d7ee7a443e4e..1d538de4e4d0 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 {
>> boolhas_reset;
>> +   unsigned intmclk_offset;
>> +   unsigned intbclk_offset;
>>  };
>>
>>  struct sun4i_i2s {
>> @@ -149,7 +153,7 @@ static int sun4i_i2s_get_bclk_div(struct sun4i_i2s *i2s,
>> const struct sun4i_i2s_clk_div *bdiv = 
>> &sun4i_i2s_bclk_div[i];
>>
>> if (bdiv->div == div)
>> -   return bdiv->val;
>> +   return bdiv->val + i2s->variant->bclk_offset;
>
> The offset should best be applied when the value is written to the register,
> in sun4i_i2s_set_clk_rate(). sun4i_i2s_get_*_div() should do what the name
> says, that is calculate a divider based on the parameters it is given.
>
ACK,
Thanks for the review,
CK
> Regards
> ChenYu
>
>> }
>>
>> return -EINVAL;
>> @@ -167,7 +171,7 @@ static int sun4i_i2s_get_mclk_div(struct sun4i_i2s *i2s,
>> const struct sun4i_i2s_clk_div *mdiv = 
>> &sun4i_i2s_mclk_div[i];
>>
>> if (mdiv->div == div)
>> -   return mdiv->val;
>> +   return mdiv->val + i2s->variant->mclk_offset;
>> }
>>
>> return -EINVAL;
>> --
>> 2.13.3
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "linux-sunxi" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to linux-sunxi+unsubscr...@googlegroups.com.
>> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi] [PATCH v3 00/12] ASoC: Add I2S support for Allwinner H3 SoCs

2017-07-31 Thread Code Kipper
On 31 July 2017 at 09:05, Olliver Schinagl  wrote:
> Hey Marcus,
>
> On 29-07-17 16:17, codekip...@gmail.com wrote:
>>
>> From: Marcus Cooper 
>>
>> Hi All,
>> please find attached a series of patches to bring i2s support to the
>> Allwinner H3 SoC. This has been tested with the following setups:
>>
>> A20 Olimex EVB connected to a pcm5102
>
> But that's not an H3 is it? :)

Was it broken?.No...Have you fucked with it?YesIs it now
broken?...well better test!
>
>> Orange Pi 2 connected to a uda1380
>> Orange Pi 2 hdmi audio playback
>> Pine 64 connected to the audio DAC board
>>
>> To get i2s working some additional patches are required which will be
>> delivered later. For now they have been pushed here
>>
>> https://github.com/codekipper/linux-sunxi/commits/sunxi-audio-h3
>
>
> Since I want to use i2s on the A20, i'm trying out your patches. It would be
> helpfull if you could point out which patches are missing (and if the
> subject doesn't cover it why those are needed)
Mainline currently supports A20...just needs pins to be added to the
dtsi and codec specific added to the board dts. If you're having
problems check pin connections to your external board and make sure
the codec is being compiled.
Good luck,
CK
>
>
>>
>> I don't own a A33 device which uses the i2s block for the audio codec
>> so if someone could test against that it would be much appreciated.
>>
>> I'm also wondering if there is a preferred way of setting the lrclk
>> size in the dts?..currently it is set to the sample width but for example
>> the pcm5102a wants it to be 32 bits whatever the sample rate.
>>
>> Thanks in advance,
>> CK
>>
>> ---
>>
>> v3 changes compared to v2 are:
>> - initial changes to prepare driver for newer SoCs has been broken down
>>   into smaller patches
>> - reduce use of regmap fields to where just needed.
>> - clkdiv expansion will be delivered later.
>> - defines for H3 variant segregated.
>> - fixed regmap config issue with SUN8I_I2S_FIFO_TX_REG.
>>
>>
>> v2 changes compared to v1 are:
>>  - massive refactoring to remove duplicate code making use of
>> regmap_fields.
>>  - extending the clock divisors.
>>  - removed code that should be delivered when we support 20/24bits
>>
>> ---
>>
>> Marcus Cooper (12):
>>   ASoC: sun4i-i2s: Extend quirks scope
>>   ASoC: sun4i-i2s: Add clkdiv offsets to quirks
>>   ASoC: sun4i-i2s: Add regmap config to quirks
>>   ASoC: sun4i-i2s: Add TX FIFO offset to quirks
>>   ASoC: sun4i-i2s: Add regmap fields for channels
>>   ASoC: sun4i-i2s: Add changes for wss and sr
>>   ASoC: sun4i-i2s: bclk and lrclk polarity tidyup
>>   ASoC: sun4i-i2s: Add mclk enable regmap field
>>   ASoC: sun4i-i2s: Add regmap field to set format
>>   ASoC: sun4i-i2s: Check for slave select bit
>>   ASoC: sun4i-i2s: Update global enable with bitmask
>>   ASoC: sun4i-i2s: Add support for H3
>>
>>  .../devicetree/bindings/sound/sun4i-i2s.txt|   2 +
>>  sound/soc/sunxi/sun4i-i2s.c| 460
>> ++---
>>  2 files changed, 398 insertions(+), 64 deletions(-)
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Re: [PATCH v2 2/2] ASoC: sun4i-i2s: Add support for H3

2017-07-25 Thread Code Kipper
On 25 July 2017 at 16:36, Maxime Ripard
 wrote:
> Hi,
>
> On Sat, Jul 22, 2017 at 08:53:52AM +0200, codekip...@gmail.com wrote:
>> From: Marcus Cooper 
>>
>> The sun8i-h3 introduces a lot of changes to the i2s block such
>> as different register locations, extended clock division and
>> more operational modes. As we have to consider the earlier
>> implementation then these changes need to be isolated.
>>
>> Signed-off-by: Marcus Cooper 
>> ---
>>  .../devicetree/bindings/sound/sun4i-i2s.txt|   2 +
>>  sound/soc/sunxi/sun4i-i2s.c| 202 
>> +
>>  2 files changed, 204 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/sound/sun4i-i2s.txt 
>> b/Documentation/devicetree/bindings/sound/sun4i-i2s.txt
>> index ee21da865771..fc5da6080759 100644
>> --- a/Documentation/devicetree/bindings/sound/sun4i-i2s.txt
>> +++ b/Documentation/devicetree/bindings/sound/sun4i-i2s.txt
>> @@ -8,6 +8,7 @@ Required properties:
>>  - compatible: should be one of the following:
>> - "allwinner,sun4i-a10-i2s"
>> - "allwinner,sun6i-a31-i2s"
>> +   - "allwinner,sun8i-h3-i2s"
>>  - reg: physical base address of the controller and length of memory mapped
>>region.
>>  - interrupts: should contain the I2S interrupt.
>> @@ -22,6 +23,7 @@ Required properties:
>>
>>  Required properties for the following compatibles:
>>   - "allwinner,sun6i-a31-i2s"
>> + - "allwinner,sun8i-h3-i2s"
>>  - resets: phandle to the reset line for this codec
>>
>>  Example:
>> diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
>> index 1854405cbcb1..2b3c2b28059c 100644
>> --- a/sound/soc/sunxi/sun4i-i2s.c
>> +++ b/sound/soc/sunxi/sun4i-i2s.c
>> @@ -26,6 +26,8 @@
>>  #include 
>>
>>  #define SUN4I_I2S_CTRL_REG   0x00
>> +#define SUN8I_I2S_CTRL_BCLK_OUT  BIT(18)
>> +#define SUN8I_I2S_CTRL_LRCK_OUT  BIT(17)
>>  #define SUN4I_I2S_CTRL_SDO_EN_MASK   GENMASK(11, 8)
>>  #define SUN4I_I2S_CTRL_SDO_EN(sdo)   BIT(8 + (sdo))
>>  #define SUN4I_I2S_CTRL_MODE_MASK BIT(5)
>> @@ -55,6 +57,7 @@
>>
>>  #define SUN4I_I2S_FMT1_REG   0x08
>>  #define SUN4I_I2S_FIFO_TX_REG0x0c
>> +#define SUN8I_I2S_INT_STA_REG0x0c
>>  #define SUN4I_I2S_FIFO_RX_REG0x10
>>
>>  #define SUN4I_I2S_FIFO_CTRL_REG  0x14
>> @@ -72,8 +75,10 @@
>>  #define SUN4I_I2S_DMA_INT_CTRL_RX_DRQ_EN BIT(3)
>>
>>  #define SUN4I_I2S_INT_STA_REG0x20
>> +#define SUN8I_I2S_FIFO_TX_REG0x20
>>
>>  #define SUN4I_I2S_CLK_DIV_REG0x24
>> +#define SUN8I_I2S_CLK_DIV_MCLK_EN8
>>  #define SUN4I_I2S_CLK_DIV_MCLK_EN7
>>  #define SUN4I_I2S_CLK_DIV_BCLK_MASK  GENMASK(6, 4)
>>  #define SUN4I_I2S_CLK_DIV_BCLK(bclk) ((bclk) << 4)
>> @@ -86,16 +91,29 @@
>>  #define SUN4I_I2S_TX_CHAN_SEL_REG0x30
>>  #define SUN4I_I2S_CHAN_SEL(num_chan) (((num_chan) - 1) << 0)
>>
>> +#define SUN8I_I2S_CHAN_CFG_REG   0x30
>> +
>>  #define SUN4I_I2S_TX_CHAN_MAP_REG0x34
>>  #define SUN4I_I2S_TX_CHAN_MAP(chan, sample)  ((sample) << (chan << 2))
>> +#define SUN8I_I2S_TX_CHAN_SEL_REG0x34
>> +#define SUN8I_I2S_TX_CHAN_OFFSET(offset) (offset << 12)
>>  #define SUN4I_I2S_TX_CHAN_EN(num_chan)   (((1 << num_chan) - 1))
>>
>>  #define SUN4I_I2S_RX_CHAN_SEL_REG0x38
>>  #define SUN4I_I2S_RX_CHAN_MAP_REG0x3c
>>
>> +#define SUN8I_I2S_TX_CHAN_MAP_REG0x44
>> +
>> +#define SUN8I_I2S_RX_CHAN_SEL_REG0x54
>> +#define SUN8I_I2S_RX_CHAN_MAP_REG0x58
>> +
>
> I would not interleave those defines. It's a bit hard to see which
> generation has which set of registers. I guess you could just move the
> new ones to the bottom of the defines.

Ok...you especially see it when looking at the patch. I'll add a
comment and move everything to the bottom.
>
>>  struct sun4i_i2s_quirks {
>>   boolhas_reset;
>>   boolhas_master_slave_sel;
>> + boolhas_fmt_set_lrck_period;
>> + boolhas_chcfg;
>> + boolhas_chsel_tx_chen;
>> + boolhas_chsel_offset;
>>   unsigned intreg_offset_txdata;  /* TX FIFO */
>>   unsigned intreg_offset_txchanmap;
>>   unsigned intreg_offset_rxchanmap;
>> @@ -113,6 +131,11 @@ struct sun4i_i2s_quirks {
>>   struct reg_fieldfield_fmt_set_mode;
>>   struct reg_fieldfield_txchansel;
>>   struct reg_fieldfield_rxchansel;
>> + struct reg_fieldfield_fmt_set_lrck_period;
>> + struct reg_fieldfield_chcfg_tx_slot_num;
>> + struct reg_fieldfield_chcfg_rx_slot_num;
>> + struct reg_field

[linux-sunxi] Re: [PATCH v2 1/2] ASoC: sun4i-i2s: Add more quirks for newer SoCs

2017-07-24 Thread Code Kipper
On 25 July 2017 at 07:52, Maxime Ripard
 wrote:
> Hi Markus,
>
> On Sat, Jul 22, 2017 at 08:53:51AM +0200, codekip...@gmail.com wrote:
>> From: Marcus Cooper 
>>
>> In preparation for changing this driver to support newer SoC
>> implementations then where needed there has been a switch from
>> regmap_update_bits to regmap_field. Also included are adjustment
>> variables although they are not set as no adjustment is required
>> for the current support.
>>
>> Signed-off-by: Marcus Cooper 
>> ---
>>  sound/soc/sunxi/sun4i-i2s.c | 267 
>> +---
>>  1 file changed, 203 insertions(+), 64 deletions(-)
>>
>> diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
>> index 62b307b0c846..1854405cbcb1 100644
>> --- a/sound/soc/sunxi/sun4i-i2s.c
>> +++ b/sound/soc/sunxi/sun4i-i2s.c
>> @@ -50,6 +50,8 @@
>>  #define SUN4I_I2S_FMT0_FMT_RIGHT_J   (2 << 0)
>>  #define SUN4I_I2S_FMT0_FMT_LEFT_J(1 << 0)
>>  #define SUN4I_I2S_FMT0_FMT_I2S   (0 << 0)
>> +#define SUN4I_I2S_FMT0_POLARITY_INVERTED (1)
>> +#define SUN4I_I2S_FMT0_POLARITY_NORMAL   (0)
>>
>>  #define SUN4I_I2S_FMT1_REG   0x08
>>  #define SUN4I_I2S_FIFO_TX_REG0x0c
>> @@ -72,7 +74,7 @@
>>  #define SUN4I_I2S_INT_STA_REG0x20
>>
>>  #define SUN4I_I2S_CLK_DIV_REG0x24
>> -#define SUN4I_I2S_CLK_DIV_MCLK_ENBIT(7)
>> +#define SUN4I_I2S_CLK_DIV_MCLK_EN7
>>  #define SUN4I_I2S_CLK_DIV_BCLK_MASK  GENMASK(6, 4)
>>  #define SUN4I_I2S_CLK_DIV_BCLK(bclk) ((bclk) << 4)
>>  #define SUN4I_I2S_CLK_DIV_MCLK_MASK  GENMASK(3, 0)
>> @@ -82,15 +84,39 @@
>>  #define SUN4I_I2S_TX_CNT_REG 0x2c
>>
>>  #define SUN4I_I2S_TX_CHAN_SEL_REG0x30
>> -#define SUN4I_I2S_TX_CHAN_SEL(num_chan)  (((num_chan) - 1) << 0)
>> +#define SUN4I_I2S_CHAN_SEL(num_chan) (((num_chan) - 1) << 0)
>>
>>  #define SUN4I_I2S_TX_CHAN_MAP_REG0x34
>>  #define SUN4I_I2S_TX_CHAN_MAP(chan, sample)  ((sample) << (chan << 2))
>> +#define SUN4I_I2S_TX_CHAN_EN(num_chan)   (((1 << num_chan) - 1))
>>
>>  #define SUN4I_I2S_RX_CHAN_SEL_REG0x38
>>  #define SUN4I_I2S_RX_CHAN_MAP_REG0x3c
>>
>> +struct sun4i_i2s_quirks {
>> + boolhas_reset;
>> + boolhas_master_slave_sel;
>
> I think both variants have a master and slave mode, so it's a bit
> misleading.
>
> You should also have a kerneldoc for that structure, to make it clear
> what each quirk is supposed to be doing.
>
>> + unsigned intreg_offset_txdata;  /* TX FIFO */
>> + unsigned intreg_offset_txchanmap;
>> + unsigned intreg_offset_rxchanmap;
>
> Is there any reason for txchanmap and rxchanmap to not be
> regmap_fields too?
>
>> + const struct regmap_config  *sun4i_i2s_regmap;
>> + unsigned intmclk_adjust;
>> + unsigned intbclk_adjust;
>> + unsigned intfmt_adjust;
>
> I would replace adjust by offset
>
>> + /* Register fields for i2s */
>> + struct reg_fieldfield_clkdiv_mclk_en;
>> + struct reg_fieldfield_fmt_set_wss;
>> + struct reg_fieldfield_fmt_set_sr;
>> + struct reg_fieldfield_fmt_set_bclk_polarity;
>> + struct reg_fieldfield_fmt_set_lrclk_polarity;
>> + struct reg_fieldfield_fmt_set_mode;
>> + struct reg_fieldfield_txchansel;
>> + struct reg_fieldfield_rxchansel;
>> +};
>> +
>>  struct sun4i_i2s {
>> + struct device   *dev;
>
> You never use it outside of the probe function (and its callee), you
> can just pass it directly as an argument
>
>>   struct clk  *bus_clk;
>>   struct clk  *mod_clk;
>>   struct regmap   *regmap;
>> @@ -100,6 +126,18 @@ struct sun4i_i2s {
>>
>>   struct snd_dmaengine_dai_dma_data   capture_dma_data;
>>   struct snd_dmaengine_dai_dma_data   playback_dma_data;
>> +
>> + /* Register fields for i2s */
>> + struct regmap_field *field_clkdiv_mclk_en;
>> + struct regmap_field *field_fmt_set_wss;
>> + struct regmap_field *field_fmt_set_sr;
>> + struct regmap_field *field_fmt_set_bclk_polarity;
>> + struct regmap_field *field_fmt_set_lrclk_polarity;
>> + struct regmap_field *field_fmt_set_mode;
>> + struct regmap_field *field_txchansel;
>> + struct regmap_field *field_rxchansel;
>> +
>> + const struct sun4i_i2s_quirks   *variant;
>>  };
>>
>>  struct sun4i_i2s_clk_div {
>> @@ -138,7 +176,7 @@ static int sun4i_i2s_get_bclk_div(struct sun4i_i2s *i2s,
>>   const struct sun4i_i2s_clk_div *bdiv = &sun4i_i2s_bclk_div[i];
>>
>>   if (bdiv->div == div)

Re: [linux-sunxi][PATCH] ARM: dts: sun7i: Add I2S0 pinctrl settings

2017-07-24 Thread Code Kipper
No...I've only got an Olimex SOM EVB which exposes these pins on a
GPIO header (like many of the dev boards). Just thought if we included
them in the dtsi then adding overlays for i2s devices would be
simplified.
BR,
CK

On 24 July 2017 at 10:20, Maxime Ripard
 wrote:
> Hi Marcus,
>
> On Sat, Jul 22, 2017 at 08:43:13AM +0200, codekip...@gmail.com wrote:
>> From: Marcus Cooper 
>>
>> The A20 SoC has a couple of i2s blocks. This patch adds
>> the pinctrl settings for block i2s0.
>>
>> Signed-off-by: Marcus Cooper 
>
> We're not adding pin groups that are not used by anyone. If you have a
> board using them, please send the DT for that board too.
>
> Thanks!
> Maxime
>
> --
> Maxime Ripard, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Re: [PATCH 3/3] ASoC: sun4i-i2s: Add support for H3

2017-07-05 Thread Code Kipper
On 5 July 2017 at 18:20, Maxime Ripard  wrote:
> On Wed, Jul 05, 2017 at 05:43:24PM +0200, codekip...@gmail.com wrote:
>> From: Marcus Cooper 
>>
>> There are a lot of changes to the sun8i-h3 i2s block but not enough
>> to warrant to a new driver.
>>
>> Signed-off-by: Marcus Cooper 
>> ---
>>  .../devicetree/bindings/sound/sun4i-i2s.txt|   2 +
>>  sound/soc/sunxi/sun4i-i2s.c| 339 
>> -
>>  2 files changed, 337 insertions(+), 4 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/sound/sun4i-i2s.txt 
>> b/Documentation/devicetree/bindings/sound/sun4i-i2s.txt
>> index ee21da865771..fc5da6080759 100644
>> --- a/Documentation/devicetree/bindings/sound/sun4i-i2s.txt
>> +++ b/Documentation/devicetree/bindings/sound/sun4i-i2s.txt
>> @@ -8,6 +8,7 @@ Required properties:
>>  - compatible: should be one of the following:
>> - "allwinner,sun4i-a10-i2s"
>> - "allwinner,sun6i-a31-i2s"
>> +   - "allwinner,sun8i-h3-i2s"
>>  - reg: physical base address of the controller and length of memory mapped
>>region.
>>  - interrupts: should contain the I2S interrupt.
>> @@ -22,6 +23,7 @@ Required properties:
>>
>>  Required properties for the following compatibles:
>>   - "allwinner,sun6i-a31-i2s"
>> + - "allwinner,sun8i-h3-i2s"
>>  - resets: phandle to the reset line for this codec
>>
>>  Example:
>> diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
>> index bb7affd53002..0b853fe320e0 100644
>> --- a/sound/soc/sunxi/sun4i-i2s.c
>> +++ b/sound/soc/sunxi/sun4i-i2s.c
>> @@ -26,9 +26,16 @@
>>  #include 
>>
>>  #define SUN4I_I2S_CTRL_REG   0x00
>> +#define SUN4I_I2S_CTRL_BCLK_OUT  BIT(18)
>> +#define SUN4I_I2S_CTRL_LRCK_OUT  BIT(17)
>> +#define SUN4I_I2S_CTRL_LRCKR_OUT BIT(16)
>>  #define SUN4I_I2S_CTRL_SDO_EN_MASK   GENMASK(11, 8)
>>  #define SUN4I_I2S_CTRL_SDO_EN(sdo)   BIT(8 + (sdo))
>>  #define SUN4I_I2S_CTRL_MODE_MASK BIT(5)
>> +#define SUN8I_I2S_CTRL_MODE_MASK GENMASK(5, 4)
>> +#define SUN8I_I2S_CTRL_MODE_RIGHT_J  (2 << 4)
>> +#define SUN8I_I2S_CTRL_MODE_I2S  (1 << 4)
>> +#define SUN8I_I2S_CTRL_MODE_PCM  (0 << 4)
>>  #define SUN4I_I2S_CTRL_MODE_SLAVE(1 << 5)
>>  #define SUN4I_I2S_CTRL_MODE_MASTER   (0 << 5)
>>  #define SUN4I_I2S_CTRL_TX_EN BIT(2)
>> @@ -36,16 +43,27 @@
>>  #define SUN4I_I2S_CTRL_GL_EN BIT(0)
>>
>>  #define SUN4I_I2S_FMT0_REG   0x04
>> +#define SUN8I_I2S_FMT0_LRCLK_POLARITY_MASK   BIT(19)
>> +#define SUN8I_I2S_FMT0_LRCLK_POLARITY_INVERTED   (1 << 19)
>> +#define SUN8I_I2S_FMT0_LRCLK_POLARITY_NORMAL (0 << 19)
>> +#define SUN8I_I2S_FMT0_LRCK_PERIOD_MASK  GENMASK(17, 8)
>> +#define SUN8I_I2S_FMT0_LRCK_PERIOD(period)   ((period) << 8)
>>  #define SUN4I_I2S_FMT0_LRCLK_POLARITY_MASK   BIT(7)
>>  #define SUN4I_I2S_FMT0_LRCLK_POLARITY_INVERTED   (1 << 7)
>>  #define SUN4I_I2S_FMT0_LRCLK_POLARITY_NORMAL (0 << 7)
>> +#define SUN8I_I2S_FMT0_BCLK_POLARITY_MASKBIT(7)
>> +#define SUN8I_I2S_FMT0_BCLK_POLARITY_INVERTED(1 << 7)
>> +#define SUN8I_I2S_FMT0_BCLK_POLARITY_NORMAL  (0 << 7)
>>  #define SUN4I_I2S_FMT0_BCLK_POLARITY_MASKBIT(6)
>>  #define SUN4I_I2S_FMT0_BCLK_POLARITY_INVERTED(1 << 6)
>>  #define SUN4I_I2S_FMT0_BCLK_POLARITY_NORMAL  (0 << 6)
>>  #define SUN4I_I2S_FMT0_SR_MASK   GENMASK(5, 4)
>> +#define SUN8I_I2S_FMT0_SR_MASK   GENMASK(6, 4)
>>  #define SUN4I_I2S_FMT0_SR(sr)((sr) << 4)
>>  #define SUN4I_I2S_FMT0_WSS_MASK  GENMASK(3, 2)
>>  #define SUN4I_I2S_FMT0_WSS(wss)  ((wss) << 2)
>> +#define SUN8I_I2S_FMT0_WSS_MASK  GENMASK(2, 0)
>> +#define SUN8I_I2S_FMT0_WSS(wss)  (wss)
>>  #define SUN4I_I2S_FMT0_FMT_MASK  GENMASK(1, 0)
>>  #define SUN4I_I2S_FMT0_FMT_RIGHT_J   (2 << 0)
>>  #define SUN4I_I2S_FMT0_FMT_LEFT_J(1 << 0)
>> @@ -53,6 +71,7 @@
>>
>>  #define SUN4I_I2S_FMT1_REG   0x08
>>  #define SUN4I_I2S_FIFO_TX_REG0x0c
>> +#define SUN8I_I2S_INT_STA_REG0x0c
>>  #define SUN4I_I2S_FIFO_RX_REG0x10
>>
>>  #define SUN4I_I2S_FIFO_CTRL_REG  0x14
>> @@ -70,10 +89,13 @@
>>  #define SUN4I_I2S_DMA_INT_CTRL_RX_DRQ_EN BIT(3)
>>
>>  #define SUN4I_I2S_INT_STA_REG0x20
>> +#define SUN8I_I2S_FIFO_TX_REG0x20
>>
>>  #define SUN4I_I2S_CLK_DIV_REG0x24
>> +#define SUN8I_I2S_CLK_DIV_MCLK_ENBIT(8)
>>  #define SUN4I_I2S_CLK_DIV_MCLK_ENBIT(7)
>>  #define SUN4I_I2S_CLK_DIV_BCLK_MASK  GENMASK(6, 4)
>> +#define SUN8I_I2S_CLK_DIV_

Re: [linux-sunxi] [PATCH 4/6] ARM: sun8i: a83t: Add device node for DMA controller

2017-05-22 Thread Code Kipper
On 22 May 2017 at 08:25, Chen-Yu Tsai  wrote:
> The A83T SoC has a DMA controller that supports 8 DMA channels
> to and from various peripherals.
>
> Add a device node for it.
>
> Signed-off-by: Chen-Yu Tsai 
> ---
>  arch/arm/boot/dts/sun8i-a83t.dtsi | 9 +
>  1 file changed, 9 insertions(+)
>
> diff --git a/arch/arm/boot/dts/sun8i-a83t.dtsi 
> b/arch/arm/boot/dts/sun8i-a83t.dtsi
> index e12dd7170b8f..47196feda26b 100644
> --- a/arch/arm/boot/dts/sun8i-a83t.dtsi
> +++ b/arch/arm/boot/dts/sun8i-a83t.dtsi
> @@ -163,6 +163,15 @@
> #size-cells = <1>;
> ranges;
>
> +   dma: dma-controller@1c02000 {
> +   compatible = "allwinner,sun8i-a83t-dma";
> +   reg = <0x01c02000 0x1000>;
> +   interrupts = ;
> +   clocks = <&ccu 21>;
> +   resets = <&ccu 7>;
Hi Wens,
these should be ccu defines, otherwise everything else looks great.
Great Work,
CK
> +   #dma-cells = <1>;
> +   };
> +
> ccu: clock@1c2 {
> compatible = "allwinner,sun8i-a83t-ccu";
> reg = <0x01c2 0x400>;
> --
> 2.11.0
>
> --
> You received this message because you are subscribed to the Google Groups 
> "linux-sunxi" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to linux-sunxi+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi] R8 I2S output - MCLK signal inverted

2017-04-21 Thread Code Kipper
On 21 April 2017 at 16:51, Maxime Ripard
 wrote:
> On Fri, Apr 21, 2017 at 05:35:40PM +0300, Hazar Karabay wrote:
>> 2017-04-21 10:35 GMT+03:00 Maxime Ripard :
>> > Wait, what are you calling MCLK?
>>
>> Master clock, is it wrong?
>
> Indeed there doesn't seem to be an option for that. It wouldn't be
> very hard to add to simple-card though.
>
>> Besides this MCLK issue, I can't get 24 bit output from I2S. My driver, DAC
>> and GR8 supports it but when I try to play something using aplay
>> with S24_LE bit depth, it says "Format s24le is not supported by hardware,
>> trying default".
>
> S24_LE is indeed not supported at the moment, but this shouldn't be
> very difficult to support either.
There is a patch here for 20 and 24bit audio...
https://github.com/codekipper/linux-sunxi/commit/206743a5a8a6b6643556eb5b61999be4d7b2f816
I'm sure it works..it's just that I haven't tested it since Maxime
delivered his driver in mainline.
CK
>
>> If it is inappropriate/off-topic to ask these kind of questions in this
>> mail group, please inform.
>
> alsa-devel and linux-arm-kernel would be more appriopriate I guess,
> but that's not a big deal.
>
> Maxime
>
> --
> Maxime Ripard, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com
>
> --
> You received this message because you are subscribed to the Google Groups 
> "linux-sunxi" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to linux-sunxi+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi] [PATCH v2 0/7] sunxi: video: Add support for HDMI output on A64/H3/H5

2017-03-21 Thread Code Kipper
I can also confirm this on an A20 with HDMI.
Much appreciated,
CK

On 21 March 2017 at 01:02, Icenowy Zheng  wrote:
>
>
> 21.03.2017, 06:01, "Jernej Skrabec" :
>> This series implements support for HDMI output. This is done using
>> DM video framework and sharing the HDMI controller code with RK3288.
>>
>> Patch 1 splits out RK3288 HDMI code in a way that it is appropriate
>> for sharing with Allwinner SoCs.
>>
>> Patch 2 splits out TCON code which is completely reusable on
>> all Allwinner SoCs.
>>
>> Patch 3 (new) converts commont TCON code to use DM video compatible
>> timing structure.
>>
>> Patch 4 adds all necessary clocks which are needed for Display
>> Engine 2, TCON and HDMI.
>>
>> Patch 5 implement actual DE2 and HDMI driver and patch 6 disables HDMI
>> on all boards which don't have it (default is on).
>>
>> Patch 7 is included here only for testing HDMI output on A64 due
>> to missing power regulator support (AXP803). Another option is to
>> use ATF which powers on HDMI. Such ATF can be found on Andre
>> Przywara's github.
>>
>> Code was tested on OrangePi 2 & OrangePi Plus 2E (both H3),
>> OrangePi PC 2 (H5) and Pine64 (A64). It was also tested on RK3288 Tinker
>> board. However, it was only compile tested for A10 and A20 targets.
>
> I tested the patched U-Boot on A10 with HDMI and A13 with LCD, and
> it works properly.
>
>>
>> This series was developed on u-boot-sunxi repository with additional,
>> not yet merged, patch: https://patchwork.ozlabs.org/patch/735617/
>>
>> Because already merged patches are not yet included in u-boot-sunxi
>> repository, they need to be cherry picked from u-boot-rockchip:
>> a0a2774aebdaa039ce787090c903cf47263f04c9
>> 520c174b3564ae183f0e7c118dc8ce3770ae20b0
>>
>> Best regards,
>> Jernej Skrabec
>>
>> Changes in v2:
>> - patch 1 & 2 were removed because they were merged
>> - collect reviewed by and tested by tags
>> - TCON split out patch is splitted in two patches
>> - fixed lcdc_enable() calls in video driver for old SoCs
>> - defconfigs should disable video driver, not enable it
>> - minor constant style fix
>>
>> Icenowy Zheng (1):
>>   [DO NOT MERGE] sunxi: add AXP803 support
>>
>> Jernej Skrabec (6):
>>   rockchip: video: Split out HDMI controller code
>>   sunxi: video: Split out TCON code
>>   sunxi: video: Convert lcdc to use struct display_timing
>>   sunxi: Add clock support for DE2/HDMI/TCON on newer SoCs
>>   sunxi: video: Add A64/H3/H5 HDMI driver
>>   sunxi: Disable DE2 video driver where not needed
>>
>>  arch/arm/include/asm/arch-rockchip/hdmi_rk3288.h | 456 --
>>  arch/arm/include/asm/arch-sunxi/clock_sun6i.h | 54 ++
>>  arch/arm/include/asm/arch-sunxi/cpu_sun4i.h | 8 +
>>  arch/arm/include/asm/arch-sunxi/display.h | 103 ---
>>  arch/arm/include/asm/arch-sunxi/display2.h | 124 
>>  arch/arm/include/asm/arch-sunxi/lcdc.h | 128 
>>  arch/arm/mach-sunxi/Makefile | 3 +
>>  arch/arm/mach-sunxi/clock_sun6i.c | 40 +-
>>  arch/arm/mach-sunxi/pmic_bus.c | 6 +-
>>  arch/arm/mach-sunxi/rsb.c | 2 +-
>>  board/sunxi/Kconfig | 10 +
>>  board/sunxi/board.c | 31 +-
>>  configs/nanopi_neo_air_defconfig | 1 +
>>  configs/nanopi_neo_defconfig | 1 +
>>  configs/orangepi_zero_defconfig | 1 +
>>  drivers/power/Kconfig | 87 ++-
>>  drivers/power/Makefile | 1 +
>>  drivers/power/axp803.c | 256 
>>  drivers/power/axp818.c | 2 +-
>>  drivers/video/Makefile | 2 +-
>>  drivers/video/dw_hdmi.c | 764 +++
>>  drivers/video/rockchip/Makefile | 2 +-
>>  drivers/video/rockchip/rk_hdmi.c | 757 +-
>>  drivers/video/rockchip/rk_vop.c | 1 -
>>  drivers/video/sunxi/Makefile | 9 +
>>  drivers/video/sunxi/lcdc.c | 209 +++
>>  drivers/video/sunxi/sunxi_de2.c | 258 
>>  drivers/video/{ => sunxi}/sunxi_display.c | 220 ++-
>>  drivers/video/sunxi/sunxi_dw_hdmi.c | 389 
>>  include/axp803.h | 73 +++
>>  include/axp_pmic.h | 3 +
>>  include/configs/sun50i.h | 2 +
>>  include/configs/sun8i.h | 4 +
>>  include/configs/sunxi-common.h | 5 +
>>  include/dw_hdmi.h | 486 ++
>>  scripts/config_whitelist.txt | 1 +
>>  36 files changed, 2977 insertions(+), 1522 deletions(-)
>>  delete mode 100644 arch/arm/include/asm/arch-rockchip/hdmi_rk3288.h
>>  create mode 100644 arch/arm/include/asm/arch-sunxi/display2.h
>>  create mode 100644 arch/arm/include/asm/arch-sunxi/lcdc.h
>>  create mode 100644 drivers/power/axp803.c
>>  create mode 100644 drivers/video/dw_hdmi.c
>>  create mode 100644 drivers/video/sunxi/Makefile
>>  create mode 100644 drivers/video/sunxi/lcdc.c
>>  create mode 100644 drivers/video/sunxi/sunxi_de2.c
>>  rename drivers/video/{ => sunxi}/sunxi_display.c (87%)
>>  create mode 100644 drivers/video/sunxi/sunxi_dw_hdmi.c
>>  create mode 100644 include/axp803.h
>>  create mode 100644 include/dw_hdmi.h
>>
>> --
>> 2.12.0
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "linux-sunxi" group.
>> To unsubscribe from this group and stop receiving emai

Re: [linux-sunxi] Re: [PATCH] ASoC: sunxi: Add bindings for sun8i to SPDIF

2017-01-19 Thread Code Kipper
On 19 January 2017 at 18:03, Mark Brown  wrote:
> On Wed, Jan 18, 2017 at 08:09:00AM +0100, Code Kipper wrote:
>
>> I missed the binding documentation on the patch for the driver so I
>> pushed it separately instead of pushing a new patch version.
>> You can find it under the subject heading 'ASoC: sun4i-spdif: Add
>> support for the H3 SoC' and Maxime has ACK it (on the condition that I
>> add the binding doc).
>
> I don't seem to have that patch.  If Maxime said it needed changes for
> him to ack it there's every chance I just deleted it waiting for you to
> resend, it's certainly confusing to see a patch like this without the
> matching code.
No worries...I'll squash this patch into it and send as a V2.
CK

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi] Re: [PATCH] ASoC: sunxi: Add bindings for sun8i to SPDIF

2017-01-17 Thread Code Kipper
On 17 January 2017 at 19:15, Mark Brown  wrote:
> On Thu, Jan 12, 2017 at 06:33:43PM +0100, codekip...@gmail.com wrote:
>> From: Marcus Cooper 
>>
>> The H3 SoC uses the same SPDIF block as found in earlier SoCs, but the
>> transmit fifo is at a different address.
>>
>> Signed-off-by: Marcus Cooper 
>> ---
>>  Documentation/devicetree/bindings/sound/sunxi,sun4i-spdif.txt | 1 +
>>  1 file changed, 1 insertion(+)
>
> This is fine but it doesn't actually add the compatible string to the
> driver which I'd expect.
Hi Mark,
I missed the binding documentation on the patch for the driver so I
pushed it separately instead of pushing a new patch version.
You can find it under the subject heading 'ASoC: sun4i-spdif: Add
support for the H3 SoC' and Maxime has ACK it (on the condition that I
add the binding doc).
BR,
CK
>
> --
> You received this message because you are subscribed to the Google Groups 
> "linux-sunxi" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to linux-sunxi+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi][PATCH] ARM: dts: sun8i-h3: Add dts for the Beelink X2 STB

2017-01-12 Thread Code Kipper
On 12 January 2017 at 18:28, Maxime Ripard
 wrote:
> Hi,
>
> On Thu, Jan 12, 2017 at 06:11:35PM +0100, codekip...@gmail.com wrote:
>> From: Marcus Cooper 
>>
>> The Beelink X2 is an STB based on the Allwinner H3 SoC with a uSD slot,
>> 2 USB ports( 1 * USB-2 Host, 1 USB OTG), a 10/100M ethernet port using the
>> SoC's integrated PHY, Wifi via a RTL8189ETV sdio wifi chip, HDMI, an IR
>> receiver, 1 LEDs and an optical S/PDIF connector.
>>
>> Signed-off-by: Marcus Cooper 
>> ---
>>  arch/arm/boot/dts/Makefile|   1 +
>>  arch/arm/boot/dts/sun8i-h3-beelink-x2.dts | 187 
>> ++
>>  2 files changed, 188 insertions(+)
>>  create mode 100644 arch/arm/boot/dts/sun8i-h3-beelink-x2.dts
>>
>> diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
>> index 78a94b747059..75960b1468a4 100644
>> --- a/arch/arm/boot/dts/Makefile
>> +++ b/arch/arm/boot/dts/Makefile
>> @@ -857,6 +857,7 @@ dtb-$(CONFIG_MACH_SUN8I) += \
>>   sun8i-a83t-cubietruck-plus.dtb \
>>   sun8i-h2-plus-orangepi-zero.dtb \
>>   sun8i-h3-bananapi-m2-plus.dtb \
>> + sun8i-h3-beelink-x2.dtb \
>>   sun8i-h3-nanopi-m1.dtb  \
>>   sun8i-h3-nanopi-neo.dtb \
>>   sun8i-h3-orangepi-2.dtb \
>> diff --git a/arch/arm/boot/dts/sun8i-h3-beelink-x2.dts 
>> b/arch/arm/boot/dts/sun8i-h3-beelink-x2.dts
>> new file mode 100644
>> index ..bc5aed52cb1d
>> --- /dev/null
>> +++ b/arch/arm/boot/dts/sun8i-h3-beelink-x2.dts
>> @@ -0,0 +1,187 @@
>> +/*
>> + * Copyright (C) 2017 Marcus Cooper 
>> + *
>> + * This file is dual-licensed: you can use it either under the terms
>> + * of the GPL or the X11 license, at your option. Note that this dual
>> + * licensing only applies to this file, and not this project as a
>> + * whole.
>> + *
>> + *  a) This file is free software; you can redistribute it and/or
>> + * modify it under the terms of the GNU General Public License as
>> + * published by the Free Software Foundation; either version 2 of the
>> + * License, or (at your option) any later version.
>> + *
>> + * This file is distributed in the hope that it will be useful,
>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
>> + * GNU General Public License for more details.
>> + *
>> + * Or, alternatively,
>> + *
>> + *  b) Permission is hereby granted, free of charge, to any person
>> + * obtaining a copy of this software and associated documentation
>> + * files (the "Software"), to deal in the Software without
>> + * restriction, including without limitation the rights to use,
>> + * copy, modify, merge, publish, distribute, sublicense, and/or
>> + * sell copies of the Software, and to permit persons to whom the
>> + * Software is furnished to do so, subject to the following
>> + * conditions:
>> + *
>> + * The above copyright notice and this permission notice shall be
>> + * included in all copies or substantial portions of the Software.
>> + *
>> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
>> + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
>> + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
>> + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
>> + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
>> + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
>> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
>> + * OTHER DEALINGS IN THE SOFTWARE.
>> + */
>> +
>> +/dts-v1/;
>> +#include "sun8i-h3.dtsi"
>> +#include "sunxi-common-regulators.dtsi"
>> +
>> +#include 
>> +#include 
>> +#include 
>> +
>> +/ {
>> + model = "Beelink X2";
>> + compatible = "roofull,beelink-x2", "allwinner,sun8i-h3";
>> +
>> + aliases {
>> + serial0 = &uart0;
>> + /* ethernet0 is the H3 emac, defined in sun8i-h3.dtsi */
>> + ethernet1 = &rtl8189ftv;
>> + };
>> +
>> + chosen {
>> + stdout-path = "serial0:115200n8";
>> + };
>> +
>> + leds {
>> + compatible = "gpio-leds";
>> + pinctrl-names = "default";
>> + pinctrl-0 = <&pwr_led_x2>;
>
> Please drop all the pinctrl nodes for the GPIOs. They're useless, and
> will be harmful when we'll switch to a stricter pinctrl driver.
>
ACK
>> +
>> + pwr_led {
>> + label = "beelink-x2:red:pwr";
>> + gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; /* PL10 */
>> + default-state = "on";
>> + };
>> + };
>> +
>> + gpio_keys {
>> + compatible = "gpio-keys";
>> + pinctrl-names = "default";
>> + pinctrl-0 = <&sw_r_x2>;
>> +
>> + sw4 {
>> + label = "power";
>> + linux,code = ;
>
> Should that be BTN_0 then if the label is

[linux-sunxi] Re: [PATCH] ASoC: sun4i-i2s: Add quirks for newer SoCs

2016-12-20 Thread Code Kipper
On 20 December 2016 at 20:16, Maxime Ripard
 wrote:
> Hi,
>
> On Tue, Dec 20, 2016 at 03:55:24PM +0100, codekip...@gmail.com wrote:
>> From: Marcus Cooper 
>>
>> Newer SoCs have additional functionality so a quirks structure
>> has been added to handle them. So far we've seen the use of a
>> reset controller, a different address for the TXFIFO and varying
>> register changes.
>>
>> This patch prepares the driver for these changes and adds the
>> reset specifier.
>>
>> Signed-off-by: Marcus Cooper 
>> ---
>>  .../devicetree/bindings/sound/sun4i-i2s.txt|  2 +
>>  sound/soc/sunxi/sun4i-i2s.c| 47 
>> --
>>  2 files changed, 45 insertions(+), 4 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/sound/sun4i-i2s.txt 
>> b/Documentation/devicetree/bindings/sound/sun4i-i2s.txt
>> index 7a2c0945fd22..494a881ccd21 100644
>> --- a/Documentation/devicetree/bindings/sound/sun4i-i2s.txt
>> +++ b/Documentation/devicetree/bindings/sound/sun4i-i2s.txt
>> @@ -18,6 +18,8 @@ Required properties:
>> - "apb" : clock for the I2S bus interface
>> - "mod" : module clock for the I2S controller
>>  - #sound-dai-cells : Must be equal to 0
>> +- resets: reset specifier for the ahb reset (A31 and newer only)
>> +
>>
>>  Example:
>>
>> diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
>> index f24d19526603..80fe4f1d6e3b 100644
>> --- a/sound/soc/sunxi/sun4i-i2s.c
>> +++ b/sound/soc/sunxi/sun4i-i2s.c
>> @@ -14,9 +14,11 @@
>>  #include 
>>  #include 
>>  #include 
>> +#include 
>>  #include 
>>  #include 
>>  #include 
>> +#include 
>>
>>  #include 
>>  #include 
>> @@ -92,6 +94,7 @@ struct sun4i_i2s {
>>   struct clk  *bus_clk;
>>   struct clk  *mod_clk;
>>   struct regmap   *regmap;
>> + struct reset_control *rst;
>>
>>   unsigned intmclk_freq;
>>
>> @@ -104,6 +107,13 @@ struct sun4i_i2s_clk_div {
>>   u8  val;
>>  };
>>
>> +struct sun4i_i2s_quirks {
>> + unsigned intreg_dac_txdata; /* TX FIFO offset for DMA config */
>> + boolhas_reset;
>> + const struct regmap_config  *sun4i_i2s_regmap;
>> + const struct snd_soc_dai_ops*ops;
>> +};
>> +
>
> This is quite hard to review without actual example of what you'll put
> in there.
Fair enough...I have a patch for the A31 but haven't got any hardware
that I can verify it on. I've confirmed on the H3 but I feel like that
patch needs some tidying up. That being said...I'll push it as a patch
set and we can talk about the setup.

>
>>  static const struct sun4i_i2s_clk_div sun4i_i2s_bclk_div[] = {
>>   { .div = 2, .val = 0 },
>>   { .div = 4, .val = 1 },
>> @@ -541,7 +551,6 @@ static struct snd_soc_dai_driver sun4i_i2s_dai = {
>>   .rates = SNDRV_PCM_RATE_8000_192000,
>>   .formats = SNDRV_PCM_FMTBIT_S16_LE,
>>   },
>> - .ops = &sun4i_i2s_dai_ops,
>>   .symmetric_rates = 1,
>>  };
>>
>> @@ -655,6 +664,7 @@ static int sun4i_i2s_probe(struct platform_device *pdev)
>>  {
>>   struct sun4i_i2s *i2s;
>>   struct resource *res;
>> + const struct sun4i_i2s_quirks *quirks;
>>   void __iomem *regs;
>>   int irq, ret;
>>
>> @@ -680,8 +690,14 @@ static int sun4i_i2s_probe(struct platform_device *pdev)
>>   return PTR_ERR(i2s->bus_clk);
>>   }
>>
>> + quirks = of_device_get_match_data(&pdev->dev);
>> + if (quirks == NULL) {
>> + dev_err(&pdev->dev, "Failed to determine the quirks to use\n");
>> + return -ENODEV;
>> + }
>> +
>>   i2s->regmap = devm_regmap_init_mmio(&pdev->dev, regs,
>> - &sun4i_i2s_regmap_config);
>> + quirks->sun4i_i2s_regmap);
>>   if (IS_ERR(i2s->regmap)) {
>>   dev_err(&pdev->dev, "Regmap initialisation failed\n");
>>   return PTR_ERR(i2s->regmap);
>> @@ -692,13 +708,25 @@ static int sun4i_i2s_probe(struct platform_device 
>> *pdev)
>>   dev_err(&pdev->dev, "Can't get our mod clock\n");
>>   return PTR_ERR(i2s->mod_clk);
>>   }
>> +
>
> Spurious change?
ACK
>
>>
>> - i2s->playback_dma_data.addr = res->start + SUN4I_I2S_FIFO_TX_REG;
>> + i2s->playback_dma_data.addr = res->start + quirks->reg_dac_txdata;
>>   i2s->playback_dma_data.maxburst = 4;
>>
>>   i2s->capture_dma_data.addr = res->start + SUN4I_I2S_FIFO_RX_REG;
>>   i2s->capture_dma_data.maxburst = 4;
>>
>> + if (quirks->has_reset) {
>> + i2s->rst = devm_reset_control_get_optional(&pdev->dev, NULL);
>> + if (IS_ERR(i2s->rst) && PTR_ERR(i2s->rst) == -EPROBE_DEFER) {
>> + ret = -EPROBE_DEFER;
>> + dev_err(&pdev->dev, "Failed to get reset: %d\n", ret);
>> + goto err_pm_disable;
>> + }
>> + if (!IS_ERR(i2s->rst))
>> + reset_control_deassert(i2s->rst);
>> + }
>> +

Re: [linux-sunxi][PATCH] ARM: dts: sun4i: A1000: add axp209 regulator nodes

2016-12-20 Thread Code Kipper
On 20 December 2016 at 15:16, Maxime Ripard
 wrote:
> On Tue, Dec 20, 2016 at 11:22:42AM +0100, codekip...@gmail.com wrote:
>> From: Marcus Cooper 
>>
>> This patch adds the regulator nodes for the axp209 by including
>> the axp209 dtsi.
>>
>> Signed-off-by: Marcus Cooper 
>> ---
>>  arch/arm/boot/dts/sun4i-a10-a1000.dts | 34 
>> ++
>>  1 file changed, 34 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/sun4i-a10-a1000.dts 
>> b/arch/arm/boot/dts/sun4i-a10-a1000.dts
>> index 68c6bdb2cf7c..e7394d701856 100644
>> --- a/arch/arm/boot/dts/sun4i-a10-a1000.dts
>> +++ b/arch/arm/boot/dts/sun4i-a10-a1000.dts
>> @@ -196,6 +196,40 @@
>>   };
>>  };
>>
>> +#include "axp209.dtsi"
>> +
>> +®_dcdc2 {
>> + regulator-always-on;
>> + regulator-min-microvolt = <100>;
>> + regulator-max-microvolt = <140>;
>> + regulator-name = "vdd-cpu";
>> +};
>> +
>> +®_dcdc3 {
>> + regulator-always-on;
>> + regulator-min-microvolt = <100>;
>> + regulator-max-microvolt = <125>;
>> + regulator-name = "vdd-int-dll";
>> +};
>> +
>> +®_ldo1 {
>> + regulator-name = "vdd-rtc";
>> +};
>> +
>> +®_ldo2 {
>> + regulator-always-on;
>> + regulator-min-microvolt = <300>;
>> + regulator-max-microvolt = <300>;
>> + regulator-name = "avcc";
>> +};
>> +
>> +®_ldo3 {
>> + regulator-always-on;
>> + regulator-min-microvolt = <280>;
>> + regulator-max-microvolt = <280>;
>> + regulator-name = "vcc-wifi";
>
> If this is used only for the wifi, there's no point in keeping it
> enabled.
>
> Also, taking the chance to enable cpufreq by setting the cpu-suplly
> property would be a good idea.
Ackfortunately my A1000 was out of it's box as I've been looking
at the channel reversal issue. I'll respin now.
CK
>
> Thanks!
> Maxime
>
> --
> Maxime Ripard, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi][PATCH 2/3] ARM: dts: sun6i: Add the SPDIF block to the A31

2016-12-20 Thread Code Kipper
On 20 December 2016 at 15:07, Maxime Ripard
 wrote:
> Hi,
>
> On Tue, Dec 20, 2016 at 11:40:37AM +0100, codekip...@gmail.com wrote:
>> From: Marcus Cooper 
>>
>> Add the SPDIF transceiver controller block to the A31 dtsi.
>>
>> Signed-off-by: Marcus Cooper 
>> ---
>>  arch/arm/boot/dts/sun6i-a31.dtsi | 14 ++
>>  1 file changed, 14 insertions(+)
>>
>> diff --git a/arch/arm/boot/dts/sun6i-a31.dtsi 
>> b/arch/arm/boot/dts/sun6i-a31.dtsi
>> index 7370ba6c9993..559c53efa7e6 100644
>> --- a/arch/arm/boot/dts/sun6i-a31.dtsi
>> +++ b/arch/arm/boot/dts/sun6i-a31.dtsi
>> @@ -613,6 +613,20 @@
>>   reg = <0x01c20ca0 0x20>;
>>   };
>>
>> + spdif: spdif@01c21000 {
>> + #sound-dai-cells = <0>;
>> + compatible = "allwinner,sun6i-a31-spdif";
>> + reg = <0x01c21000 0x400>;
>> + interrupts = ;
>> + clocks = <&ccu CLK_APB1_SPDIF>, <&ccu CLK_SPDIF>;
>> + resets = <&ccu RST_APB1_SPDIF>;
>> + clock-names = "apb", "spdif";
>> + dmas = <&dma 2>, <&dma 2>;
>> + dma-names = "rx", "tx";
>> + spdif-out = "disabled";
>
> That property isn't documented anywhere, and doesn't seem to be used
> in your driver either.
Ooopsdo you want me to respin a new patch or will you do your
magic with 'dd'? It fell through the cracks as it was cherry picked
from my dev branch where I was at one time playing with spdif-in. This
has pretty much been relegated to the bottom of my todo/finish list.
>
> On a separate topic, is the channel inversion bug also found on the
> A31?
I have seen this and I'm sure that was also on my A31 hardware but
I've just fired her up and the speaker test worked as expected. I also
repeated the test on my A10 device and didn't hear the issue.
CK
>
> Maxime
>
> --
> Maxime Ripard, Free Electrons
> Embedded Linux and Kernel engineering
> http://free-electrons.com

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi] [PATCH] clk: sunxi-ng: sun8i-h3: Set CLK_SET_RATE_PARENT for audio module clocks

2016-11-11 Thread Code Kipper
On 11 November 2016 at 11:05, Chen-Yu Tsai  wrote:
> The audio module clocks are supposed to be set according to the sample
> rate of the audio stream. The audio PLL provides the clock signal for
> thees module clocks, and only it is freely tunable.
nick! these
CK
>
> Set CLK_SET_RATE_PARENT for the audio module clocks so their users can
> properly tune the clock rate.
>
> Fixes: 0577e4853bfb ("clk: sunxi-ng: Add H3 clocks")
> Signed-off-by: Chen-Yu Tsai 
> ---
>  drivers/clk/sunxi-ng/ccu-sun8i-h3.c | 10 +-
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/clk/sunxi-ng/ccu-sun8i-h3.c 
> b/drivers/clk/sunxi-ng/ccu-sun8i-h3.c
> index 4d70590f05e3..21c427d86f28 100644
> --- a/drivers/clk/sunxi-ng/ccu-sun8i-h3.c
> +++ b/drivers/clk/sunxi-ng/ccu-sun8i-h3.c
> @@ -394,16 +394,16 @@ static SUNXI_CCU_MP_WITH_MUX_GATE(spi1_clk, "spi1", 
> mod0_default_parents, 0x0a4,
>  static const char * const i2s_parents[] = { "pll-audio-8x", "pll-audio-4x",
> "pll-audio-2x", "pll-audio" };
>  static SUNXI_CCU_MUX_WITH_GATE(i2s0_clk, "i2s0", i2s_parents,
> -  0x0b0, 16, 2, BIT(31), 0);
> +  0x0b0, 16, 2, BIT(31), CLK_SET_RATE_PARENT);
>
>  static SUNXI_CCU_MUX_WITH_GATE(i2s1_clk, "i2s1", i2s_parents,
> -  0x0b4, 16, 2, BIT(31), 0);
> +  0x0b4, 16, 2, BIT(31), CLK_SET_RATE_PARENT);
>
>  static SUNXI_CCU_MUX_WITH_GATE(i2s2_clk, "i2s2", i2s_parents,
> -  0x0b8, 16, 2, BIT(31), 0);
> +  0x0b8, 16, 2, BIT(31), CLK_SET_RATE_PARENT);
>
>  static SUNXI_CCU_M_WITH_GATE(spdif_clk, "spdif", "pll-audio",
> -0x0c0, 0, 4, BIT(31), 0);
> +0x0c0, 0, 4, BIT(31), CLK_SET_RATE_PARENT);
>
>  static SUNXI_CCU_GATE(usb_phy0_clk,"usb-phy0", "osc24M",
>   0x0cc, BIT(8), 0);
> @@ -466,7 +466,7 @@ static SUNXI_CCU_M_WITH_GATE(ve_clk, "ve", "pll-ve",
>  0x13c, 16, 3, BIT(31), 0);
>
>  static SUNXI_CCU_GATE(ac_dig_clk,  "ac-dig",   "pll-audio",
> - 0x140, BIT(31), 0);
> + 0x140, BIT(31), CLK_SET_RATE_PARENT);
>  static SUNXI_CCU_GATE(avs_clk, "avs",  "osc24M",
>   0x144, BIT(31), 0);
>
> --
> 2.10.2
>
> --
> You received this message because you are subscribed to the Google Groups 
> "linux-sunxi" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to linux-sunxi+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi] Re: Pine64 TFTP boot support

2016-11-08 Thread Code Kipper
On 8 November 2016 at 11:13, Andre Przywara  wrote:
> Hi,
>
> On 08/11/16 09:44, Code Kipper wrote:
>> On 7 November 2016 at 15:29, Benjamin Henrion  wrote:
>>> On Mon, Nov 7, 2016 at 3:23 PM, Chen-Yu Tsai  wrote:
>>>> On Mon, Nov 7, 2016 at 9:06 PM, Benjamin Henrion  wrote:
>>>>> On Mon, Nov 7, 2016 at 1:57 PM, Benjamin Henrion  wrote:
>>>>>> Hi,
>>>>>>
>>>>>> There is now TFTP boot support in the latest u-boot tarball, so I made
>>>>>> this recipe if you want to compile it:
>>>>>>
>>>>>> https://github.com/zoobab/uboot-pine64
>>>>>>
>>>>>> The binary image is copied from the latest build on my laptop.
>>>>>>
>>>>>> If there are Pine64 owners here, I would be happy if someone could
>>>>>> test it (flash it to an SD card and try to load a kernel with a
>>>>>> dnsmasq for example).
>>>>>
>>>>> The main goal here was to add an A64 board to the Kernelci.org list of
>>>>> tested SOCs, and they required a working TFTP boot. Sadly, they don't
>>>>> support booting from SD cards, which is the most used case for tablet
>>>>> SOCs.
>> Hi Benjamin,
>> I had a play with this briefly last night setting the environmental
>> variables by hand. What I did keep on seeing was "Retry count
>> exceeded" when TFTPing the Image file. Is this something you see?, I
>
> Can you try to define CONFIG_SYS_FSL_ERRATUM_A008585 in the defconfig
> and recompile?
> I think the A64 has an arch timer bug, but it doesn't show every time
> for me [1].
>
> Also if you are in for testing, can you try to dd:
> http://andrep.de/a64/pine64_firmware-20161102.img
> to sector 16 of the SD card?
> # dd if=pine64_firmware-20161102.img of=/dev/sdx bs=8k seek=1
> (and replacing sdx with your SD card reader)
> This is a proper boot0-less SPL firmware image.
> This directory also contains other gems you might find useful ;-)
Thanks...I'll make up a card image with your little treats. I've yet
to confirm that I've built the kernel correctly yet. Does this look
familiar?
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- defconfig
make ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- LOADADDR=0x40008000 Image dtbs
Cheers,
CK
>
> Cheers,
> Andre.
>
> [1] http://lists.denx.de/pipermail/u-boot/2016-November/271836.html
>
>> do see quite a few timeouts with my other boards but they always
>> succeed in getting the image. I did eventually manage to load the
>> kernel plus dtb but it didn't boot. Can you paste what is in your
>> boot.cmd /uEnv.txt files?
>> Thanks,
>> CK
>>>>
>>>> Well, kernelci.org is about automated build and boot testing. There's
>>>> nothing automated about having to pull out an SD card to put a new
>>>> kernel on it. :)
>>>
>>> It can be automated via an SD card switcher:
>>>
>>> http://www.linuxinternals.org/blog/2014/06/04/a-microsd-card-remote-switcher/
>>> http://hackaday.com/2014/06/08/the-in-circuit-sd-card-switch/
>>>
>>> --
>>> Benjamin Henrion 
>>> FFII Brussels - +32-484-566109 - +32-2-3500762
>>> "In July 2005, after several failed attempts to legalise software
>>> patents in Europe, the patent establishment changed its strategy.
>>> Instead of explicitly seeking to sanction the patentability of
>>> software, they are now seeking to create a central European patent
>>> court, which would establish and enforce patentability rules in their
>>> favor, without any possibility of correction by competing courts or
>>> democratically elected legislators."
>>>
>>> --
>>> You received this message because you are subscribed to the Google Groups 
>>> "linux-sunxi" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>> email to linux-sunxi+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi] Re: Pine64 TFTP boot support

2016-11-08 Thread Code Kipper
On 7 November 2016 at 15:29, Benjamin Henrion  wrote:
> On Mon, Nov 7, 2016 at 3:23 PM, Chen-Yu Tsai  wrote:
>> On Mon, Nov 7, 2016 at 9:06 PM, Benjamin Henrion  wrote:
>>> On Mon, Nov 7, 2016 at 1:57 PM, Benjamin Henrion  wrote:
 Hi,

 There is now TFTP boot support in the latest u-boot tarball, so I made
 this recipe if you want to compile it:

 https://github.com/zoobab/uboot-pine64

 The binary image is copied from the latest build on my laptop.

 If there are Pine64 owners here, I would be happy if someone could
 test it (flash it to an SD card and try to load a kernel with a
 dnsmasq for example).
>>>
>>> The main goal here was to add an A64 board to the Kernelci.org list of
>>> tested SOCs, and they required a working TFTP boot. Sadly, they don't
>>> support booting from SD cards, which is the most used case for tablet
>>> SOCs.
Hi Benjamin,
I had a play with this briefly last night setting the environmental
variables by hand. What I did keep on seeing was "Retry count
exceeded" when TFTPing the Image file. Is this something you see?, I
do see quite a few timeouts with my other boards but they always
succeed in getting the image. I did eventually manage to load the
kernel plus dtb but it didn't boot. Can you paste what is in your
boot.cmd /uEnv.txt files?
Thanks,
CK
>>
>> Well, kernelci.org is about automated build and boot testing. There's
>> nothing automated about having to pull out an SD card to put a new
>> kernel on it. :)
>
> It can be automated via an SD card switcher:
>
> http://www.linuxinternals.org/blog/2014/06/04/a-microsd-card-remote-switcher/
> http://hackaday.com/2014/06/08/the-in-circuit-sd-card-switch/
>
> --
> Benjamin Henrion 
> FFII Brussels - +32-484-566109 - +32-2-3500762
> "In July 2005, after several failed attempts to legalise software
> patents in Europe, the patent establishment changed its strategy.
> Instead of explicitly seeking to sanction the patentability of
> software, they are now seeking to create a central European patent
> court, which would establish and enforce patentability rules in their
> favor, without any possibility of correction by competing courts or
> democratically elected legislators."
>
> --
> You received this message because you are subscribed to the Google Groups 
> "linux-sunxi" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to linux-sunxi+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi] Pine64 TFTP boot support

2016-11-07 Thread Code Kipper
Much appreciated.I've just started playing with my Pine64 and
mainly use netboot for tinkering.
Thanks,
CK

On 7 November 2016 at 13:57, Benjamin Henrion  wrote:
> Hi,
>
> There is now TFTP boot support in the latest u-boot tarball, so I made
> this recipe if you want to compile it:
>
> https://github.com/zoobab/uboot-pine64
>
> The binary image is copied from the latest build on my laptop.
>
> If there are Pine64 owners here, I would be happy if someone could
> test it (flash it to an SD card and try to load a kernel with a
> dnsmasq for example).
>
> Best,
>
> --
> Benjamin Henrion 
> FFII Brussels - +32-484-566109 - +32-2-3500762
> "In July 2005, after several failed attempts to legalise software
> patents in Europe, the patent establishment changed its strategy.
> Instead of explicitly seeking to sanction the patentability of
> software, they are now seeking to create a central European patent
> court, which would establish and enforce patentability rules in their
> favor, without any possibility of correction by competing courts or
> democratically elected legislators."
>
> --
> You received this message because you are subscribed to the Google Groups 
> "linux-sunxi" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to linux-sunxi+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi] A20, Mainline kernel: how to get sound on headphone output?

2016-10-18 Thread Code Kipper
On 18 October 2016 at 12:13, Thomas Gahr  wrote:
>> Hi Thomas,
>> have you played with the alsamixer settings? you may have to do some
>> unmuting https://groups.google.com/forum/#!topic/linux-sunxi/rJDiF8qSnLc
>
>
> Hi CodeKipper,
> thanks for your answer!
>
> I'm afraid playing with alsa(mixer) settings is no help for me, since alsa
> does not even recognize the card, so there's nothing I can unmute.
> I *did* try to play with the settings (like the suggestion from
> https://linux-sunxi.org/Audio_Codec) but, no surprise here, this did not
> work, it only lead to I/O error message from alsamixer.
> The hardware is not even showing up in /sys/class/sound so I think the error
> is "below" alsa, i.e. something wrong with my kernel config / modules loaded
> or missing
can you run dmesg | grep codec and also show a diff of all your
changes. To get the codec working should only be one line added to
your dts.
CK
>
> --
> You received this message because you are subscribed to the Google Groups
> "linux-sunxi" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to linux-sunxi+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi] A20, Mainline kernel: how to get sound on headphone output?

2016-10-18 Thread Code Kipper
Hi Thomas,
have you played with the alsamixer settings? you may have to do some
unmuting https://groups.google.com/forum/#!topic/linux-sunxi/rJDiF8qSnLc
BR,
CK

On 18 October 2016 at 11:48, Thomas Gahr  wrote:
> Hello,
>
> I've been trying to figure out how to get sound on the headphone outputs.
> AFAICT, A20 supports I2S and S/PDIF but these are for external audio
> components, while I only need the internal headphone amp.
> I've seen that the audio codec has been added in 4.4 but it is disabled in
> the .dts file used in my kernel. I've enabled it and re-compiled the dtb,
> and after reboot I loaded the sun4i-codec module but still I have no
> success.
>
> The problem: alsa does not show the device, also in /dev/snd there's only
> the USB audio card I've been using so far (which I'd love to get rid of).
> dmesg also does not mention anything about the audio-codec.
> I'm sure there's something simple I'm missing, the question is just: what?
>
> Some information:
>
> root@alarmaster /boot # uname -a
> Linux alarmaster 4.8.1-2-ARCH #1 SMP Sat Oct 8 15:03:46 MDT 2016 armv7l
> GNU/Linux
>
> root@alarmaster /boot # lsmod|grep snd
> snd_soc_pcm 5489  0
> snd_soc_s3c_dma 1531  1 snd_soc_pcm
> snd_soc_core  151946  3 sun4i_codec,snd_soc_pcm,snd_soc_s3c_dma
> snd_pcm_dmaengine   5600  1 snd_soc_core
> ac97_bus1838  1 snd_soc_core
> snd_usb_audio 141947  0
> snd_usbmidi_lib20465  1 snd_usb_audio
> snd_hwdep   6292  1 snd_usb_audio
> snd_rawmidi23170  1 snd_usbmidi_lib
> snd_seq_device  4852  1 snd_rawmidi
> snd_pcm95325  4
> snd_soc_pcm,snd_usb_audio,snd_pcm_dmaengine,snd_soc_core
> snd_timer  22629  1 snd_pcm
>
>
>
> root@alarmaster /boot # lsmod
> Module  Size  Used by
> snd_soc_pcm 5489  0
> snd_soc_s3c_dma 1531  1 snd_soc_pcm
> sun4i_codec12356  0
> snd_soc_core  151946  3 sun4i_codec,snd_soc_pcm,snd_soc_s3c_dma
> snd_pcm_dmaengine   5600  1 snd_soc_core
> ac97_bus1838  1 snd_soc_core
> ccm 7895  3
> usb_f_ecm   6613  2
> usb_f_rndis15906  2
> u_ether12644  2 usb_f_ecm,usb_f_rndis
> ipt_MASQUERADE  1223  1
> nf_nat_masquerade_ipv4 2957  1 ipt_MASQUERADE
> iptable_nat 1924  1
> nf_nat_ipv4 5381  1 iptable_nat
> nf_nat 17482  2 nf_nat_masquerade_ipv4,nf_nat_ipv4
> xt_tcpudp   2322  8
> nf_conntrack_ipv4  14210  2
> nf_defrag_ipv4  1620  1 nf_conntrack_ipv4
> xt_conntrack3007  1
> nf_conntrack  103452  5
> nf_conntrack_ipv4,nf_nat_masquerade_ipv4,xt_conntrack,nf_nat_ipv4,nf_nat
> iptable_filter  1929  1
> arc41943  2
> ath9k_htc  56999  0
> snd_usb_audio 141947  0
> ath9k_common   28242  1 ath9k_htc
> snd_usbmidi_lib20465  1 snd_usb_audio
> ath9k_hw  438363  2 ath9k_htc,ath9k_common
> snd_hwdep   6292  1 snd_usb_audio
> snd_rawmidi23170  1 snd_usbmidi_lib
> evdev  12539  0
> snd_seq_device  4852  1 snd_rawmidi
> snd_pcm95325  4
> snd_soc_pcm,snd_usb_audio,snd_pcm_dmaengine,snd_soc_core
> snd_timer  22629  1 snd_pcm
> ath21859  3 ath9k_htc,ath9k_hw,ath9k_common
> mac80211  417547  1 ath9k_htc
> axp20x_pek  3651  0
> dwmac_sunxi 2638  0
> stmmac_platform 5932  1 dwmac_sunxi
> cfg80211  254986  4 ath9k_htc,mac80211,ath,ath9k_common
> stmmac 82035  3 stmmac_platform,dwmac_sunxi
> rfkill 19399  3 cfg80211
> sun4i_ts4456  0
> sun4i_ss   16538  0
> sun4i_lradc_keys3478  0
> spi_sun4i   4571  0
> sunxi_wdt   3769  0
> uio_pdrv_genirq 3591  0
> uio 9341  1 uio_pdrv_genirq
> sch_fq_codel9160  8
> libcomposite   44779  16 usb_f_ecm,usb_f_rndis
> ip_tables  12937  2 iptable_filter,iptable_nat
> x_tables   18965  5
> ip_tables,iptable_filter,xt_tcpudp,ipt_MASQUERADE,xt_conntrack
>
>
>
>
> Thanks,
>
>
> Thomas
>
> --
> You received this message because you are subscribed to the Google Groups
> "linux-sunxi" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to linux-sunxi+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [linux-sunxi] usb boot on windows

2016-10-14 Thread Code Kipper
I'm sure I've done it using virtualboxbut it's been a while since
I've fel booted anything.

CK

On 14 October 2016 at 11:26, Bernhard Nortmann  wrote:
> Hi Ron!
>
> I haven't tried it out, but NextThingCo has added some Windows code in their
> sunxi-tools fork at https://github.com/NextThingCo/sunxi-tools/branches .
> The "windows" branch even has a precompiled dist/fel.exe. (If I'm reading
> things right, it's built against a statically linked mingw32 libusb.)
>
> Regards, B. Nortmann
>
>
>
> Am 14.10.2016 um 08:07 schrieb Ron:
>>
>> Has anyone able to fel boot on windows?
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "linux-sunxi" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to linux-sunxi+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Re: [PATCH 07/14] ASoC: Add sun8i audio card

2016-10-04 Thread Code Kipper
On 4 October 2016 at 11:46, Mylène Josserand
 wrote:
> Add the audio card for sun8i SoC. This card links the codec driver
> (digital part) with the DAI driver. The analog codec driver is
> added as an aux_device.
>
> Signed-off-by: Mylène Josserand 
> ---
>  sound/soc/sunxi/Kconfig  |  14 +++
>  sound/soc/sunxi/Makefile |   1 +
>  sound/soc/sunxi/sun8i.c  | 101 
> +++
>  3 files changed, 116 insertions(+)
>  create mode 100644 sound/soc/sunxi/sun8i.c
>
> diff --git a/sound/soc/sunxi/Kconfig b/sound/soc/sunxi/Kconfig
> index 9e287b0..7b97395 100644
> --- a/sound/soc/sunxi/Kconfig
> +++ b/sound/soc/sunxi/Kconfig
> @@ -27,6 +27,20 @@ config SND_SUN4I_SPDIF
>   Say Y or M to add support for the S/PDIF audio block in the 
> Allwinner
>   A10 and affiliated SoCs.
>
> +config SND_SUN8I
> +   tristate "Allwinner SUN6I/SUN8I audio card support"
> +   select SND_SUN8I_CODEC
> +   select SND_SUN4I_I2S
> +   select SND_SUN8I_CODEC_ANALOG
> +   select REGMAP_MMIO
> +   help
> + This option enables the audio card for Allwinner A33 (sun8i) SoC.
> + It enables the DAI driver (SND_SUN4I_I2S), the digital audio
> + codec driver (SND_SUN8I_CODEC) and the analog codec driver
> + (SND_SUN8I_CODEC_ANALOG).
> +
> + Say Y or M if you want to add sun8i/6i card support
> +
>  config SND_SUN8I_CODEC
> tristate "Allwinner SUN8I audio codec"
> select REGMAP_MMIO
> diff --git a/sound/soc/sunxi/Makefile b/sound/soc/sunxi/Makefile
> index 1da63d3..7f1bab9 100644
> --- a/sound/soc/sunxi/Makefile
> +++ b/sound/soc/sunxi/Makefile
> @@ -1,5 +1,6 @@
>  obj-$(CONFIG_SND_SUN4I_CODEC) += sun4i-codec.o
>  obj-$(CONFIG_SND_SUN4I_I2S) += sun4i-i2s.o
>  obj-$(CONFIG_SND_SUN4I_SPDIF) += sun4i-spdif.o
> +obj-$(CONFIG_SND_SUN8I) += sun8i.o
>  obj-$(CONFIG_SND_SUN8I_CODEC) += sun8i-codec.o
>  obj-$(CONFIG_SND_SUN8I_CODEC_ANALOG) += sun8i-codec-analog.o
> diff --git a/sound/soc/sunxi/sun8i.c b/sound/soc/sunxi/sun8i.c
> new file mode 100644
> index 000..565cd88
> --- /dev/null
> +++ b/sound/soc/sunxi/sun8i.c
> @@ -0,0 +1,101 @@
> +/*
> + * ALSA SoC driver for Allwinner sun8i SoC
> + *
> + * Copyright (C) 2016 Mylène Josserand 
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + */
> +
> +#include 
> +#include 
> +
> +#include 
> +
> +static struct snd_soc_aux_dev sun8i_audio_prcm_aux_devs[] = {
> +   {
> +   .name = "sun8i-codec-analog",
> +   .codec_name = "sun8i-codec-analog.0",
> +   },
> +};
> +
> +static struct snd_soc_dai_link sun8i_dai_link = {
> +   .name   = "sun4i-i2s",
> +   .stream_name= "Playback",
> +   .codec_dai_name = "sun8i",
> +   .dai_fmt= SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_I2S |
> +   SND_SOC_DAIFMT_CBM_CFM,
> +};
> +
> +static struct snd_soc_card sun8i_card = {
> +   .name   = "sun8i-card",
> +   .owner  = THIS_MODULE,
> +   .dai_link   = &sun8i_dai_link,
> +   .num_links  = 1,
> +   .aux_dev= sun8i_audio_prcm_aux_devs,
> +   .num_aux_devs   = ARRAY_SIZE(sun8i_audio_prcm_aux_devs),
> +};
> +
> +static int sun8i_probe(struct platform_device *pdev)
> +{
> +   struct snd_soc_dai_link *link = &sun8i_dai_link;
> +   struct device_node *np = pdev->dev.of_node;
> +   int ret;
> +
> +   /* register the soc card */
> +   sun8i_card.dev = &pdev->dev;
> +
> +   /* Retrieve the audio-codec from DT */
> +   link->codec_of_node = of_parse_phandle(np, "allwinner,audio-codec", 
> 0);
> +   if (!link->codec_of_node) {
> +   dev_err(&pdev->dev, "Missing audio codec\n");
> +   return -EINVAL;
> +   }
> +
> +   /* Retrieve DAI from DT */
> +   link->cpu_of_node = of_parse_phandle(np, "allwinner,i2s-controller", 
> 0);
Now that I've spent some time trying to add my changes for the H3
ontop of your code,  I think this file should be more generic and rely
on the dtsi more. It's pretty A33 specific but with little effort it
can be worked to cover all of the sun8i type drivers. I would change
"allwinner,i2s-controller" to "allwinner,audio-dai" for starters and
then maybe pull in some info for the dai-link from the dtsi.
CK
> +   if (!link->cpu_of_node) {
> +   dev_err(&pdev->dev, "Missing I2S controller\n");
> +   return -EINVAL;
> +   }
> +
> +   link->platform_of_node = link->cpu_of_node;

[linux-sunxi] Re: [PATCH 03/14] ASoC: sun4i-i2s: Add apb reset

2016-10-04 Thread Code Kipper
On 4 October 2016 at 11:46, Mylène Josserand
 wrote:
> Add APB deassert function for sun4i-i2s driver.
>
> Signed-off-by: Mylène Josserand 
> ---
>  sound/soc/sunxi/sun4i-i2s.c | 16 +++-
>  1 file changed, 15 insertions(+), 1 deletion(-)
>
> diff --git a/sound/soc/sunxi/sun4i-i2s.c b/sound/soc/sunxi/sun4i-i2s.c
> index 687a8f8..f3f7026 100644
> --- a/sound/soc/sunxi/sun4i-i2s.c
> +++ b/sound/soc/sunxi/sun4i-i2s.c
> @@ -17,6 +17,7 @@
>  #include 
>  #include 
>  #include 
> +#include 
>
>  #include 
>  #include 
> @@ -589,6 +590,7 @@ static int sun4i_i2s_probe(struct platform_device *pdev)
>  {
> struct sun4i_i2s *i2s;
> struct resource *res;
> +   struct reset_control *reset_apb;
> void __iomem *regs;
> int irq, ret;
>
> @@ -626,7 +628,19 @@ static int sun4i_i2s_probe(struct platform_device *pdev)
> dev_err(&pdev->dev, "Can't get our mod clock\n");
> return PTR_ERR(i2s->mod_clk);
> }
> -
> +
> +   reset_apb = devm_reset_control_get(&pdev->dev, "apb_reset");
> +   if (IS_ERR(reset_apb)) {
> +   dev_err(&pdev->dev, "Can't get apb reset\n");
> +   return PTR_ERR(i2s->mod_clk);
> +   }
> +
> +   ret = reset_control_deassert(reset_apb);
> +   if (ret < 0) {
> +   dev_err(&pdev->dev, "Can't deassert apb reset (%d)\n", ret);
> +   return ret;
> +   }
> +
Is this functionality only required for A31 and onwards?,
CK
> i2s->playback_dma_data.addr = res->start + SUN4I_I2S_FIFO_TX_REG;
> i2s->playback_dma_data.maxburst = 4;
>
> --
> 2.9.3
>
>
> ___
> linux-arm-kernel mailing list
> linux-arm-ker...@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[linux-sunxi] Re: [PATCH 04/14] ASoC: Add sun8i analog codec driver

2016-10-04 Thread Code Kipper
On 4 October 2016 at 11:46, Mylène Josserand
 wrote:
> Add the analog part of the sun8i (A33) codec driver. This driver
> implements all the analog part of the codec using PRCM registers.
>
> The read/write regmap functions must be handled in a custom way as
> the PRCM register behaves as "mailbox" register.
>
> Signed-off-by: Mylène Josserand 
> ---
>  sound/soc/sunxi/Kconfig  |   7 +
>  sound/soc/sunxi/Makefile |   1 +
>  sound/soc/sunxi/sun8i-codec-analog.c | 304 
> +++
>  3 files changed, 312 insertions(+)
>  create mode 100644 sound/soc/sunxi/sun8i-codec-analog.c
>
> diff --git a/sound/soc/sunxi/Kconfig b/sound/soc/sunxi/Kconfig
> index dd23682..7aee95a 100644
> --- a/sound/soc/sunxi/Kconfig
> +++ b/sound/soc/sunxi/Kconfig
> @@ -26,4 +26,11 @@ 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.
> +
> +config SND_SUN8I_CODEC_ANALOG
> +   tristate "Allwinner SUN8I analog codec"
> +   select REGMAP_MMIO
> +help
> + Say Y or M if you want to add sun8i analog audiocodec support
> +
>  endmenu
> diff --git a/sound/soc/sunxi/Makefile b/sound/soc/sunxi/Makefile
> index 604c7b84..241c0df 100644
> --- a/sound/soc/sunxi/Makefile
> +++ b/sound/soc/sunxi/Makefile
> @@ -1,3 +1,4 @@
>  obj-$(CONFIG_SND_SUN4I_CODEC) += sun4i-codec.o
>  obj-$(CONFIG_SND_SUN4I_I2S) += sun4i-i2s.o
>  obj-$(CONFIG_SND_SUN4I_SPDIF) += sun4i-spdif.o
> +obj-$(CONFIG_SND_SUN8I_CODEC_ANALOG) += sun8i-codec-analog.o
> diff --git a/sound/soc/sunxi/sun8i-codec-analog.c 
> b/sound/soc/sunxi/sun8i-codec-analog.c
> new file mode 100644
> index 000..be3d540
> --- /dev/null
> +++ b/sound/soc/sunxi/sun8i-codec-analog.c
> @@ -0,0 +1,304 @@
> +/*
> + * This driver supports the analog controls for the internal codec
> + * found in Allwinner's A31s, A33 and A23 SoCs.
> + *
> + * Copyright 2016 Chen-Yu Tsai 
> + * Copyright 2016 Mylène Josserand 
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + */
> +
> +#include 
> +#include 
> +#include 
> +#include 
> +
> +#include 
> +#include 
> +#include 
> +
> +/* Codec analog control register offsets and bit fields */
> +#define SUN8I_ADDA_HP_VOLC 0x00
> +#define SUN8I_ADDA_HP_VOLC_PA_CLK_GATE 7
> +#define SUN8I_ADDA_HP_VOLC_HP_VOL  0
> +#define SUN8I_ADDA_LOMIXSC 0x01
> +#define SUN8I_ADDA_LOMIXSC_MIC16
> +#define SUN8I_ADDA_LOMIXSC_MIC25
> +#define SUN8I_ADDA_LOMIXSC_PHONE   4
> +#define SUN8I_ADDA_LOMIXSC_PHONEN  3
> +#define SUN8I_ADDA_LOMIXSC_LINEINL 2
> +#define SUN8I_ADDA_LOMIXSC_DACL1
> +#define SUN8I_ADDA_LOMIXSC_DACR0
> +#define SUN8I_ADDA_ROMIXSC 0x02
> +#define SUN8I_ADDA_ROMIXSC_MIC16
> +#define SUN8I_ADDA_ROMIXSC_MIC25
> +#define SUN8I_ADDA_ROMIXSC_PHONE   4
> +#define SUN8I_ADDA_ROMIXSC_PHONEP  3
> +#define SUN8I_ADDA_ROMIXSC_LINEINR 2
> +#define SUN8I_ADDA_ROMIXSC_DACR1
> +#define SUN8I_ADDA_ROMIXSC_DACL0
> +#define SUN8I_ADDA_DAC_PA_SRC  0x03
> +#define SUN8I_ADDA_DAC_PA_SRC_DACAREN  7
> +#define SUN8I_ADDA_DAC_PA_SRC_DACALEN  6
> +#define SUN8I_ADDA_DAC_PA_SRC_RMIXEN   5
> +#define SUN8I_ADDA_DAC_PA_SRC_LMIXEN   4
> +#define SUN8I_ADDA_DAC_PA_SRC_RHPPAMUTE3
> +#define SUN8I_ADDA_DAC_PA_SRC_LHPPAMUTE2
> +#define SUN8I_ADDA_DAC_PA_SRC_RHPIS1
> +#define SUN8I_ADDA_DAC_PA_SRC_LHPIS0
> +#define SUN8I_ADDA_PHONEIN_GCTRL   0x04
> +#define SUN8I_ADDA_PHONEIN_GCTRL_PHONEPG   4
> +#define SUN8I_ADDA_PHONEIN_GCTRL_PHONENG   0
> +#define SUN8I_ADDA_LINEIN_GCTRL0x05
> +#define SUN8I_ADDA_LINEIN_GCTRL_LINEING4
> +#define SUN8I_ADDA_LINEIN_GCTRL_PHONEG 0
> +#define SUN8I_ADDA_MICIN_GCTRL 0x06
> +#define SUN8I_ADDA_MICIN_GCTRL_MIC1G   4
> +#define SUN8I_ADDA_MICIN_GCTRL_MIC2G   0
> +#define SUN8I_ADDA_PAEN_HP_CT

[linux-sunxi] Re: [PATCH 07/14] ASoC: Add sun8i audio card

2016-10-04 Thread Code Kipper
On 4 October 2016 at 11:46, Mylène Josserand
 wrote:
> Add the audio card for sun8i SoC. This card links the codec driver
> (digital part) with the DAI driver. The analog codec driver is
> added as an aux_device.
>
> Signed-off-by: Mylène Josserand 
> ---
>  sound/soc/sunxi/Kconfig  |  14 +++
>  sound/soc/sunxi/Makefile |   1 +
>  sound/soc/sunxi/sun8i.c  | 101 
> +++
>  3 files changed, 116 insertions(+)
>  create mode 100644 sound/soc/sunxi/sun8i.c
>
> diff --git a/sound/soc/sunxi/Kconfig b/sound/soc/sunxi/Kconfig
> index 9e287b0..7b97395 100644
> --- a/sound/soc/sunxi/Kconfig
> +++ b/sound/soc/sunxi/Kconfig
> @@ -27,6 +27,20 @@ config SND_SUN4I_SPDIF
>   Say Y or M to add support for the S/PDIF audio block in the 
> Allwinner
>   A10 and affiliated SoCs.
>
> +config SND_SUN8I
> +   tristate "Allwinner SUN6I/SUN8I audio card support"
> +   select SND_SUN8I_CODEC
> +   select SND_SUN4I_I2S
> +   select SND_SUN8I_CODEC_ANALOG
> +   select REGMAP_MMIO
> +   help
> + This option enables the audio card for Allwinner A33 (sun8i) SoC.
> + It enables the DAI driver (SND_SUN4I_I2S), the digital audio
> + codec driver (SND_SUN8I_CODEC) and the analog codec driver
> + (SND_SUN8I_CODEC_ANALOG).
> +
> + Say Y or M if you want to add sun8i/6i card support
> +
>  config SND_SUN8I_CODEC
> tristate "Allwinner SUN8I audio codec"
> select REGMAP_MMIO
> diff --git a/sound/soc/sunxi/Makefile b/sound/soc/sunxi/Makefile
> index 1da63d3..7f1bab9 100644
> --- a/sound/soc/sunxi/Makefile
> +++ b/sound/soc/sunxi/Makefile
> @@ -1,5 +1,6 @@
>  obj-$(CONFIG_SND_SUN4I_CODEC) += sun4i-codec.o
>  obj-$(CONFIG_SND_SUN4I_I2S) += sun4i-i2s.o
>  obj-$(CONFIG_SND_SUN4I_SPDIF) += sun4i-spdif.o
> +obj-$(CONFIG_SND_SUN8I) += sun8i.o
Great work with this...I've been battling with the audio codec for the
h3 for a while and it looks like almost everything that I need is
delivered here.
>  obj-$(CONFIG_SND_SUN8I_CODEC) += sun8i-codec.o
>  obj-$(CONFIG_SND_SUN8I_CODEC_ANALOG) += sun8i-codec-analog.o
> diff --git a/sound/soc/sunxi/sun8i.c b/sound/soc/sunxi/sun8i.c
> new file mode 100644
> index 000..565cd88
> --- /dev/null
> +++ b/sound/soc/sunxi/sun8i.c
> @@ -0,0 +1,101 @@
> +/*
> + * ALSA SoC driver for Allwinner sun8i SoC
> + *
> + * Copyright (C) 2016 Mylène Josserand 
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + */
> +
> +#include 
> +#include 
> +
> +#include 
> +
> +static struct snd_soc_aux_dev sun8i_audio_prcm_aux_devs[] = {
> +   {
> +   .name = "sun8i-codec-analog",
> +   .codec_name = "sun8i-codec-analog.0",
> +   },
> +};
> +
> +static struct snd_soc_dai_link sun8i_dai_link = {
> +   .name   = "sun4i-i2s",
> +   .stream_name= "Playback",
> +   .codec_dai_name = "sun8i",
> +   .dai_fmt= SND_SOC_DAIFMT_NB_NF | SND_SOC_DAIFMT_I2S |
> +   SND_SOC_DAIFMT_CBM_CFM,
> +};
> +
> +static struct snd_soc_card sun8i_card = {
> +   .name   = "sun8i-card",
> +   .owner  = THIS_MODULE,
> +   .dai_link   = &sun8i_dai_link,
> +   .num_links  = 1,
> +   .aux_dev= sun8i_audio_prcm_aux_devs,
> +   .num_aux_devs   = ARRAY_SIZE(sun8i_audio_prcm_aux_devs),
> +};
> +
> +static int sun8i_probe(struct platform_device *pdev)
> +{
> +   struct snd_soc_dai_link *link = &sun8i_dai_link;
> +   struct device_node *np = pdev->dev.of_node;
> +   int ret;
> +
> +   /* register the soc card */
> +   sun8i_card.dev = &pdev->dev;
> +
> +   /* Retrieve the audio-codec from DT */
> +   link->codec_of_node = of_parse_phandle(np, "allwinner,audio-codec", 
> 0);
> +   if (!link->codec_of_node) {
> +   dev_err(&pdev->dev, "Missing audio codec\n");
> +   return -EINVAL;
> +   }
> +
> +   /* Retrieve DAI from DT */
> +   link->cpu_of_node = of_parse_phandle(np, "allwinner,i2s-controller", 
> 0);
> +   if (!link->cpu_of_node) {
> +   dev_err(&pdev->dev, "Missing I2S controller\n");
> +   return -EINVAL;
> +   }
> +
My one question is that we have sun8i-a23 and sun8i-a33, and I think
we need to distinguish them here. The sun8i-a23 doesn't use the i2s
block but does use the prcm.
> +   link->platform_of_node = link->cpu_of_node;
> +
> +   /* Register the sound card */
> +   ret = devm_snd_soc_register_card(&

Re: [linux-sunxi] [PATCH v9 2/2] Add mixer controls: Line-In, FM-In, Mic 2, Capture Source, Differential Line-In.

2016-08-29 Thread Code Kipper
On 29 August 2016 at 20:03, Danny Milosavljevic  wrote:
>
> Note: Mic1 Capture Volume is in a different register on A20 than on A10.
> Note: Mic2 Capture Volume is in a different register on A20 than on A10.
> ---
>  sound/soc/sunxi/sun4i-codec.c | 256 
> ++
>  1 file changed, 236 insertions(+), 20 deletions(-)
Hi Danny,
I think this should be delivered in a series of patches like what I've
attempted to do here
https://github.com/codekipper/linux-sunxi/commits/sunxi-wip?page=2
I haven't worked with my A20 for a while which is why I haven't
delivered these changes, however summer is coming to an end and should
be able to retest and deliver soon.
I can see that there is a difference like you've mentioned between the
A10 and A20 with the MIC pre-amps so approve of the use of a common
array.
Something also looks wrong with the whitespacing for sun4i_codec_codec.
BR,
CK
>
> --
> You received this message because you are subscribed to the Google Groups 
> "linux-sunxi" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to linux-sunxi+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to linux-sunxi+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


  1   2   3   >