[linux-sunxi] New A33 CCU may cause I2C bus to stop working

2016-09-18 Thread Lawrence Yu
Hi.

I may be doing something wrong, but I noticed on branch sunxi-next after
commit

[2c89ce4f4b19561218c1acb97172bd7ba1a6ddc2] ARM: sun8i: Convert the A23 and
A33 to the CCU

the I2C bus on an A33 tablet appears to stop working.

After the commit i2cget responds as follows (with a long timeout)

# i2cget 0 0x40
i2cget: WARNING! This program can confuse your I2C bus
Continue? [y/N] y
[  110.728256] i2c i2c-0: mv64xxx: I2C bus locked, block: 1, time_left: 0
i2cget: read failed: Connection timed out

Before the commit i2cget responds with (returns very quickly)

# i2cget 0 0x40
i2cget: WARNING! This program can confuse your I2C bus
Continue? [y/N] y
i2cget: read failed: No such device or address

I confirmed with logic analyzer attached to I2C bus that prior to the
commit, there was activity on the I2C bus lines with i2cget, but after the
commit, there is no activity on the I2C bus lines.

Can anyone else confirm?

Thanks!

-- 
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] Using sunxi-ng (SPI0)

2016-09-18 Thread Tim Michals
All,

Trying create a dt using new sunxi-ng for SPI0:

sun8i-h3.dtsi:

uart3: serial@01c28c00 {
compatible = "snps,dw-apb-uart";
reg = <0x01c28c00 0x400>;
interrupts = ;
reg-shift = <2>;
reg-io-width = <4>;
clocks = < CLK_BUS_UART3>;
resets = < RST_BUS_UART3>;
dmas = < 9>, < 9>;
dma-names = "rx", "tx";
status = "disabled";
};

spi0: spi@01c68000 {
compatible = "allwinner,sun6i-a31-spi";
reg = <0x01c68000 0x1000>;
interrupts = ;
clocks = < CLK_BUS_SPI0>, < CLK_SPI0>;
resets = < RST_BUS_SPI0>;
dmas = < 23>, < 23>;
dma-names = "rx", "tx";
status = "disabled";
#address-cells = <1>;
#size-cells = <0>;
};

sun8i-orangepi-pc.dts:
.
usb0_id_detect_pin: usb0_id_detect_pin@0 {
allwinner,pins = "PG12";
allwinner,function = "gpio_in";
allwinner,drive = ;
allwinner,pull = ;
};

spi0_pins_a: spi0@0 {
allwinner,pins = "PC0", "PC1", "PC2";
allwinner,function = "spi0";
allwinner,drive = ;
allwinner,pull = ;
};

spi0_cs0_pins_a: spi0_cs0@0 {
allwinner,pins = "PC3";
allwinner,function = "spi0";
allwinner,drive = ;
allwinner,pull = ;
};
..

 {
pinctrl-names = "default";
pinctrl-0 = <_pins_a>, <_cs0_pins_a>;
status = "okay";
};

Linux kernel is reporting:

[0.766378] sun6i-spi 1c68000.spi: Unable to acquire AHB clock
[0.772273] sun6i-spi: probe of 1c68000.spi failed with error -2

What I'm doing wrong?  (yes, it should be an overlay, but, trying to debug 
first)

Tim

-- 
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 v4 3/3] ASoC: sun4i-codec: Add custom regmap configs

2016-09-18 Thread Maxime Ripard
On Thu, Sep 15, 2016 at 06:36:30PM +0200, Danny Milosavljevic wrote:
> ASoC: sun4i-codec: The A20 has a few extra registers that the A10
> doesn't have.
> Therefore, use different regmaps for A10 as compared to A20.

Same comment with the commit log.

> 
> Signed-off-by: Danny Milosavljevic 
> ---
>  sound/soc/sunxi/sun4i-codec.c | 33 ++---
>  1 file changed, 30 insertions(+), 3 deletions(-)
> 
> diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c
> index 3b53b78..c5d6d84c 100644
> --- a/sound/soc/sunxi/sun4i-codec.c
> +++ b/sound/soc/sunxi/sun4i-codec.c
> @@ -682,12 +682,37 @@ static const struct regmap_config 
> sun4i_codec_regmap_config = {
>   .reg_bits   = 32,
>   .reg_stride = 4,
>   .val_bits   = 32,
> + .max_register   = SUN4I_CODEC_ADC_RXCNT,
> +};
> +
> +static const struct regmap_config sun7i_codec_regmap_config = {
> + .reg_bits   = 32,
> + .reg_stride = 4,
> + .val_bits   = 32,
>   .max_register   = SUN7I_CODEC_AC_MIC_PHONE_CAL,
>  };
>  
> +struct sun4i_codec_quirks {
> + const struct regmap_config *regmap_config;
> +};
> +
> +static const struct sun4i_codec_quirks sun4i_codec_quirks = {
> + .regmap_config = _codec_regmap_config,
> +};
> +
> +static const struct sun4i_codec_quirks sun7i_codec_quirks = {
> + .regmap_config = _codec_regmap_config,
> +};
> +
>  static const struct of_device_id sun4i_codec_of_match[] = {
> - { .compatible = "allwinner,sun4i-a10-codec" },
> - { .compatible = "allwinner,sun7i-a20-codec" },
> + {
> + .compatible = "allwinner,sun4i-a10-codec",
> + .data = _codec_quirks,
> + },
> + {
> + .compatible = "allwinner,sun7i-a20-codec",
> + .data = _codec_quirks,
> + },
>   {}
>  };
>  MODULE_DEVICE_TABLE(of, sun4i_codec_of_match);
> @@ -760,6 +785,7 @@ static int sun4i_codec_probe(struct platform_device *pdev)
>  {
>   struct snd_soc_card *card;
>   struct sun4i_codec *scodec;
> + const struct sun4i_codec_quirks *quirks;
>   struct resource *res;
>   void __iomem *base;
>   int ret;
> @@ -777,8 +803,9 @@ static int sun4i_codec_probe(struct platform_device *pdev)
>   return PTR_ERR(base);
>   }
>  
> + quirks = of_device_get_match_data(>dev);

And you probably want to check that quirks isn't null there.

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.


signature.asc
Description: PGP signature


[linux-sunxi] Re: [PATCH v4 2/3] ASoC: rename some sun7i-only registers

2016-09-18 Thread Maxime Ripard
On Thu, Sep 15, 2016 at 06:36:29PM +0200, Danny Milosavljevic wrote:
> ASoC: sun4i-codec: Some of the registers are sun7i-only.

That line is useless, you already have the commit title.

> 
> Therefore rename "SUN4I_CODEC_SYS_VERI" to "SUN7I_CODEC_AC_DAC_CAL" and
> rename "SUN4I_CODEC_AC_MIC_PHONE_CAL" to "SUN7I_CODEC_AC_MIC_PHONE_CAL".

And removing it, you could make a real sentence, like:

Some of the registers defined in the driver are only usable on the
A20. Rename these registers.

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.


signature.asc
Description: PGP signature


[linux-sunxi] Re: [PATCH v4 1/3] ASoC: sun4i-codec: rename sun4i_codec_widgets for consistency

2016-09-18 Thread Maxime Ripard
On Thu, Sep 15, 2016 at 06:36:28PM +0200, Danny Milosavljevic wrote:
> ASoC: sun4i-codec: Rename "sun4i_codec_widgets" to "sun4i_codec_controls" for
> consistency with the struct field name.
> 
> Signed-off-by: Danny Milosavljevic 

Acked-by: Maxime Ripard 

Thanks!

-- 
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.


signature.asc
Description: PGP signature


[linux-sunxi] [PATCH] dmaengine: sun6i: Add support for Allwinner A83T (sun8i) variant

2016-09-18 Thread Jean-Francois Moine
The A83T SoC has the same dma engine as the A31 (sun6i), with a reduced
amount of endpoints and physical channels.

Signed-off-by: Jean-Francois Moine 
---
 Documentation/devicetree/bindings/dma/sun6i-dma.txt | 1 +
 drivers/dma/sun6i-dma.c | 7 +++
 2 files changed, 8 insertions(+)

diff --git a/Documentation/devicetree/bindings/dma/sun6i-dma.txt 
b/Documentation/devicetree/bindings/dma/sun6i-dma.txt
index d13c136..6b26704 100644
--- a/Documentation/devicetree/bindings/dma/sun6i-dma.txt
+++ b/Documentation/devicetree/bindings/dma/sun6i-dma.txt
@@ -7,6 +7,7 @@ Required properties:
 - compatible:  Must be one of
  "allwinner,sun6i-a31-dma"
  "allwinner,sun8i-a23-dma"
+ "allwinner,sun8i-a83t-dma"
  "allwinner,sun8i-h3-dma"
 - reg: Should contain the registers base address and length
 - interrupts:  Should contain a reference to the interrupt used by this device
diff --git a/drivers/dma/sun6i-dma.c b/drivers/dma/sun6i-dma.c
index 3835fcd..8346199 100644
--- a/drivers/dma/sun6i-dma.c
+++ b/drivers/dma/sun6i-dma.c
@@ -1011,6 +1011,12 @@ static struct sun6i_dma_config sun8i_a23_dma_cfg = {
.nr_max_vchans   = 37,
 };
 
+static struct sun6i_dma_config sun8i_a83t_dma_cfg = {
+   .nr_max_channels = 8,
+   .nr_max_requests = 28,
+   .nr_max_vchans   = 39,
+};
+
 /*
  * The H3 has 12 physical channels, a maximum DRQ port id of 27,
  * and a total of 34 usable source and destination endpoints.
@@ -1025,6 +1031,7 @@ static struct sun6i_dma_config sun8i_h3_dma_cfg = {
 static const struct of_device_id sun6i_dma_match[] = {
{ .compatible = "allwinner,sun6i-a31-dma", .data = _a31_dma_cfg },
{ .compatible = "allwinner,sun8i-a23-dma", .data = _a23_dma_cfg },
+   { .compatible = "allwinner,sun8i-a83t-dma", .data = _a83t_dma_cfg 
},
{ .compatible = "allwinner,sun8i-h3-dma", .data = _h3_dma_cfg },
{ /* sentinel */ }
 };
-- 
2.10.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.