Lines Matching refs:touchkey

33 	struct cypress_sf_data *touchkey = devid;  in cypress_sf_irq_handler()  local
38 val = i2c_smbus_read_byte_data(touchkey->client, in cypress_sf_irq_handler()
41 dev_err(&touchkey->client->dev, in cypress_sf_irq_handler()
47 bitmap_xor(&changed, &keystates, &touchkey->keystates, in cypress_sf_irq_handler()
48 touchkey->num_keys); in cypress_sf_irq_handler()
50 for_each_set_bit(key, &changed, touchkey->num_keys) { in cypress_sf_irq_handler()
52 dev_dbg(&touchkey->client->dev, in cypress_sf_irq_handler()
54 input_report_key(touchkey->input_dev, in cypress_sf_irq_handler()
55 touchkey->keycodes[key], new_state); in cypress_sf_irq_handler()
58 input_sync(touchkey->input_dev); in cypress_sf_irq_handler()
59 touchkey->keystates = keystates; in cypress_sf_irq_handler()
66 struct cypress_sf_data *touchkey; in cypress_sf_probe() local
69 touchkey = devm_kzalloc(&client->dev, sizeof(*touchkey), GFP_KERNEL); in cypress_sf_probe()
70 if (!touchkey) in cypress_sf_probe()
73 touchkey->client = client; in cypress_sf_probe()
74 i2c_set_clientdata(client, touchkey); in cypress_sf_probe()
76 touchkey->regulators[0].supply = "vdd"; in cypress_sf_probe()
77 touchkey->regulators[1].supply = "avdd"; in cypress_sf_probe()
80 ARRAY_SIZE(touchkey->regulators), in cypress_sf_probe()
81 touchkey->regulators); in cypress_sf_probe()
87 touchkey->num_keys = device_property_read_u32_array(&client->dev, in cypress_sf_probe()
90 if (touchkey->num_keys < 0) { in cypress_sf_probe()
92 touchkey->num_keys = 2; in cypress_sf_probe()
95 touchkey->keycodes = devm_kcalloc(&client->dev, in cypress_sf_probe()
96 touchkey->num_keys, in cypress_sf_probe()
97 sizeof(*touchkey->keycodes), in cypress_sf_probe()
99 if (!touchkey->keycodes) in cypress_sf_probe()
103 touchkey->keycodes, in cypress_sf_probe()
104 touchkey->num_keys); in cypress_sf_probe()
112 touchkey->keycodes[0] = KEY_BACK; in cypress_sf_probe()
113 touchkey->keycodes[1] = KEY_MENU; in cypress_sf_probe()
116 error = regulator_bulk_enable(ARRAY_SIZE(touchkey->regulators), in cypress_sf_probe()
117 touchkey->regulators); in cypress_sf_probe()
124 touchkey->input_dev = devm_input_allocate_device(&client->dev); in cypress_sf_probe()
125 if (!touchkey->input_dev) { in cypress_sf_probe()
130 touchkey->input_dev->name = CYPRESS_SF_DEV_NAME; in cypress_sf_probe()
131 touchkey->input_dev->id.bustype = BUS_I2C; in cypress_sf_probe()
133 for (key = 0; key < touchkey->num_keys; ++key) in cypress_sf_probe()
134 input_set_capability(touchkey->input_dev, in cypress_sf_probe()
135 EV_KEY, touchkey->keycodes[key]); in cypress_sf_probe()
137 error = input_register_device(touchkey->input_dev); in cypress_sf_probe()
147 CYPRESS_SF_DEV_NAME, touchkey); in cypress_sf_probe()
160 struct cypress_sf_data *touchkey = i2c_get_clientdata(client); in cypress_sf_suspend() local
165 error = regulator_bulk_disable(ARRAY_SIZE(touchkey->regulators), in cypress_sf_suspend()
166 touchkey->regulators); in cypress_sf_suspend()
179 struct cypress_sf_data *touchkey = i2c_get_clientdata(client); in cypress_sf_resume() local
182 error = regulator_bulk_enable(ARRAY_SIZE(touchkey->regulators), in cypress_sf_resume()
183 touchkey->regulators); in cypress_sf_resume()