Unverified Commit 9f27530a authored by Mark Brown's avatar Mark Brown
Browse files

Support for CS42L83 on Apple machines

Merge series from Martin Povišer <povik+lin@cutebit.org>:

there's a CS42L83 headphone jack codec found in Apple computers (in the
recent 'Apple Silicon' ones as well as in earlier models, one example
[1]). The part isn't publicly documented, but it appears almost
identical to CS42L42, for which we have a driver in kernel. This series
adapts the CS42L42 driver to the new part, and makes one change in
anticipation of a machine driver for the Apple computers.

Patch 1 adds new compatible to the cs42l42 schema.

Patches 2 to 7 are taken from Richard's recent series [2] adding
soundwire support to cs42l42. They are useful refactorings to build on
in the later patches, and also this way our work doesn't diverge.
(I fixed missing free_irq path in cs42l42_init, did
 s/Soundwire/SoundWire/ in changelogs, rebased.)

Patch 8 exports some regmap-related symbols from cs42l42.c so they can
be used to create cs42l83 regmap in cs42l83-i2c.c later.

Patch 9 is the cs42l83 support proper.

Patch 10 implements 'set_bclk_ratio' on the cs42l42 core. This will be
called by the upcoming ASoC machine driver for 'Apple Silicon' Macs.
(We have touched on this change to be made in earlier discussion, see
 [3] and replies.)

Patch 11 brings cs42l42-i2c.c in sync with cs42l83-i2c.c on
dev_err_probe() usage.
parents 3c193b5f ac088c31
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ properties:
  compatible:
    enum:
      - cirrus,cs42l42
      - cirrus,cs42l83

  reg:
    description:
+1 −0
Original line number Diff line number Diff line
@@ -1913,6 +1913,7 @@ L: alsa-devel@alsa-project.org (moderated for non-subscribers)
S:	Maintained
F:	Documentation/devicetree/bindings/sound/apple,*
F:	sound/soc/apple/*
F:	sound/soc/codecs/cs42l83-i2c.c
ARM/ARTPEC MACHINE SUPPORT
M:	Jesper Nilsson <jesper.nilsson@axis.com>
+1 −0
Original line number Diff line number Diff line
@@ -40,6 +40,7 @@
#define CS42L42_PAGE_30		0x3000

#define CS42L42_CHIP_ID		0x42A42
#define CS42L83_CHIP_ID		0x42A83

/* Page 0x10 Global Registers */
#define CS42L42_DEVID_AB		(CS42L42_PAGE_10 + 0x01)
+14 −1
Original line number Diff line number Diff line
@@ -692,9 +692,15 @@ config SND_SOC_CS35L45_I2C
	  Enable support for Cirrus Logic CS35L45 smart speaker amplifier
	  with I2C control.

config SND_SOC_CS42L42_CORE
	tristate

config SND_SOC_CS42L42
	tristate "Cirrus Logic CS42L42 CODEC"
	tristate "Cirrus Logic CS42L42 CODEC (I2C)"
	depends on I2C
	select REGMAP
	select REGMAP_I2C
	select SND_SOC_CS42L42_CORE

config SND_SOC_CS42L51
	tristate
@@ -716,6 +722,13 @@ config SND_SOC_CS42L73
	tristate "Cirrus Logic CS42L73 CODEC"
	depends on I2C

config SND_SOC_CS42L83
	tristate "Cirrus Logic CS42L83 CODEC"
	depends on I2C
	select REGMAP
	select REGMAP_I2C
	select SND_SOC_CS42L42_CORE

config SND_SOC_CS4234
	tristate "Cirrus Logic CS4234 CODEC"
	depends on I2C
+5 −1
Original line number Diff line number Diff line
@@ -65,11 +65,13 @@ snd-soc-cs35l45-objs := cs35l45.o
snd-soc-cs35l45-spi-objs := cs35l45-spi.o
snd-soc-cs35l45-i2c-objs := cs35l45-i2c.o
snd-soc-cs42l42-objs := cs42l42.o
snd-soc-cs42l42-i2c-objs := cs42l42-i2c.o
snd-soc-cs42l51-objs := cs42l51.o
snd-soc-cs42l51-i2c-objs := cs42l51-i2c.o
snd-soc-cs42l52-objs := cs42l52.o
snd-soc-cs42l56-objs := cs42l56.o
snd-soc-cs42l73-objs := cs42l73.o
snd-soc-cs42l83-i2c-objs := cs42l83-i2c.o
snd-soc-cs4234-objs := cs4234.o
snd-soc-cs4265-objs := cs4265.o
snd-soc-cs4270-objs := cs4270.o
@@ -422,12 +424,14 @@ obj-$(CONFIG_SND_SOC_CS35L45_TABLES) += snd-soc-cs35l45-tables.o
obj-$(CONFIG_SND_SOC_CS35L45)	+= snd-soc-cs35l45.o
obj-$(CONFIG_SND_SOC_CS35L45_SPI)	+= snd-soc-cs35l45-spi.o
obj-$(CONFIG_SND_SOC_CS35L45_I2C)	+= snd-soc-cs35l45-i2c.o
obj-$(CONFIG_SND_SOC_CS42L42)	+= snd-soc-cs42l42.o
obj-$(CONFIG_SND_SOC_CS42L42_CORE)	+= snd-soc-cs42l42.o
obj-$(CONFIG_SND_SOC_CS42L42)	+= snd-soc-cs42l42-i2c.o
obj-$(CONFIG_SND_SOC_CS42L51)	+= snd-soc-cs42l51.o
obj-$(CONFIG_SND_SOC_CS42L51_I2C)	+= snd-soc-cs42l51-i2c.o
obj-$(CONFIG_SND_SOC_CS42L52)	+= snd-soc-cs42l52.o
obj-$(CONFIG_SND_SOC_CS42L56)	+= snd-soc-cs42l56.o
obj-$(CONFIG_SND_SOC_CS42L73)	+= snd-soc-cs42l73.o
obj-$(CONFIG_SND_SOC_CS42L83)	+= snd-soc-cs42l83-i2c.o
obj-$(CONFIG_SND_SOC_CS4234)	+= snd-soc-cs4234.o
obj-$(CONFIG_SND_SOC_CS4265)	+= snd-soc-cs4265.o
obj-$(CONFIG_SND_SOC_CS4270)	+= snd-soc-cs4270.o
Loading