Skip to contentSkip to conversation

ASoC: cs35l36: Add support for Cirrus CS35L36 Amplifier

PATCH Superseded James Schulman 2 participants 3 messages Feb 6, 2019 – Feb 7, 2019

Subsystems (3)

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 ASoC: cs35l36: Add support for Cirrus CS35L36 Amplifier

Add driver support for Cirrus Logic CS35L36 boosted speaker amplifier

---
 include/sound/cs35l36.h    |   43 +
 sound/soc/codecs/Kconfig   |    5 +
 sound/soc/codecs/Makefile  |    2 +
 sound/soc/codecs/cs35l36.c | 1960 ++++++++++++++++++++++++++++++++++++++++++++
 sound/soc/codecs/cs35l36.h |  446 ++++++++++
 5 files changed, 2456 insertions(+)
 create mode 100644 include/sound/cs35l36.h
 create mode 100644 sound/soc/codecs/cs35l36.c
 create mode 100644 sound/soc/codecs/cs35l36.h
include/sound/cs35l36.h new file +43 -0
new file mode 100644
index 0000000..f1cf121
@@ -0,0 +1,43 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * linux/sound/cs35l36.h -- Platform data for CS35L36
+ *
+ * Copyright 2018 Cirrus Logic, Inc.
+ *
+ * Author: James Schulman <[email protected]>
+ *
+ */
+
+#ifndef __CS35L36_H
+#define __CS35L36_H
+
+struct cs35l36_vpbr_cfg {
+	bool is_present;
+	bool vpbr_en;
+	int vpbr_thld;
+	int vpbr_atk_rate;
+	int vpbr_atk_vol;
+	int vpbr_max_attn;
+	int vpbr_wait;
+	int vpbr_rel_rate;
+	int vpbr_mute_en;
+};
+
+struct cs35l36_platform_data {
+	bool multi_amp_mode;
+	bool dcm_mode;
+	bool amp_pcm_inv;
+	bool imon_pol_inv;
+	bool vmon_pol_inv;
+	int boost_ind;
+	int bst_vctl;
+	int bst_vctl_sel;
+	int bst_ipk;
+	bool extern_boost;
+	int temp_warn_thld;
+	int irq_drv_sel;
+	int irq_gpio_sel;
+	struct cs35l36_vpbr_cfg vpbr_config;
+};
+
+#endif /* __CS35L36_H */
sound/soc/codecs/Kconfig +5 -0
index a15710c..3946222 100644
@@ -55,6 +55,7 @@ config SND_SOC_ALL_CODECS
 	select SND_SOC_CS35L33 if I2C
 	select SND_SOC_CS35L34 if I2C
 	select SND_SOC_CS35L35 if I2C
+	select SND_SOC_CS35L36 if I2C
 	select SND_SOC_CS42L42 if I2C
 	select SND_SOC_CS42L51_I2C if I2C
 	select SND_SOC_CS42L52 if I2C && INPUT
@@ -483,6 +484,10 @@ config SND_SOC_CS35L35
 	tristate "Cirrus Logic CS35L35 CODEC"
 	depends on I2C
 
+config SND_SOC_CS35L36
+	tristate "Cirrus Logic CS35L36 CODEC"
+	depends on I2C
+
 config SND_SOC_CS42L42
 	tristate "Cirrus Logic CS42L42 CODEC"
 	depends on I2C
sound/soc/codecs/Makefile +2 -0
index 3d7a597..427b180 100644
@@ -47,6 +47,7 @@ snd-soc-cs35l32-objs := cs35l32.o
 snd-soc-cs35l33-objs := cs35l33.o
 snd-soc-cs35l34-objs := cs35l34.o
 snd-soc-cs35l35-objs := cs35l35.o
+snd-soc-cs35l36-objs := cs35l36.o
 snd-soc-cs42l42-objs := cs42l42.o
 snd-soc-cs42l51-objs := cs42l51.o
 snd-soc-cs42l51-i2c-objs := cs42l51-i2c.o
@@ -318,6 +319,7 @@ obj-$(CONFIG_SND_SOC_CS35L32)	+= snd-soc-cs35l32.o
 obj-$(CONFIG_SND_SOC_CS35L33)	+= snd-soc-cs35l33.o
 obj-$(CONFIG_SND_SOC_CS35L34)	+= snd-soc-cs35l34.o
 obj-$(CONFIG_SND_SOC_CS35L35)	+= snd-soc-cs35l35.o
+obj-$(CONFIG_SND_SOC_CS35L36)	+= snd-soc-cs35l36.o
 obj-$(CONFIG_SND_SOC_CS42L42)	+= snd-soc-cs42l42.o
 obj-$(CONFIG_SND_SOC_CS42L51)	+= snd-soc-cs42l51.o
 obj-$(CONFIG_SND_SOC_CS42L51_I2C)	+= snd-soc-cs42l51-i2c.o
sound/soc/codecs/cs35l36.c new file +1960 -0

1,960 lines not on this page · raw message

sound/soc/codecs/cs35l36.h new file +446 -0

446 lines not on this page · raw message

Signature · 1 line
1.9.1
#1 lore raw
Quoted 23 lines · James Schulman

Add driver support for Cirrus Logic CS35L36 boosted speaker amplifier

---
 include/sound/cs35l36.h    |   43 +
 sound/soc/codecs/Kconfig   |    5 +
 sound/soc/codecs/Makefile  |    2 +
 sound/soc/codecs/cs35l36.c | 1960 ++++++++++++++++++++++++++++++++++++++++++++
 sound/soc/codecs/cs35l36.h |  446 ++++++++++
 5 files changed, 2456 insertions(+)
 create mode 100644 include/sound/cs35l36.h
 create mode 100644 sound/soc/codecs/cs35l36.c
 create mode 100644 sound/soc/codecs/cs35l36.h
include/sound/cs35l36.h new file +0 -0
new file mode 100644
index 0000000..f1cf121

include/sound/cs35l36.h line 9

Quoted 9 lines
include/sound/cs35l36.h new file +9 -0
@@ -0,0 +1,43 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * linux/sound/cs35l36.h -- Platform data for CS35L36
+ *
+ * Copyright 2018 Cirrus Logic, Inc.
+ *
+ * Author: James Schulman <[email protected]>
+ *
+ */

This isn't quite right you should still be using /* */ for the SPDX in header files.

Quoted 6 lines
sound/soc/codecs/cs35l36.c new file +0 -0
new file mode 100644
index 0000000..261bc0b

sound/soc/codecs/cs35l36.c line 9

Quoted 9 lines
sound/soc/codecs/cs35l36.c new file +9 -0
@@ -0,0 +1,1960 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * cs35l36.c -- CS35L36 ALSA SoC audio driver
+ *
+ * Copyright 2018 Cirrus Logic, Inc.
+ *
+ * Author: James Schulman <[email protected]>
+ *
+ */

And Mark will have wanted all of this as a C++ comment.

See this patch for a good example of the advised style:

commit ba34f253711a8427d2ef29475afe406b2d6e5118
ASoC: nau8822: convert to SPDX identifiers

Thanks,
Charles

#2 lore raw
Quoted 28 lines · Charles Keepax
Quoted 27 lines · James Schulman

Add driver support for Cirrus Logic CS35L36 boosted speaker amplifier

---
 include/sound/cs35l36.h    |   43 +
 sound/soc/codecs/Kconfig   |    5 +
 sound/soc/codecs/Makefile  |    2 +
 sound/soc/codecs/cs35l36.c | 1960 ++++++++++++++++++++++++++++++++++++++++++++
 sound/soc/codecs/cs35l36.h |  446 ++++++++++
 5 files changed, 2456 insertions(+)
 create mode 100644 include/sound/cs35l36.h
 create mode 100644 sound/soc/codecs/cs35l36.c
 create mode 100644 sound/soc/codecs/cs35l36.h
include/sound/cs35l36.h new file +4 -0
new file mode 100644
index 0000000..f1cf121
@@ -0,0 +1,43 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * linux/sound/cs35l36.h -- Platform data for CS35L36
+ *
Quoted 9 lines

include/sound/cs35l36.h line 9

Quoted 5 lines
include/sound/cs35l36.h new file +5 -0
+ * Copyright 2018 Cirrus Logic, Inc.
+ *
+ * Author: James Schulman <[email protected]>
+ *
+ */

This isn't quite right you should still be using /* */ for the SPDX in header files.

Ok I see. Apologies for the confusion. I misread Mark's feedback.

Quoted 18 lines
Quoted 6 lines
sound/soc/codecs/cs35l36.c new file +0 -0
new file mode 100644
index 0000000..261bc0b

sound/soc/codecs/cs35l36.c line 9

Quoted 9 lines
sound/soc/codecs/cs35l36.c new file +9 -0
@@ -0,0 +1,1960 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * cs35l36.c -- CS35L36 ALSA SoC audio driver
+ *
+ * Copyright 2018 Cirrus Logic, Inc.
+ *
+ * Author: James Schulman <[email protected]>
+ *
+ */

And Mark will have wanted all of this as a C++ comment.

Quoted 8 lines

See this patch for a good example of the advised style:

commit ba34f253711a8427d2ef29475afe406b2d6e5118
ASoC: nau8822: convert to SPDX identifiers

Thanks,
Charles

Thanks Charles I'll get this cleared up.

Regards,
James