提交 bb327e92 编写于 作者: C Charles Keepax 提交者: Chanwoo Choi

extcon: arizona: Simplify pdata symantics for micd_dbtime

Currently micd_dbtime can be set to 0 for default, 1 for 4 measurements,
or a greater than 16-bit value for 2 measurements. This patch simplifies
the symantics to 2 for 2 measurements, 4 for 4 measurements and any
other value for the default.

I am not super keen on changing the symantics of the pdata at this stage
in the drivers life, but acceptance of the DT binding for this field has
been made conditional on this happening.
Signed-off-by: NCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Signed-off-by: NChanwoo Choi <cw00.choi@samsung.com>
上级 57f70ef9
...@@ -48,6 +48,9 @@ ...@@ -48,6 +48,9 @@
#define HPDET_DEBOUNCE 500 #define HPDET_DEBOUNCE 500
#define DEFAULT_MICD_TIMEOUT 2000 #define DEFAULT_MICD_TIMEOUT 2000
#define MICD_DBTIME_TWO_READINGS 2
#define MICD_DBTIME_FOUR_READINGS 4
#define MICD_LVL_1_TO_7 (ARIZONA_MICD_LVL_1 | ARIZONA_MICD_LVL_2 | \ #define MICD_LVL_1_TO_7 (ARIZONA_MICD_LVL_1 | ARIZONA_MICD_LVL_2 | \
ARIZONA_MICD_LVL_3 | ARIZONA_MICD_LVL_4 | \ ARIZONA_MICD_LVL_3 | ARIZONA_MICD_LVL_4 | \
ARIZONA_MICD_LVL_5 | ARIZONA_MICD_LVL_6 | \ ARIZONA_MICD_LVL_5 | ARIZONA_MICD_LVL_6 | \
...@@ -1318,11 +1321,19 @@ static int arizona_extcon_probe(struct platform_device *pdev) ...@@ -1318,11 +1321,19 @@ static int arizona_extcon_probe(struct platform_device *pdev)
arizona->pdata.micd_rate arizona->pdata.micd_rate
<< ARIZONA_MICD_RATE_SHIFT); << ARIZONA_MICD_RATE_SHIFT);
if (arizona->pdata.micd_dbtime) switch (arizona->pdata.micd_dbtime) {
case MICD_DBTIME_FOUR_READINGS:
regmap_update_bits(arizona->regmap, ARIZONA_MIC_DETECT_1, regmap_update_bits(arizona->regmap, ARIZONA_MIC_DETECT_1,
ARIZONA_MICD_DBTIME_MASK, ARIZONA_MICD_DBTIME_MASK,
arizona->pdata.micd_dbtime ARIZONA_MICD_DBTIME);
<< ARIZONA_MICD_DBTIME_SHIFT); break;
case MICD_DBTIME_TWO_READINGS:
regmap_update_bits(arizona->regmap, ARIZONA_MIC_DETECT_1,
ARIZONA_MICD_DBTIME_MASK, 0);
break;
default:
break;
}
BUILD_BUG_ON(ARRAY_SIZE(arizona_micd_levels) != 0x40); BUILD_BUG_ON(ARRAY_SIZE(arizona_micd_levels) != 0x40);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册