Lines Matching refs:touchkey

33 	struct cypress_sf_data *touchkey = devid;
38 val = i2c_smbus_read_byte_data(touchkey->client,
41 dev_err(&touchkey->client->dev,
47 bitmap_xor(&changed, &keystates, &touchkey->keystates,
48 touchkey->num_keys);
50 for_each_set_bit(key, &changed, touchkey->num_keys) {
52 dev_dbg(&touchkey->client->dev,
54 input_report_key(touchkey->input_dev,
55 touchkey->keycodes[key], new_state);
58 input_sync(touchkey->input_dev);
59 touchkey->keystates = keystates;
66 struct cypress_sf_data *touchkey = arg;
68 regulator_bulk_disable(ARRAY_SIZE(touchkey->regulators),
69 touchkey->regulators);
74 struct cypress_sf_data *touchkey;
77 touchkey = devm_kzalloc(&client->dev, sizeof(*touchkey), GFP_KERNEL);
78 if (!touchkey)
81 touchkey->client = client;
82 i2c_set_clientdata(client, touchkey);
84 touchkey->regulators[0].supply = "vdd";
85 touchkey->regulators[1].supply = "avdd";
88 ARRAY_SIZE(touchkey->regulators),
89 touchkey->regulators);
95 touchkey->num_keys = device_property_read_u32_array(&client->dev,
98 if (touchkey->num_keys < 0) {
100 touchkey->num_keys = 2;
103 touchkey->keycodes = devm_kcalloc(&client->dev,
104 touchkey->num_keys,
105 sizeof(*touchkey->keycodes),
107 if (!touchkey->keycodes)
111 touchkey->keycodes,
112 touchkey->num_keys);
120 touchkey->keycodes[0] = KEY_BACK;
121 touchkey->keycodes[1] = KEY_MENU;
124 error = regulator_bulk_enable(ARRAY_SIZE(touchkey->regulators),
125 touchkey->regulators);
134 touchkey);
138 touchkey->input_dev = devm_input_allocate_device(&client->dev);
139 if (!touchkey->input_dev) {
144 touchkey->input_dev->name = CYPRESS_SF_DEV_NAME;
145 touchkey->input_dev->id.bustype = BUS_I2C;
147 for (key = 0; key < touchkey->num_keys; ++key)
148 input_set_capability(touchkey->input_dev,
149 EV_KEY, touchkey->keycodes[key]);
151 error = input_register_device(touchkey->input_dev);
161 CYPRESS_SF_DEV_NAME, touchkey);
174 struct cypress_sf_data *touchkey = i2c_get_clientdata(client);
179 error = regulator_bulk_disable(ARRAY_SIZE(touchkey->regulators),
180 touchkey->regulators);
193 struct cypress_sf_data *touchkey = i2c_get_clientdata(client);
196 error = regulator_bulk_enable(ARRAY_SIZE(touchkey->regulators),
197 touchkey->regulators);