Unverified Commit 98fda42a authored by Mark Brown's avatar Mark Brown
Browse files

ASoC: cs42l42: Add SoundWire support

Merge series from Stefan Binding <sbinding@opensource.cirrus.com>:

The CS42L42 has a SoundWire interface for control and audio. This
chain of patches adds support for this.

Patches #1 .. #5 split out various changes to the existing code that
are needed for adding Soundwire. These are mostly around clocking and
supporting the separate probe and enumeration stages in SoundWire.

Patches #6 .. #8 actually adds the SoundWire handling.
parents 6570befb 16838bfb
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -469,7 +469,7 @@ static int sdw_prep_deprep_slave_ports(struct sdw_bus *bus,
	}

	/* Inform slave about the impending port prepare */
	sdw_do_port_prep(s_rt, prep_ch, SDW_OPS_PORT_PRE_PREP);
	sdw_do_port_prep(s_rt, prep_ch, prep ? SDW_OPS_PORT_PRE_PREP : SDW_OPS_PORT_PRE_DEPREP);

	/* Prepare Slave port implementing CP_SM */
	if (!dpn_prop->simple_ch_prep_sm) {
@@ -501,7 +501,7 @@ static int sdw_prep_deprep_slave_ports(struct sdw_bus *bus,
	}

	/* Inform slaves about ports prepared */
	sdw_do_port_prep(s_rt, prep_ch, SDW_OPS_PORT_POST_PREP);
	sdw_do_port_prep(s_rt, prep_ch, prep ? SDW_OPS_PORT_POST_PREP : SDW_OPS_PORT_POST_DEPREP);

	/* Disable interrupt after Port de-prepare */
	if (!prep && intr)
+5 −3
Original line number Diff line number Diff line
@@ -566,13 +566,15 @@ struct sdw_prepare_ch {
 * enum sdw_port_prep_ops: Prepare operations for Data Port
 *
 * @SDW_OPS_PORT_PRE_PREP: Pre prepare operation for the Port
 * @SDW_OPS_PORT_PREP: Prepare operation for the Port
 * @SDW_OPS_PORT_PRE_DEPREP: Pre deprepare operation for the Port
 * @SDW_OPS_PORT_POST_PREP: Post prepare operation for the Port
 * @SDW_OPS_PORT_POST_DEPREP: Post deprepare operation for the Port
 */
enum sdw_port_prep_ops {
	SDW_OPS_PORT_PRE_PREP = 0,
	SDW_OPS_PORT_PREP = 1,
	SDW_OPS_PORT_POST_PREP = 2,
	SDW_OPS_PORT_PRE_DEPREP,
	SDW_OPS_PORT_POST_PREP,
	SDW_OPS_PORT_POST_DEPREP,
};

/**
+5 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@
#define CS42L42_PAGE_24		0x2400
#define CS42L42_PAGE_25		0x2500
#define CS42L42_PAGE_26		0x2600
#define CS42L42_PAGE_27		0x2700
#define CS42L42_PAGE_28		0x2800
#define CS42L42_PAGE_29		0x2900
#define CS42L42_PAGE_2A		0x2A00
@@ -720,6 +721,10 @@

#define CS42L42_SRC_SDOUT_FS		(CS42L42_PAGE_26 + 0x09)

/* Page 0x27 DMA */
#define CS42L42_SOFT_RESET_REBOOT	(CS42L42_PAGE_27 + 0x01)
#define CS42L42_SFT_RST_REBOOT_MASK	BIT(1)

/* Page 0x28 S/PDIF Registers */
#define CS42L42_SPDIF_CTL1		(CS42L42_PAGE_28 + 0x01)
#define CS42L42_SPDIF_CTL2		(CS42L42_PAGE_28 + 0x02)
+8 −0
Original line number Diff line number Diff line
@@ -69,6 +69,7 @@ config SND_SOC_ALL_CODECS
	imply SND_SOC_CS35L45_I2C
	imply SND_SOC_CS35L45_SPI
	imply SND_SOC_CS42L42
	imply SND_SOC_CS42L42_SDW
	imply SND_SOC_CS42L51_I2C
	imply SND_SOC_CS42L52
	imply SND_SOC_CS42L56
@@ -722,6 +723,13 @@ config SND_SOC_CS42L42
	select REGMAP_I2C
	select SND_SOC_CS42L42_CORE

config SND_SOC_CS42L42_SDW
	tristate "Cirrus Logic CS42L42 CODEC on Soundwire"
	depends on SOUNDWIRE
	select SND_SOC_CS42L42_CORE
	help
	  Enable support for Cirrus Logic CS42L42 codec with Soundwire control

config SND_SOC_CS42L51
	tristate

+2 −0
Original line number Diff line number Diff line
@@ -69,6 +69,7 @@ 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-cs42l42-sdw-objs := cs42l42-sdw.o
snd-soc-cs42l51-objs := cs42l51.o
snd-soc-cs42l51-i2c-objs := cs42l51-i2c.o
snd-soc-cs42l52-objs := cs42l52.o
@@ -434,6 +435,7 @@ 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_CORE)	+= snd-soc-cs42l42.o
obj-$(CONFIG_SND_SOC_CS42L42)	+= snd-soc-cs42l42-i2c.o
obj-$(CONFIG_SND_SOC_CS42L42_SDW)	+= snd-soc-cs42l42-sdw.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
Loading