Skip to contentSkip to conversation

mfd: lochnagar: Add support for the Cirrus Logic Lochnagar

PATCH In review Charles Keepax 5 participants 14 messages Sep 5, 2018 – Sep 25, 2018

Subsystems (7)
lore
Share & tools
lore

Charles Keepax

author maintainer
#0 lore raw

PATCH 1/5 mfd: lochnagar: Add support for the Cirrus Logic Lochnagar

From: Charles Keepax <[email protected]>

Lochnagar is an evaluation and development board for Cirrus Logic Smart CODEC and Amp devices. It allows the connection of most Cirrus Logic devices on mini-cards, as well as allowing connection of various application processor systems to provide a full evaluation platform. Audio system topology, clocking and power can all be controlled through the Lochnagar, allowing the device under test to be used in a variety of possible use cases.

As the Lochnagar is a fairly complex device this MFD driver allows the drivers for the various features to be bound in. Initially clocking, regulator and pinctrl will be added as these are necessary to configure the system. But in time at least audio and voltage/current monitoring will also be added.

---
 MAINTAINERS                         |  13 +
 drivers/mfd/Kconfig                 |   7 +
 drivers/mfd/Makefile                |   2 +
 drivers/mfd/lochnagar-i2c.c         | 735 ++++++++++++++++++++++++++++++++++++
 include/linux/mfd/lochnagar.h       |  51 +++
 include/linux/mfd/lochnagar1_regs.h | 160 ++++++++
 include/linux/mfd/lochnagar2_regs.h | 256 +++++++++++++
 7 files changed, 1224 insertions(+)
 create mode 100644 drivers/mfd/lochnagar-i2c.c
 create mode 100644 include/linux/mfd/lochnagar.h
 create mode 100644 include/linux/mfd/lochnagar1_regs.h
 create mode 100644 include/linux/mfd/lochnagar2_regs.h
MAINTAINERS +13 -0
index 2c1c6aef7d74..9454463c2ddd 100644
@@ -3486,6 +3486,19 @@ L:	[email protected]
 S:	Maintained
 F:	drivers/net/ethernet/cirrus/ep93xx_eth.c
 
+CIRRUS LOGIC LOCHNAGAR DRIVER
+M:	Charles Keepax <[email protected]>
+M:	Richard Fitzgerald <[email protected]>
+L:	[email protected]
+S:	Supported
+F:	drivers/clk/clk-lochnagar.c
+F:	drivers/mfd/lochnagar-i2c.c
+F:	drivers/pinctrl/cirrus/pinctrl-lochnagar.c
+F:	drivers/regulator/lochnagar-regulator.c
+F:	include/dt-bindings/clk/lochnagar.h
+F:	include/dt-bindings/pinctrl/lochnagar.h
+F:	include/linux/mfd/lochnagar*
+
 CISCO FCOE HBA DRIVER
 M:	Satish Kharat <[email protected]>
 M:	Sesidhar Baddela <[email protected]>
drivers/mfd/Kconfig +7 -0
index 11841f4b7b2b..9f713952b3cc 100644
@@ -1669,6 +1669,13 @@ config MFD_VX855
 	  VIA VX855/VX875 south bridge. You will need to enable the vx855_spi
 	  and/or vx855_gpio drivers for this to do anything useful.
 
+config MFD_LOCHNAGAR
+	bool "Cirrus Logic Lochnagar Audio Development Board"
+	select MFD_CORE
+	depends on I2C && OF
+	help
+	  Support for Cirrus Logic Lochnagar audio development board.
+
 config MFD_ARIZONA
 	select REGMAP
 	select REGMAP_IRQ
drivers/mfd/Makefile +2 -0
index 5856a9489cbd..f16773cb887f 100644
@@ -37,6 +37,8 @@ obj-$(CONFIG_MFD_T7L66XB)	+= t7l66xb.o tmio_core.o
 obj-$(CONFIG_MFD_TC6387XB)	+= tc6387xb.o tmio_core.o
 obj-$(CONFIG_MFD_TC6393XB)	+= tc6393xb.o tmio_core.o
 
+obj-$(CONFIG_MFD_LOCHNAGAR)	+= lochnagar-i2c.o
+
 obj-$(CONFIG_MFD_ARIZONA)	+= arizona-core.o
 obj-$(CONFIG_MFD_ARIZONA)	+= arizona-irq.o
 obj-$(CONFIG_MFD_ARIZONA_I2C)	+= arizona-i2c.o
drivers/mfd/lochnagar-i2c.c new file +735 -0

735 lines not on this page · raw message

include/linux/mfd/lochnagar.h new file +51 -0

51 lines not on this page · raw message

include/linux/mfd/lochnagar1_regs.h new file +160 -0

160 lines not on this page · raw message

include/linux/mfd/lochnagar2_regs.h new file +256 -0

256 lines not on this page · raw message

Signature · 1 line
2.11.0
author maintainer
#1 lore raw

PATCH 2/5 clk: lochnagar: Add support for the Cirrus Logic Lochnagar

From: Charles Keepax <[email protected]>

Lochnagar is an evaluation and development board for Cirrus Logic Smart CODEC and Amp devices. It allows the connection of most Cirrus Logic devices on mini-cards, as well as allowing connection of various application processor systems to provide a full evaluation platform.

The Lochnagar can take several input clocks from the host system, provides several of its own clock sources, and provides extensive routing options for those clocks to be supplied to the attached CODEC/Amp device.

---
 drivers/clk/Kconfig                 |   7 +
 drivers/clk/Makefile                |   1 +
 drivers/clk/clk-lochnagar.c         | 452 ++++++++++++++++++++++++++++++++++++
 include/dt-bindings/clk/lochnagar.h |  36 +++
 4 files changed, 496 insertions(+)
 create mode 100644 drivers/clk/clk-lochnagar.c
 create mode 100644 include/dt-bindings/clk/lochnagar.h
drivers/clk/Kconfig +7 -0
index 721572a8c429..ce32fcf833ae 100644
@@ -213,6 +213,13 @@ config COMMON_CLK_XGENE
 	---help---
 	  Sypport for the APM X-Gene SoC reference, PLL, and device clocks.
 
+config COMMON_CLK_LOCHNAGAR
+	tristate "Cirrus Logic Lochnagar clock driver"
+	depends on MFD_LOCHNAGAR
+	help
+	  This driver supports the clocking features of the Cirrus Logic
+	  Lochnagar audio development board.
+
 config COMMON_CLK_NXP
 	def_bool COMMON_CLK && (ARCH_LPC18XX || ARCH_LPC32XX)
 	select REGMAP_MMIO if ARCH_LPC32XX
drivers/clk/Makefile +1 -0
index ae40cbe770f0..bd27b40b4f1f 100644
@@ -30,6 +30,7 @@ obj-$(CONFIG_COMMON_CLK_GEMINI)		+= clk-gemini.o
 obj-$(CONFIG_COMMON_CLK_ASPEED)		+= clk-aspeed.o
 obj-$(CONFIG_ARCH_HIGHBANK)		+= clk-highbank.o
 obj-$(CONFIG_CLK_HSDK)			+= clk-hsdk-pll.o
+obj-$(CONFIG_COMMON_CLK_LOCHNAGAR)	+= clk-lochnagar.o
 obj-$(CONFIG_COMMON_CLK_MAX77686)	+= clk-max77686.o
 obj-$(CONFIG_ARCH_MOXART)		+= clk-moxart.o
 obj-$(CONFIG_ARCH_NOMADIK)		+= clk-nomadik.o
drivers/clk/clk-lochnagar.c new file +452 -0

452 lines not on this page · raw message

include/dt-bindings/clk/lochnagar.h new file +36 -0
new file mode 100644
index 000000000000..7ffa768a7dfe
@@ -0,0 +1,36 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Device Tree defines for Lochnagar clocking
+ *
+ * Copyright 2017-2018 Cirrus Logic Inc.
+ *
+ * Author: Charles Keepax <[email protected]>
+ *
+ * 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_CLK_LOCHNAGAR_H
+#define DT_BINDINGS_CLK_LOCHNAGAR_H
+
+#define LOCHNAGAR_CDC_MCLK1		0
+#define LOCHNAGAR_CDC_MCLK2		1
+#define LOCHNAGAR_DSP_CLKIN		2
+#define LOCHNAGAR_GF_CLKOUT1		3
+#define LOCHNAGAR_GF_CLKOUT2		4
+#define LOCHNAGAR_PSIA1_MCLK		5
+#define LOCHNAGAR_PSIA2_MCLK		6
+#define LOCHNAGAR_SPDIF_MCLK		7
+#define LOCHNAGAR_ADAT_MCLK		8
+#define LOCHNAGAR_SOUNDCARD_MCLK	9
+#define LOCHNAGAR_PMIC_32K		10
+#define LOCHNAGAR_CLK_12M		11
+#define LOCHNAGAR_CLK_11M		12
+#define LOCHNAGAR_CLK_24M		13
+#define LOCHNAGAR_CLK_22M		14
+#define LOCHNAGAR_USB_CLK_24M		15
+#define LOCHNAGAR_USB_CLK_12M		16
+#define LOCHNAGAR_SPDIF_CLKOUT		17
+
+#endif
Signature · 1 line
2.11.0
maintainer
#2 lore raw

Re: [PATCH 2/5] clk: lochnagar: Add support for the Cirrus Logic Lochnagar

Quoted 13 lines · Charles Keepax

From: Charles Keepax <[email protected]>

Lochnagar is an evaluation and development board for Cirrus Logic Smart CODEC and Amp devices. It allows the connection of most Cirrus Logic devices on mini-cards, as well as allowing connection of various application processor systems to provide a full evaluation platform.

The Lochnagar can take several input clocks from the host system, provides several of its own clock sources, and provides extensive routing options for those clocks to be supplied to the attached CODEC/Amp device.

Quoted 6 lines
---
 drivers/clk/Kconfig                 |   7 +
 drivers/clk/Makefile                |   1 +
 drivers/clk/clk-lochnagar.c         | 452 ++++++++++++++++++++++++++++++++++++
 include/dt-bindings/clk/lochnagar.h |  36 +++

The binding headers should be part of the binding patch and that should come first in the series.

Quoted 3 lines
 4 files changed, 496 insertions(+)
 create mode 100644 drivers/clk/clk-lochnagar.c
 create mode 100644 include/dt-bindings/clk/lochnagar.h
author maintainer
#3 lore raw

PATCH 3/5 regulator: lochnagar: Add support for the Cirrus Logic Lochnagar

In reply to Charles Keepax

From: Charles Keepax <[email protected]>

Lochnagar is an evaluation and development board for Cirrus Logic Smart CODEC and Amp devices. It allows the connection of most Cirrus Logic devices on mini-cards, as well as allowing connection of various application processor systems to provide a full evaluation platform.

The Lochnagar board provides power supplies for the attached CODEC/Amp device. Currently this driver supports the microphone supplies and the digital core voltage for the attached device. There are some additional supplies that will be added in time but these supplies are sufficient for most systems/use-cases.

---
 drivers/regulator/Kconfig               |   7 +
 drivers/regulator/Makefile              |   1 +
 drivers/regulator/lochnagar-regulator.c | 258 ++++++++++++++++++++++++++++++++
 3 files changed, 266 insertions(+)
 create mode 100644 drivers/regulator/lochnagar-regulator.c
drivers/regulator/Kconfig +7 -0
index 5dbccf5f3037..10c3aa7e4bfd 100644
@@ -356,6 +356,13 @@ config REGULATOR_LM363X
 	  One boost output voltage is configurable and always on.
 	  Other LDOs are used for the display module.
 
+config REGULATOR_LOCHNAGAR
+	tristate "Cirrus Logic Lochnagar regulator driver"
+	depends on MFD_LOCHNAGAR
+	help
+	  This enables regulator support on the Cirrus Logic Lochnagar audio
+	  development board.
+
 config REGULATOR_LP3971
 	tristate "National Semiconductors LP3971 PMIC regulator driver"
 	depends on I2C
drivers/regulator/Makefile +1 -0
index bd818ceb7c72..72eaa51cdaf9 100644
@@ -46,6 +46,7 @@ obj-$(CONFIG_REGULATOR_HI655X) += hi655x-regulator.o
 obj-$(CONFIG_REGULATOR_ISL6271A) += isl6271a-regulator.o
 obj-$(CONFIG_REGULATOR_ISL9305) += isl9305.o
 obj-$(CONFIG_REGULATOR_LM363X) += lm363x-regulator.o
+obj-$(CONFIG_REGULATOR_LOCHNAGAR) += lochnagar-regulator.o
 obj-$(CONFIG_REGULATOR_LP3971) += lp3971.o
 obj-$(CONFIG_REGULATOR_LP3972) += lp3972.o
 obj-$(CONFIG_REGULATOR_LP872X) += lp872x.o
drivers/regulator/lochnagar-regulator.c new file +258 -0

258 lines not on this page · raw message

Signature · 1 line
2.11.0
author maintainer
#4 lore raw

PATCH 4/5 pinctrl: lochnagar: Add support for the Cirrus Logic Lochnagar

In reply to Charles Keepax

From: Charles Keepax <[email protected]>

Lochnagar is an evaluation and development board for Cirrus Logic Smart CODEC and Amp devices. It allows the connection of most Cirrus Logic devices on mini-cards, as well as allowing connection of various application processor systems to provide a full evaluation platform.

Lochnagar provides many pins which can generally be used for an audio function such as an AIF or a PDM interface, but also as GPIOs.

---
 drivers/pinctrl/cirrus/Kconfig             |   10 +
 drivers/pinctrl/cirrus/Makefile            |    2 +
 drivers/pinctrl/cirrus/pinctrl-lochnagar.c | 1161 ++++++++++++++++++++++++++++
 drivers/pinctrl/cirrus/pinctrl-lochnagar.h |  115 +++
 include/dt-bindings/pinctrl/lochnagar.h    |  135 ++++
 5 files changed, 1423 insertions(+)
 create mode 100644 drivers/pinctrl/cirrus/pinctrl-lochnagar.c
 create mode 100644 drivers/pinctrl/cirrus/pinctrl-lochnagar.h
 create mode 100644 include/dt-bindings/pinctrl/lochnagar.h
drivers/pinctrl/cirrus/Kconfig +10 -0
index 27013e5949bc..74af07e25174 100644
@@ -1,3 +1,13 @@
+config PINCTRL_LOCHNAGAR
+	tristate "Cirrus Logic Lochnagar pinctrl driver"
+	depends on MFD_LOCHNAGAR
+	select PINMUX
+	select PINCONF
+	select GENERIC_PINCONF
+	help
+	  This driver supports configuring the GPIO and other pin configuration
+	  of the Cirrus Logic Lochnagar audio development board.
+
 # This is all selected by the Madera MFD driver Kconfig options
 config PINCTRL_MADERA
 	tristate
drivers/pinctrl/cirrus/Makefile +2 -0
index 6e4938cde9e3..20baebf438f6 100644
@@ -1,4 +1,6 @@
 # Cirrus Logic pinctrl drivers
+obj-$(CONFIG_PINCTRL_LOCHNAGAR)	+= pinctrl-lochnagar.o
+
 pinctrl-madera-objs		:= pinctrl-madera-core.o
 ifeq ($(CONFIG_PINCTRL_CS47L35),y)
 pinctrl-madera-objs		+= pinctrl-cs47l35.o
drivers/pinctrl/cirrus/pinctrl-lochnagar.c new file +1161 -0

1,161 lines not on this page · raw message

drivers/pinctrl/cirrus/pinctrl-lochnagar.h new file +115 -0

115 lines not on this page · raw message

include/dt-bindings/pinctrl/lochnagar.h new file +135 -0

135 lines not on this page · raw message

Signature · 1 line
2.11.0
maintainer
#5 lore raw

Re: [PATCH 4/5] pinctrl: lochnagar: Add support for the Cirrus Logic Lochnagar

Quoted 12 lines · Charles Keepax

From: Charles Keepax <[email protected]>

Lochnagar is an evaluation and development board for Cirrus Logic Smart CODEC and Amp devices. It allows the connection of most Cirrus Logic devices on mini-cards, as well as allowing connection of various application processor systems to provide a full evaluation platform.

Lochnagar provides many pins which can generally be used for an audio function such as an AIF or a PDM interface, but also as GPIOs.

Quoted 8 lines
---
 drivers/pinctrl/cirrus/Kconfig             |   10 +
 drivers/pinctrl/cirrus/Makefile            |    2 +
 drivers/pinctrl/cirrus/pinctrl-lochnagar.c | 1161 ++++++++++++++++++++++++++++
 drivers/pinctrl/cirrus/pinctrl-lochnagar.h |  115 +++
 include/dt-bindings/pinctrl/lochnagar.h    |  135 ++++

This belongs with the binding patch.

Quoted 4 lines
 5 files changed, 1423 insertions(+)
 create mode 100644 drivers/pinctrl/cirrus/pinctrl-lochnagar.c
 create mode 100644 drivers/pinctrl/cirrus/pinctrl-lochnagar.h
 create mode 100644 include/dt-bindings/pinctrl/lochnagar.h
author maintainer
#6 lore raw

PATCH 5/5 mfd: lochnagar: Add initial binding documentation

In reply to Charles Keepax

Lochnagar is an evaluation and development board for Cirrus Logic Smart CODEC and Amp devices. It allows the connection of most Cirrus Logic devices on mini-cards, as well as allowing connection of various application processor systems to provide a full evaluation platform.

---
 .../devicetree/bindings/mfd/cirrus,lochnagar.txt   | 230 +++++++++++++++++++++
 1 file changed, 230 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mfd/cirrus,lochnagar.txt
Documentation/devicetree/bindings/mfd/cirrus,lochnagar.txt new file +230 -0
new file mode 100644
index 000000000000..3382a14c19fe
@@ -0,0 +1,230 @@
+Cirrus Logic Lochnagar Audio Development Board
+
+Lochnagar is an evaluation and development board for Cirrus Logic
+Smart CODEC and Amp devices. It allows the connection of most Cirrus
+Logic devices on mini-cards, as well as allowing connection of
+various application processor systems to provide a full evaluation
+platform.  Audio system topology, clocking and power can all be
+controlled through the Lochnagar, allowing the device under test
+to be used in a variety of possible use cases.
+
+Also see these documents for generic binding information:
+  [1] GPIO : ../gpio/gpio.txt
+  [2] Pinctrl: ../pinctrl/pinctrl-bindings.txt
+  [3] Clock : ../clock/clock-bindings.txt
+  [4] Regulator: ../regulator/regulator.txt
+
+And these for relevant defines:
+  [5] include/dt-bindings/pinctrl/lochnagar.h
+  [6] include/dt-bindings/clock/lochnagar.h
+
+Required properties:
+
+  - compatible : One of the following strings:
+                 "cirrus,lochnagar1"
+                 "cirrus,lochnagar2"
+
+  - reg : I2C slave address
+
+  - gpio-controller : Indicates this device is a GPIO controller.
+  - #gpio-cells : Must be 2. The first cell is the pin number, see
+    [5] for available pins and the second cell is used to specify
+    optional parameters, see [1].
+  - gpio-ranges : Range of pins managed by the GPIO controller, see
+    [1]. Both the GPIO and Pinctrl base should be set to zero and the
+    count to the appropriate of the LOCHNAGARx_PIN_NUM_GPIOS define,
+    see [5].
+
+  - reset-gpios : Reset line to the Lochnagar, see [1].
+
+  - #clock-cells : Must be 1. The first cell indicates the clock
+    number, see [6] for available clocks and [3].
+
+  - pinctrl-names : A pinctrl state named "default" must be defined.
+  - pinctrl-0 : A phandle to the default pinctrl state.
+
+  - SYSVDD-supply: Primary power supply for the Lochnagar.
+
+Optional properties:
+
+  - present-gpios : Host present line, indicating the presence of a
+    host system, see [1]. This can be omitted if the present line is
+    tied in hardware.
+
+  - clocks : Must contain an entry for each clock in clock-names.
+  - clock-names : May contain entries for each of the following
+    clocks:
+     - ln-cdc-clkout : Output clock from CODEC card.
+     - ln-dsp-clkout : Output clock from DSP card.
+     - ln-gf-mclk1,ln-gf-mclk2,ln-gf-mclk3,ln-gf-mclk4 : Optional
+       input audio clocks from host system.
+     - ln-psia1-mclk, ln-psia2-mclk : Optional input audio clocks from
+       external connector.
+     - ln-spdif-clkout : Optional input audio clock from SPDIF.
+     - ln-adat-clkout : Optional input audio clock from ADAT.
+
+  - assigned-clocks : A list of Lochnagar clocks to be reparented, see
+    [6] for available clocks.
+  - assigned-clock-parents : Parents to be assigned to the clocks
+    listed in "assigned-clocks".
+
+  - MICBIAS1-supply, MICBIAS2-supply: Regulator supplies for the
+    MICxVDD outputs, supplying the digital microphones, normally
+    supplied from the attached CODEC.
+
+Required sub-nodes:
+
+The pin configurations are defined as a child of the pinctrl states
+node, see [2]. Each sub-node can have the following properties:
+  - groups : A list of groups to select (either this or "pins" must be
+    specified), available groups:
+      codec-aif1, codec-aif2, codec-aif3, dsp-aif1, dsp-aif2, psia1,
+      psia2, gf-aif1, gf-aif2, gf-aif3, gf-aif4, spdif-aif, usb-aif1,
+      usb-aif2, adat-aif, soundcard-aif
+  - pins : A list of pin names to select (either this or "groups" must
+    be specified), available pins:
+      fgpa-gpio1, fgpa-gpio2, fgpa-gpio3, fgpa-gpio4, fgpa-gpio5,
+      fgpa-gpio6, codec-gpio1, codec-gpio2, codec-gpio3, codec-gpio4,
+      codec-gpio5, codec-gpio6, codec-gpio7, codec-gpio8, dsp-gpio1,
+      dsp-gpio2, dsp-gpio3, dsp-gpio4, dsp-gpio5, dsp-gpio6, gf-gpio2,
+      gf-gpio3, gf-gpio7, codec-aif1-bclk, codec-aif1-rxdat,
+      codec-aif1-lrclk, codec-aif1-txdat, codec-aif2-bclk,
+      codec-aif2-rxdat, codec-aif2-lrclk, codec-aif2-txdat,
+      codec-aif3-bclk, codec-aif3-rxdat, codec-aif3-lrclk,
+      codec-aif3-txdat, dsp-aif1-bclk, dsp-aif1-rxdat, dsp-aif1-lrclk,
+      dsp-aif1-txdat, dsp-aif2-bclk, dsp-aif2-rxdat,
+      dsp-aif2-lrclk, dsp-aif2-txdat, psia1-bclk, psia1-rxdat,
+      psia1-lrclk, psia1-txdat, psia2-bclk, psia2-rxdat, psia2-lrclk,
+      psia2-txdat, gf-aif3-bclk, gf-aif3-rxdat, gf-aif3-lrclk,
+      gf-aif3-txdat, gf-aif4-bclk, gf-aif4-rxdat, gf-aif4-lrclk,
+      gf-aif4-txdat, gf-aif1-bclk, gf-aif1-rxdat, gf-aif1-lrclk,
+      gf-aif1-txdat, gf-aif2-bclk, gf-aif2-rxdat, gf-aif2-lrclk,
+      gf-aif2-txdat, dsp-uart1-rx, dsp-uart1-tx, dsp-uart2-rx,
+      dsp-uart2-tx, gf-uart2-rx, gf-uart2-tx, usb-uart-rx,
+      codec-pdmclk1, codec-pdmdat1, codec-pdmclk2, codec-pdmdat2,
+      codec-dmicclk1, codec-dmicdat1, codec-dmicclk2, codec-dmicdat2,
+      codec-dmicclk3, codec-dmicdat3, codec-dmicclk4, codec-dmicdat4,
+      dsp-dmicclk1, dsp-dmicdat1, dsp-dmicclk2, dsp-dmicdat2, i2c2-scl,
+      i2c2-sda, i2c3-scl, i2c3-sda, i2c4-scl, i2c4-sda, dsp-standby,
+      codec-mclk1, codec-mclk2, dsp-clkin, psia1-mclk, psia2-mclk,
+      gf-gpio1, gf-gpio5, dsp-gpio20, led1, led2
+  - function : The mux function to select, available functions:
+      aif, fgpa-gpio1, fgpa-gpio2, fgpa-gpio3, fgpa-gpio4, fgpa-gpio5,
+      fgpa-gpio6, codec-gpio1, codec-gpio2, codec-gpio3, codec-gpio4,
+      codec-gpio5, codec-gpio6, codec-gpio7, codec-gpio8, dsp-gpio1,
+      dsp-gpio2, dsp-gpio3, dsp-gpio4, dsp-gpio5, dsp-gpio6, gf-gpio2,
+      gf-gpio3, gf-gpio7, gf-gpio1, gf-gpio5, dsp-gpio20, codec-clkout,
+      dsp-clkout, pmic-32k, spdif-clkout, clk-12m288, clk-11m2986,
+      clk-24m576, clk-22m5792, xmos-mclk, gf-clkout1, gf-mclk1,
+      gf-mclk3, gf-mclk2, gf-clkout2, codec-mclk1, codec-mclk2,
+      dsp-clkin, psia1-mclk, psia2-mclk, spdif-mclk, codec-irq,
+      codec-reset, dsp-reset, dsp-irq, dsp-standby, codec-pdmclk1,
+      codec-pdmdat1, codec-pdmclk2, codec-pdmdat2, codec-dmicclk1,
+      codec-dmicdat1, codec-dmicclk2, codec-dmicdat2, codec-dmicclk3,
+      codec-dmicdat3, codec-dmicclk4, codec-dmicdat4, dsp-dmicclk1,
+      dsp-dmicdat1, dsp-dmicclk2, dsp-dmicdat2, dsp-uart1-rx,
+      dsp-uart1-tx, dsp-uart2-rx, dsp-uart2-tx, gf-uart2-rx,
+      gf-uart2-tx, usb-uart-rx, usb-uart-tx, i2c2-scl, i2c2-sda,
+      i2c3-scl, i2c3-sda, i2c4-scl, i2c4-sda, gpio, spdif-aif, psia1,
+      psia1-bclk, psia1-lrclk, psia1-rxdat, psia1-txdat, psia2,
+      psia2-bclk, psia2-lrclk, psia2-rxdat, psia2-txdat, codec-aif1,
+      codec-aif1-bclk, codec-aif1-lrclk, codec-aif1-rxdat,
+      codec-aif1-txdat, codec-aif2, codec-aif2-bclk, codec-aif2-lrclk,
+      codec-aif2-rxdat, codec-aif2-txdat, codec-aif3, codec-aif3-bclk,
+      codec-aif3-lrclk, codec-aif3-rxdat, codec-aif3-txdat, dsp-aif1,
+      dsp-aif1-bclk, dsp-aif1-lrclk, dsp-aif1-rxdat, dsp-aif1-txdat,
+      dsp-aif2, dsp-aif2-bclk, dsp-aif2-lrclk, dsp-aif2-rxdat,
+      dsp-aif2-txdat, gf-aif3, gf-aif3-bclk, gf-aif3-lrclk,
+      gf-aif3-rxdat, gf-aif3-txdat, gf-aif4, gf-aif4-bclk,
+      gf-aif4-lrclk, gf-aif4-rxdat, gf-aif4-txdat, gf-aif1,
+      gf-aif1-bclk, gf-aif1-lrclk, gf-aif1-rxdat, gf-aif1-txdat,
+      gf-aif2, gf-aif2-bclk, gf-aif2-lrclk, gf-aif2-rxdat,
+      gf-aif2-txdat, usb-aif1, usb-aif2, adat-aif, soundcard-aif,
+
+  - aif-master : Specifies that an AIF group will be used as a master
+    interface (either this or aif-slave is required if a group is
+    being muxed to an AIF)
+  - aif-slave : Specifies that an AIF group will be used as a slave
+    interface (either this or aif-master is required if a group is
+    being muxed to an AIF)
+
+Optional sub-nodes:
+
+  - VDDCORE : Initialisation data for the VDDCORE regulator, which
+    supplies the CODECs digital core if it has no build regulator for that
+    purpose.
+
+  - MICVDD : Initialisation data for the MICVDD regulator, which
+    supplies the CODECs MICVDD.
+  - MIC1VDD, MIC2VDD : Initialisation data for the MICxVDD supplies.
+      Optional Properties:
+      - cirrus,micbias-input : A property selecting which of the CODEC
+        minicard micbias outputs should be used, valid values are 1 - 4.
+
+  - VDD1V8 : Recommended fixed regulator for the VDD1V8 regulator, which supplies the
+    CODECs analog and 1.8V digital supplies.
+      Required Properties:
+      - compatible : Should be set to "regulator-fixed"
+      - regulator-min-microvolt : Should be set to 1.8V
+      - regulator-max-microvolt : Should be set to 1.8V
+      - regulator-boot-on
+      - regulator-always-on
+      - vin-supply : Should be set to same supply as SYSVDD
+
+Example:
+lochnagar: lochnagar@22 {
+	compatible = "cirrus,lochnagar2";
+	reg = <0x22>;
+
+	gpio-controller;
+	#gpio-cells = <2>;
+	gpio-ranges = <&lochnagar 0 0 110>;
+
+	reset-gpio = <&gpio0 55 0>;
+	present-gpio = <&gpio0 60 0>;
+
+	#clock-cells = <1>;
+
+	clocks = <&clk_audio>;
+	clock-names = "ln-gf-mclk2";
+
+	assigned-clocks = <&lochnagar LOCHNAGAR_CDC_MCLK1>,
+			  <&lochnagar LOCHNAGAR_CDC_MCLK2>;
+	assigned-clock-parents = <&clk_audio>,
+				 <&lochnagar LOCHNAGAR_PMIC_32K>;
+
+	SYSVDD-supply = <&wallvdd>;
+
+	pinctrl-names = "default";
+	pinctrl-0 = <&pin_settings>;
+
+	pin_settings: pin_settings {
+		ap_aif {
+			aif-slave;
+			groups = "gf-aif1";
+			function = "codec-aif3";
+		};
+		codec_aif {
+			aif-master;
+			groups = "codec-aif3";
+			function = "gf-aif1";
+		};
+	};
+
+	lochnagar_micvdd: MICVDD {
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+	};
+
+	lochnagar_vdd1v8: VDD1V8 {
+		compatible = "regulator-fixed";
+
+		regulator-name = "VDD1V8";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		regulator-boot-on;
+		regulator-always-on;
+
+		vin-supply = <&wallvdd>;
+	};
+};
Signature · 1 line
2.11.0
maintainer
#7 lore raw
In reply to Charles Keepax
Quoted 6 lines · Charles Keepax

From: Charles Keepax <[email protected]>

Lochnagar is an evaluation and development board for Cirrus Logic Smart CODEC and Amp devices. It allows the connection of most Cirrus Logic devices on mini-cards, as well as allowing connection of various application processor systems to provide a

Copying Linus who's been working on improving support for plugin modules recently, he has some patches out for review at the minute adding a framework for such modules.

#8 lore raw
In reply to Charles Keepax
Quoted 10 lines · Charles Keepax

From: Charles Keepax <[email protected]>

Lochnagar is an evaluation and development board for Cirrus Logic Smart CODEC and Amp devices. It allows the connection of most Cirrus Logic devices on mini-cards, as well as allowing connection of various application processor systems to provide a full evaluation platform. Audio system topology, clocking and power can all be controlled through the Lochnagar, allowing the device under test to be used in a variety of possible use cases.

Quoted 7 lines

As the Lochnagar is a fairly complex device this MFD driver allows the drivers for the various features to be bound in. Initially clocking, regulator and pinctrl will be added as these are necessary to configure the system. But in time at least audio and voltage/current monitoring will also be added.

It's a bit confusing, maybe you can clear it up:
it appears to be an I2C device, so when you say this is a "development board" is there something like a board controller that is accessed over I2C and this is what the driver really probes to, not the board per se?

I guess jamming this card into the I2C slot of any other system (would work fine with a 96Boards LS connector as it seems, actually) also involves connecting some I2S or similar on the side for high-datarate traffic?

This driver seems to only concern itself with the I2C board controller per se, not the board is that right?

Yours,
Linus Walleij

author maintainer
#9 lore raw
Quoted 27 lines · Linus Walleij
Quoted 10 lines · Charles Keepax

From: Charles Keepax <[email protected]>

Lochnagar is an evaluation and development board for Cirrus Logic Smart CODEC and Amp devices. It allows the connection of most Cirrus Logic devices on mini-cards, as well as allowing connection of various application processor systems to provide a full evaluation platform. Audio system topology, clocking and power can all be controlled through the Lochnagar, allowing the device under test to be used in a variety of possible use cases.

Quoted 7 lines

As the Lochnagar is a fairly complex device this MFD driver allows the drivers for the various features to be bound in. Initially clocking, regulator and pinctrl will be added as these are necessary to configure the system. But in time at least audio and voltage/current monitoring will also be added.

It's a bit confusing, maybe you can clear it up:
it appears to be an I2C device, so when you say this is a "development board" is there something like a board controller that is accessed over I2C and this is what the driver really probes to, not the board per se?

Quoted 8 lines

I guess jamming this card into the I2C slot of any other system (would work fine with a 96Boards LS connector as it seems, actually) also involves connecting some I2S or similar on the side for high-datarate traffic?

This driver seems to only concern itself with the I2C board controller per se, not the board is that right?

Yeah I have poorly phrased that, these patches are very much just dealing with the board controller chip.

You could connect just the I2C to something like the 96Boards LS connector, and control all the functionality accessed by this driver. Although if you want to send audio between your 96Boards device and the Lochnagar you would need to connect up some I2S as well.

Thanks,
Charles

maintainer
#10 lore raw
Quoted 33 lines · Charles Keepax
Quoted 32 lines · Linus Walleij
Quoted 10 lines · Charles Keepax

From: Charles Keepax <[email protected]>

Lochnagar is an evaluation and development board for Cirrus Logic Smart CODEC and Amp devices. It allows the connection of most Cirrus Logic devices on mini-cards, as well as allowing connection of various application processor systems to provide a full evaluation platform. Audio system topology, clocking and power can all be controlled through the Lochnagar, allowing the device under test to be used in a variety of possible use cases.

Quoted 7 lines

As the Lochnagar is a fairly complex device this MFD driver allows the drivers for the various features to be bound in. Initially clocking, regulator and pinctrl will be added as these are necessary to configure the system. But in time at least audio and voltage/current monitoring will also be added.

It's a bit confusing, maybe you can clear it up:
it appears to be an I2C device, so when you say this is a "development board" is there something like a board controller that is accessed over I2C and this is what the driver really probes to, not the board per se?

I guess jamming this card into the I2C slot of any other system (would work fine with a 96Boards LS connector as it seems, actually) also involves connecting some I2S or similar on the side for high-datarate traffic?

Quoted 6 lines
Quoted 3 lines

This driver seems to only concern itself with the I2C board controller per se, not the board is that right?

Yeah I have poorly phrased that, these patches are very much just dealing with the board controller chip.

How would the codec I2C connect to the host? Is there one I2C bus or 2? The binding looks mostly fine to me, but I think we need to understand that part.

Quoted 9 lines

You could connect just the I2C to something like the 96Boards LS connector, and control all the functionality accessed by this driver. Although if you want to send audio between your 96Boards device and the Lochnagar you would need to connect up some I2S as well.

Thanks,
Charles

author maintainer
#11 lore raw
Quoted 19 lines · Rob Herring
Quoted 18 lines · Charles Keepax
Quoted 16 lines · Linus Walleij

On Wed, Sep 5, 2018 at 12:41 PM Charles Keepax <[email protected]> wrote:
It's a bit confusing, maybe you can clear it up:
it appears to be an I2C device, so when you say this is a "development board" is there something like a board controller that is accessed over I2C and this is what the driver really probes to, not the board per se?

I guess jamming this card into the I2C slot of any other system (would work fine with a 96Boards LS connector as it seems, actually) also involves connecting some I2S or similar on the side for high-datarate traffic?

This driver seems to only concern itself with the I2C board controller per se, not the board is that right?

Quoted 7 lines
Quoted 2 lines

Yeah I have poorly phrased that, these patches are very much just dealing with the board controller chip.

How would the codec I2C connect to the host? Is there one I2C bus or 2? The binding looks mostly fine to me, but I think we need to understand that part.

If the CODEC is I2C based then both the CODEC and the controller IC will be on the same I2C bus. If the CODEC is connected over SPI that is obviously a separate bus as the board controller chip is I2C only.

There are some additional I2C interfaces but they are not currently used on any mini-cards, and they are intended for secondary purposes not control of the CODEC itself.

Thanks,
Charles

#12 lore raw
In reply to Charles Keepax
I love your patch! Yet something to improve:

Hi Charles,

I love your patch! Yet something to improve:

[auto build test ERROR on ljones-mfd/for-mfd-next]
[also build test ERROR on v4.19-rc2 next-20180906]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Charles-Keepax/mfd-lochnagar-Add-support-for-the-Cirrus-Logic-Lochnagar/20180907-010308
base:   https://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git for-mfd-next
config: alpha-allmodconfig (attached as .config)
compiler: alpha-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0

reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=7.2.0 make.cross ARCH=alpha

All errors (new ones prefixed by >>):

drivers/mfd/lochnagar-i2c.o: In function `lochnagar_i2c_probe':

>> (.text+0x4ec): undefined reference to `__devm_regmap_init_i2c'
   (.text+0x500): undefined reference to `__devm_regmap_init_i2c'
   drivers/mfd/lochnagar-i2c.o: In function `lochnagar_i2c_init':
>> (.init.text+0x10): undefined reference to `i2c_register_driver'

(.init.text+0x24): undefined reference to `i2c_register_driver'

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation

author maintainer
#13 lore raw
Quoted 18 lines · kbuild test robot

Hi Charles,

I love your patch! Yet something to improve:

[auto build test ERROR on ljones-mfd/for-mfd-next]
[also build test ERROR on v4.19-rc2 next-20180906]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Charles-Keepax/mfd-lochnagar-Add-support-for-the-Cirrus-Logic-Lochnagar/20180907-010308
base:   https://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd.git for-mfd-next
config: alpha-allmodconfig (attached as .config)
compiler: alpha-linux-gnu-gcc (Debian 7.2.0-11) 7.2.0

reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=7.2.0 make.cross ARCH=alpha

Quoted 5 lines

All errors (new ones prefixed by >>):

drivers/mfd/lochnagar-i2c.o: In function `lochnagar_i2c_probe':

Quoted 1 line
Quoted 1 line

(.text+0x4ec): undefined reference to `__devm_regmap_init_i2c'

(.text+0x500): undefined reference to `__devm_regmap_init_i2c'

Sorry seems I am missing a select REGMAP_I2C in the Kconfig will fix up for v2 after any other comments.

Quoted 3 lines

drivers/mfd/lochnagar-i2c.o: In function `lochnagar_i2c_init':

Quoted 1 line
Quoted 1 line

(.init.text+0x10): undefined reference to `i2c_register_driver'

(.init.text+0x24): undefined reference to `i2c_register_driver'

Not sure what is causing this one there is a depends on I2C in there will have a look and see if I can figure that out.

Thanks,
Charles