Lines Matching refs:ts

68 static void cy8ctmg110_power(struct cy8ctmg110 *ts, bool poweron)  in cy8ctmg110_power()  argument
70 if (ts->reset_pin) in cy8ctmg110_power()
71 gpio_direction_output(ts->reset_pin, 1 - poweron); in cy8ctmg110_power()
152 static int cy8ctmg110_set_sleepmode(struct cy8ctmg110 *ts, bool sleep) in cy8ctmg110_set_sleepmode() argument
166 return cy8ctmg110_write_regs(ts, CY8CTMG110_TOUCH_WAKEUP_TIME, 3, reg_p); in cy8ctmg110_set_sleepmode()
182 struct cy8ctmg110 *ts; in cy8ctmg110_probe() local
196 ts = kzalloc(sizeof(struct cy8ctmg110), GFP_KERNEL); in cy8ctmg110_probe()
198 if (!ts || !input_dev) { in cy8ctmg110_probe()
203 ts->client = client; in cy8ctmg110_probe()
204 ts->input = input_dev; in cy8ctmg110_probe()
205 ts->reset_pin = pdata->reset_pin; in cy8ctmg110_probe()
206 ts->irq_pin = pdata->irq_pin; in cy8ctmg110_probe()
208 snprintf(ts->phys, sizeof(ts->phys), in cy8ctmg110_probe()
212 input_dev->phys = ts->phys; in cy8ctmg110_probe()
224 if (ts->reset_pin) { in cy8ctmg110_probe()
225 err = gpio_request(ts->reset_pin, NULL); in cy8ctmg110_probe()
229 ts->reset_pin); in cy8ctmg110_probe()
234 cy8ctmg110_power(ts, true); in cy8ctmg110_probe()
235 cy8ctmg110_set_sleepmode(ts, false); in cy8ctmg110_probe()
237 err = gpio_request(ts->irq_pin, "touch_irq_key"); in cy8ctmg110_probe()
241 ts->irq_pin, err); in cy8ctmg110_probe()
245 err = gpio_direction_input(ts->irq_pin); in cy8ctmg110_probe()
249 ts->irq_pin, err); in cy8ctmg110_probe()
253 client->irq = gpio_to_irq(ts->irq_pin); in cy8ctmg110_probe()
258 ts->irq_pin, err); in cy8ctmg110_probe()
264 "touch_reset_key", ts); in cy8ctmg110_probe()
275 i2c_set_clientdata(client, ts); in cy8ctmg110_probe()
280 free_irq(client->irq, ts); in cy8ctmg110_probe()
282 gpio_free(ts->irq_pin); in cy8ctmg110_probe()
284 cy8ctmg110_set_sleepmode(ts, true); in cy8ctmg110_probe()
285 cy8ctmg110_power(ts, false); in cy8ctmg110_probe()
286 if (ts->reset_pin) in cy8ctmg110_probe()
287 gpio_free(ts->reset_pin); in cy8ctmg110_probe()
290 kfree(ts); in cy8ctmg110_probe()
297 struct cy8ctmg110 *ts = i2c_get_clientdata(client); in cy8ctmg110_suspend() local
302 cy8ctmg110_set_sleepmode(ts, true); in cy8ctmg110_suspend()
303 cy8ctmg110_power(ts, false); in cy8ctmg110_suspend()
311 struct cy8ctmg110 *ts = i2c_get_clientdata(client); in cy8ctmg110_resume() local
316 cy8ctmg110_power(ts, true); in cy8ctmg110_resume()
317 cy8ctmg110_set_sleepmode(ts, false); in cy8ctmg110_resume()
326 struct cy8ctmg110 *ts = i2c_get_clientdata(client); in cy8ctmg110_remove() local
328 cy8ctmg110_set_sleepmode(ts, true); in cy8ctmg110_remove()
329 cy8ctmg110_power(ts, false); in cy8ctmg110_remove()
331 free_irq(client->irq, ts); in cy8ctmg110_remove()
332 input_unregister_device(ts->input); in cy8ctmg110_remove()
333 gpio_free(ts->irq_pin); in cy8ctmg110_remove()
334 if (ts->reset_pin) in cy8ctmg110_remove()
335 gpio_free(ts->reset_pin); in cy8ctmg110_remove()
336 kfree(ts); in cy8ctmg110_remove()