Lines Matching full:hid
3 * ISHTP-HID glue driver.
8 #include <linux/hid.h>
11 #include "ishtp-hid.h"
14 * ishtp_hid_parse() - hid-core .parse() callback
15 * @hid: hid device instance
21 static int ishtp_hid_parse(struct hid_device *hid) in ishtp_hid_parse() argument
23 struct ishtp_hid_data *hid_data = hid->driver_data; in ishtp_hid_parse()
27 rv = hid_parse_report(hid, client_data->report_descr[hid_data->index], in ishtp_hid_parse()
36 static int ishtp_hid_start(struct hid_device *hid) in ishtp_hid_start() argument
41 static void ishtp_hid_stop(struct hid_device *hid) in ishtp_hid_stop() argument
45 static int ishtp_hid_open(struct hid_device *hid) in ishtp_hid_open() argument
50 static void ishtp_hid_close(struct hid_device *hid) in ishtp_hid_close() argument
54 static int ishtp_raw_request(struct hid_device *hid, unsigned char reportnum, in ishtp_raw_request() argument
58 struct ishtp_hid_data *hid_data = hid->driver_data; in ishtp_raw_request()
73 hid_ishtp_get_report(hid, reportnum, rtype); in ishtp_raw_request()
86 hid_ishtp_set_feature(hid, ishtp_buf, ishtp_buf_len, reportnum); in ishtp_raw_request()
91 hid_hw_wait(hid); in ishtp_raw_request()
97 * ishtp_hid_request() - hid-core .request() callback
98 * @hid: hid device instance
104 static void ishtp_hid_request(struct hid_device *hid, struct hid_report *rep, in ishtp_hid_request() argument
107 struct ishtp_hid_data *hid_data = hid->driver_data; in ishtp_hid_request()
108 /* the specific report length, just HID part of it */ in ishtp_hid_request()
119 hid_ishtp_get_report(hid, rep->id, rep->type); in ishtp_hid_request()
131 hid_ishtp_set_feature(hid, buf, len, rep->id); in ishtp_hid_request()
138 * ishtp_wait_for_response() - hid-core .wait() callback
139 * @hid: hid device instance
145 static int ishtp_wait_for_response(struct hid_device *hid) in ishtp_wait_for_response() argument
147 struct ishtp_hid_data *hid_data = hid->driver_data; in ishtp_wait_for_response()
150 hid_ishtp_trace(client_data, "%s hid %p\n", __func__, hid); in ishtp_wait_for_response()
161 hid_err(hid, in ishtp_wait_for_response()
165 hid_ishtp_trace(client_data, "%s hid %p done\n", __func__, hid); in ishtp_wait_for_response()
174 * @hid: hid device instance
178 void ishtp_hid_wakeup(struct hid_device *hid) in ishtp_hid_wakeup() argument
180 struct ishtp_hid_data *hid_data = hid->driver_data; in ishtp_hid_wakeup()
198 * ishtp_hid_probe() - hid register ll driver
199 * @cur_hid_dev: Index of hid device calling to register
202 * This function is used to allocate and add HID device.
210 struct hid_device *hid; in ishtp_hid_probe() local
213 hid = hid_allocate_device(); in ishtp_hid_probe()
214 if (IS_ERR(hid)) in ishtp_hid_probe()
215 return PTR_ERR(hid); in ishtp_hid_probe()
227 hid->driver_data = hid_data; in ishtp_hid_probe()
229 client_data->hid_sensor_hubs[cur_hid_dev] = hid; in ishtp_hid_probe()
231 hid->ll_driver = &ishtp_hid_ll_driver; in ishtp_hid_probe()
232 hid->bus = BUS_INTEL_ISHTP; in ishtp_hid_probe()
233 hid->dev.parent = ishtp_device(client_data->cl_device); in ishtp_hid_probe()
235 hid->version = le16_to_cpu(ISH_HID_VERSION); in ishtp_hid_probe()
236 hid->vendor = le16_to_cpu(client_data->hid_devices[cur_hid_dev].vid); in ishtp_hid_probe()
237 hid->product = le16_to_cpu(client_data->hid_devices[cur_hid_dev].pid); in ishtp_hid_probe()
238 snprintf(hid->name, sizeof(hid->name), "%s %04X:%04X", "hid-ishtp", in ishtp_hid_probe()
239 hid->vendor, hid->product); in ishtp_hid_probe()
241 rv = hid_add_device(hid); in ishtp_hid_probe()
245 hid_ishtp_trace(client_data, "%s allocated hid %p\n", __func__, hid); in ishtp_hid_probe()
252 hid_destroy_device(hid); in ishtp_hid_probe()
257 * ishtp_hid_remove() - Remove registered hid device
260 * This function is used to destroy allocatd HID device.