• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/input/keyboard/

Lines Matching refs:keypad

115 static int stmpe_keypad_read_data(struct stmpe_keypad *keypad, u8 *data)
117 const struct stmpe_keypad_variant *variant = keypad->variant;
118 struct stmpe *stmpe = keypad->stmpe;
139 struct stmpe_keypad *keypad = dev;
140 struct input_dev *input = keypad->input;
141 const struct stmpe_keypad_variant *variant = keypad->variant;
146 ret = stmpe_keypad_read_data(keypad, fifo);
162 input_report_key(input, keypad->keymap[code], !up);
169 static int __devinit stmpe_keypad_altfunc_init(struct stmpe_keypad *keypad)
171 const struct stmpe_keypad_variant *variant = keypad->variant;
174 struct stmpe *stmpe = keypad->stmpe;
179 * Figure out which pins need to be set to the keypad alternate
183 * for the keypad.
185 * keypad->{cols,rows} are a bitmask of which pins (of the ones useable
186 * for the keypad) are used on the board.
192 if (keypad->cols & (1 << i))
201 if (keypad->rows & (1 << i))
210 static int __devinit stmpe_keypad_chip_init(struct stmpe_keypad *keypad)
212 const struct stmpe_keypad_platform_data *plat = keypad->plat;
213 const struct stmpe_keypad_variant *variant = keypad->variant;
214 struct stmpe *stmpe = keypad->stmpe;
227 ret = stmpe_keypad_altfunc_init(keypad);
231 ret = stmpe_reg_write(stmpe, STMPE_KPC_COL, keypad->cols);
235 ret = stmpe_reg_write(stmpe, STMPE_KPC_ROW_LSB, keypad->rows);
242 keypad->rows >> 8);
264 struct stmpe_keypad *keypad;
270 plat = stmpe->pdata->keypad;
278 keypad = kzalloc(sizeof(struct stmpe_keypad), GFP_KERNEL);
279 if (!keypad)
288 input->name = "STMPE keypad";
298 input->keycode = keypad->keymap;
299 input->keycodesize = sizeof(keypad->keymap[0]);
300 input->keycodemax = ARRAY_SIZE(keypad->keymap);
308 keypad->cols |= 1 << KEY_COL(key);
309 keypad->rows |= 1 << KEY_ROW(key);
312 keypad->stmpe = stmpe;
313 keypad->plat = plat;
314 keypad->input = input;
315 keypad->variant = &stmpe_keypad_variants[stmpe->partnum];
317 ret = stmpe_keypad_chip_init(keypad);
329 "stmpe-keypad", keypad);
335 platform_set_drvdata(pdev, keypad);
345 kfree(keypad);
351 struct stmpe_keypad *keypad = platform_get_drvdata(pdev);
352 struct stmpe *stmpe = keypad->stmpe;
357 free_irq(irq, keypad);
358 input_unregister_device(keypad->input);
360 kfree(keypad);
366 .driver.name = "stmpe-keypad",
385 MODULE_DESCRIPTION("STMPExxxx keypad driver");