Lines Matching +full:debounce +full:- +full:press +full:- +full:ms
1 // SPDX-License-Identifier: GPL-2.0-only
159 if (!ts3a227e->jack) in ts3a227e_jack_report()
162 if (ts3a227e->plugged) in ts3a227e_jack_report()
164 if (ts3a227e->mic_present) in ts3a227e_jack_report()
167 if (ts3a227e->buttons_held & (1 << i)) in ts3a227e_jack_report()
170 snd_soc_jack_report(ts3a227e->jack, report, TS3A227E_JACK_MASK); in ts3a227e_jack_report()
180 ts3a227e->plugged = plugged; in ts3a227e_new_jack_state()
182 if (mic_present != ts3a227e->mic_present) { in ts3a227e_new_jack_state()
183 ts3a227e->mic_present = mic_present; in ts3a227e_new_jack_state()
184 ts3a227e->buttons_held = 0; in ts3a227e_new_jack_state()
186 /* Enable key press detection. */ in ts3a227e_new_jack_state()
187 regmap_update_bits(ts3a227e->regmap, in ts3a227e_new_jack_state()
197 struct regmap *regmap = ts3a227e->regmap; in ts3a227e_interrupt()
199 struct device *dev = ts3a227e->dev; in ts3a227e_interrupt()
223 ts3a227e->buttons_held |= (1 << i); in ts3a227e_interrupt()
225 ts3a227e->buttons_held &= ~(1 << i); in ts3a227e_interrupt()
234 * ts3a227e_enable_jack_detect - Specify a jack for event reporting
240 * events 0-3 will be routed to the given jack. Jack can be null to stop
248 snd_jack_set_key(jack->jack, SND_JACK_BTN_0, KEY_PLAYPAUSE); in ts3a227e_enable_jack_detect()
249 snd_jack_set_key(jack->jack, SND_JACK_BTN_1, KEY_VOICECOMMAND); in ts3a227e_enable_jack_detect()
250 snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEUP); in ts3a227e_enable_jack_detect()
251 snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOLUMEDOWN); in ts3a227e_enable_jack_detect()
253 ts3a227e->jack = jack; in ts3a227e_enable_jack_detect()
264 return -EINVAL; in ts3a227e_set_jack()
310 err = device_property_read_u32(dev, "ti,debounce-release-ms", in ts3a227e_parse_device_property()
319 err = device_property_read_u32(dev, "ti,debounce-press-ms", &value_ms); in ts3a227e_parse_device_property()
330 regmap_update_bits(ts3a227e->regmap, TS3A227E_REG_SETTING_3, in ts3a227e_parse_device_property()
333 err = device_property_read_u32(dev, "ti,debounce-insertion-ms", in ts3a227e_parse_device_property()
342 regmap_update_bits(ts3a227e->regmap, TS3A227E_REG_SETTING_1, in ts3a227e_parse_device_property()
354 struct device *dev = &i2c->dev; in ts3a227e_i2c_probe()
358 ts3a227e = devm_kzalloc(&i2c->dev, sizeof(*ts3a227e), GFP_KERNEL); in ts3a227e_i2c_probe()
360 return -ENOMEM; in ts3a227e_i2c_probe()
363 ts3a227e->dev = dev; in ts3a227e_i2c_probe()
364 ts3a227e->irq = i2c->irq; in ts3a227e_i2c_probe()
366 ts3a227e->regmap = devm_regmap_init_i2c(i2c, &ts3a227e_regmap_config); in ts3a227e_i2c_probe()
367 if (IS_ERR(ts3a227e->regmap)) in ts3a227e_i2c_probe()
368 return PTR_ERR(ts3a227e->regmap); in ts3a227e_i2c_probe()
376 ret = devm_request_threaded_irq(dev, i2c->irq, NULL, ts3a227e_interrupt, in ts3a227e_i2c_probe()
380 dev_err(dev, "Cannot request irq %d (%d)\n", i2c->irq, ret); in ts3a227e_i2c_probe()
384 ret = devm_snd_soc_register_component(&i2c->dev, &ts3a227e_soc_driver, in ts3a227e_i2c_probe()
390 regmap_update_bits(ts3a227e->regmap, TS3A227E_REG_INTERRUPT_DISABLE, in ts3a227e_i2c_probe()
395 regmap_read(ts3a227e->regmap, TS3A227E_REG_ACCESSORY_STATUS, &acc_reg); in ts3a227e_i2c_probe()
407 dev_dbg(ts3a227e->dev, "suspend disable irq\n"); in ts3a227e_suspend()
408 disable_irq(ts3a227e->irq); in ts3a227e_suspend()
417 dev_dbg(ts3a227e->dev, "resume enable irq\n"); in ts3a227e_resume()
418 enable_irq(ts3a227e->irq); in ts3a227e_resume()