Skip to contentSkip to conversation

Add support for Cirrus Logic CS47L35/L85/L90/L91 codecs

PATCH Superseded Richard Fitzgerald 2 participants 19 messages Sep 6, 2017 – Sep 12, 2017

Subsystems (11)
Device tree bindings Sound ASoC GPIO +7 more subsystems

v5 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v5 cover Add support for Cirrus Logic CS47L35/L85/L90/L91 codecs

The Cirrus Logic CS47L35, CS47L85, CS47L90/91 codecs are complex audio SoC devices. In addition to the core audio capability they have onboard GPIO, regulators, DSPs and interrupt controller and a large register map space accessed over SPI or I2C. This family of codecs is based around common IP blocks and they are managed by a set of common drivers referred to as "Madera".

Summary of changes since V4:
- Fixed review comments on MFD code
- Fixed dependency error in core codec driver
- minor bugfix to core codec driver

Richard Fitzgerald (17):
mfd: madera: Add register definitions for Cirrus Logic Madera codecs
mfd: madera: Add DT bindings for Cirrus Logic Madera codecs
mfd: madera: Add common support for Cirrus Logic Madera codecs
mfd: madera: Register map tables for Cirrus Logic CS47L35
mfd: madera: Register map tables for Cirrus Logic CS47L85
mfd: madera: Register map tables for Cirrus Logic CS47L90/91
regulator: arizona-micsupp: Add support for Cirrus Logic Madera codecs
regulator: arizona-ldo1: Add support for Cirrus Logic Madera codecs
irqchip: Add driver for Cirrus Logic Madera codecs
pinctrl: madera: Add DT bindings for Cirrus Logic Madera codecs
pinctrl: madera: Add driver for Cirrus Logic Madera codecs
gpio: madera: Support Cirrus Logic Madera class codecs
ASoC: madera: Add DT bindings for Cirrus Logic Madera codecs
ASoC: madera: Add common support for Cirrus Logic Madera codecs
ASoC: cs47l35: Add codec driver for Cirrus Logic CS47L35
ASoC: cs47l85: Add codec driver for Cirrus Logic CS47L85
ASoC: cs47l90: Add codec driver for Cirrus Logic CS47L90

 Documentation/devicetree/bindings/mfd/madera.txt   |  102 +
 .../bindings/pinctrl/cirrus,madera-pinctrl.txt     |   99 +
 .../bindings/regulator/arizona-regulator.txt       |    3 +-
 Documentation/devicetree/bindings/sound/madera.txt |   67 +
 MAINTAINERS                                        |   23 +
 drivers/gpio/Kconfig                               |    6 +
 drivers/gpio/Makefile                              |    1 +
 drivers/gpio/gpio-madera.c                         |  196 +
 drivers/irqchip/Kconfig                            |    3 +
 drivers/irqchip/Makefile                           |    1 +
 drivers/irqchip/irq-madera.c                       |  301 ++
 drivers/mfd/Kconfig                                |   48 +
 drivers/mfd/Makefile                               |   13 +
 drivers/mfd/cs47l35-tables.c                       | 1610 +++++++
 drivers/mfd/cs47l85-tables.c                       | 3010 +++++++++++++
 drivers/mfd/cs47l90-tables.c                       | 2675 ++++++++++++
 drivers/mfd/madera-core.c                          |  599 +++
 drivers/mfd/madera-i2c.c                           |  139 +
 drivers/mfd/madera-spi.c                           |  138 +
 drivers/mfd/madera.h                               |   44 +
 drivers/pinctrl/Kconfig                            |    1 +
 drivers/pinctrl/Makefile                           |    1 +
 drivers/pinctrl/cirrus/Kconfig                     |   15 +
 drivers/pinctrl/cirrus/Makefile                    |   11 +
 drivers/pinctrl/cirrus/pinctrl-cs47l35.c           |   46 +
 drivers/pinctrl/cirrus/pinctrl-cs47l85.c           |   60 +
 drivers/pinctrl/cirrus/pinctrl-cs47l90.c           |   58 +
 drivers/pinctrl/cirrus/pinctrl-madera.c            | 1074 +++++
 drivers/pinctrl/cirrus/pinctrl-madera.h            |   40 +
 drivers/regulator/Kconfig                          |   15 +-
 drivers/regulator/arizona-ldo1.c                   |   82 +-
 drivers/regulator/arizona-micsupp.c                |   71 +-
 include/dt-bindings/sound/madera.h                 |   27 +
 include/linux/irqchip/irq-madera-pdata.h           |   23 +
 include/linux/irqchip/irq-madera.h                 |   98 +
 include/linux/mfd/madera/core.h                    |  196 +
 include/linux/mfd/madera/pdata.h                   |   61 +
 include/linux/mfd/madera/registers.h               | 3987 ++++++++++++++++++
 include/sound/madera-pdata.h                       |   61 +
 sound/soc/codecs/Kconfig                           |   23 +
 sound/soc/codecs/Makefile                          |    8 +
 sound/soc/codecs/cs47l35.c                         | 1748 ++++++++
 sound/soc/codecs/cs47l85.c                         | 2722 ++++++++++++
 sound/soc/codecs/cs47l90.c                         | 2661 ++++++++++++
 sound/soc/codecs/madera.c                          | 4439 ++++++++++++++++++++
 sound/soc/codecs/madera.h                          |  470 +++
 46 files changed, 27066 insertions(+), 10 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/mfd/madera.txt
 create mode 100644 Documentation/devicetree/bindings/pinctrl/cirrus,madera-pinctrl.txt
 create mode 100644 Documentation/devicetree/bindings/sound/madera.txt
 create mode 100644 drivers/gpio/gpio-madera.c
 create mode 100644 drivers/irqchip/irq-madera.c
 create mode 100644 drivers/mfd/cs47l35-tables.c
 create mode 100644 drivers/mfd/cs47l85-tables.c
 create mode 100644 drivers/mfd/cs47l90-tables.c
 create mode 100644 drivers/mfd/madera-core.c
 create mode 100644 drivers/mfd/madera-i2c.c
 create mode 100644 drivers/mfd/madera-spi.c
 create mode 100644 drivers/mfd/madera.h
 create mode 100644 drivers/pinctrl/cirrus/Kconfig
 create mode 100644 drivers/pinctrl/cirrus/Makefile
 create mode 100644 drivers/pinctrl/cirrus/pinctrl-cs47l35.c
 create mode 100644 drivers/pinctrl/cirrus/pinctrl-cs47l85.c
 create mode 100644 drivers/pinctrl/cirrus/pinctrl-cs47l90.c
 create mode 100644 drivers/pinctrl/cirrus/pinctrl-madera.c
 create mode 100644 drivers/pinctrl/cirrus/pinctrl-madera.h
 create mode 100644 include/dt-bindings/sound/madera.h
 create mode 100644 include/linux/irqchip/irq-madera-pdata.h
 create mode 100644 include/linux/irqchip/irq-madera.h
 create mode 100644 include/linux/mfd/madera/core.h
 create mode 100644 include/linux/mfd/madera/pdata.h
 create mode 100644 include/linux/mfd/madera/registers.h
 create mode 100644 include/sound/madera-pdata.h
 create mode 100644 sound/soc/codecs/cs47l35.c
 create mode 100644 sound/soc/codecs/cs47l85.c
 create mode 100644 sound/soc/codecs/cs47l90.c
 create mode 100644 sound/soc/codecs/madera.c
 create mode 100644 sound/soc/codecs/madera.h
Signature · 6 lines
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#1 lore raw

PATCH v5 1/17 mfd: madera: Add register definitions for Cirrus Logic Madera codecs

This patch adds a header file of register definitions for Cirrus Logic "Madera" class codecs. These codecs are all based off a common set of hardware IP so have a common register map (with a few minor device-to-device variations).

The registers.h file is tool-generated directly from the hardware design but has been manually stripped down to reduce size (full register map is >44000 lines). All names are kept the same as datasheet names so that they can be cross-referenced between source and datasheet without confusion.

The register map layout is kept fully-defined rather than factored into macros and/or block-indexing code. The major reasons for this are:

- #1 is that it makes the source highly greppable, which is important. "What does the driver do with register bits XYZ" or "Where does it use register bits XYZ" are commonly types of questions. These can be quickly answered by a grep. Squashing definitions into generator macros or block- indexing code is a way of defeating grep.

- most of the register definitions are used in tables, so a constant value is required. Using generator macros make the table definition clunky and obscure.

- the code is clearer when it's there in the source exactly what register and field it is using

- it is easier to diff the register map of a new (unsupported) codec against what is already supported and merge in differences

- it makes the register map available in source for maintenance/debugging instead of having to refer back to the datasheet for a register map

---
 MAINTAINERS                          |   10 +
 include/linux/mfd/madera/registers.h | 3987 ++++++++++++++++++++++++++++++++++
 2 files changed, 3997 insertions(+)
 create mode 100644 include/linux/mfd/madera/registers.h
MAINTAINERS +10 -0
index c98eb66..c03a393 100644
@@ -3417,6 +3417,16 @@ M:	Dave Goodell <[email protected]>
 S:	Supported
 F:	drivers/infiniband/hw/usnic/
 
+CIRRUS LOGIC MADERA CODEC DRIVERS
+M:	Charles Keepax <[email protected]>
+M:	Richard Fitzgerald <[email protected]>
+L:	[email protected] (moderated for non-subscribers)
+L:	[email protected]
+T:	git https://github.com/CirrusLogic/linux-drivers.git
+W:	https://github.com/CirrusLogic/linux-drivers/wiki
+S:	Supported
+F:	include/linux/mfd/madera/*
+
 CLEANCACHE API
 M:	Konrad Rzeszutek Wilk <[email protected]>
 L:	[email protected]
include/linux/mfd/madera/registers.h new file +3987 -0

2,984 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.9.1

Part of the diff is not shown here. View the raw message.

#2 lore raw

PATCH v5 2/17 mfd: madera: Add DT bindings for Cirrus Logic Madera codecs

In reply to Richard Fitzgerald

Specification of the bindings for the parent MFD driver component of the Cirrus Logic Madera codec drivers.

Note that although the interrupt controller and GPIO are child drivers their required bindings are trivial, mandatory, and exist within the parent MFD node so are documented here.

---
 Documentation/devicetree/bindings/mfd/madera.txt | 102 +++++++++++++++++++++++
 1 file changed, 102 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/madera.txt
Documentation/devicetree/bindings/mfd/madera.txt new file +102 -0
new file mode 100644
index 0000000..db32660
@@ -0,0 +1,102 @@
+Cirrus Logic Madera class audio codecs Multi-Functional Device
+
+These devices are audio SoCs with extensive digital capabilities and a range
+of analogue I/O.
+
+See also the child driver bindings in:
+bindings/pinctrl/cirrus,madera-pinctrl.txt
+bindings/regulator/arizona-regulator.txt
+bindings/sound/madera.txt
+
+Required properties:
+
+  - compatible : One of the following chip-specific strings:
+        "cirrus,cs47l35"
+        "cirrus,cs47l85"
+        "cirrus,cs47l90"
+        "cirrus,cs47l91"
+        "cirrus,wm1840"
+
+  - reg : I2C slave address when connected using I2C, chip select number when
+    using SPI.
+
+  - DCVDD-supply : Power supply for the device as defined in
+    bindings/regulator/regulator.txt
+    Mandatory on CS47L35, CS47L90, CS47L91
+    Optional on CS47L85, WM1840
+
+  - AVDD-supply, DBVDD1-supply, DBVDD2-supply, CPVDD1-supply, CPVDD2-supply :
+    Power supplies for the device
+
+  - DBVDD3-supply, DBVDD4-supply : Power supplies for the device
+    (CS47L85, CS47L90, CS47L91, WM1840)
+
+  - SPKVDDL-supply, SPKVDDR-supply : Power supplies for the device
+    (CS47L85, WM1840)
+
+  - SPKVDD-supply : Power supply for the device
+    (CS47L35)
+
+  - interrupt-controller : Indicates that this device is an interrupt controller
+
+  - #interrupt-cells: the number of cells to describe an IRQ, must be 2.
+    The first cell is the IRQ number.
+    The second cell is the flags, encoded as the trigger masks from
+    bindings/interrupt-controller/interrupts.txt
+
+  - gpio-controller : Indicates this device is a GPIO controller.
+
+  - #gpio-cells : Must be 2. The first cell is the pin number. The second cell
+    is reserved for future use and must be zero
+
+  - interrupt-parent : The parent interrupt controller.
+
+  - interrupts : The interrupt line the /IRQ signal for the device is
+    connected to.
+
+Optional properties:
+
+  - MICVDD-supply : Power supply, only need to be specified if
+    powered externally
+
+  - reset-gpios : One entry specifying the GPIO controlling /RESET.
+    As defined in bindings/gpio.txt.
+    Although optional, it is strongly recommended to use a hardware reset
+
+  - MICBIASx : Initial data for the MICBIAS regulators, as covered in
+    Documentation/devicetree/bindings/regulator/regulator.txt.
+    One for each MICBIAS generator (MICBIAS1, MICBIAS2, ...)
+    (all codecs)
+
+    One for each output pin (MICBIAS1A, MIBCIAS1B, MICBIAS2A, ...)
+    (all except CS47L85, WM1840)
+
+    The following following additional property is supported for the generator
+    nodes:
+      - cirrus,ext-cap : Set to 1 if the MICBIAS has external decoupling
+        capacitors attached.
+
+Optional child nodes:
+    micvdd : Node containing initialization data for the micvdd regulator
+    See bindings/regulator/arizona-regulator.txt
+
+    ldo1 : Node containing initialization data for the LDO1 regulator
+    See bindings/regulator/arizona-regulator.txt
+    (cs47l85, wm1840)
+
+Example:
+
+cs47l85@0 {
+	compatible = "cirrus,cs47l85";
+	reg = <0>;
+
+	reset-gpios = <&gpio 0>;
+
+	interrupt-controller;
+	#interrupt-cells = <2>;
+	interrupts = <&host_irq1>;
+	interrupt-parent = <&gic>;
+
+	gpio-controller;
+	#gpio-cells = <2>;
+};
Signature · 1 line
1.9.1
#3 lore raw

PATCH v5 3/17 mfd: madera: Add common support for Cirrus Logic Madera codecs

In reply to Richard Fitzgerald

This adds the generic core support for Cirrus Logic "Madera" class codecs. These are complex audio codec SoCs with a variety of digital and analogue I/O, onboard audio processing and DSPs, and other features.

These codecs are all based off a common set of hardware IP so can be supported by a core of common code (with a few minor device-to-device variations).

---
Changes since V4:
- Fixed Lee's review comments and applied ack as requested

 MAINTAINERS                      |   3 +
 drivers/mfd/Kconfig              |  27 ++
 drivers/mfd/Makefile             |   4 +
 drivers/mfd/madera-core.c        | 599 +++++++++++++++++++++++++++++++++++++++
 drivers/mfd/madera-i2c.c         | 139 +++++++++
 drivers/mfd/madera-spi.c         | 138 +++++++++
 drivers/mfd/madera.h             |  44 +++
 include/linux/mfd/madera/core.h  | 196 +++++++++++++
 include/linux/mfd/madera/pdata.h |  61 ++++
 9 files changed, 1211 insertions(+)
 create mode 100644 drivers/mfd/madera-core.c
 create mode 100644 drivers/mfd/madera-i2c.c
 create mode 100644 drivers/mfd/madera-spi.c
 create mode 100644 drivers/mfd/madera.h
 create mode 100644 include/linux/mfd/madera/core.h
 create mode 100644 include/linux/mfd/madera/pdata.h
MAINTAINERS +3 -0
index c03a393..642b9be 100644
@@ -3425,7 +3425,10 @@ L:	[email protected]
 T:	git https://github.com/CirrusLogic/linux-drivers.git
 W:	https://github.com/CirrusLogic/linux-drivers/wiki
 S:	Supported
+F:	Documentation/devicetree/bindings/mfd/madera.txt
 F:	include/linux/mfd/madera/*
+F:	drivers/mfd/madera*
+F:	drivers/mfd/cs47l*
 
 CLEANCACHE API
 M:	Konrad Rzeszutek Wilk <[email protected]>
drivers/mfd/Kconfig +27 -0
index fc5e4fe..cc14818 100644
@@ -222,6 +222,33 @@ config MFD_CROS_EC_SPI
 	  response time cannot be guaranteed, we support ignoring
 	  'pre-amble' bytes before the response actually starts.
 
+config MFD_MADERA
+	bool
+	select MFD_CORE
+	select REGMAP
+	select REGMAP_IRQ
+	select MADERA_IRQ
+
+config MFD_MADERA_I2C
+	bool "Cirrus Logic Madera codecs with I2C"
+	select MFD_MADERA
+	select REGMAP_I2C
+	depends on I2C
+	depends on PINCTRL
+	help
+	  Support for the Cirrus Logic Madera platform audio SoC
+	  core functionality controlled via I2C.
+
+config MFD_MADERA_SPI
+	bool "Cirrus Logic Madera codecs with SPI"
+	select MFD_MADERA
+	select REGMAP_SPI
+	depends on SPI_MASTER
+	depends on PINCTRL
+	help
+	  Support for the Cirrus Logic Madera platform audio SoC
+	  core functionality controlled via SPI.
+
 config MFD_ASIC3
 	bool "Compaq ASIC3"
 	depends on GPIOLIB && ARM
drivers/mfd/Makefile +4 -0
index c3d0a1b..1d03eef 100644
@@ -74,6 +74,10 @@ obj-$(CONFIG_MFD_WM8350_I2C)	+= wm8350-i2c.o
 wm8994-objs			:= wm8994-core.o wm8994-irq.o wm8994-regmap.o
 obj-$(CONFIG_MFD_WM8994)	+= wm8994.o
 
+obj-$(CONFIG_MFD_MADERA)	+= madera-core.o
+obj-$(CONFIG_MFD_MADERA_I2C)	+= madera-i2c.o
+obj-$(CONFIG_MFD_MADERA_SPI)	+= madera-spi.o
+
 obj-$(CONFIG_TPS6105X)		+= tps6105x.o
 obj-$(CONFIG_TPS65010)		+= tps65010.o
 obj-$(CONFIG_TPS6507X)		+= tps6507x.o
drivers/mfd/madera-core.c new file +599 -0

599 lines not on this page · raw message

drivers/mfd/madera-i2c.c new file +139 -0

139 lines not on this page · raw message

drivers/mfd/madera-spi.c new file +138 -0

138 lines not on this page · raw message

drivers/mfd/madera.h new file +44 -0

44 lines not on this page · raw message

include/linux/mfd/madera/core.h new file +196 -0

196 lines not on this page · raw message

include/linux/mfd/madera/pdata.h new file +61 -0

61 lines not on this page · raw message

Signature · 1 line
1.9.1
#4 lore raw

PATCH v5 4/17 mfd: madera: Register map tables for Cirrus Logic CS47L35

In reply to Richard Fitzgerald

Regmap configuration tables for Cirrus Logic CS47L35 codecs.

---
 drivers/mfd/Kconfig          |    7 +
 drivers/mfd/Makefile         |    3 +
 drivers/mfd/cs47l35-tables.c | 1610 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 1620 insertions(+)
 create mode 100644 drivers/mfd/cs47l35-tables.c
drivers/mfd/Kconfig +7 -0
index cc14818..c858a11 100644
@@ -249,6 +249,13 @@ config MFD_MADERA_SPI
 	  Support for the Cirrus Logic Madera platform audio SoC
 	  core functionality controlled via SPI.
 
+config MFD_CS47L35
+	bool "Cirrus Logic CS47L35"
+	select PINCTRL_CS47L35
+	depends on MFD_MADERA
+	help
+	  Support for Cirrus Logic CS47L35 Smart Codec
+
 config MFD_ASIC3
 	bool "Compaq ASIC3"
 	depends on GPIOLIB && ARM
drivers/mfd/Makefile +3 -0
index 1d03eef..1921fa9 100644
@@ -75,6 +75,9 @@ wm8994-objs			:= wm8994-core.o wm8994-irq.o wm8994-regmap.o
 obj-$(CONFIG_MFD_WM8994)	+= wm8994.o
 
 obj-$(CONFIG_MFD_MADERA)	+= madera-core.o
+ifeq ($(CONFIG_MFD_CS47L35),y)
+obj-$(CONFIG_MFD_MADERA)	+= cs47l35-tables.o
+endif
 obj-$(CONFIG_MFD_MADERA_I2C)	+= madera-i2c.o
 obj-$(CONFIG_MFD_MADERA_SPI)	+= madera-spi.o
 
drivers/mfd/cs47l35-tables.c new file +1610 -0

1,610 lines not on this page · raw message

Signature · 1 line
1.9.1
#5 lore raw

PATCH v5 5/17 mfd: madera: Register map tables for Cirrus Logic CS47L85

In reply to Richard Fitzgerald

Regmap configuration tables for Cirrus Logic CS47L85 codecs.

---
 drivers/mfd/Kconfig          |    7 +
 drivers/mfd/Makefile         |    3 +
 drivers/mfd/cs47l85-tables.c | 3010 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 3020 insertions(+)
 create mode 100644 drivers/mfd/cs47l85-tables.c
drivers/mfd/Kconfig +7 -0
index c858a11..3207fd1 100644
@@ -256,6 +256,13 @@ config MFD_CS47L35
 	help
 	  Support for Cirrus Logic CS47L35 Smart Codec
 
+config MFD_CS47L85
+	bool "Cirrus Logic CS47L85"
+	select PINCTRL_CS47L85
+	depends on MFD_MADERA
+	help
+	  Support for Cirrus Logic CS47L85 Smart Codec
+
 config MFD_ASIC3
 	bool "Compaq ASIC3"
 	depends on GPIOLIB && ARM
drivers/mfd/Makefile +3 -0
index 1921fa9..bdb3583 100644
@@ -78,6 +78,9 @@ obj-$(CONFIG_MFD_MADERA)	+= madera-core.o
 ifeq ($(CONFIG_MFD_CS47L35),y)
 obj-$(CONFIG_MFD_MADERA)	+= cs47l35-tables.o
 endif
+ifeq ($(CONFIG_MFD_CS47L85),y)
+obj-$(CONFIG_MFD_MADERA)	+= cs47l85-tables.o
+endif
 obj-$(CONFIG_MFD_MADERA_I2C)	+= madera-i2c.o
 obj-$(CONFIG_MFD_MADERA_SPI)	+= madera-spi.o
 
drivers/mfd/cs47l85-tables.c new file +3010 -0

2,978 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 6 lines
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Part of the diff is not shown here. View the raw message.

#6 lore raw

PATCH v5 6/17 mfd: madera: Register map tables for Cirrus Logic CS47L90/91

In reply to Richard Fitzgerald

Regmap configuration tables for Cirrus Logic CS47L90 and CS47L91 codecs.

---
 drivers/mfd/Kconfig          |    7 +
 drivers/mfd/Makefile         |    3 +
 drivers/mfd/cs47l90-tables.c | 2675 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 2685 insertions(+)
 create mode 100644 drivers/mfd/cs47l90-tables.c
drivers/mfd/Kconfig +7 -0
index 3207fd1..99fef6e 100644
@@ -263,6 +263,13 @@ config MFD_CS47L85
 	help
 	  Support for Cirrus Logic CS47L85 Smart Codec
 
+config MFD_CS47L90
+	bool "Cirrus Logic CS47L90/91"
+	select PINCTRL_CS47L90
+	depends on MFD_MADERA
+	help
+	  Support for Cirrus Logic CS47L90 and CS47L91 Smart Codecs
+
 config MFD_ASIC3
 	bool "Compaq ASIC3"
 	depends on GPIOLIB && ARM
drivers/mfd/Makefile +3 -0
index bdb3583..8a45b9f 100644
@@ -81,6 +81,9 @@ endif
 ifeq ($(CONFIG_MFD_CS47L85),y)
 obj-$(CONFIG_MFD_MADERA)	+= cs47l85-tables.o
 endif
+ifeq ($(CONFIG_MFD_CS47L90),y)
+obj-$(CONFIG_MFD_MADERA)	+= cs47l90-tables.o
+endif
 obj-$(CONFIG_MFD_MADERA_I2C)	+= madera-i2c.o
 obj-$(CONFIG_MFD_MADERA_SPI)	+= madera-spi.o
 
drivers/mfd/cs47l90-tables.c new file +2675 -0

2,675 lines not on this page · raw message

Signature · 1 line
1.9.1
#7 lore raw

PATCH v5 7/17 regulator: arizona-micsupp: Add support for Cirrus Logic Madera codecs

In reply to Richard Fitzgerald

This adds a new driver identity "madera-micsupp" and probe function so that this driver can be used to control the micsupp regulator on Cirrus Logic Madera codecs.

---
No changes since V4

 .../bindings/regulator/arizona-regulator.txt       |  3 +-
 drivers/regulator/Kconfig                          |  7 ++-
 drivers/regulator/arizona-micsupp.c                | 71 +++++++++++++++++++++-
 3 files changed, 76 insertions(+), 5 deletions(-)
Documentation/devicetree/bindings/regulator/arizona-regulator.txt +2 -1
index 443564d..91b00f9 100644
@@ -5,7 +5,8 @@ of analogue I/O.
 
 This document lists regulator specific bindings, see the primary binding
 document:
-  ../mfd/arizona.txt
+  For Wolfson Arizona codecs: ../mfd/arizona.txt
+  For Cirrus Logic Madera codecs: ../mfd/madera.txt
 
 Optional properties:
   - wlf,ldoena : GPIO specifier for the GPIO controlling LDOENA
drivers/regulator/Kconfig +4 -3
index 0fd6195..cb73df4 100644
@@ -134,11 +134,12 @@ config REGULATOR_ARIZONA_LDO1
 	  devices.
 
 config REGULATOR_ARIZONA_MICSUPP
-	tristate "Wolfson Arizona class devices MICSUPP"
-	depends on MFD_ARIZONA
+	tristate "Cirrus Madera and Wolfson Arizona class devices MICSUPP"
+	depends on MFD_ARIZONA || MFD_MADERA
 	depends on SND_SOC
 	help
-	  Support for the MICSUPP regulators found on Wolfson Arizona class
+	  Support for the MICSUPP regulators found on Cirrus Logic Madera codecs
+	  and Wolfson Arizona codecs
 	  devices.
 
 config REGULATOR_AS3711
drivers/regulator/arizona-micsupp.c +70 -1

98 lines not on this page · raw message

Signature · 1 line
1.9.1
#8 lore raw

PATCH v5 8/17 regulator: arizona-ldo1: Add support for Cirrus Logic Madera codecs

In reply to Richard Fitzgerald

This adds a new driver identity "madera-ldo1" and probe function so that this driver can be used to control the LDO1 regulator on some Cirrus Logic Madera codecs.

---
No changes since V4

 drivers/regulator/Kconfig        |  8 ++--
 drivers/regulator/arizona-ldo1.c | 82 +++++++++++++++++++++++++++++++++++++++-
 2 files changed, 85 insertions(+), 5 deletions(-)
drivers/regulator/Kconfig +4 -4
index cb73df4..bfb4679 100644
@@ -126,12 +126,12 @@ config REGULATOR_AB8500
 	  signal AB8500 PMIC
 
 config REGULATOR_ARIZONA_LDO1
-	tristate "Wolfson Arizona class devices LDO1"
-	depends on MFD_ARIZONA
+	tristate "Cirrus Madera and Wolfson Arizona class devices LDO1"
+	depends on MFD_ARIZONA || MFD_MADERA
 	depends on SND_SOC
 	help
-	  Support for the LDO1 regulators found on Wolfson Arizona class
-	  devices.
+	  Support for the LDO1 regulators found on Cirrus Logic Madera codecs
+	  and Wolfson Arizona codecs.
 
 config REGULATOR_ARIZONA_MICSUPP
 	tristate "Cirrus Madera and Wolfson Arizona class devices MICSUPP"
drivers/regulator/arizona-ldo1.c +81 -1

109 lines not on this page · raw message

Signature · 1 line
1.9.1
#9 lore raw

PATCH v5 9/17 irqchip: Add driver for Cirrus Logic Madera codecs

In reply to Richard Fitzgerald

The Cirrus Logic Madera codecs (Cirrus Logic CS47L35/85/90/91 and WM1840) are highly complex devices containing up to 7 programmable DSPs and many other internal sources of interrupts plus a number of GPIOs that can be used as interrupt inputs. The large number (>150) of internal interrupt sources are managed by an on-board interrupt controller.

This driver provides the handling for the interrupt controller. As the codec is accessed via regmap, we can make use of the generic IRQ functionality from regmap to do most of the work. Only around half of the possible interrupt source are currently of interest from the driver so only this subset is defined. Others can be added in future if needed.

The KConfig options are not user-configurable because this driver is mandatory so is automatically included when the parent MFD driver is selected.

---
Changes since V4:
- Fixed missing include of linux/interrupt.h in irq-madera.h

 MAINTAINERS                              |   2 +
 drivers/irqchip/Kconfig                  |   3 +
 drivers/irqchip/Makefile                 |   1 +
 drivers/irqchip/irq-madera.c             | 301 +++++++++++++++++++++++++++++++
 include/linux/irqchip/irq-madera-pdata.h |  23 +++
 include/linux/irqchip/irq-madera.h       |  98 ++++++++++
 6 files changed, 428 insertions(+)
 create mode 100644 drivers/irqchip/irq-madera.c
 create mode 100644 include/linux/irqchip/irq-madera-pdata.h
 create mode 100644 include/linux/irqchip/irq-madera.h
MAINTAINERS +2 -0
index 642b9be..ed94481 100644
@@ -3426,7 +3426,9 @@ T:	git https://github.com/CirrusLogic/linux-drivers.git
 W:	https://github.com/CirrusLogic/linux-drivers/wiki
 S:	Supported
 F:	Documentation/devicetree/bindings/mfd/madera.txt
+F:	include/linux/irqchip/irq-madera*
 F:	include/linux/mfd/madera/*
+F:	drivers/irqchip/irq-madera*
 F:	drivers/mfd/madera*
 F:	drivers/mfd/cs47l*
 
drivers/irqchip/Kconfig +3 -0
index 9d8a1dd..94df0f3 100644
@@ -135,6 +135,9 @@ config IMGPDC_IRQ
 	select GENERIC_IRQ_CHIP
 	select IRQ_DOMAIN
 
+config MADERA_IRQ
+	bool
+
 config IRQ_MIPS_CPU
 	bool
 	select GENERIC_IRQ_CHIP
drivers/irqchip/Makefile +1 -0
index 845abc1..177cb95 100644
@@ -16,6 +16,7 @@ obj-$(CONFIG_ARCH_S3C24XX)		+= irq-s3c24xx.o
 obj-$(CONFIG_DW_APB_ICTL)		+= irq-dw-apb-ictl.o
 obj-$(CONFIG_METAG)			+= irq-metag-ext.o
 obj-$(CONFIG_METAG_PERFCOUNTER_IRQS)	+= irq-metag.o
+obj-$(CONFIG_MADERA_IRQ)		+= irq-madera.o
 obj-$(CONFIG_CLPS711X_IRQCHIP)		+= irq-clps711x.o
 obj-$(CONFIG_OR1K_PIC)			+= irq-or1k-pic.o
 obj-$(CONFIG_ORION_IRQCHIP)		+= irq-orion.o
drivers/irqchip/irq-madera.c new file +301 -0

301 lines not on this page · raw message

include/linux/irqchip/irq-madera-pdata.h new file +23 -0
new file mode 100644
index 0000000..1b6cc31
@@ -0,0 +1,23 @@
+/*
+ * Platform data for Cirrus Logic Madera codecs irqchip driver
+ *
+ * Copyright 2016-2017 Cirrus Logic
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef IRQCHIP_MADERA_PDATA_H
+#define IRQCHIP_MADERA_PDATA_H
+
+/**
+ * struct madera_irqchip_pdata - Configuration for Madera devices IRQ driver
+ *
+ * @irq_flags: Mode for primary IRQ (defaults to active low)
+ */
+struct madera_irqchip_pdata {
+	unsigned int irq_flags;
+};
+
+#endif
include/linux/irqchip/irq-madera.h new file +98 -0

98 lines not on this page · raw message

Signature · 1 line
1.9.1
#10 lore raw

PATCH v5 10/17 pinctrl: madera: Add DT bindings for Cirrus Logic Madera codecs

In reply to Richard Fitzgerald

This is the binding description of the pinctrl driver for Cirru Logic Madera codecs. The binding uses the generic pinctrl binding so the main purpose here is to describe the device-specific names for groups and functions.

---
No changes since V4

 .../bindings/pinctrl/cirrus,madera-pinctrl.txt     | 99 ++++++++++++++++++++++
 1 file changed, 99 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/pinctrl/cirrus,madera-pinctrl.txt
Documentation/devicetree/bindings/pinctrl/cirrus,madera-pinctrl.txt new file +99 -0
new file mode 100644
index 0000000..b0e36cf
@@ -0,0 +1,99 @@
+Cirrus Logic Madera class audio codecs pinctrl driver
+
+The Cirrus Logic Madera codecs provide a number of GPIO functions for
+interfacing to external hardware and to provide logic outputs to other devices.
+Certain groups of GPIO pins also have an alternate function, normally as an
+audio interface.
+
+The set of available GPIOs, functions and alternate function groups differs
+between codecs so refer to the datasheet for the codec for further information
+on what is supported on that device.
+
+The properties for this driver exist within the parent MFD driver node.
+
+See also
+  the core bindings for the parent MFD driver:
+    Documentation/devicetree/bindings/mfd/madera.txt
+
+  the generic pinmix bindings:
+    Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt
+
+Required properties of parent mfd node:
+  - pinctrl-names : must be "default"
+  - pinctrl-0 : a phandle to the node containing the subnodes containing default
+      configurations
+
+Required subnodes:
+  One subnode is required to contain the default settings. It contains an
+  arbitrary number of configuration subnodes, one for each group or pin
+  configuration you want to apply as a default.
+
+Required properties of configuration subnodes:
+  - groups : name of one pin group to configure. One of:
+	aif1, aif2, aif3, aif4, mif1, mif2, mif3, pdmspk1, pdmspk2,
+	dmic4, dmic5, dmic6,
+	gpio1, gpio2, ..., gpio40
+    The gpioN groups select the single pin of this name for configuration
+
+Optional properties of configuration subnodes:
+  Any configuration option not explicitly listed in the dts will be left at
+  chip default setting.
+
+  - function : name of function to assign to this group. One of:
+	aif1, aif2, aif3, aif4, mif1, mif2, mif3, pdmspk1, pdmspk2,
+	dmic3, dmic4, dmic5, dmic6,
+	io, dsp-gpio, irq1, irq2,
+	fll1-clk, fll1-lock, fll2-clk, fll2-lock, fll3-clk, fll3-lock,
+	fllao-clk, fllao-lock,
+	opclk, opclk-async, pwm1, pwm2, spdif,
+	asrc1-in1-lock, asrc1-in2-lock, asrc2-in1-lock, asrc2-in2-lock,
+	spkl-short-circuit, spkr-short-circuit, spk-shutdown,
+	spk-overheat-shutdown, spk-overheat-warn,
+	timer1-sts, timer2-sts, timer3-sts, timer4-sts, timer5-sts, timer6-sts,
+	timer7-sts, timer8-sts,
+	log1-fifo-ne, log2-fifo-ne, log3-fifo-ne, log4-fifo-ne, log5-fifo-ne,
+	log6-fifo-ne, log7-fifo-ne, log8-fifo-ne,
+
+  - bias-disable : disable pull-up and pull-down
+  - bias-bus-hold : enable buskeeper
+  - bias-pull-up : output is pulled-up
+  - bias-pull-down : output is pulled-down
+  - drive-push-pull : CMOS output
+  - drive-open-drain : open-drain output
+  - drive-strength : drive strength in mA. Valid values are 4 or 8
+  - input-schmitt-enable : enable schmitt-trigger mode
+  - input-schmitt-disable : disable schmitt-trigger mode
+  - input-debounce : A value of 0 disables debounce, a value !=0 enables
+	debounce
+  - output-low : set the pin to output mode with low level
+  - output-high : set the pin to output mode with high level
+
+Example:
+
+cs47l85@0 {
+	compatible = "cirrus,cs47l85";
+
+	pinctrl-names = "default";
+	pinctrl-0 = <&cs47l85_defaults>;
+
+	cs47l85_defaults: cs47l85-gpio-defaults {
+		aif1 {
+			groups = "aif1";
+			function = "aif1";
+			bias-bus-hold;
+		};
+
+		aif2 {
+			groups = "aif2";
+			function = "aif2";
+			bias-bus-hold;
+		};
+
+		opclk {
+			groups = "gpio1";
+			function = "opclk";
+			bias-pull-up;
+			drive-strength = <8>;
+		};
+	};
+};
Signature · 1 line
1.9.1
#11 lore raw

PATCH v5 11/17 pinctrl: madera: Add driver for Cirrus Logic Madera codecs

In reply to Richard Fitzgerald

These codecs have a variable number of I/O lines each of which is individually selectable to a wide range of possible functions.

The functionality is slightly different from the traditional muxed GPIO since most of the functions can be mapped to any pin (and even the same function to multiple pins). Most pins have a dedicated "alternate" function that is only available on that pin. The alternate functions are usually a group of signals, though it is not always necessary to enable the full group, depending on the alternate function and how it is to be used. The mapping between alternate functions and GPIO pins varies between codecs depending on the number of alternate functions and available pins.

Note on the Kconfig options:
The formula "default y if..." is used for PINCTRL_MADERA so that its select options will be processed, allowing us to group selects for pinctrl into the pinctrl Kconfig where they logically belong instead of accumulating under the parent MFD Kconfig.

---
No changes since V4

 MAINTAINERS                              |    2 +
 drivers/pinctrl/Kconfig                  |    1 +
 drivers/pinctrl/Makefile                 |    1 +
 drivers/pinctrl/cirrus/Kconfig           |   15 +
 drivers/pinctrl/cirrus/Makefile          |   11 +
 drivers/pinctrl/cirrus/pinctrl-cs47l35.c |   46 ++
 drivers/pinctrl/cirrus/pinctrl-cs47l85.c |   60 ++
 drivers/pinctrl/cirrus/pinctrl-cs47l90.c |   58 ++
 drivers/pinctrl/cirrus/pinctrl-madera.c  | 1074 ++++++++++++++++++++++++++++++
 drivers/pinctrl/cirrus/pinctrl-madera.h  |   40 ++
 10 files changed, 1308 insertions(+)
 create mode 100644 drivers/pinctrl/cirrus/Kconfig
 create mode 100644 drivers/pinctrl/cirrus/Makefile
 create mode 100644 drivers/pinctrl/cirrus/pinctrl-cs47l35.c
 create mode 100644 drivers/pinctrl/cirrus/pinctrl-cs47l85.c
 create mode 100644 drivers/pinctrl/cirrus/pinctrl-cs47l90.c
 create mode 100644 drivers/pinctrl/cirrus/pinctrl-madera.c
 create mode 100644 drivers/pinctrl/cirrus/pinctrl-madera.h
MAINTAINERS +2 -0
index ed94481..9d75ab6 100644
@@ -3426,11 +3426,13 @@ T:	git https://github.com/CirrusLogic/linux-drivers.git
 W:	https://github.com/CirrusLogic/linux-drivers/wiki
 S:	Supported
 F:	Documentation/devicetree/bindings/mfd/madera.txt
+F:	Documentation/devicetree/bindings/pinctrl/cirrus,madera-pinctrl.txt
 F:	include/linux/irqchip/irq-madera*
 F:	include/linux/mfd/madera/*
 F:	drivers/irqchip/irq-madera*
 F:	drivers/mfd/madera*
 F:	drivers/mfd/cs47l*
+F:	drivers/pinctrl/cirrus/*
 
 CLEANCACHE API
 M:	Konrad Rzeszutek Wilk <[email protected]>
drivers/pinctrl/Kconfig +1 -0
index 1778cf4..aeb2169 100644
@@ -368,6 +368,7 @@ source "drivers/pinctrl/uniphier/Kconfig"
 source "drivers/pinctrl/vt8500/Kconfig"
 source "drivers/pinctrl/mediatek/Kconfig"
 source "drivers/pinctrl/zte/Kconfig"
+source "drivers/pinctrl/cirrus/Kconfig"
 
 config PINCTRL_XWAY
 	bool
drivers/pinctrl/Makefile +1 -0
index c16e279..a7e776f 100644
@@ -65,3 +65,4 @@ obj-$(CONFIG_PINCTRL_UNIPHIER)	+= uniphier/
 obj-$(CONFIG_ARCH_VT8500)	+= vt8500/
 obj-$(CONFIG_PINCTRL_MTK)	+= mediatek/
 obj-$(CONFIG_PINCTRL_ZX)	+= zte/
+obj-y				+= cirrus/
drivers/pinctrl/cirrus/Kconfig new file +15 -0
new file mode 100644
index 0000000..093527ea
@@ -0,0 +1,15 @@
+config PINCTRL_MADERA
+	bool
+	select PINMUX
+	select GENERIC_PINCONF
+	default y if MFD_MADERA=y
+
+config PINCTRL_CS47L35
+	bool
+
+config PINCTRL_CS47L85
+	bool
+
+config PINCTRL_CS47L90
+	bool
+
drivers/pinctrl/cirrus/Makefile new file +11 -0
new file mode 100644
index 0000000..b34473c
@@ -0,0 +1,11 @@
+# Cirrus Logic pinctrl drivers
+obj-$(CONFIG_PINCTRL_MADERA)	+= pinctrl-madera.o
+ifeq ($(CONFIG_PINCTRL_CS47L35),y)
+obj-$(CONFIG_PINCTRL_MADERA)	+= pinctrl-cs47l35.o
+endif
+ifeq ($(CONFIG_PINCTRL_CS47L85),y)
+obj-$(CONFIG_PINCTRL_MADERA)	+= pinctrl-cs47l85.o
+endif
+ifeq ($(CONFIG_PINCTRL_CS47L90),y)
+obj-$(CONFIG_PINCTRL_MADERA)	+= pinctrl-cs47l90.o
+endif
drivers/pinctrl/cirrus/pinctrl-cs47l35.c new file +46 -0

46 lines not on this page · raw message

drivers/pinctrl/cirrus/pinctrl-cs47l85.c new file +60 -0

60 lines not on this page · raw message

drivers/pinctrl/cirrus/pinctrl-cs47l90.c new file +58 -0

58 lines not on this page · raw message

drivers/pinctrl/cirrus/pinctrl-madera.c new file +1074 -0

1,074 lines not on this page · raw message

drivers/pinctrl/cirrus/pinctrl-madera.h new file +40 -0
new file mode 100644
index 0000000..7b55e22
@@ -0,0 +1,40 @@
+/*
+ * Pinctrl for Cirrus Logic Madera codecs
+ *
+ * Copyright 2016-2017 Cirrus Logic
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef PINCTRL_MADERA_H
+#define PINCTRL_MADERA_H
+
+struct madera_pin_groups {
+	const char *name;
+	const unsigned int *pins;
+	unsigned int n_pins;
+};
+
+struct madera_pin_chip {
+	unsigned int n_pins;
+
+	const struct madera_pin_groups *pin_groups;
+	unsigned int n_pin_groups;
+};
+
+struct madera_pin_private {
+	struct madera *madera;
+
+	const struct madera_pin_chip *chip; /* chip-specific groups */
+
+	struct device *dev;
+	struct pinctrl_dev *pctl;
+};
+
+extern const struct madera_pin_chip cs47l35_pin_chip;
+extern const struct madera_pin_chip cs47l85_pin_chip;
+extern const struct madera_pin_chip cs47l90_pin_chip;
+
+#endif
Signature · 1 line
1.9.1
Reviewed-by on v5 11/17
#12 lore raw

Re: [PATCH v5 11/17] pinctrl: madera: Add driver for Cirrus Logic Madera codecs

Quoted 19 lines · Richard Fitzgerald

These codecs have a variable number of I/O lines each of which is individually selectable to a wide range of possible functions.

The functionality is slightly different from the traditional muxed GPIO since most of the functions can be mapped to any pin (and even the same function to multiple pins). Most pins have a dedicated "alternate" function that is only available on that pin. The alternate functions are usually a group of signals, though it is not always necessary to enable the full group, depending on the alternate function and how it is to be used. The mapping between alternate functions and GPIO pins varies between codecs depending on the number of alternate functions and available pins.

Note on the Kconfig options:
The formula "default y if..." is used for PINCTRL_MADERA so that its select options will be processed, allowing us to group selects for pinctrl into the pinctrl Kconfig where they logically belong instead of accumulating under the parent MFD Kconfig.

Quoted 3 lines

---
No changes since V4

I think I reviewed this? Did I miss it?
Anyways

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#13 lore raw

PATCH v5 12/17 gpio: madera: Support Cirrus Logic Madera class codecs

In reply to Richard Fitzgerald

This adds support for the GPIOs on Cirrus Logic Madera class codecs. Any pins not used for special functions (see the pinctrl driver) can be used as general single-bit input or output lines. The number of available GPIOs varies between codecs.

---
 MAINTAINERS                |   1 +
 drivers/gpio/Kconfig       |   6 ++
 drivers/gpio/Makefile      |   1 +
 drivers/gpio/gpio-madera.c | 196 +++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 204 insertions(+)
 create mode 100644 drivers/gpio/gpio-madera.c
MAINTAINERS +1 -0
index 9d75ab6..94fc0bd 100644
@@ -3429,6 +3429,7 @@ F:	Documentation/devicetree/bindings/mfd/madera.txt
 F:	Documentation/devicetree/bindings/pinctrl/cirrus,madera-pinctrl.txt
 F:	include/linux/irqchip/irq-madera*
 F:	include/linux/mfd/madera/*
+F:	drivers/gpio/gpio-madera*
 F:	drivers/irqchip/irq-madera*
 F:	drivers/mfd/madera*
 F:	drivers/mfd/cs47l*
drivers/gpio/Kconfig +6 -0
index 3388d54..d072b30 100644
@@ -985,6 +985,12 @@ config GPIO_LP87565
 	  This driver can also be built as a module. If so, the module will be
 	  called gpio-lp87565.
 
+config GPIO_MADERA
+	bool "Cirrus Logic Madera class codecs"
+	depends on PINCTRL_MADERA
+	help
+	  Support for GPIOs on Cirrus Logic Madera class codecs.
+
 config GPIO_MAX77620
 	tristate "GPIO support for PMIC MAX77620 and MAX20024"
 	depends on MFD_MAX77620
drivers/gpio/Makefile +1 -0
index aeb70e9d..a171dc7 100644
@@ -69,6 +69,7 @@ obj-$(CONFIG_ARCH_LPC32XX)	+= gpio-lpc32xx.o
 obj-$(CONFIG_GPIO_LP873X)	+= gpio-lp873x.o
 obj-$(CONFIG_GPIO_LP87565)	+= gpio-lp87565.o
 obj-$(CONFIG_GPIO_LYNXPOINT)	+= gpio-lynxpoint.o
+obj-$(CONFIG_GPIO_MADERA)	+= gpio-madera.o
 obj-$(CONFIG_GPIO_MAX730X)	+= gpio-max730x.o
 obj-$(CONFIG_GPIO_MAX7300)	+= gpio-max7300.o
 obj-$(CONFIG_GPIO_MAX7301)	+= gpio-max7301.o
drivers/gpio/gpio-madera.c new file +196 -0

196 lines not on this page · raw message

Signature · 1 line
1.9.1
#14 lore raw

PATCH v5 13/17 ASoC: madera: Add DT bindings for Cirrus Logic Madera codecs

In reply to Richard Fitzgerald

The Cirrus Logic Madera codecs are a family of related codecs with extensive digital and analogue I/O, digital mixing and routing, signal processing and programmable DSPs.

---
 Documentation/devicetree/bindings/sound/madera.txt | 67 ++++++++++++++++++++++
 MAINTAINERS                                        |  1 +
 include/dt-bindings/sound/madera.h                 | 27 +++++++++
 3 files changed, 95 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/madera.txt
 create mode 100644 include/dt-bindings/sound/madera.h
Documentation/devicetree/bindings/sound/madera.txt new file +67 -0
new file mode 100644
index 0000000..1114fcf
@@ -0,0 +1,67 @@
+Cirrus Logic Madera class audio codecs
+
+This describes audio configuration bindings for these codecs.
+
+See also the core bindings for the parent MFD driver:
+See Documentation/devicetree/bindings/mfd/madera.txt
+
+and defines for values used in these bindings:
+include/dt-bindings/sound/madera.h
+
+These properties are all contained in the parent MFD node.
+
+Optional properties:
+  - cirrus,dmic-ref : Indicates how the MICBIAS pins have been externally
+    connected to DMICs on each input, one cell per input.
+    <IN1 IN2 IN3 ...>
+    A value of 0 indicates MICVDD and is the default, other values depend on the
+    codec:
+    For CS47L35 one of the CS47L35_DMIC_REF_xxx values
+    For all other codecs one of the MADERA_DMIC_REF_xxx values
+    Also see the datasheet for a description of the INn_DMIC_SUP field.
+
+  - cirrus,inmode : A list of input mode settings for each input. A maximum of
+    16 cells, with four cells per input in the order INnAL, INnAR INnBL INnBR.
+    For non-muxed inputs the first two cells for that input set the mode for
+    the left and right channel and the second two cells must be 0.
+    For muxed inputs the first two cells for that input set the mode of the
+    left and right A inputs and the second two cells set the mode of the left
+    and right B inputs.
+    Valid mode values are one of the MADERA_INMODE_xxx. If the array is shorter
+    than the number of inputs the unspecified inputs default to
+    MADERA_INMODE_DIFF.
+
+  - cirrus,out-mono : Mono bit for each output, must contain six cells if
+    specified. A non-zero value indicates the corresponding output is mono.
+
+  - cirrus,max-channels-clocked : Maximum number of channels that I2S clocks
+    will be generated for. Useful when clock master for systems where the I2S
+    bus has multiple data lines.
+    One cell for each AIF, use a value of zero for AIFs that should be handled
+    normally.
+
+  - cirrus,pdm-fmt : PDM speaker data format, must contain 2 cells
+    (OUT5 and OUT6). See the PDM_SPKn_FMT field in the datasheet for a
+    description of this value.
+    The second cell is ignored for codecs that do not have OUT6.
+
+  - cirrus,pdm-mute : PDM mute format, must contain 2 cells
+    (OUT5 and OUT6). See the PDM_SPKn_CTRL_1 register in the datasheet for a
+    description of this value.
+    The second cell is ignored for codecs that do not have OUT6.
+
+Example:
+
+cs47l35@0 {
+	compatible = "cirrus,cs47l35";
+
+	cirrus,dmic-ref = <0 0 CS47L35_DMIC_REF_MICBIAS1B 0>;
+	cirrus,inmode = <
+		MADERA_INMODE_DMIC MADERA_INMODE_DMIC /* IN1A digital */
+		MADERA_INMODE_SE   MADERA_INMODE_SE   /* IN1B single-ended */
+		MADERA_INMODE_DIFF MADERA_INMODE_DIFF /* IN2 differential */
+		0 0 	/* not used on this codec */
+	>;
+	cirrus,out-mono = <0 0 0 0 0 0>;
+	cirrus,max-channels-clocked = <2 0 0>;
+};
MAINTAINERS +1 -0
index 94fc0bd..92f02b7 100644
@@ -3427,6 +3427,7 @@ W:	https://github.com/CirrusLogic/linux-drivers/wiki
 S:	Supported
 F:	Documentation/devicetree/bindings/mfd/madera.txt
 F:	Documentation/devicetree/bindings/pinctrl/cirrus,madera-pinctrl.txt
+F:	include/dt-bindings/sound/madera*
 F:	include/linux/irqchip/irq-madera*
 F:	include/linux/mfd/madera/*
 F:	drivers/gpio/gpio-madera*
include/dt-bindings/sound/madera.h new file +27 -0
new file mode 100644
index 0000000..5c05b7a
@@ -0,0 +1,27 @@
+/*
+ * Device Tree defines for Madera codecs
+ *
+ * Copyright 2016-2017 Cirrus Logic
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef DT_BINDINGS_SOUND_MADERA_H
+#define DT_BINDINGS_SOUND_MADERA_H
+
+#define MADERA_INMODE_DIFF		0
+#define MADERA_INMODE_SE		1
+#define MADERA_INMODE_DMIC		2
+
+#define MADERA_DMIC_REF_MICVDD		0
+#define MADERA_DMIC_REF_MICBIAS1	1
+#define MADERA_DMIC_REF_MICBIAS2	2
+#define MADERA_DMIC_REF_MICBIAS3	3
+
+#define CS47L35_DMIC_REF_MICBIAS1B	1
+#define CS47L35_DMIC_REF_MICBIAS2A	2
+#define CS47L35_DMIC_REF_MICBIAS2B	3
+
+#endif
Signature · 1 line
1.9.1
#15 lore raw

PATCH v5 14/17 ASoC: madera: Add common support for Cirrus Logic Madera codecs

In reply to Richard Fitzgerald

The Cirrus Logic Madera codecs are a family of related codecs with extensive digital and analogue I/O, digital mixing and routing, signal processing and programmable DSPs.

This patch adds common support code shared by all Madera codecs.

---
Changes since V4:
- renaming of bus error interrupts to match new names in registers.h
- include madera-irq.c in madera.c
- fixed return of wrong variable in madera_get_variable_u32_array

 MAINTAINERS                  |    4 +
 include/sound/madera-pdata.h |   61 +
 sound/soc/codecs/Kconfig     |    5 +
 sound/soc/codecs/Makefile    |    2 +
 sound/soc/codecs/madera.c    | 4439 ++++++++++++++++++++++++++++++++++++++++++
 sound/soc/codecs/madera.h    |  470 +++++
 6 files changed, 4981 insertions(+)
 create mode 100644 include/sound/madera-pdata.h
 create mode 100644 sound/soc/codecs/madera.c
 create mode 100644 sound/soc/codecs/madera.h
MAINTAINERS +4 -0
index 92f02b7..ecb3043 100644
@@ -3427,14 +3427,18 @@ W:	https://github.com/CirrusLogic/linux-drivers/wiki
 S:	Supported
 F:	Documentation/devicetree/bindings/mfd/madera.txt
 F:	Documentation/devicetree/bindings/pinctrl/cirrus,madera-pinctrl.txt
+F:	Documentation/devicetree/bindings/sound/madera.txt
 F:	include/dt-bindings/sound/madera*
 F:	include/linux/irqchip/irq-madera*
 F:	include/linux/mfd/madera/*
+F:	include/sound/madera*
 F:	drivers/gpio/gpio-madera*
 F:	drivers/irqchip/irq-madera*
 F:	drivers/mfd/madera*
 F:	drivers/mfd/cs47l*
 F:	drivers/pinctrl/cirrus/*
+F:	sound/soc/codecs/cs47l*
+F:	sound/soc/codecs/madera*
 
 CLEANCACHE API
 M:	Konrad Rzeszutek Wilk <[email protected]>
include/sound/madera-pdata.h new file +61 -0

61 lines not on this page · raw message

sound/soc/codecs/Kconfig +5 -0
index c367d11..44a2978 100644
@@ -252,10 +252,12 @@ config SND_SOC_WM_HUBS
 config SND_SOC_WM_ADSP
 	tristate
 	select SND_SOC_COMPRESS
+	default y if SND_SOC_MADERA=y
 	default y if SND_SOC_CS47L24=y
 	default y if SND_SOC_WM5102=y
 	default y if SND_SOC_WM5110=y
 	default y if SND_SOC_WM2200=y
+	default m if SND_SOC_MADERA=m
 	default m if SND_SOC_CS47L24=m
 	default m if SND_SOC_WM5102=m
 	default m if SND_SOC_WM5110=m
@@ -591,6 +593,9 @@ config SND_SOC_ISABELLE
 config SND_SOC_LM49453
 	tristate
 
+config SND_SOC_MADERA
+	tristate
+
 config SND_SOC_MAX98088
        tristate
 
sound/soc/codecs/Makefile +2 -0
index 77c1818..e1ab86a 100644
@@ -79,6 +79,7 @@ snd-soc-jz4740-codec-objs := jz4740.o
 snd-soc-l3-objs := l3.o
 snd-soc-lm4857-objs := lm4857.o
 snd-soc-lm49453-objs := lm49453.o
+snd-soc-madera-objs := madera.o
 snd-soc-max9768-objs := max9768.o
 snd-soc-max98088-objs := max98088.o
 snd-soc-max98090-objs := max98090.o
@@ -319,6 +320,7 @@ obj-$(CONFIG_SND_SOC_JZ4740_CODEC)	+= snd-soc-jz4740-codec.o
 obj-$(CONFIG_SND_SOC_L3)	+= snd-soc-l3.o
 obj-$(CONFIG_SND_SOC_LM4857)	+= snd-soc-lm4857.o
 obj-$(CONFIG_SND_SOC_LM49453)   += snd-soc-lm49453.o
+obj-$(CONFIG_SND_SOC_MADERA)	+= snd-soc-madera.o
 obj-$(CONFIG_SND_SOC_MAX9768)	+= snd-soc-max9768.o
 obj-$(CONFIG_SND_SOC_MAX98088)	+= snd-soc-max98088.o
 obj-$(CONFIG_SND_SOC_MAX98090)	+= snd-soc-max98090.o
sound/soc/codecs/madera.c new file +4439 -0

2,886 lines not on this page · raw message

sound/soc/codecs/madera.h new file +470 -0

470 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.9.1

Part of the diff is not shown here. View the raw message.

#16 lore raw

PATCH v5 15/17 ASoC: cs47l35: Add codec driver for Cirrus Logic CS47L35

In reply to Richard Fitzgerald

Adds the codec driver for the CS47L35 SmartCodec. This is a multi-functional codec based on the Cirrus Logic Madera platform.

---
Changes since V4:
- replaced use of trivial wrapper function around blocking_notifier_call_chain with a direct call
- include irq-madera.h
- alphabetical ordering of header includes

 sound/soc/codecs/Kconfig   |    6 +
 sound/soc/codecs/Makefile  |    2 +
 sound/soc/codecs/cs47l35.c | 1748 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 1756 insertions(+)
 create mode 100644 sound/soc/codecs/cs47l35.c
sound/soc/codecs/Kconfig +6 -0
index 44a2978..b03e086 100644
@@ -63,6 +63,7 @@ config SND_SOC_ALL_CODECS
 	select SND_SOC_CS43130 if I2C
 	select SND_SOC_CS4349 if I2C
 	select SND_SOC_CS47L24 if MFD_CS47L24
+	select SND_SOC_CS47L35 if MFD_CS47L35
 	select SND_SOC_CS53L30 if I2C
 	select SND_SOC_CX20442 if TTY
 	select SND_SOC_DA7210 if SND_SOC_I2C_AND_SPI
@@ -504,6 +505,9 @@ config SND_SOC_CS4349
 config SND_SOC_CS47L24
 	tristate
 
+config SND_SOC_CS47L35
+	tristate
+
 # Cirrus Logic Quad-Channel ADC
 config SND_SOC_CS53L30
 	tristate "Cirrus Logic CS53L30 CODEC"
@@ -595,6 +599,8 @@ config SND_SOC_LM49453
 
 config SND_SOC_MADERA
 	tristate
+	default y if SND_SOC_CS47L35=y
+	default m if SND_SOC_CS47L35=m
 
 config SND_SOC_MAX98088
        tristate
sound/soc/codecs/Makefile +2 -0
index e1ab86a..eb31a44 100644
@@ -56,6 +56,7 @@ snd-soc-cs42xx8-i2c-objs := cs42xx8-i2c.o
 snd-soc-cs43130-objs := cs43130.o
 snd-soc-cs4349-objs := cs4349.o
 snd-soc-cs47l24-objs := cs47l24.o
+snd-soc-cs47l35-objs := cs47l35.o
 snd-soc-cs53l30-objs := cs53l30.o
 snd-soc-cx20442-objs := cx20442.o
 snd-soc-da7210-objs := da7210.o
@@ -297,6 +298,7 @@ obj-$(CONFIG_SND_SOC_CS42XX8_I2C) += snd-soc-cs42xx8-i2c.o
 obj-$(CONFIG_SND_SOC_CS43130)   += snd-soc-cs43130.o
 obj-$(CONFIG_SND_SOC_CS4349)	+= snd-soc-cs4349.o
 obj-$(CONFIG_SND_SOC_CS47L24)	+= snd-soc-cs47l24.o
+obj-$(CONFIG_SND_SOC_CS47L35)	+= snd-soc-cs47l35.o
 obj-$(CONFIG_SND_SOC_CS53L30)	+= snd-soc-cs53l30.o
 obj-$(CONFIG_SND_SOC_CX20442)	+= snd-soc-cx20442.o
 obj-$(CONFIG_SND_SOC_DA7210)	+= snd-soc-da7210.o
sound/soc/codecs/cs47l35.c new file +1748 -0

1,748 lines not on this page · raw message

Signature · 6 lines
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#17 lore raw

PATCH v5 16/17 ASoC: cs47l85: Add codec driver for Cirrus Logic CS47L85

In reply to Richard Fitzgerald

Adds the codec driver for the CS47L85 SmartCodec. This is a multi-functional codec based on the Cirrus Logic Madera platform.

---
Changes since V4:
- replaced use of trivial wrapper function around blocking_notifier_call_chain with a direct call

 sound/soc/codecs/Kconfig   |    6 +
 sound/soc/codecs/Makefile  |    2 +
 sound/soc/codecs/cs47l85.c | 2722 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 2730 insertions(+)
 create mode 100644 sound/soc/codecs/cs47l85.c
sound/soc/codecs/Kconfig +6 -0
index b03e086..f50de38 100644
@@ -64,6 +64,7 @@ config SND_SOC_ALL_CODECS
 	select SND_SOC_CS4349 if I2C
 	select SND_SOC_CS47L24 if MFD_CS47L24
 	select SND_SOC_CS47L35 if MFD_CS47L35
+	select SND_SOC_CS47L85 if MFD_CS47L85
 	select SND_SOC_CS53L30 if I2C
 	select SND_SOC_CX20442 if TTY
 	select SND_SOC_DA7210 if SND_SOC_I2C_AND_SPI
@@ -508,6 +509,9 @@ config SND_SOC_CS47L24
 config SND_SOC_CS47L35
 	tristate
 
+config SND_SOC_CS47L85
+	tristate
+
 # Cirrus Logic Quad-Channel ADC
 config SND_SOC_CS53L30
 	tristate "Cirrus Logic CS53L30 CODEC"
@@ -600,7 +604,9 @@ config SND_SOC_LM49453
 config SND_SOC_MADERA
 	tristate
 	default y if SND_SOC_CS47L35=y
+	default y if SND_SOC_CS47L85=y
 	default m if SND_SOC_CS47L35=m
+	default m if SND_SOC_CS47L85=m
 
 config SND_SOC_MAX98088
        tristate
sound/soc/codecs/Makefile +2 -0
index eb31a44..0831d35 100644
@@ -57,6 +57,7 @@ snd-soc-cs43130-objs := cs43130.o
 snd-soc-cs4349-objs := cs4349.o
 snd-soc-cs47l24-objs := cs47l24.o
 snd-soc-cs47l35-objs := cs47l35.o
+snd-soc-cs47l85-objs := cs47l85.o
 snd-soc-cs53l30-objs := cs53l30.o
 snd-soc-cx20442-objs := cx20442.o
 snd-soc-da7210-objs := da7210.o
@@ -299,6 +300,7 @@ obj-$(CONFIG_SND_SOC_CS43130)   += snd-soc-cs43130.o
 obj-$(CONFIG_SND_SOC_CS4349)	+= snd-soc-cs4349.o
 obj-$(CONFIG_SND_SOC_CS47L24)	+= snd-soc-cs47l24.o
 obj-$(CONFIG_SND_SOC_CS47L35)	+= snd-soc-cs47l35.o
+obj-$(CONFIG_SND_SOC_CS47L85)	+= snd-soc-cs47l85.o
 obj-$(CONFIG_SND_SOC_CS53L30)	+= snd-soc-cs53l30.o
 obj-$(CONFIG_SND_SOC_CX20442)	+= snd-soc-cx20442.o
 obj-$(CONFIG_SND_SOC_DA7210)	+= snd-soc-da7210.o
sound/soc/codecs/cs47l85.c new file +2722 -0

2,722 lines not on this page · raw message

Signature · 1 line
1.9.1
#18 lore raw

PATCH v5 17/17 ASoC: cs47l90: Add codec driver for Cirrus Logic CS47L90

In reply to Richard Fitzgerald

Adds the codec driver for the CS47L90 SmartCodec. This is a multi-functional codec based on the Cirrus Logic Madera platform.

---
Changes since V4:
- replaced use of trivial wrapper function around blocking_notifier_call_chain with a direct call
- removed renaming of bus error interrupts, this belongs in patch #14

 sound/soc/codecs/Kconfig   |    6 +
 sound/soc/codecs/Makefile  |    2 +
 sound/soc/codecs/cs47l90.c | 2661 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 2669 insertions(+)
 create mode 100644 sound/soc/codecs/cs47l90.c
sound/soc/codecs/Kconfig +6 -0
index f50de38..2c9ab5f 100644
@@ -65,6 +65,7 @@ config SND_SOC_ALL_CODECS
 	select SND_SOC_CS47L24 if MFD_CS47L24
 	select SND_SOC_CS47L35 if MFD_CS47L35
 	select SND_SOC_CS47L85 if MFD_CS47L85
+	select SND_SOC_CS47L90 if MFD_CS47L90
 	select SND_SOC_CS53L30 if I2C
 	select SND_SOC_CX20442 if TTY
 	select SND_SOC_DA7210 if SND_SOC_I2C_AND_SPI
@@ -512,6 +513,9 @@ config SND_SOC_CS47L35
 config SND_SOC_CS47L85
 	tristate
 
+config SND_SOC_CS47L90
+	tristate
+
 # Cirrus Logic Quad-Channel ADC
 config SND_SOC_CS53L30
 	tristate "Cirrus Logic CS53L30 CODEC"
@@ -605,8 +609,10 @@ config SND_SOC_MADERA
 	tristate
 	default y if SND_SOC_CS47L35=y
 	default y if SND_SOC_CS47L85=y
+	default y if SND_SOC_CS47L90=y
 	default m if SND_SOC_CS47L35=m
 	default m if SND_SOC_CS47L85=m
+	default m if SND_SOC_CS47L90=m
 
 config SND_SOC_MAX98088
        tristate
sound/soc/codecs/Makefile +2 -0
index 0831d35..f7c0d82 100644
@@ -58,6 +58,7 @@ snd-soc-cs4349-objs := cs4349.o
 snd-soc-cs47l24-objs := cs47l24.o
 snd-soc-cs47l35-objs := cs47l35.o
 snd-soc-cs47l85-objs := cs47l85.o
+snd-soc-cs47l90-objs := cs47l90.o
 snd-soc-cs53l30-objs := cs53l30.o
 snd-soc-cx20442-objs := cx20442.o
 snd-soc-da7210-objs := da7210.o
@@ -301,6 +302,7 @@ obj-$(CONFIG_SND_SOC_CS4349)	+= snd-soc-cs4349.o
 obj-$(CONFIG_SND_SOC_CS47L24)	+= snd-soc-cs47l24.o
 obj-$(CONFIG_SND_SOC_CS47L35)	+= snd-soc-cs47l35.o
 obj-$(CONFIG_SND_SOC_CS47L85)	+= snd-soc-cs47l85.o
+obj-$(CONFIG_SND_SOC_CS47L90)	+= snd-soc-cs47l90.o
 obj-$(CONFIG_SND_SOC_CS53L30)	+= snd-soc-cs53l30.o
 obj-$(CONFIG_SND_SOC_CX20442)	+= snd-soc-cx20442.o
 obj-$(CONFIG_SND_SOC_DA7210)	+= snd-soc-da7210.o
sound/soc/codecs/cs47l90.c new file +2661 -0

2,661 lines not on this page · raw message

Signature · 6 lines
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html