Lines Matching full:mpr121
3 * Touchkey driver for Freescale MPR121 Controllor
54 /* MPR121 has 12 keys */
87 struct mpr121_touchkey *mpr121 = input_get_drvdata(dev); in mpr_touchkey_report() local
88 struct input_dev *input = mpr121->input_dev; in mpr_touchkey_report()
89 struct i2c_client *client = mpr121->client; in mpr_touchkey_report()
109 bit_changed = reg ^ mpr121->statusbits; in mpr_touchkey_report()
110 mpr121->statusbits = reg; in mpr_touchkey_report()
111 for_each_set_bit(key_num, &bit_changed, mpr121->keycount) { in mpr_touchkey_report()
115 key_val = mpr121->keycodes[key_num]; in mpr_touchkey_report()
129 struct mpr121_touchkey *mpr121 = dev_id; in mpr_touchkey_interrupt() local
131 mpr_touchkey_report(mpr121->input_dev); in mpr_touchkey_interrupt()
136 static int mpr121_phys_init(struct mpr121_touchkey *mpr121, in mpr121_phys_init() argument
166 * The internal MPR121-auto-configuration can do this if it's in mpr121_phys_init()
182 eleconf = mpr121->keycount | ELECTRODE_CONF_QUICK_CHARGE; in mpr121_phys_init()
188 dev_dbg(&client->dev, "set up with %x keys.\n", mpr121->keycount); in mpr121_phys_init()
201 struct mpr121_touchkey *mpr121; in mpr_touchkey_probe() local
211 mpr121 = devm_kzalloc(dev, sizeof(*mpr121), GFP_KERNEL); in mpr_touchkey_probe()
212 if (!mpr121) in mpr_touchkey_probe()
219 mpr121->client = client; in mpr_touchkey_probe()
220 mpr121->input_dev = input_dev; in mpr_touchkey_probe()
221 mpr121->keycount = device_property_count_u32(dev, "linux,keycodes"); in mpr_touchkey_probe()
222 if (mpr121->keycount > MPR121_MAX_KEY_COUNT) { in mpr_touchkey_probe()
223 dev_err(dev, "too many keys defined (%d)\n", mpr121->keycount); in mpr_touchkey_probe()
228 mpr121->keycodes, in mpr_touchkey_probe()
229 mpr121->keycount); in mpr_touchkey_probe()
236 input_dev->name = "Freescale MPR121 Touchkey"; in mpr_touchkey_probe()
242 input_set_drvdata(input_dev, mpr121); in mpr_touchkey_probe()
244 input_dev->keycode = mpr121->keycodes; in mpr_touchkey_probe()
245 input_dev->keycodesize = sizeof(mpr121->keycodes[0]); in mpr_touchkey_probe()
246 input_dev->keycodemax = mpr121->keycount; in mpr_touchkey_probe()
248 for (i = 0; i < mpr121->keycount; i++) in mpr_touchkey_probe()
249 input_set_capability(input_dev, EV_KEY, mpr121->keycodes[i]); in mpr_touchkey_probe()
251 error = mpr121_phys_init(mpr121, client, vdd_uv); in mpr_touchkey_probe()
264 dev->driver->name, mpr121); in mpr_touchkey_probe()
297 i2c_set_clientdata(client, mpr121); in mpr_touchkey_probe()
319 struct mpr121_touchkey *mpr121 = i2c_get_clientdata(client); in mpr_resume() local
325 mpr121->keycount); in mpr_resume()
340 { .compatible = "fsl,mpr121-touchkey" },
348 .name = "mpr121",
360 MODULE_DESCRIPTION("Touch Key driver for Freescale MPR121 Chip");