Lines Matching full:lp

46 static short read_state(struct kp_data *lp)  in read_state()  argument
50 i2c_smbus_write_byte(lp->client, 240); in read_state()
51 x = 0xF & (~(i2c_smbus_read_byte(lp->client) >> 4)); in read_state()
53 i2c_smbus_write_byte(lp->client, 15); in read_state()
54 y = 0xF & (~i2c_smbus_read_byte(lp->client)); in read_state()
66 struct kp_data *lp = dev_id; in pcf8574_kp_irq_handler() local
67 unsigned char nextstate = read_state(lp); in pcf8574_kp_irq_handler()
69 if (lp->laststate != nextstate) { in pcf8574_kp_irq_handler()
70 int key_down = nextstate < ARRAY_SIZE(lp->btncode); in pcf8574_kp_irq_handler()
72 lp->btncode[nextstate] : lp->btncode[lp->laststate]; in pcf8574_kp_irq_handler()
74 input_report_key(lp->idev, keycode, key_down); in pcf8574_kp_irq_handler()
75 input_sync(lp->idev); in pcf8574_kp_irq_handler()
77 lp->laststate = nextstate; in pcf8574_kp_irq_handler()
87 struct kp_data *lp; in pcf8574_kp_probe() local
94 lp = kzalloc(sizeof(*lp), GFP_KERNEL); in pcf8574_kp_probe()
95 if (!lp) in pcf8574_kp_probe()
105 lp->idev = idev; in pcf8574_kp_probe()
106 lp->client = client; in pcf8574_kp_probe()
109 idev->keycode = lp->btncode; in pcf8574_kp_probe()
110 idev->keycodesize = sizeof(lp->btncode[0]); in pcf8574_kp_probe()
111 idev->keycodemax = ARRAY_SIZE(lp->btncode); in pcf8574_kp_probe()
114 if (lp->btncode[i] <= KEY_MAX) { in pcf8574_kp_probe()
115 lp->btncode[i] = pcf8574_kp_btncode[i]; in pcf8574_kp_probe()
116 __set_bit(lp->btncode[i], idev->keybit); in pcf8574_kp_probe()
121 sprintf(lp->name, DRV_NAME); in pcf8574_kp_probe()
122 sprintf(lp->phys, "kp_data/input0"); in pcf8574_kp_probe()
124 idev->name = lp->name; in pcf8574_kp_probe()
125 idev->phys = lp->phys; in pcf8574_kp_probe()
131 lp->laststate = read_state(lp); in pcf8574_kp_probe()
135 DRV_NAME, lp); in pcf8574_kp_probe()
147 i2c_set_clientdata(client, lp); in pcf8574_kp_probe()
151 free_irq(client->irq, lp); in pcf8574_kp_probe()
155 kfree(lp); in pcf8574_kp_probe()
162 struct kp_data *lp = i2c_get_clientdata(client); in pcf8574_kp_remove() local
164 free_irq(client->irq, lp); in pcf8574_kp_remove()
166 input_unregister_device(lp->idev); in pcf8574_kp_remove()
167 kfree(lp); in pcf8574_kp_remove()