Searched refs:ts3a227e (Results 1 - 2 of 2) sorted by relevance

/linux-4.1.27/sound/soc/codecs/
H A Dts3a227e.c23 #include "ts3a227e.h"
25 struct ts3a227e { struct
147 static void ts3a227e_jack_report(struct ts3a227e *ts3a227e) ts3a227e_jack_report() argument
152 if (!ts3a227e->jack) ts3a227e_jack_report()
155 if (ts3a227e->plugged) ts3a227e_jack_report()
157 if (ts3a227e->mic_present) ts3a227e_jack_report()
160 if (ts3a227e->buttons_held & (1 << i)) ts3a227e_jack_report()
163 snd_soc_jack_report(ts3a227e->jack, report, TS3A227E_JACK_MASK); ts3a227e_jack_report()
166 static void ts3a227e_new_jack_state(struct ts3a227e *ts3a227e, unsigned acc_reg) ts3a227e_new_jack_state() argument
173 ts3a227e->plugged = plugged; ts3a227e_new_jack_state()
175 if (mic_present != ts3a227e->mic_present) { ts3a227e_new_jack_state()
176 ts3a227e->mic_present = mic_present; ts3a227e_new_jack_state()
177 ts3a227e->buttons_held = 0; ts3a227e_new_jack_state()
180 regmap_update_bits(ts3a227e->regmap, ts3a227e_new_jack_state()
189 struct ts3a227e *ts3a227e = (struct ts3a227e *)data; ts3a227e_interrupt() local
190 struct regmap *regmap = ts3a227e->regmap; ts3a227e_interrupt()
197 ts3a227e_new_jack_state(ts3a227e, acc_reg); ts3a227e_interrupt()
204 ts3a227e->buttons_held |= (1 << i); ts3a227e_interrupt()
206 ts3a227e->buttons_held &= ~(1 << i); ts3a227e_interrupt()
209 ts3a227e_jack_report(ts3a227e); ts3a227e_interrupt()
227 struct ts3a227e *ts3a227e = snd_soc_component_get_drvdata(component); ts3a227e_enable_jack_detect() local
234 ts3a227e->jack = jack; ts3a227e_enable_jack_detect()
235 ts3a227e_jack_report(ts3a227e); ts3a227e_enable_jack_detect()
257 static int ts3a227e_parse_dt(struct ts3a227e *ts3a227e, struct device_node *np) ts3a227e_parse_dt() argument
264 regmap_update_bits(ts3a227e->regmap, TS3A227E_REG_SETTING_3, ts3a227e_parse_dt()
275 struct ts3a227e *ts3a227e; ts3a227e_i2c_probe() local
280 ts3a227e = devm_kzalloc(&i2c->dev, sizeof(*ts3a227e), GFP_KERNEL); ts3a227e_i2c_probe()
281 if (ts3a227e == NULL) ts3a227e_i2c_probe()
284 i2c_set_clientdata(i2c, ts3a227e); ts3a227e_i2c_probe()
286 ts3a227e->regmap = devm_regmap_init_i2c(i2c, &ts3a227e_regmap_config); ts3a227e_i2c_probe()
287 if (IS_ERR(ts3a227e->regmap)) ts3a227e_i2c_probe()
288 return PTR_ERR(ts3a227e->regmap); ts3a227e_i2c_probe()
291 ret = ts3a227e_parse_dt(ts3a227e, dev->of_node); ts3a227e_i2c_probe()
300 "TS3A227E", ts3a227e); ts3a227e_i2c_probe()
312 regmap_update_bits(ts3a227e->regmap, TS3A227E_REG_INTERRUPT_DISABLE, ts3a227e_i2c_probe()
317 regmap_read(ts3a227e->regmap, TS3A227E_REG_ACCESSORY_STATUS, &acc_reg); ts3a227e_i2c_probe()
318 ts3a227e_new_jack_state(ts3a227e, acc_reg); ts3a227e_i2c_probe()
319 ts3a227e_jack_report(ts3a227e); ts3a227e_i2c_probe()
325 { "ts3a227e", 0 },
331 { .compatible = "ti,ts3a227e", },
338 .name = "ts3a227e",
347 MODULE_DESCRIPTION("ASoC ts3a227e driver");
H A DMakefile118 snd-soc-ts3a227e-objs := ts3a227e.o
300 obj-$(CONFIG_SND_SOC_TS3A227E) += snd-soc-ts3a227e.o

Completed in 113 milliseconds