Lines Matching refs:qt2160
46 struct qt2160_data *qt2160; member
74 struct qt2160_data *qt2160 = led->qt2160; in qt2160_led_set() local
75 struct i2c_client *client = qt2160->client; in qt2160_led_set()
158 static int qt2160_get_key_matrix(struct qt2160_data *qt2160) in qt2160_get_key_matrix() argument
160 struct i2c_client *client = qt2160->client; in qt2160_get_key_matrix()
161 struct input_dev *input = qt2160->input; in qt2160_get_key_matrix()
179 old_matrix = qt2160->key_matrix; in qt2160_get_key_matrix()
180 qt2160->key_matrix = new_matrix = (regs[2] << 8) | regs[1]; in qt2160_get_key_matrix()
187 input_report_key(input, qt2160->keycodes[i], keyval); in qt2160_get_key_matrix()
200 struct qt2160_data *qt2160 = _qt2160; in qt2160_irq() local
202 mod_delayed_work(system_wq, &qt2160->dwork, 0); in qt2160_irq()
207 static void qt2160_schedule_read(struct qt2160_data *qt2160) in qt2160_schedule_read() argument
209 schedule_delayed_work(&qt2160->dwork, QT2160_CYCLE_INTERVAL); in qt2160_schedule_read()
214 struct qt2160_data *qt2160 = in qt2160_worker() local
217 dev_dbg(&qt2160->client->dev, "worker\n"); in qt2160_worker()
219 qt2160_get_key_matrix(qt2160); in qt2160_worker()
222 qt2160_schedule_read(qt2160); in qt2160_worker()
260 static int qt2160_register_leds(struct qt2160_data *qt2160) in qt2160_register_leds() argument
262 struct i2c_client *client = qt2160->client; in qt2160_register_leds()
267 struct qt2160_led *led = &qt2160->leds[i]; in qt2160_register_leds()
274 led->qt2160 = qt2160; in qt2160_register_leds()
289 static void qt2160_unregister_leds(struct qt2160_data *qt2160) in qt2160_unregister_leds() argument
294 led_classdev_unregister(&qt2160->leds[i].cdev); in qt2160_unregister_leds()
299 static inline int qt2160_register_leds(struct qt2160_data *qt2160) in qt2160_register_leds() argument
304 static inline void qt2160_unregister_leds(struct qt2160_data *qt2160) in qt2160_unregister_leds() argument
344 struct qt2160_data *qt2160; in qt2160_probe() local
362 qt2160 = kzalloc(sizeof(struct qt2160_data), GFP_KERNEL); in qt2160_probe()
364 if (!qt2160 || !input) { in qt2160_probe()
370 qt2160->client = client; in qt2160_probe()
371 qt2160->input = input; in qt2160_probe()
372 INIT_DELAYED_WORK(&qt2160->dwork, qt2160_worker); in qt2160_probe()
377 input->keycode = qt2160->keycodes; in qt2160_probe()
378 input->keycodesize = sizeof(qt2160->keycodes[0]); in qt2160_probe()
384 qt2160->keycodes[i] = qt2160_key2code[i]; in qt2160_probe()
398 IRQF_TRIGGER_FALLING, "qt2160", qt2160); in qt2160_probe()
406 error = qt2160_register_leds(qt2160); in qt2160_probe()
412 error = input_register_device(qt2160->input); in qt2160_probe()
419 i2c_set_clientdata(client, qt2160); in qt2160_probe()
420 qt2160_schedule_read(qt2160); in qt2160_probe()
425 qt2160_unregister_leds(qt2160); in qt2160_probe()
428 free_irq(client->irq, qt2160); in qt2160_probe()
431 kfree(qt2160); in qt2160_probe()
437 struct qt2160_data *qt2160 = i2c_get_clientdata(client); in qt2160_remove() local
439 qt2160_unregister_leds(qt2160); in qt2160_remove()
443 free_irq(client->irq, qt2160); in qt2160_remove()
445 cancel_delayed_work_sync(&qt2160->dwork); in qt2160_remove()
447 input_unregister_device(qt2160->input); in qt2160_remove()
448 kfree(qt2160); in qt2160_remove()