Lines Matching +full:debounce +full:- +full:release +full:- +full:ms
1 // SPDX-License-Identifier: GPL-2.0-only
160 if (!ts3a227e->jack) in ts3a227e_jack_report()
163 if (ts3a227e->plugged) in ts3a227e_jack_report()
165 if (ts3a227e->mic_present) in ts3a227e_jack_report()
168 if (ts3a227e->buttons_held & (1 << i)) in ts3a227e_jack_report()
171 snd_soc_jack_report(ts3a227e->jack, report, TS3A227E_JACK_MASK); in ts3a227e_jack_report()
181 ts3a227e->plugged = plugged; in ts3a227e_new_jack_state()
183 if (mic_present != ts3a227e->mic_present) { in ts3a227e_new_jack_state()
184 ts3a227e->mic_present = mic_present; in ts3a227e_new_jack_state()
185 ts3a227e->buttons_held = 0; in ts3a227e_new_jack_state()
188 regmap_update_bits(ts3a227e->regmap, in ts3a227e_new_jack_state()
198 struct regmap *regmap = ts3a227e->regmap; in ts3a227e_interrupt()
200 struct device *dev = ts3a227e->dev; in ts3a227e_interrupt()
224 ts3a227e->buttons_held |= (1 << i); in ts3a227e_interrupt()
226 ts3a227e->buttons_held &= ~(1 << i); in ts3a227e_interrupt()
235 * ts3a227e_enable_jack_detect - Specify a jack for event reporting
241 * events 0-3 will be routed to the given jack. Jack can be null to stop
249 snd_jack_set_key(jack->jack, SND_JACK_BTN_0, KEY_PLAYPAUSE); in ts3a227e_enable_jack_detect()
250 snd_jack_set_key(jack->jack, SND_JACK_BTN_1, KEY_VOICECOMMAND); in ts3a227e_enable_jack_detect()
251 snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEUP); in ts3a227e_enable_jack_detect()
252 snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOLUMEDOWN); in ts3a227e_enable_jack_detect()
254 ts3a227e->jack = jack; in ts3a227e_enable_jack_detect()
265 return -EINVAL; in ts3a227e_set_jack()
311 err = device_property_read_u32(dev, "ti,debounce-release-ms", in ts3a227e_parse_device_property()
320 err = device_property_read_u32(dev, "ti,debounce-press-ms", &value_ms); in ts3a227e_parse_device_property()
331 regmap_update_bits(ts3a227e->regmap, TS3A227E_REG_SETTING_3, in ts3a227e_parse_device_property()
334 err = device_property_read_u32(dev, "ti,debounce-insertion-ms", in ts3a227e_parse_device_property()
343 regmap_update_bits(ts3a227e->regmap, TS3A227E_REG_SETTING_1, in ts3a227e_parse_device_property()
355 struct device *dev = &i2c->dev; in ts3a227e_i2c_probe()
359 ts3a227e = devm_kzalloc(&i2c->dev, sizeof(*ts3a227e), GFP_KERNEL); in ts3a227e_i2c_probe()
361 return -ENOMEM; in ts3a227e_i2c_probe()
364 ts3a227e->dev = dev; in ts3a227e_i2c_probe()
365 ts3a227e->irq = i2c->irq; in ts3a227e_i2c_probe()
367 ts3a227e->regmap = devm_regmap_init_i2c(i2c, &ts3a227e_regmap_config); in ts3a227e_i2c_probe()
368 if (IS_ERR(ts3a227e->regmap)) in ts3a227e_i2c_probe()
369 return PTR_ERR(ts3a227e->regmap); in ts3a227e_i2c_probe()
377 ret = devm_request_threaded_irq(dev, i2c->irq, NULL, ts3a227e_interrupt, in ts3a227e_i2c_probe()
381 dev_err(dev, "Cannot request irq %d (%d)\n", i2c->irq, ret); in ts3a227e_i2c_probe()
385 ret = devm_snd_soc_register_component(&i2c->dev, &ts3a227e_soc_driver, in ts3a227e_i2c_probe()
391 regmap_update_bits(ts3a227e->regmap, TS3A227E_REG_INTERRUPT_DISABLE, in ts3a227e_i2c_probe()
396 regmap_read(ts3a227e->regmap, TS3A227E_REG_ACCESSORY_STATUS, &acc_reg); in ts3a227e_i2c_probe()
408 dev_dbg(ts3a227e->dev, "suspend disable irq\n"); in ts3a227e_suspend()
409 disable_irq(ts3a227e->irq); in ts3a227e_suspend()
418 dev_dbg(ts3a227e->dev, "resume enable irq\n"); in ts3a227e_resume()
419 enable_irq(ts3a227e->irq); in ts3a227e_resume()