Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 2236a28f authored by Mark Brown's avatar Mark Brown
Browse files

Merge remote-tracking branches 'asoc/topic/cpcap', 'asoc/topic/cq93vc' and...

Merge remote-tracking branches 'asoc/topic/cpcap', 'asoc/topic/cq93vc' and 'asoc/topic/cs35l32' into asoc-next
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -429,6 +429,10 @@ config SND_SOC_BD28623
config SND_SOC_BT_SCO
	tristate "Dummy BT SCO codec driver"

config SND_SOC_CPCAP
	tristate "Motorola CPCAP codec"
	depends on MFD_CPCAP

config SND_SOC_CQ0093VC
	tristate

+2 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ snd-soc-ak5558-objs := ak5558.o
snd-soc-arizona-objs := arizona.o
snd-soc-bd28623-objs := bd28623.o
snd-soc-bt-sco-objs := bt-sco.o
snd-soc-cpcap-objs := cpcap.o
snd-soc-cq93vc-objs := cq93vc.o
snd-soc-cs35l32-objs := cs35l32.o
snd-soc-cs35l33-objs := cs35l33.o
@@ -290,6 +291,7 @@ obj-$(CONFIG_SND_SOC_ARIZONA) += snd-soc-arizona.o
obj-$(CONFIG_SND_SOC_BD28623)	+= snd-soc-bd28623.o
obj-$(CONFIG_SND_SOC_BT_SCO)	+= snd-soc-bt-sco.o
obj-$(CONFIG_SND_SOC_CQ0093VC) += snd-soc-cq93vc.o
obj-$(CONFIG_SND_SOC_CPCAP)	+= snd-soc-cpcap.o
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
+1562 −0

File added.

Preview size limit exceeded, changes collapsed.

+17 −16
Original line number Diff line number Diff line
@@ -45,7 +45,7 @@ static const struct snd_kcontrol_new cq93vc_snd_controls[] = {

static int cq93vc_mute(struct snd_soc_dai *dai, int mute)
{
	struct snd_soc_codec *codec = dai->codec;
	struct snd_soc_component *component = dai->component;
	u8 reg;

	if (mute)
@@ -53,7 +53,7 @@ static int cq93vc_mute(struct snd_soc_dai *dai, int mute)
	else
		reg = 0;

	snd_soc_update_bits(codec, DAVINCI_VC_REG09, DAVINCI_VC_REG09_MUTE,
	snd_soc_component_update_bits(component, DAVINCI_VC_REG09, DAVINCI_VC_REG09_MUTE,
			    reg);

	return 0;
@@ -72,23 +72,23 @@ static int cq93vc_set_dai_sysclk(struct snd_soc_dai *codec_dai,
	return -EINVAL;
}

static int cq93vc_set_bias_level(struct snd_soc_codec *codec,
static int cq93vc_set_bias_level(struct snd_soc_component *component,
				enum snd_soc_bias_level level)
{
	switch (level) {
	case SND_SOC_BIAS_ON:
		snd_soc_write(codec, DAVINCI_VC_REG12,
		snd_soc_component_write(component, DAVINCI_VC_REG12,
			     DAVINCI_VC_REG12_POWER_ALL_ON);
		break;
	case SND_SOC_BIAS_PREPARE:
		break;
	case SND_SOC_BIAS_STANDBY:
		snd_soc_write(codec, DAVINCI_VC_REG12,
		snd_soc_component_write(component, DAVINCI_VC_REG12,
			     DAVINCI_VC_REG12_POWER_ALL_OFF);
		break;
	case SND_SOC_BIAS_OFF:
		/* force all power off */
		snd_soc_write(codec, DAVINCI_VC_REG12,
		snd_soc_component_write(component, DAVINCI_VC_REG12,
			     DAVINCI_VC_REG12_POWER_ALL_OFF);
		break;
	}
@@ -130,24 +130,25 @@ static int cq93vc_probe(struct snd_soc_component *component)
	return 0;
}

static const struct snd_soc_codec_driver soc_codec_dev_cq93vc = {
static const struct snd_soc_component_driver soc_component_dev_cq93vc = {
	.set_bias_level		= cq93vc_set_bias_level,
	.component_driver = {
	.probe			= cq93vc_probe,
	.controls		= cq93vc_snd_controls,
	.num_controls		= ARRAY_SIZE(cq93vc_snd_controls),
	},
	.idle_bias_on		= 1,
	.use_pmdown_time	= 1,
	.endianness		= 1,
	.non_legacy_dai_naming	= 1,
};

static int cq93vc_platform_probe(struct platform_device *pdev)
{
	return snd_soc_register_codec(&pdev->dev,
			&soc_codec_dev_cq93vc, &cq93vc_dai, 1);
	return devm_snd_soc_register_component(&pdev->dev,
			&soc_component_dev_cq93vc, &cq93vc_dai, 1);
}

static int cq93vc_platform_remove(struct platform_device *pdev)
{
	snd_soc_unregister_codec(&pdev->dev);
	return 0;
}

+22 −23
Original line number Diff line number Diff line
@@ -43,7 +43,7 @@ static const char *const cs35l32_supply_names[CS35L32_NUM_SUPPLIES] = {

struct  cs35l32_private {
	struct regmap *regmap;
	struct snd_soc_codec *codec;
	struct snd_soc_component *component;
	struct regulator_bulk_data supplies[CS35L32_NUM_SUPPLIES];
	struct cs35l32_platform_data pdata;
	struct gpio_desc *reset_gpio;
@@ -154,16 +154,16 @@ static const struct snd_soc_dapm_route cs35l32_audio_map[] = {

static int cs35l32_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
{
	struct snd_soc_codec *codec = codec_dai->codec;
	struct snd_soc_component *component = codec_dai->component;

	switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
	case SND_SOC_DAIFMT_CBM_CFM:
		snd_soc_update_bits(codec, CS35L32_ADSP_CTL,
		snd_soc_component_update_bits(component, CS35L32_ADSP_CTL,
				    CS35L32_ADSP_MASTER_MASK,
				CS35L32_ADSP_MASTER_MASK);
		break;
	case SND_SOC_DAIFMT_CBS_CFS:
		snd_soc_update_bits(codec, CS35L32_ADSP_CTL,
		snd_soc_component_update_bits(component, CS35L32_ADSP_CTL,
				    CS35L32_ADSP_MASTER_MASK, 0);
		break;
	default:
@@ -175,9 +175,9 @@ static int cs35l32_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)

static int cs35l32_set_tristate(struct snd_soc_dai *dai, int tristate)
{
	struct snd_soc_codec *codec = dai->codec;
	struct snd_soc_component *component = dai->component;

	return snd_soc_update_bits(codec, CS35L32_PWRCTL2,
	return snd_soc_component_update_bits(component, CS35L32_PWRCTL2,
					CS35L32_SDOUT_3ST, tristate << 3);
}

@@ -202,7 +202,7 @@ static struct snd_soc_dai_driver cs35l32_dai[] = {
	}
};

static int cs35l32_codec_set_sysclk(struct snd_soc_codec *codec,
static int cs35l32_component_set_sysclk(struct snd_soc_component *component,
			      int clk_id, int source, unsigned int freq, int dir)
{
	unsigned int val;
@@ -224,21 +224,22 @@ static int cs35l32_codec_set_sysclk(struct snd_soc_codec *codec,
		return -EINVAL;
	}

	return snd_soc_update_bits(codec, CS35L32_CLK_CTL,
	return snd_soc_component_update_bits(component, CS35L32_CLK_CTL,
			CS35L32_MCLK_DIV2_MASK | CS35L32_MCLK_RATIO_MASK, val);
}

static const struct snd_soc_codec_driver soc_codec_dev_cs35l32 = {
	.set_sysclk = cs35l32_codec_set_sysclk,

	.component_driver = {
static const struct snd_soc_component_driver soc_component_dev_cs35l32 = {
	.set_sysclk		= cs35l32_component_set_sysclk,
	.controls		= cs35l32_snd_controls,
	.num_controls		= ARRAY_SIZE(cs35l32_snd_controls),
	.dapm_widgets		= cs35l32_dapm_widgets,
	.num_dapm_widgets	= ARRAY_SIZE(cs35l32_dapm_widgets),
	.dapm_routes		= cs35l32_audio_map,
	.num_dapm_routes	= ARRAY_SIZE(cs35l32_audio_map),
	},
	.idle_bias_on		= 1,
	.use_pmdown_time	= 1,
	.endianness		= 1,
	.non_legacy_dai_naming	= 1,
};

/* Current and threshold powerup sequence Pg37 in datasheet */
@@ -483,8 +484,8 @@ static int cs35l32_i2c_probe(struct i2c_client *i2c_client,
	/* Clear MCLK Error Bit since we don't have the clock yet */
	ret = regmap_read(cs35l32->regmap, CS35L32_INT_STATUS_1, &reg);

	ret =  snd_soc_register_codec(&i2c_client->dev,
			&soc_codec_dev_cs35l32, cs35l32_dai,
	ret = devm_snd_soc_register_component(&i2c_client->dev,
			&soc_component_dev_cs35l32, cs35l32_dai,
			ARRAY_SIZE(cs35l32_dai));
	if (ret < 0)
		goto err_disable;
@@ -501,8 +502,6 @@ static int cs35l32_i2c_remove(struct i2c_client *i2c_client)
{
	struct cs35l32_private *cs35l32 = i2c_get_clientdata(i2c_client);

	snd_soc_unregister_codec(&i2c_client->dev);

	/* Hold down reset */
	gpiod_set_value_cansleep(cs35l32->reset_gpio, 0);