Lines Matching refs:qt2160

3  *  qt2160.c - Atmel AT42QT2160 Touch Sense Controller
46 struct qt2160_data *qt2160;
74 struct qt2160_data *qt2160 = led->qt2160;
75 struct i2c_client *client = qt2160->client;
94 * of every LED in the qt2160. It's a HW limitation.
158 static int qt2160_get_key_matrix(struct qt2160_data *qt2160)
160 struct i2c_client *client = qt2160->client;
161 struct input_dev *input = qt2160->input;
179 old_matrix = qt2160->key_matrix;
180 qt2160->key_matrix = new_matrix = (regs[2] << 8) | regs[1];
187 input_report_key(input, qt2160->keycodes[i], keyval);
200 struct qt2160_data *qt2160 = _qt2160;
202 mod_delayed_work(system_wq, &qt2160->dwork, 0);
207 static void qt2160_schedule_read(struct qt2160_data *qt2160)
209 schedule_delayed_work(&qt2160->dwork, QT2160_CYCLE_INTERVAL);
214 struct qt2160_data *qt2160 =
217 dev_dbg(&qt2160->client->dev, "worker\n");
219 qt2160_get_key_matrix(qt2160);
222 qt2160_schedule_read(qt2160);
260 static int qt2160_register_leds(struct qt2160_data *qt2160)
262 struct i2c_client *client = qt2160->client;
267 struct qt2160_led *led = &qt2160->leds[i];
269 snprintf(led->name, sizeof(led->name), "qt2160:x%d", i);
274 led->qt2160 = qt2160;
289 static void qt2160_unregister_leds(struct qt2160_data *qt2160)
294 led_classdev_unregister(&qt2160->leds[i].cdev);
299 static inline int qt2160_register_leds(struct qt2160_data *qt2160)
304 static inline void qt2160_unregister_leds(struct qt2160_data *qt2160)
344 struct qt2160_data *qt2160;
362 qt2160 = kzalloc(sizeof(struct qt2160_data), GFP_KERNEL);
364 if (!qt2160 || !input) {
370 qt2160->client = client;
371 qt2160->input = input;
372 INIT_DELAYED_WORK(&qt2160->dwork, qt2160_worker);
377 input->keycode = qt2160->keycodes;
378 input->keycodesize = sizeof(qt2160->keycodes[0]);
384 qt2160->keycodes[i] = qt2160_key2code[i];
398 IRQF_TRIGGER_FALLING, "qt2160", qt2160);
406 error = qt2160_register_leds(qt2160);
412 error = input_register_device(qt2160->input);
419 i2c_set_clientdata(client, qt2160);
420 qt2160_schedule_read(qt2160);
425 qt2160_unregister_leds(qt2160);
428 free_irq(client->irq, qt2160);
431 kfree(qt2160);
437 struct qt2160_data *qt2160 = i2c_get_clientdata(client);
439 qt2160_unregister_leds(qt2160);
443 free_irq(client->irq, qt2160);
445 cancel_delayed_work_sync(&qt2160->dwork);
447 input_unregister_device(qt2160->input);
448 kfree(qt2160);
454 { "qt2160", 0, },
462 .name = "qt2160",