The code currently reads a property mediatek,eint-use-ext-res with values ranging between 0 and 4. Not only should this be a boolean property, but there's no need for it to even be a DT property, seeing as all current boards will use the internal resistor anyway. Since there's no current dt-binding or Devicetree user of this property, remove its handling and make the driver always configure the internal resistor. Signed-off-by: Nícolas F. R. A. Prado <nfraprado@xxxxxxxxxxxxx> --- sound/soc/codecs/mt6359-accdet.c | 53 +++++++++++----------------------------- sound/soc/codecs/mt6359-accdet.h | 1 - 2 files changed, 14 insertions(+), 40 deletions(-) diff --git a/sound/soc/codecs/mt6359-accdet.c b/sound/soc/codecs/mt6359-accdet.c index d78d7516342a5c2273b1c2962c0346646aa6390f..e04cfb9a607aa5d38d46329eb1387545fda37ccc 100644 --- a/sound/soc/codecs/mt6359-accdet.c +++ b/sound/soc/codecs/mt6359-accdet.c @@ -82,14 +82,10 @@ static unsigned int adjust_eint_analog_setting(struct mt6359_accdet *priv) RG_EINT1CONFIGACCDET_MASK_SFT, BIT(RG_EINT1CONFIGACCDET_SFT)); } - if (priv->data->eint_use_ext_res == 0x3 || - priv->data->eint_use_ext_res == 0x4) { - /*select 500k, use internal resistor */ - regmap_update_bits(priv->regmap, - RG_EINT0HIRENB_ADDR, - RG_EINT0HIRENB_MASK_SFT, - BIT(RG_EINT0HIRENB_SFT)); - } + /*select 500k, use internal resistor */ + regmap_update_bits(priv->regmap, RG_EINT0HIRENB_ADDR, + RG_EINT0HIRENB_MASK_SFT, + BIT(RG_EINT0HIRENB_SFT)); } return 0; } @@ -543,13 +539,6 @@ static int mt6359_accdet_parse_dt(struct mt6359_accdet *priv) else if (tmp == 2) priv->caps |= ACCDET_PMIC_BI_EINT; - ret = of_property_read_u32(node, "mediatek,eint-use-ext-res", - &priv->data->eint_use_ext_res); - if (ret) { - /* eint use internal resister */ - priv->data->eint_use_ext_res = 0x0; - } - ret = of_property_read_u32(node, "mediatek,eint-comp-vth", &priv->data->eint_comp_vth); if (ret) @@ -651,30 +640,16 @@ static void config_eint_init_by_mode(struct mt6359_accdet *priv) if (priv->data->eint_detect_mode == 0x1 || priv->data->eint_detect_mode == 0x2 || priv->data->eint_detect_mode == 0x3) { - if (priv->data->eint_use_ext_res == 0x1) { - if (priv->caps & ACCDET_PMIC_EINT0) { - regmap_update_bits(priv->regmap, - RG_EINT0CONFIGACCDET_ADDR, - RG_EINT0CONFIGACCDET_MASK_SFT, - 0); - } else if (priv->caps & ACCDET_PMIC_EINT1) { - regmap_update_bits(priv->regmap, - RG_EINT1CONFIGACCDET_ADDR, - RG_EINT1CONFIGACCDET_MASK_SFT, - 0); - } - } else { - if (priv->caps & ACCDET_PMIC_EINT0) { - regmap_update_bits(priv->regmap, - RG_EINT0CONFIGACCDET_ADDR, - RG_EINT0CONFIGACCDET_MASK_SFT, - BIT(RG_EINT0CONFIGACCDET_SFT)); - } else if (priv->caps & ACCDET_PMIC_EINT1) { - regmap_update_bits(priv->regmap, - RG_EINT1CONFIGACCDET_ADDR, - RG_EINT1CONFIGACCDET_MASK_SFT, - BIT(RG_EINT1CONFIGACCDET_SFT)); - } + if (priv->caps & ACCDET_PMIC_EINT0) { + regmap_update_bits(priv->regmap, + RG_EINT0CONFIGACCDET_ADDR, + RG_EINT0CONFIGACCDET_MASK_SFT, + BIT(RG_EINT0CONFIGACCDET_SFT)); + } else if (priv->caps & ACCDET_PMIC_EINT1) { + regmap_update_bits(priv->regmap, + RG_EINT1CONFIGACCDET_ADDR, + RG_EINT1CONFIGACCDET_MASK_SFT, + BIT(RG_EINT1CONFIGACCDET_SFT)); } } diff --git a/sound/soc/codecs/mt6359-accdet.h b/sound/soc/codecs/mt6359-accdet.h index 38c36d59b9cc68bd90e16137a05a62b521b75ac1..99de5037a2294b62cb8535fc45dbf4c6fafb5c7f 100644 --- a/sound/soc/codecs/mt6359-accdet.h +++ b/sound/soc/codecs/mt6359-accdet.h @@ -75,7 +75,6 @@ struct dts_data { bool hp_eint_high; struct pwm_deb_settings *pwm_deb; unsigned int eint_detect_mode; - unsigned int eint_use_ext_res; unsigned int eint_comp_vth; }; -- 2.48.1