Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 26 additions & 3 deletions sound/soc/codecs/rt1308-sdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ static int rt1308_io_init(struct device *dev, struct sdw_slave *slave)
{
struct rt1308_sdw_priv *rt1308 = dev_get_drvdata(dev);
int ret = 0;
unsigned int efuse_m_btl_l, efuse_m_btl_r, tmp;
unsigned int efuse_c_btl_l, efuse_c_btl_r;

if (rt1308->hw_init)
return 0;
Expand Down Expand Up @@ -209,14 +211,35 @@ static int rt1308_io_init(struct device *dev, struct sdw_slave *slave)

/* read efuse */
regmap_write(rt1308->regmap, 0xc360, 0x01);
regmap_write(rt1308->regmap, 0xc360, 0x80);
regmap_write(rt1308->regmap, 0xc361, 0x80);
regmap_write(rt1308->regmap, 0xc7f0, 0x04);
regmap_write(rt1308->regmap, 0xc7f1, 0xfe);
msleep(100);
regmap_write(rt1308->regmap, 0xc7f0, 0x44);
msleep(20);
regmap_write(rt1308->regmap, 0xc240, 0x10);

regmap_read(rt1308->regmap, 0xc861, &tmp);
efuse_m_btl_l = tmp;
regmap_read(rt1308->regmap, 0xc860, &tmp);
efuse_m_btl_l = efuse_m_btl_l | (tmp << 8);
regmap_read(rt1308->regmap, 0xc863, &tmp);
efuse_c_btl_l = tmp;
regmap_read(rt1308->regmap, 0xc862, &tmp);
efuse_c_btl_l = efuse_c_btl_l | (tmp << 8);
regmap_read(rt1308->regmap, 0xc871, &tmp);
efuse_m_btl_r = tmp;
regmap_read(rt1308->regmap, 0xc870, &tmp);
efuse_m_btl_r = efuse_m_btl_r | (tmp << 8);
regmap_read(rt1308->regmap, 0xc873, &tmp);
efuse_c_btl_r = tmp;
regmap_read(rt1308->regmap, 0xc872, &tmp);
efuse_c_btl_r = efuse_c_btl_r | (tmp << 8);
dev_info(&slave->dev, "%s m_btl_l=0x%x, m_btl_r=0x%x\n", __func__,
efuse_m_btl_l, efuse_m_btl_r);
dev_info(&slave->dev, "%s c_btl_l=0x%x, c_btl_r=0x%x\n", __func__,
efuse_c_btl_l, efuse_c_btl_r);

/* initial settings */
regmap_write(rt1308->regmap, 0xc103, 0xc0);
regmap_write(rt1308->regmap, 0xc030, 0x17);
Expand All @@ -241,8 +264,8 @@ static int rt1308_io_init(struct device *dev, struct sdw_slave *slave)
regmap_write(rt1308->regmap, 0xc0a1, 0x71);
regmap_write(rt1308->regmap, 0xc210, 0x00);
regmap_write(rt1308->regmap, 0xc070, 0x00);
regmap_write(rt1308->regmap, 0xc100, 0xaf);
regmap_write(rt1308->regmap, 0xc101, 0xaf);
regmap_write(rt1308->regmap, 0xc100, 0xe7);
regmap_write(rt1308->regmap, 0xc101, 0xe7);
regmap_write(rt1308->regmap, 0xc310, 0x24);

/* Mark Slave initialization complete */
Expand Down
1 change: 1 addition & 0 deletions sound/soc/codecs/rt700.c
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,7 @@ static int rt700_hpo_mux_event(struct snd_soc_dapm_widget *w,
val_l = (1 << RT700_MUTE_SFT);
regmap_write(rt700->regmap,
RT700_SET_GAIN_HP_H, (val_h << 8 | val_l));
usleep_range(50000, 55000);
break;
}
return 0;
Expand Down
10 changes: 6 additions & 4 deletions sound/soc/codecs/rt711.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,8 @@ static void rt711_jack_init(struct rt711_priv *rt711)
RT711_JD2_2PORT_200K_DECODE_HP |
RT711_HP_JD_SEL_JD2);
rt711_index_update_bits(rt711->regmap, RT711_VENDOR_REG,
RT711_CC_DET1, RT711_HP_JD_FINAL_RESULT_CTL_JD12,
RT711_CC_DET1,
RT711_HP_JD_FINAL_RESULT_CTL_JD12,
RT711_HP_JD_FINAL_RESULT_CTL_JD12);
break;
default:
Expand Down Expand Up @@ -741,12 +742,13 @@ static int rt711_dac_surround_event(struct snd_soc_dapm_widget *w,
RT711_SET_GAIN_HP_H, (val_h << 8 | val_l));
break;
case SND_SOC_DAPM_PRE_PMD:
regmap_write(rt711->regmap,
RT711_SET_STREAMID_DAC2, 0x00);

val_l = (1 << RT711_MUTE_SFT);
regmap_write(rt711->regmap,
RT711_SET_GAIN_HP_H, (val_h << 8 | val_l));
usleep_range(50000, 55000);

regmap_write(rt711->regmap,
RT711_SET_STREAMID_DAC2, 0x00);
break;
}
return 0;
Expand Down