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 = arg; in cypress_sf_disable_regulators() local
68 regulator_bulk_disable(ARRAY_SIZE(touchkey->regulators), in cypress_sf_disable_regulators()
69 touchkey->regulators); in cypress_sf_disable_regulators()
74 struct cypress_sf_data *touchkey; in cypress_sf_probe() local
77 touchkey = devm_kzalloc(&client->dev, sizeof(*touchkey), GFP_KERNEL); in cypress_sf_probe()
78 if (!touchkey) in cypress_sf_probe()
81 touchkey->client = client; in cypress_sf_probe()
82 i2c_set_clientdata(client, touchkey); in cypress_sf_probe()
84 touchkey->regulators[0].supply = "vdd"; in cypress_sf_probe()
85 touchkey->regulators[1].supply = "avdd"; in cypress_sf_probe()
88 ARRAY_SIZE(touchkey->regulators), in cypress_sf_probe()
89 touchkey->regulators); in cypress_sf_probe()
95 touchkey->num_keys = device_property_read_u32_array(&client->dev, in cypress_sf_probe()
98 if (touchkey->num_keys < 0) { in cypress_sf_probe()
100 touchkey->num_keys = 2; in cypress_sf_probe()
103 touchkey->keycodes = devm_kcalloc(&client->dev, in cypress_sf_probe()
104 touchkey->num_keys, in cypress_sf_probe()
105 sizeof(*touchkey->keycodes), in cypress_sf_probe()
107 if (!touchkey->keycodes) in cypress_sf_probe()
111 touchkey->keycodes, in cypress_sf_probe()
112 touchkey->num_keys); in cypress_sf_probe()
120 touchkey->keycodes[0] = KEY_BACK; in cypress_sf_probe()
121 touchkey->keycodes[1] = KEY_MENU; in cypress_sf_probe()
124 error = regulator_bulk_enable(ARRAY_SIZE(touchkey->regulators), in cypress_sf_probe()
125 touchkey->regulators); in cypress_sf_probe()
134 touchkey); in cypress_sf_probe()
138 touchkey->input_dev = devm_input_allocate_device(&client->dev); in cypress_sf_probe()
139 if (!touchkey->input_dev) { in cypress_sf_probe()
144 touchkey->input_dev->name = CYPRESS_SF_DEV_NAME; in cypress_sf_probe()
145 touchkey->input_dev->id.bustype = BUS_I2C; in cypress_sf_probe()
147 for (key = 0; key < touchkey->num_keys; ++key) in cypress_sf_probe()
148 input_set_capability(touchkey->input_dev, in cypress_sf_probe()
149 EV_KEY, touchkey->keycodes[key]); in cypress_sf_probe()
151 error = input_register_device(touchkey->input_dev); in cypress_sf_probe()
161 CYPRESS_SF_DEV_NAME, touchkey); in cypress_sf_probe()
174 struct cypress_sf_data *touchkey = i2c_get_clientdata(client); in cypress_sf_suspend() local
179 error = regulator_bulk_disable(ARRAY_SIZE(touchkey->regulators), in cypress_sf_suspend()
180 touchkey->regulators); in cypress_sf_suspend()
193 struct cypress_sf_data *touchkey = i2c_get_clientdata(client); in cypress_sf_resume() local
196 error = regulator_bulk_enable(ARRAY_SIZE(touchkey->regulators), in cypress_sf_resume()
197 touchkey->regulators); in cypress_sf_resume()