Skip to content

Commit

Permalink
sound/soc/codecs/ts3a227e: add device property ti,insertion-debounce-…
Browse files Browse the repository at this point in the history
…time

Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
  • Loading branch information
mhennerich committed Aug 9, 2017
1 parent abf66b5 commit cd4045d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion sound/soc/codecs/ts3a227e.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ static const int ts3a227e_buttons[] = {
#define ADC_COMPLETE_INT_DISABLE 0x04
#define INTB_DISABLE 0x08

/* TS3A227E_REG_SETTING_1 */
#define INSERT_DEBOUNCE_SETTING_MASK 0x7

/* TS3A227E_REG_SETTING_2 0x05 */
#define KP_ENABLE 0x04

Expand Down Expand Up @@ -271,7 +274,7 @@ static const struct regmap_config ts3a227e_regmap_config = {
static int ts3a227e_parse_device_property(struct ts3a227e *ts3a227e,
struct device *dev)
{
u32 micbias;
u32 micbias, debounce;
int err;

err = device_property_read_u32(dev, "ti,micbias", &micbias);
Expand All @@ -281,6 +284,13 @@ static int ts3a227e_parse_device_property(struct ts3a227e *ts3a227e,
(micbias & 0x07) << MICBIAS_SETTING_SFT);
}

err = device_property_read_u32(dev, "ti,insertion-debounce-time", &debounce);
if (!err) {
regmap_update_bits(ts3a227e->regmap, TS3A227E_REG_SETTING_1,
INSERT_DEBOUNCE_SETTING_MASK,
(debounce & 0x07));
}

return 0;
}

Expand Down

0 comments on commit cd4045d

Please sign in to comment.