Commit ed857072 authored by David Lin's avatar David Lin Committed by Mark Brown

ASoC: nau8825: Add ADCOUT IO drive strength control

Add a property to control the driving of ADCOUT.
Signed-off-by: default avatarDavid Lin <CTLIN0@nuvoton.com>
Link: https://lore.kernel.org/r/20220913120641.792502-1-CTLIN0@nuvoton.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 515626a3
...@@ -1976,6 +1976,10 @@ static void nau8825_init_regs(struct nau8825 *nau8825) ...@@ -1976,6 +1976,10 @@ static void nau8825_init_regs(struct nau8825 *nau8825)
/* Disable short Frame Sync detection logic */ /* Disable short Frame Sync detection logic */
regmap_update_bits(regmap, NAU8825_REG_LEFT_TIME_SLOT, regmap_update_bits(regmap, NAU8825_REG_LEFT_TIME_SLOT,
NAU8825_DIS_FS_SHORT_DET, NAU8825_DIS_FS_SHORT_DET); NAU8825_DIS_FS_SHORT_DET, NAU8825_DIS_FS_SHORT_DET);
/* ADCDAT IO drive strength control */
regmap_update_bits(regmap, NAU8825_REG_CHARGE_PUMP,
NAU8825_ADCOUT_DS_MASK,
nau8825->adcout_ds << NAU8825_ADCOUT_DS_SFT);
} }
static const struct regmap_config nau8825_regmap_config = { static const struct regmap_config nau8825_regmap_config = {
...@@ -2514,6 +2518,7 @@ static void nau8825_print_device_properties(struct nau8825 *nau8825) ...@@ -2514,6 +2518,7 @@ static void nau8825_print_device_properties(struct nau8825 *nau8825)
nau8825->jack_eject_debounce); nau8825->jack_eject_debounce);
dev_dbg(dev, "crosstalk-enable: %d\n", dev_dbg(dev, "crosstalk-enable: %d\n",
nau8825->xtalk_enable); nau8825->xtalk_enable);
dev_dbg(dev, "adcout-drive-strong: %d\n", nau8825->adcout_ds);
} }
static int nau8825_read_device_properties(struct device *dev, static int nau8825_read_device_properties(struct device *dev,
...@@ -2580,6 +2585,7 @@ static int nau8825_read_device_properties(struct device *dev, ...@@ -2580,6 +2585,7 @@ static int nau8825_read_device_properties(struct device *dev,
nau8825->jack_eject_debounce = 0; nau8825->jack_eject_debounce = 0;
nau8825->xtalk_enable = device_property_read_bool(dev, nau8825->xtalk_enable = device_property_read_bool(dev,
"nuvoton,crosstalk-enable"); "nuvoton,crosstalk-enable");
nau8825->adcout_ds = device_property_read_bool(dev, "nuvoton,adcout-drive-strong");
nau8825->mclk = devm_clk_get(dev, "mclk"); nau8825->mclk = devm_clk_get(dev, "mclk");
if (PTR_ERR(nau8825->mclk) == -EPROBE_DEFER) { if (PTR_ERR(nau8825->mclk) == -EPROBE_DEFER) {
......
...@@ -418,6 +418,8 @@ ...@@ -418,6 +418,8 @@
#define NAU8825_POWERUP_HP_DRV_L (1 << 0) #define NAU8825_POWERUP_HP_DRV_L (1 << 0)
/* CHARGE_PUMP (0x80) */ /* CHARGE_PUMP (0x80) */
#define NAU8825_ADCOUT_DS_SFT 12
#define NAU8825_ADCOUT_DS_MASK (1 << NAU8825_ADCOUT_DS_SFT)
#define NAU8825_JAMNODCLOW (1 << 10) #define NAU8825_JAMNODCLOW (1 << 10)
#define NAU8825_POWER_DOWN_DACR (1 << 9) #define NAU8825_POWER_DOWN_DACR (1 << 9)
#define NAU8825_POWER_DOWN_DACL (1 << 8) #define NAU8825_POWER_DOWN_DACL (1 << 8)
...@@ -477,6 +479,7 @@ struct nau8825 { ...@@ -477,6 +479,7 @@ struct nau8825 {
int imp_rms[NAU8825_XTALK_IMM]; int imp_rms[NAU8825_XTALK_IMM];
int xtalk_enable; int xtalk_enable;
bool xtalk_baktab_initialized; /* True if initialized. */ bool xtalk_baktab_initialized; /* True if initialized. */
bool adcout_ds;
}; };
int nau8825_enable_jack_detect(struct snd_soc_component *component, int nau8825_enable_jack_detect(struct snd_soc_component *component,
......
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