Commit 9ba4af79 authored by Steve Lee's avatar Steve Lee Committed by Mark Brown

ASoC: max98390: Add Amp init common setting func.

 Add amp common init function to gather common init setting and finaize.
  - add max98390_init_regs func
  - move amp setting to max98390_init_regs func.
  - removed unneceary setting and finalize common register values.
Signed-off-by: default avatarSteve Lee <steves.lee@maximintegrated.com>
Link: https://lore.kernel.org/r/20200611094718.18371-1-steves.lee@maximintegrated.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 6b76bf3e
...@@ -842,6 +842,20 @@ static int max98390_dsm_calibrate(struct snd_soc_component *component) ...@@ -842,6 +842,20 @@ static int max98390_dsm_calibrate(struct snd_soc_component *component)
return 0; return 0;
} }
static void max98390_init_regs(struct snd_soc_component *component)
{
struct max98390_priv *max98390 =
snd_soc_component_get_drvdata(component);
regmap_write(max98390->regmap, MAX98390_CLK_MON, 0x6f);
regmap_write(max98390->regmap, MAX98390_DAT_MON, 0x00);
regmap_write(max98390->regmap, MAX98390_PWR_GATE_CTL, 0x00);
regmap_write(max98390->regmap, MAX98390_PCM_RX_EN_A, 0x03);
regmap_write(max98390->regmap, MAX98390_ENV_TRACK_VOUT_HEADROOM, 0x0e);
regmap_write(max98390->regmap, MAX98390_BOOST_BYPASS1, 0x46);
regmap_write(max98390->regmap, MAX98390_FET_SCALING3, 0x03);
}
static int max98390_probe(struct snd_soc_component *component) static int max98390_probe(struct snd_soc_component *component)
{ {
struct max98390_priv *max98390 = struct max98390_priv *max98390 =
...@@ -853,18 +867,10 @@ static int max98390_probe(struct snd_soc_component *component) ...@@ -853,18 +867,10 @@ static int max98390_probe(struct snd_soc_component *component)
/* Update dsm bin param */ /* Update dsm bin param */
max98390_dsm_init(component); max98390_dsm_init(component);
/* Amp Setting */ /* Amp init setting */
regmap_write(max98390->regmap, MAX98390_CLK_MON, 0x6f); max98390_init_regs(component);
regmap_write(max98390->regmap, MAX98390_PCM_RX_EN_A, 0x03);
regmap_write(max98390->regmap, MAX98390_PWR_GATE_CTL, 0x2d);
regmap_write(max98390->regmap, MAX98390_ENV_TRACK_VOUT_HEADROOM, 0x0e);
regmap_write(max98390->regmap, MAX98390_BOOST_BYPASS1, 0x46);
regmap_write(max98390->regmap, MAX98390_FET_SCALING3, 0x03);
/* Dsm Setting */ /* Dsm Setting */
regmap_write(max98390->regmap, DSM_VOL_CTRL, 0x94);
regmap_write(max98390->regmap, DSMIG_EN, 0x19);
regmap_write(max98390->regmap, MAX98390_R203A_AMP_EN, 0x80);
if (max98390->ref_rdc_value) { if (max98390->ref_rdc_value) {
regmap_write(max98390->regmap, DSM_TPROT_RECIP_RDC_ROOM_BYTE0, regmap_write(max98390->regmap, DSM_TPROT_RECIP_RDC_ROOM_BYTE0,
max98390->ref_rdc_value & 0x000000ff); max98390->ref_rdc_value & 0x000000ff);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment