Lines Matching refs:tk

29 	struct dir685_touchkeys *tk = data;  in dir685_tk_irq_thread()  local
30 const int num_bits = min_t(int, ARRAY_SIZE(tk->codes), 16); in dir685_tk_irq_thread()
38 err = i2c_master_recv(tk->client, buf, sizeof(buf)); in dir685_tk_irq_thread()
40 dev_err(tk->dev, "short read %d\n", err); in dir685_tk_irq_thread()
44 dev_dbg(tk->dev, "IN: %*ph\n", (int)sizeof(buf), buf); in dir685_tk_irq_thread()
48 changed = tk->cur_key ^ key; in dir685_tk_irq_thread()
50 dev_dbg(tk->dev, "key %d is %s\n", i, in dir685_tk_irq_thread()
52 input_report_key(tk->input, tk->codes[i], test_bit(i, &key)); in dir685_tk_irq_thread()
56 tk->cur_key = key; in dir685_tk_irq_thread()
57 input_sync(tk->input); in dir685_tk_irq_thread()
66 struct dir685_touchkeys *tk; in dir685_tk_probe() local
70 tk = devm_kzalloc(&client->dev, sizeof(*tk), GFP_KERNEL); in dir685_tk_probe()
71 if (!tk) in dir685_tk_probe()
74 tk->input = devm_input_allocate_device(dev); in dir685_tk_probe()
75 if (!tk->input) in dir685_tk_probe()
78 tk->client = client; in dir685_tk_probe()
79 tk->dev = dev; in dir685_tk_probe()
81 tk->input->keycodesize = sizeof(u16); in dir685_tk_probe()
82 tk->input->keycodemax = ARRAY_SIZE(tk->codes); in dir685_tk_probe()
83 tk->input->keycode = tk->codes; in dir685_tk_probe()
84 tk->codes[0] = KEY_UP; in dir685_tk_probe()
85 tk->codes[1] = KEY_DOWN; in dir685_tk_probe()
86 tk->codes[2] = KEY_LEFT; in dir685_tk_probe()
87 tk->codes[3] = KEY_RIGHT; in dir685_tk_probe()
88 tk->codes[4] = KEY_ENTER; in dir685_tk_probe()
89 tk->codes[5] = KEY_WPS_BUTTON; in dir685_tk_probe()
94 tk->codes[6] = KEY_RESERVED; in dir685_tk_probe()
96 __set_bit(EV_KEY, tk->input->evbit); in dir685_tk_probe()
97 for (i = 0; i < ARRAY_SIZE(tk->codes); i++) in dir685_tk_probe()
98 __set_bit(tk->codes[i], tk->input->keybit); in dir685_tk_probe()
99 __clear_bit(KEY_RESERVED, tk->input->keybit); in dir685_tk_probe()
101 tk->input->name = "D-Link DIR-685 touchkeys"; in dir685_tk_probe()
102 tk->input->id.bustype = BUS_I2C; in dir685_tk_probe()
104 err = input_register_device(tk->input); in dir685_tk_probe()
111 dev_warn(tk->dev, "error setting brightness level\n"); in dir685_tk_probe()
120 "dir685-tk", tk); in dir685_tk_probe()