pm_runtime_put_autosuspend(priv->dev);
}
-static void cs42l43_start_load_detect(struct cs42l43_codec *priv)
+static const struct reg_sequence cs42l43_3pole_patch[] = {
+ { 0x4000, 0x00000055 },
+ { 0x4000, 0x000000AA },
+ { 0x17420, 0x8500F300 },
+ { 0x17424, 0x36003E00 },
+ { 0x4000, 0x00000000 },
+};
+
+static const struct reg_sequence cs42l43_4pole_patch[] = {
+ { 0x4000, 0x00000055 },
+ { 0x4000, 0x000000AA },
+ { 0x17420, 0x7800E600 },
+ { 0x17424, 0x36003800 },
+ { 0x4000, 0x00000000 },
+};
+
+static void cs42l43_start_load_detect(struct cs42l43_codec *priv, bool mic)
{
struct cs42l43 *cs42l43 = priv->core;
dev_err(priv->dev, "Load detect HP power down timed out\n");
}
+ if (mic)
+ regmap_multi_reg_write_bypassed(cs42l43->regmap,
+ cs42l43_4pole_patch,
+ ARRAY_SIZE(cs42l43_4pole_patch));
+ else
+ regmap_multi_reg_write_bypassed(cs42l43->regmap,
+ cs42l43_3pole_patch,
+ ARRAY_SIZE(cs42l43_3pole_patch));
+
regmap_update_bits(cs42l43->regmap, CS42L43_BLOCK_EN3,
CS42L43_ADC1_EN_MASK | CS42L43_ADC2_EN_MASK, 0);
regmap_update_bits(cs42l43->regmap, CS42L43_DACCNFG2, CS42L43_HP_HPF_EN_MASK, 0);
reinit_completion(&priv->load_detect);
- cs42l43_start_load_detect(priv);
+ cs42l43_start_load_detect(priv, mic);
time_left = wait_for_completion_timeout(&priv->load_detect,
msecs_to_jiffies(CS42L43_LOAD_TIMEOUT_MS));
cs42l43_stop_load_detect(priv);
}
switch (val & CS42L43_AMP3_RES_DET_MASK) {
- case 0x0: // low impedance
- case 0x1: // high impedance
+ case 0x0: // < 22 Ohm impedance
+ case 0x1: // < 150 Ohm impedance
+ case 0x2: // < 1000 Ohm impedance
return CS42L43_JACK_HEADPHONE;
- case 0x2: // lineout
- case 0x3: // Open circuit
+ case 0x3: // > 1000 Ohm impedance
return CS42L43_JACK_LINEOUT;
default:
return -EINVAL;