mbox series

[0/4] ARM: sun8i: a83t: Add support for I2S and I2C

Message ID 20171212081148.9194-1-wens@csie.org
Headers show
Series ARM: sun8i: a83t: Add support for I2S and I2C | expand

Message

Chen-Yu Tsai Dec. 12, 2017, 8:11 a.m. UTC
Hi everyone,

This series adds support for I2S and I2C on the Allwinner A83T SoC.
The I2S controllers are similar to the ones found on the A31. However
the TX FIFO and interrupt status registers were swapped around. This
seems to be a recurring theme for the audio related hardware blocks.

Patch 1 adds support for the A83T variant with a compatible string
and associated quirks structure.

Patch 2 adds device nodes and default pinmux settings for the I2S
controllers.

Patch 3 adds device nodes and default pinmux settings for the I2C
controllers.

Patch 4 is an example of a PCM5122 codec tied to I2C2 and I2S1 over
the GPIO header of the Banana Pi M3. This patch should not be merged.

Please have a look.

Regards
ChenYu


Chen-Yu Tsai (4):
  ASoC: sun4i-i2s: Add support for A83T
  ARM: dts: sun8i: a83t: Add I2S controller device nodes
  ARM: dts: sun8i: a83t: Add I2C device nodes and pinmux settings
  [DO NOT MERGE] ARM: dts: sun8i: a83t: bpi-m3: Enable PCM5122 codec
    with I2S1

 .../devicetree/bindings/sound/sun4i-i2s.txt        |  2 +
 arch/arm/boot/dts/sun8i-a83t-bananapi-m3.dts       | 33 ++++++++
 arch/arm/boot/dts/sun8i-a83t.dtsi                  | 99 ++++++++++++++++++++++
 sound/soc/sunxi/sun4i-i2s.c                        | 21 +++++
 4 files changed, 155 insertions(+)

Comments

Maxime Ripard Dec. 12, 2017, 8:29 a.m. UTC | #1
Hi,

On Tue, Dec 12, 2017 at 04:11:46PM +0800, Chen-Yu Tsai wrote:
> The A83T has 3 I2S controllers. The first is multiplexed with the TDM
> controller. The pins are generally connected to the codec side of the
> AXP81x PMIC/codec/RTC chip. The second is free for other uses. The
> third only supports output, and is connected internally to the HDMI
> controller for HDMI audio output.
> 
> This patch adds device nodes for the controllers, and a default pinmux
> setting for the second controller.
> 
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>

Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Maxime Ripard Dec. 12, 2017, 8:32 a.m. UTC | #2
Hi,

On Tue, Dec 12, 2017 at 04:11:47PM +0800, Chen-Yu Tsai wrote:
> +		i2c0: i2c@1c2ac00 {
> +			compatible = "allwinner,sun6i-a31-i2c";

Same remark than for Mylene's patch here, you should have a per-SoC
compatible first.

Once fixed,
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>

Maxime
Maxime Ripard Dec. 12, 2017, 8:35 a.m. UTC | #3
Hi,

On Tue, Dec 12, 2017 at 04:11:48PM +0800, Chen-Yu Tsai wrote:
> This patch enables a PiFi DAC+ V2.0, which is a PCM5122-based audio
> output DAC add-on board for the Raspberry Pi B+ and later, connected
> to the GPIO header of the Bananapi M3 via jumper cables. The power,
> ground, and I2C pins are in the same position, but the I2S ones are
> not.
> 
> The I2C controller used is I2C2, while the I2S controller is I2S1.
> 
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>
> ---
> 
> I'm sure I've asked this before, and IIRC the answer was yes: The I2C
> controllers available on the GPIO header all have proper, always-on,
> external pull-ups. Does that mean we can enable them by default, seeing
> as they are likely intended to be used this way (as I2C pins)?
> 
> I think we have a few boards where either I2C or UARTs on the GPIO
> header are enabled by default.

The consensus we reached that we would fill the nodes, but leave them
disabled.

In this particular case, I guess it would help for the i2c controller,
but not for the i2s one.

Maxime