ASoC: wsa881x: Remove support for wsa881x 1.x chip revision

On kernel version 4.4, support for wsa881x v1.x can be dropped
as it will not ship with any products using this version.

CRs-fixed: 1008341
Change-Id: I7a8c28602d6c66b876b1e413791850bcaefdea98
Signed-off-by: Stephen Oglesby <soglesby@codeaurora.org>
This commit is contained in:
Stephen Oglesby 2016-04-20 18:25:57 -07:00 committed by Kyle Yan
parent 9194c460b8
commit 0f02e45668
3 changed files with 52 additions and 167 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, The Linux Foundation. All rights reserved.
* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -154,30 +154,6 @@ static struct reg_default wsa881x_defaults[] = {
{WSA881X_SPKR_STATUS3, 0x00},
};
/* Default register reset values for WSA881x rev 1.0 or 1.1 */
static struct reg_sequence wsa881x_rev_1_x[] = {
{WSA881X_INTR_MASK, 0x1F, 0x00},
{WSA881X_OTP_REG_28, 0xFF, 0x00},
{WSA881X_OTP_REG_29, 0xFF, 0x00},
{WSA881X_OTP_REG_30, 0xFF, 0x00},
{WSA881X_OTP_REG_31, 0xFF, 0x00},
{WSA881X_TEMP_ADC_CTRL, 0x00, 0x00},
{WSA881X_ADC_SEL_IBIAS, 0x25, 0x00},
{WSA881X_SPKR_DRV_GAIN, 0x01, 0x00},
{WSA881X_SPKR_DAC_CTL, 0x40, 0x00},
{WSA881X_SPKR_BBM_CTL, 0x00, 0x00},
{WSA881X_SPKR_MISC_CTL1, 0x80, 0x00},
{WSA881X_SPKR_MISC_CTL2, 0x00, 0x00},
{WSA881X_SPKR_BIAS_INT, 0x56, 0x00},
{WSA881X_SPKR_BIAS_PSRR, 0x54, 0x00},
{WSA881X_BOOST_PS_CTL, 0xC0, 0x00},
{WSA881X_BOOST_PRESET_OUT1, 0x77, 0x00},
{WSA881X_BOOST_LOOP_STABILITY, 0xAD, 0x00},
{WSA881X_SPKR_PROT_ATEST2, 0x00, 0x00},
{WSA881X_BONGO_RESRV_REG1, 0x00, 0x00},
{WSA881X_BONGO_RESRV_REG2, 0x00, 0x00},
};
/* Default register reset values for WSA881x rev 2.0 */
static struct reg_sequence wsa881x_rev_2_0[] = {
{WSA881X_RESET_CTL, 0x00, 0x00},
@ -222,26 +198,10 @@ void wsa881x_regmap_defaults(struct regmap *regmap, u8 version)
return;
}
switch (version) {
case WSA881X_1_X:
regcache_cache_only(regmap, true);
ret = regmap_multi_reg_write(regmap,
wsa881x_rev_1_x,
ARRAY_SIZE(wsa881x_rev_1_x));
regcache_cache_only(regmap, false);
break;
case WSA881X_2_0:
regcache_cache_only(regmap, true);
ret = regmap_multi_reg_write(regmap,
wsa881x_rev_2_0,
ret = regmap_multi_reg_write(regmap, wsa881x_rev_2_0,
ARRAY_SIZE(wsa881x_rev_2_0));
regcache_cache_only(regmap, false);
break;
default:
pr_debug("%s: unknown version", __func__);
ret = -EINVAL;
break;
}
if (ret)
pr_debug("%s: Failed to update regmap defaults ret= %d\n",

View file

@ -177,12 +177,7 @@ static ssize_t wsa881x_codec_version_read(struct snd_info_entry *entry,
return -EINVAL;
}
if (WSA881X_IS_2_0(wsa881x->version))
len = snprintf(buffer, sizeof(buffer),
"WSA881X-SOUNDWIRE_2_0\n");
else
len = snprintf(buffer, sizeof(buffer),
"WSA881X-SOUNDWIRE_1_0\n");
len = snprintf(buffer, sizeof(buffer), "WSA881X-SOUNDWIRE_2_0\n");
return simple_read_from_buffer(buf, count, &pos, buffer, len);
}
@ -453,14 +448,9 @@ static int wsa881x_visense_txfe_ctrl(struct snd_soc_codec *codec, bool enable,
__func__, enable, isense1_gain, isense2_gain, vsense_gain);
if (enable) {
if (WSA881X_IS_2_0(wsa881x->version))
regmap_multi_reg_write(wsa881x->regmap,
wsa881x_vi_txfe_en_2_0,
ARRAY_SIZE(wsa881x_vi_txfe_en_2_0));
else
regmap_multi_reg_write(wsa881x->regmap,
wsa881x_vi_txfe_en,
ARRAY_SIZE(wsa881x_vi_txfe_en));
} else {
snd_soc_update_bits(codec, WSA881X_SPKR_PROT_FE_VSENSE_VCM,
0x08, 0x08);
@ -787,46 +777,18 @@ static int wsa881x_spkr_pa_event(struct snd_soc_dapm_widget *w,
switch (event) {
case SND_SOC_DAPM_PRE_PMU:
snd_soc_update_bits(codec, WSA881X_SPKR_OCP_CTL, 0xC0, 0x80);
if (WSA881X_IS_2_0(wsa881x->version))
regmap_multi_reg_write(wsa881x->regmap,
wsa881x_pre_pmu_pa_2_0,
ARRAY_SIZE(wsa881x_pre_pmu_pa_2_0));
else
regmap_multi_reg_write(wsa881x->regmap,
wsa881x_pre_pmu_pa,
ARRAY_SIZE(wsa881x_pre_pmu_pa));
break;
case SND_SOC_DAPM_POST_PMU:
if (WSA881X_IS_2_0(wsa881x->version)) {
if (!wsa881x->comp_enable) {
/*
* 1ms delay is needed before change in gain
* as per HW requirement.
*/
usleep_range(1000, 1010);
wsa881x_ramp_pa_gain(codec, G_13P5DB, G_18DB,
1000);
}
} else {
/*
* 710us delay is needed after PA enable as per
* HW requirement.
*/
usleep_range(710, 720);
regmap_multi_reg_write(wsa881x->regmap,
wsa881x_post_pmu_pa,
ARRAY_SIZE(wsa881x_post_pmu_pa));
if (!wsa881x->comp_enable) {
/*
* 1ms delay is needed before change in gain
* as per HW requirement.
*/
usleep_range(1000, 1010);
wsa881x_ramp_pa_gain(codec, G_12DB, G_13P5DB,
1000);
}
snd_soc_update_bits(codec, WSA881X_ADC_SEL_IBIAS,
0x70, 0x40);
wsa881x_ramp_pa_gain(codec, G_13P5DB, G_18DB, 1000);
}
if (wsa881x->visense_enable) {
wsa881x_visense_txfe_ctrl(codec, ENABLE,
@ -911,7 +873,6 @@ static void wsa881x_init(struct snd_soc_codec *codec)
/* Bring out of digital reset */
snd_soc_update_bits(codec, WSA881X_CDC_RST_CTL, 0x01, 0x01);
if (WSA881X_IS_2_0(wsa881x->version)) {
snd_soc_update_bits(codec, WSA881X_CLOCK_CONFIG, 0x10, 0x10);
snd_soc_update_bits(codec, WSA881X_SPKR_OCP_CTL, 0x02, 0x02);
snd_soc_update_bits(codec, WSA881X_SPKR_MISC_CTL1, 0xC0, 0x80);
@ -943,27 +904,6 @@ static void wsa881x_init(struct snd_soc_codec *codec)
0xFF, 0xB2);
snd_soc_update_bits(codec, WSA881X_BONGO_RESRV_REG2,
0xFF, 0x05);
} else {
/* Set DAC polarity to Rising */
snd_soc_update_bits(codec, WSA881X_SPKR_DAC_CTL, 0x02, 0x02);
/* set Bias Ref ctrl to 1.225V */
snd_soc_update_bits(codec, WSA881X_BIAS_REF_CTRL, 0x07, 0x00);
snd_soc_update_bits(codec, WSA881X_SPKR_BBM_CTL, 0x02, 0x02);
snd_soc_update_bits(codec, WSA881X_SPKR_MISC_CTL1, 0xC0, 0x00);
snd_soc_update_bits(codec, WSA881X_SPKR_MISC_CTL2, 0x07, 0x04);
snd_soc_update_bits(codec, WSA881X_SPKR_BIAS_INT, 0x0F, 0x0F);
snd_soc_update_bits(codec, WSA881X_SPKR_PA_INT, 0xF0, 0x10);
snd_soc_update_bits(codec, WSA881X_SPKR_PA_INT, 0x0F, 0x0E);
snd_soc_update_bits(codec, WSA881X_BOOST_PS_CTL, 0x80, 0x00);
snd_soc_update_bits(codec, WSA881X_BOOST_PRESET_OUT1,
0xF0, 0xB0);
snd_soc_update_bits(codec, WSA881X_BOOST_PRESET_OUT2,
0xF0, 0x30);
snd_soc_update_bits(codec, WSA881X_SPKR_DRV_EN, 0x0F, 0x0C);
snd_soc_update_bits(codec, WSA881X_BOOST_CURRENT_LIMIT,
0x0F, 0x08);
snd_soc_update_bits(codec, WSA881X_BOOST_ZX_CTL, 0x20, 0x00);
}
}
static int32_t wsa881x_resource_acquire(struct snd_soc_codec *codec,
@ -1003,17 +943,10 @@ static int32_t wsa881x_temp_reg_read(struct snd_soc_codec *codec,
wsa881x_resource_acquire(codec, ENABLE);
if (WSA881X_IS_2_0(wsa881x->version)) {
snd_soc_update_bits(codec, WSA881X_TADC_VALUE_CTL, 0x01, 0x00);
wsa_temp_reg->dmeas_msb = snd_soc_read(codec, WSA881X_TEMP_MSB);
wsa_temp_reg->dmeas_lsb = snd_soc_read(codec, WSA881X_TEMP_LSB);
snd_soc_update_bits(codec, WSA881X_TADC_VALUE_CTL, 0x01, 0x01);
} else {
wsa_temp_reg->dmeas_msb = snd_soc_read(codec,
WSA881X_TEMP_DOUT_MSB);
wsa_temp_reg->dmeas_lsb = snd_soc_read(codec,
WSA881X_TEMP_DOUT_LSB);
}
wsa_temp_reg->d1_msb = snd_soc_read(codec, WSA881X_OTP_REG_1);
wsa_temp_reg->d1_lsb = snd_soc_read(codec, WSA881X_OTP_REG_2);
wsa_temp_reg->d2_msb = snd_soc_read(codec, WSA881X_OTP_REG_3);

View file

@ -1,4 +1,4 @@
/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
@ -20,14 +20,6 @@
#define WSA881X_MAX_SWR_PORTS 4
enum {
WSA881X_1_X = 0,
WSA881X_2_0,
};
#define WSA881X_IS_2_0(ver) \
((ver == WSA881X_2_0) ? 1 : 0)
extern int wsa881x_set_channel_map(struct snd_soc_codec *codec, u8 *port,
u8 num_port, unsigned int *ch_mask,
unsigned int *ch_rate);