Skip to contentSkip to conversation

device property: Add new array helper

PATCH In review Charles Keepax 2 participants 9 messages May 28, 2019 – Jun 5, 2019

Subsystems (8)
lore
Share & tools
lore

Charles Keepax

author maintainer
#0 lore raw

PATCH 1/6 device property: Add new array helper

It is fairly common to want to read an integer array property that is composed of an unknown number of fixed size integer groups. For example, say each group consists of three values which correspond to the settings for one input on the device and the driver supports several chips with different numbers of inputs.

Add a new helper function to provide this functionality, it differs for the existing helpers in that it allows reading a smaller number of values than the full array size and checks that the number of values read is a multiple of the group size.

---
 drivers/base/property.c  | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
 include/linux/property.h |  2 ++
 2 files changed, 50 insertions(+)
drivers/base/property.c +48 -0
index 348b37e64944c..656d21e01a648 100644
@@ -133,6 +133,54 @@ int device_property_read_u32_array(struct device *dev, const char *propname,
 EXPORT_SYMBOL_GPL(device_property_read_u32_array);
 
 /**
+ * device_property_read_u32_2darray - return a 2d u32 array property of a device
+ * @dev: Device to get the property of
+ * @propname: Name of the property
+ * @val: The values are stored here or %NULL to return the number of values
+ * @nval: Size of the @val array
+ * @multiple: Number of entries in each block of data
+ *
+ * Function reads an array of u32 properties split up into fixed size
+ * sub-groups, with @propname from the device firmware description and
+ * stores them to @val if found.
+ *
+ * Return: Number of values read
+ *	   %0 if the property was not found,
+ *	   %-EINVAL if given arguments are not valid,
+ *	   %-ENODATA if the property does not have a value,
+ *	   %-EPROTO if the property is not an array of numbers,
+ *	   %-EOVERFLOW if the size of the property is not as expected.
+ *	   %-ENXIO if no suitable firmware interface is present.
+ */
+int device_property_read_u32_2darray(struct device *dev, const char *propname,
+				     u32 *val, size_t nval, int multiple)
+{
+	int n, ret;
+
+	n = device_property_read_u32_array(dev, propname, NULL, 0);
+	if (n == -EINVAL) {
+		return 0;	/* missing, ignore */
+	} else if (n < 0) {
+		dev_warn(dev, "%s malformed (%d)\n", propname, n);
+		return n;
+	} else if ((n % multiple) != 0) {
+		dev_warn(dev, "%s not a multiple of %d entries\n",
+			 propname, multiple);
+		return -EOVERFLOW;
+	}
+
+	if (n > nval)
+		n = nval;
+
+	ret = device_property_read_u32_array(dev, propname, val, n);
+	if (ret < 0)
+		return ret;
+	else
+		return n;
+}
+EXPORT_SYMBOL_GPL(device_property_read_u32_2darray);
+
+/**
  * device_property_read_u64_array - return a u64 array property of a device
  * @dev: Device to get the property of
  * @propname: Name of the property
include/linux/property.h +2 -0
index a29369c89e6ef..854867f0d139f 100644
@@ -43,6 +43,8 @@ int device_property_read_u16_array(struct device *dev, const char *propname,
 				   u16 *val, size_t nval);
 int device_property_read_u32_array(struct device *dev, const char *propname,
 				   u32 *val, size_t nval);
+int device_property_read_u32_2darray(struct device *dev, const char *propname,
+				   u32 *val, size_t nval, int multiple);
 int device_property_read_u64_array(struct device *dev, const char *propname,
 				   u64 *val, size_t nval);
 int device_property_read_string_array(struct device *dev, const char *propname,
Signature · 1 line
2.11.0
author maintainer
#1 lore raw

PATCH v2 2/6 ASoC: madera: Add DT bindings for Cirrus Logic Madera codecs

From: Richard Fitzgerald <[email protected]>

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.

---

No change since v1.

Thanks,
Charles

 Documentation/devicetree/bindings/sound/madera.txt | 67 ++++++++++++++++++++++
 MAINTAINERS                                        |  1 +
 include/dt-bindings/sound/madera.h                 | 29 ++++++++++
 3 files changed, 97 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 0000000000000..1114fcf1aa4c2
@@ -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 5cfbea4ce5750..642cb5610dd50 100644
@@ -3915,6 +3915,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 +29 -0
new file mode 100644
index 0000000000000..9ff4eae5259b0
@@ -0,0 +1,29 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+/*
+ * Device Tree defines for Madera codecs
+ *
+ * Copyright (C) 2016-2017 Cirrus Logic, Inc. and
+ *                         Cirrus Logic International Semiconductor Ltd.
+ *
+ * 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
2.11.0
author maintainer
#2 lore raw

PATCH v2 3/6 ASoC: madera: Add common support for Cirrus Logic Madera codecs

In reply to Charles Keepax

From: Richard Fitzgerald <[email protected]>

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.

This patch also adds the pdata to the parent mfd pdata struct. Since there is a circular build dependency it's convenient to patch them both atomically.

---

Changes since v1:
- Improve error message in madera_spin_sysclk
- Handle spurious over temperature events
- Factor out generic OF helper function for array reads
- Rename destory functions to free
- Add spaces in madera_dfc_width_text

Thanks,
Charles

 MAINTAINERS                      |    4 +
 include/linux/mfd/madera/pdata.h |    4 +
 include/sound/madera-pdata.h     |   63 +
 sound/soc/codecs/Kconfig         |    5 +
 sound/soc/codecs/Makefile        |    2 +
 sound/soc/codecs/madera.c        | 4435 ++++++++++++++++++++++++++++++++++++++
 sound/soc/codecs/madera.h        |  445 ++++
 7 files changed, 4958 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 642cb5610dd50..793dbe7e57897 100644
@@ -3915,14 +3915,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*
 
 CLANG-FORMAT FILE
 M:	Miguel Ojeda <[email protected]>
include/linux/mfd/madera/pdata.h +4 -0
index 8dc852402dbb1..60cd8ec985637 100644
@@ -16,6 +16,7 @@
 #include <linux/regulator/arizona-ldo1.h>
 #include <linux/regulator/arizona-micsupp.h>
 #include <linux/regulator/machine.h>
+#include <sound/madera-pdata.h>
 
 #define MADERA_MAX_MICBIAS		4
 #define MADERA_MAX_CHILD_MICBIAS	4
@@ -39,6 +40,7 @@ struct madera_codec_pdata;
  * @gpsw:	    General purpose switch mode setting. Depends on the external
  *		    hardware connected to the switch. (See the SW1_MODE field
  *		    in the datasheet for the available values for your codec)
+ * @codec:	    Substruct of pdata for the ASoC codec driver
  */
 struct madera_pdata {
 	struct gpio_desc *reset;
@@ -53,6 +55,8 @@ struct madera_pdata {
 	int n_gpio_configs;
 
 	u32 gpsw[MADERA_MAX_GPSW];
+
+	struct madera_codec_pdata codec;
 };
 
 #endif
include/sound/madera-pdata.h new file +63 -0

63 lines not on this page · raw message

sound/soc/codecs/Kconfig +5 -0
index 472bde124ebec..4b1bd3bb8eda4 100644
@@ -283,10 +283,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
@@ -703,6 +705,9 @@ config SND_SOC_LOCHNAGAR_SC
 	  This driver support the sound card functionality of the Cirrus
 	  Logic Lochnagar audio development board.
 
+config SND_SOC_MADERA
+	tristate
+
 config SND_SOC_MAX98088
 	tristate "Maxim MAX98088/9 Low-Power, Stereo Audio Codec"
 	depends on I2C
sound/soc/codecs/Makefile +2 -0
index 454b8087a5bdd..2a39ddbaccba1 100644
@@ -93,6 +93,7 @@ snd-soc-l3-objs := l3.o
 snd-soc-lm4857-objs := lm4857.o
 snd-soc-lm49453-objs := lm49453.o
 snd-soc-lochnagar-sc-objs := lochnagar-sc.o
+snd-soc-madera-objs := madera.o
 snd-soc-max9759-objs := max9759.o
 snd-soc-max9768-objs := max9768.o
 snd-soc-max98088-objs := max98088.o
@@ -368,6 +369,7 @@ 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_LOCHNAGAR_SC)	+= snd-soc-lochnagar-sc.o
+obj-$(CONFIG_SND_SOC_MADERA)	+= snd-soc-madera.o
 obj-$(CONFIG_SND_SOC_MAX9759)	+= snd-soc-max9759.o
 obj-$(CONFIG_SND_SOC_MAX9768)	+= snd-soc-max9768.o
 obj-$(CONFIG_SND_SOC_MAX98088)	+= snd-soc-max98088.o
sound/soc/codecs/madera.c new file +4435 -0

2,862 lines not on this page · raw message

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

445 lines not on this page · raw message

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

Signature · 1 line
2.11.0

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

author maintainer
#3 lore raw

Re: [PATCH v2 3/6] ASoC: madera: Add common support for Cirrus Logic Madera codecs

Quoted 18 lines · Charles Keepax

From: Richard Fitzgerald <[email protected]>

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.

This patch also adds the pdata to the parent mfd pdata struct. Since there is a circular build dependency it's convenient to patch them both atomically.

---

sound/soc/codecs/madera.c line 586

Quoted 3 lines
sound/soc/codecs/madera.c new file +3 -0
+static int madera_inmux_put(struct snd_kcontrol *kcontrol,
+			    struct snd_ctl_elem_value *ucontrol)
+{

Looks like there are still some issues with the inmux handling here, afraid I will probably need to do a v3 to fix them up.

Thanks,
Charles

author maintainer
#4 lore raw

PATCH v2 4/6 ASoC: cs47l35: Add codec driver for Cirrus Logic CS47L35

In reply to Charles Keepax

From: Richard Fitzgerald <[email protected]>

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

---

Changes since v1:
- Rename destroy functions to free

Thanks,
Charles

 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 4b1bd3bb8eda4..a5f631c1cc2ae 100644
@@ -70,6 +70,7 @@ config SND_SOC_ALL_CODECS
 	select SND_SOC_CS4341 if SND_SOC_I2C_AND_SPI
 	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_CX2072X if I2C
@@ -578,6 +579,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"
@@ -707,6 +711,8 @@ config SND_SOC_LOCHNAGAR_SC
 
 config SND_SOC_MADERA
 	tristate
+	default y if SND_SOC_CS47L35=y
+	default m if SND_SOC_CS47L35=m
 
 config SND_SOC_MAX98088
 	tristate "Maxim MAX98088/9 Low-Power, Stereo Audio Codec"
sound/soc/codecs/Makefile +2 -0
index 2a39ddbaccba1..b275b8b600eed 100644
@@ -65,6 +65,7 @@ snd-soc-cs43130-objs := cs43130.o
 snd-soc-cs4341-objs := cs4341.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-cx2072x-objs := cx2072x.o
@@ -341,6 +342,7 @@ obj-$(CONFIG_SND_SOC_CS43130)   += snd-soc-cs43130.o
 obj-$(CONFIG_SND_SOC_CS4341)	+= snd-soc-cs4341.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_CX2072X)	+= snd-soc-cx2072x.o
sound/soc/codecs/cs47l35.c new file +1748 -0

1,748 lines not on this page · raw message

Signature · 1 line
2.11.0
author maintainer
#5 lore raw

PATCH v2 5/6 ASoC: cs47l85: Add codec driver for Cirrus Logic CS47L85

In reply to Charles Keepax

From: Richard Fitzgerald <[email protected]>

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

---

Changes since v1:
- Rename destroy functions to free

Thanks,
Charles

 sound/soc/codecs/Kconfig   |    6 +
 sound/soc/codecs/Makefile  |    2 +
 sound/soc/codecs/cs47l85.c | 2686 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 2694 insertions(+)
 create mode 100644 sound/soc/codecs/cs47l85.c
sound/soc/codecs/Kconfig +6 -0
index a5f631c1cc2ae..ff0faeabc9aca 100644
@@ -71,6 +71,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_CX2072X if I2C
@@ -582,6 +583,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"
@@ -712,7 +716,9 @@ config SND_SOC_LOCHNAGAR_SC
 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 "Maxim MAX98088/9 Low-Power, Stereo Audio Codec"
sound/soc/codecs/Makefile +2 -0
index b275b8b600eed..cc8dcafda4b77 100644
@@ -66,6 +66,7 @@ snd-soc-cs4341-objs := cs4341.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-cx2072x-objs := cx2072x.o
@@ -343,6 +344,7 @@ obj-$(CONFIG_SND_SOC_CS4341)	+= snd-soc-cs4341.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_CX2072X)	+= snd-soc-cx2072x.o
sound/soc/codecs/cs47l85.c new file +2686 -0

2,686 lines not on this page · raw message

Signature · 1 line
2.11.0
author maintainer
#6 lore raw

PATCH v2 6/6 ASoC: cs47l90: Add codec driver for Cirrus Logic CS47L90

In reply to Charles Keepax

From: Richard Fitzgerald <[email protected]>

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

---

Changes since v1:
- Rename destroy functions to free

Thanks,
Charles

 sound/soc/codecs/Kconfig   |    6 +
 sound/soc/codecs/Makefile  |    2 +
 sound/soc/codecs/cs47l90.c | 2624 ++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 2632 insertions(+)
 create mode 100644 sound/soc/codecs/cs47l90.c
sound/soc/codecs/Kconfig +6 -0
index ff0faeabc9aca..6d973ab76a87c 100644
@@ -72,6 +72,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_CX2072X if I2C
@@ -586,6 +587,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"
@@ -717,8 +721,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 "Maxim MAX98088/9 Low-Power, Stereo Audio Codec"
sound/soc/codecs/Makefile +2 -0
index cc8dcafda4b77..1934c4ee5b10b 100644
@@ -67,6 +67,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-cx2072x-objs := cx2072x.o
@@ -345,6 +346,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_CX2072X)	+= snd-soc-cx2072x.o
sound/soc/codecs/cs47l90.c new file +2624 -0

2,624 lines not on this page · raw message

Signature · 1 line
2.11.0
#7 lore raw
In reply to Charles Keepax
Quoted 8 lines · Charles Keepax

It is fairly common to want to read an integer array property that is composed of an unknown number of fixed size integer groups. For example, say each group consists of three values which correspond to the settings for one input on the device and the driver supports several chips with different numbers of inputs.

Quoted 4 lines

Add a new helper function to provide this functionality, it differs for the existing helpers in that it allows reading a smaller number of values than the full array size and checks that the number of values read is a multiple of the group size.

As a rule, you need also CC all of the device property framework changes to [email protected], so please resend the series with that taken into account.

Thanks!

author maintainer
#8 lore raw
Quoted 10 lines · Rafael J. Wysocki
Quoted 8 lines · Charles Keepax

It is fairly common to want to read an integer array property that is composed of an unknown number of fixed size integer groups. For example, say each group consists of three values which correspond to the settings for one input on the device and the driver supports several chips with different numbers of inputs.

Quoted 9 lines
Quoted 4 lines

Add a new helper function to provide this functionality, it differs for the existing helpers in that it allows reading a smaller number of values than the full array size and checks that the number of values read is a multiple of the group size.

As a rule, you need also CC all of the device property framework changes to [email protected], so please resend the series with that taken into account.

Sorry will resend with them included.

Thanks,
Charles