Skip to content

mfd: Add support for Analog Devices A2B transceiver

Daniel Mack alsa-devel linux-clk linux-devicetree linux-gpio linux-i2c lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest10 patches 24 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10dt-bindings: mfd: Add documentation for ad242xDocumentation/devicetree/bindings/mfd/adi,ad242x-bus.yaml Documentation/devicetree/bindings/mfd/adi,ad242x-master.yaml Documentation/devicetree/bindings/mfd/adi,ad242x-slave.yaml+372 -01 reply
2/10dt-bindings: i2c: Add documentation for ad242x i2c controllersDocumentation/devicetree/bindings/i2c/adi,ad242x-i2c.yaml+31 -01 reply
3/10dt-bindings: gpio: Add documentation for ad242x GPIO controllersDocumentation/devicetree/bindings/gpio/adi,ad242x-gpio.yaml+65 -00 replies
3/10dt-bindings: gpio: Add documentation for AD242x GPIO controllersDocumentation/devicetree/bindings/gpio/adi,ad242x-gpio.yaml+65 -00 replies
4/10dt-bindings: clock: Add documentation for AD242x clock providersDocumentation/devicetree/bindings/clock/adi,ad242x-clk.yaml include/dt-bindings/clock/adi,ad242x.h+41 -01 reply
5/10dt-bindings: sound: Add documentation for AD242x codecsDocumentation/devicetree/bindings/sound/adi,ad242x-codec.yaml+31 -00 replies
6/10mfd: Add core driver for AD242x A2B transceiversdrivers/mfd/Kconfig drivers/mfd/Makefile drivers/mfd/ad242x-bus.c +4 more+1561 -07 replies
7/10i2c: Add driver for AD242x bus controllerdrivers/i2c/busses/Kconfig drivers/i2c/busses/Makefile drivers/i2c/busses/i2c-ad242x.c+189 -05 replies
8/10gpio: Add driver for AD242x GPIO controllersdrivers/gpio/Kconfig drivers/gpio/Makefile drivers/gpio/gpio-ad242x.c+236 -00 replies
9/10clk: Add support for AD242x clock output providersdrivers/clk/Kconfig drivers/clk/Makefile drivers/clk/clk-ad242x.c+238 -01 reply
10/10ASoC: Add codec component for AD242x nodessound/soc/codecs/Kconfig sound/soc/codecs/Makefile sound/soc/codecs/ad242x.c+345 -06 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 00/10] mfd: Add support for Analog Devices A2B transceiver

This patch series adds support for Analog Device's AD242x A2B transceivers.

https://www.analog.com/media/en/technical-documentation/user-guides/AD242x_TRM_Rev1.1.pdf

These transceivers are used to form an audio network by connecting the parts in a daisy-chain. On top of audio, the devices expose some other functions such as GPIO, programmable clock outputs and remote-side I2C bus master. The first node in the chain is called the master node, and all other devices are called slave nodes. Up to 15 such devices can be connected this way.

The master device responds on two addresses on the I2C bus. The primary one is used to access all registers in the master node itself, the secondary is for accessing remote nodes after prior setup through the master node. In the driver stack, these details are hidden behind specific regmap configs.

The driver stack is implemented as MFD core and companion drivers that can be registered as sub-devices in DT. Drivers for these sub-devices can be used for both master and slave nodes, as they just interface with the node's regmap.

The master node is responsible for discovering all the slave nodes at probe time, and it needs to take the used audio and routing modes in each of the slave devices into account in order to pre-calculate the bus-timings correctly. Hence, this bus is not hot-pluggable.

Transceivers can both receive and provide audio, and streams can be routed from one node to any other, including many others. The tricky bit is how to expose the audio routing in DT in a sane way. The way it is implemented here, the slave nodes specify the number of slots they each consume and generate, and which thereof they forward from one side to the other. This mimics the internal register structure and should allow for even exotic setups.

Please let me know what you think and what could be improved.

Thanks,
Daniel

Daniel Mack (10):
dt-bindings: mfd: Add documentation for ad242x
dt-bindings: i2c: Add documentation for ad242x i2c controllers
dt-bindings: gpio: Add documentation for AD242x GPIO controllers
dt-bindings: clock: Add documentation for AD242x clock providers
dt-bindings: sound: Add documentation for AD242x codecs
mfd: Add core driver for AD242x A2B transceivers
i2c: Add driver for AD242x bus controller
gpio: Add driver for AD242x GPIO controllers
clk: Add support for AD242x clock output providers
ASoC: Add codec component for AD242x nodes

 .../bindings/clock/adi,ad242x-clk.yaml        |  32 +
 .../bindings/gpio/adi,ad242x-gpio.yaml        |  65 ++
 .../bindings/i2c/adi,ad242x-i2c.yaml          |  31 +
 .../bindings/mfd/adi,ad242x-bus.yaml          |  29 +
 .../bindings/mfd/adi,ad242x-master.yaml       | 235 +++++++
 .../bindings/mfd/adi,ad242x-slave.yaml        | 108 ++++
 .../bindings/sound/adi,ad242x-codec.yaml      |  31 +
 drivers/clk/Kconfig                           |   6 +
 drivers/clk/Makefile                          |   1 +
 drivers/clk/clk-ad242x.c                      | 231 +++++++
 drivers/gpio/Kconfig                          |   6 +
 drivers/gpio/Makefile                         |   1 +
 drivers/gpio/gpio-ad242x.c                    | 229 +++++++
 drivers/i2c/busses/Kconfig                    |  10 +
 drivers/i2c/busses/Makefile                   |   1 +
 drivers/i2c/busses/i2c-ad242x.c               | 178 +++++
 drivers/mfd/Kconfig                           |  11 +
 drivers/mfd/Makefile                          |   1 +
 drivers/mfd/ad242x-bus.c                      |  42 ++
 drivers/mfd/ad242x-master.c                   | 611 ++++++++++++++++++
 drivers/mfd/ad242x-node.c                     | 262 ++++++++
 drivers/mfd/ad242x-slave.c                    | 234 +++++++
 include/dt-bindings/clock/adi,ad242x.h        |   9 +
 include/linux/mfd/ad242x.h                    | 400 ++++++++++++
 sound/soc/codecs/Kconfig                      |   5 +
 sound/soc/codecs/Makefile                     |   2 +
 sound/soc/codecs/ad242x.c                     | 338 ++++++++++
 27 files changed, 3109 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/clock/adi,ad242x-clk.yaml
 create mode 100644 Documentation/devicetree/bindings/gpio/adi,ad242x-gpio.yaml
 create mode 100644 Documentation/devicetree/bindings/i2c/adi,ad242x-i2c.yaml
 create mode 100644 Documentation/devicetree/bindings/mfd/adi,ad242x-bus.yaml
 create mode 100644 Documentation/devicetree/bindings/mfd/adi,ad242x-master.yaml
 create mode 100644 Documentation/devicetree/bindings/mfd/adi,ad242x-slave.yaml
 create mode 100644 Documentation/devicetree/bindings/sound/adi,ad242x-codec.yaml
 create mode 100644 drivers/clk/clk-ad242x.c
 create mode 100644 drivers/gpio/gpio-ad242x.c
 create mode 100644 drivers/i2c/busses/i2c-ad242x.c
 create mode 100644 drivers/mfd/ad242x-bus.c
 create mode 100644 drivers/mfd/ad242x-master.c
 create mode 100644 drivers/mfd/ad242x-node.c
 create mode 100644 drivers/mfd/ad242x-slave.c
 create mode 100644 include/dt-bindings/clock/adi,ad242x.h
 create mode 100644 include/linux/mfd/ad242x.h
 create mode 100644 sound/soc/codecs/ad242x.c
Signature · 1 line
2.23.0