Lines Matching refs:shid

34 static int ssam_kbd_get_descriptor(struct surface_hid_device *shid, u8 entry, u8 *buf, size_t len)  in ssam_kbd_get_descriptor()  argument
40 rqst.target_category = shid->uid.category; in ssam_kbd_get_descriptor()
41 rqst.target_id = shid->uid.target; in ssam_kbd_get_descriptor()
43 rqst.instance_id = shid->uid.instance; in ssam_kbd_get_descriptor()
52 status = ssam_retry(ssam_request_do_sync_onstack, shid->ctrl, &rqst, &rsp, sizeof(entry)); in ssam_kbd_get_descriptor()
57 dev_err(shid->dev, "invalid descriptor length: got %zu, expected, %zu\n", in ssam_kbd_get_descriptor()
65 static int ssam_kbd_set_caps_led(struct surface_hid_device *shid, bool value) in ssam_kbd_set_caps_led() argument
70 rqst.target_category = shid->uid.category; in ssam_kbd_set_caps_led()
71 rqst.target_id = shid->uid.target; in ssam_kbd_set_caps_led()
73 rqst.instance_id = shid->uid.instance; in ssam_kbd_set_caps_led()
78 return ssam_retry(ssam_request_do_sync_onstack, shid->ctrl, &rqst, NULL, sizeof(value_u8)); in ssam_kbd_set_caps_led()
81 static int ssam_kbd_get_feature_report(struct surface_hid_device *shid, u8 *buf, size_t len) in ssam_kbd_get_feature_report() argument
88 rqst.target_category = shid->uid.category; in ssam_kbd_get_feature_report()
89 rqst.target_id = shid->uid.target; in ssam_kbd_get_feature_report()
91 rqst.instance_id = shid->uid.instance; in ssam_kbd_get_feature_report()
100 status = ssam_retry(ssam_request_do_sync_onstack, shid->ctrl, &rqst, &rsp, sizeof(payload)); in ssam_kbd_get_feature_report()
105 dev_err(shid->dev, "invalid feature report length: got %zu, expected, %zu\n", in ssam_kbd_get_feature_report()
126 struct surface_hid_device *shid = container_of(nf, struct surface_hid_device, notif); in ssam_kbd_event_fn() local
133 if (shid->uid.category != event->target_category) in ssam_kbd_event_fn()
136 if (shid->uid.target != event->target_id) in ssam_kbd_event_fn()
139 if (shid->uid.instance != event->instance_id) in ssam_kbd_event_fn()
145 hid_input_report(shid->hid, HID_INPUT_REPORT, (u8 *)&event->data[0], event->length, 0); in ssam_kbd_event_fn()
184 static int skbd_output_report(struct surface_hid_device *shid, u8 rprt_id, u8 *buf, size_t len) in skbd_output_report() argument
189 caps_led = skbd_get_caps_led_value(shid->hid, rprt_id, buf, len); in skbd_output_report()
193 status = ssam_kbd_set_caps_led(shid, caps_led); in skbd_output_report()
200 static int skbd_get_feature_report(struct surface_hid_device *shid, u8 rprt_id, u8 *buf, size_t len) in skbd_get_feature_report() argument
214 status = ssam_kbd_get_feature_report(shid, report, ARRAY_SIZE(report)); in skbd_get_feature_report()
225 static int skbd_set_feature_report(struct surface_hid_device *shid, u8 rprt_id, u8 *buf, size_t len) in skbd_set_feature_report() argument
237 struct surface_hid_device *shid; in surface_kbd_probe() local
244 shid = devm_kzalloc(&pdev->dev, sizeof(*shid), GFP_KERNEL); in surface_kbd_probe()
245 if (!shid) in surface_kbd_probe()
248 shid->dev = &pdev->dev; in surface_kbd_probe()
249 shid->ctrl = ctrl; in surface_kbd_probe()
251 shid->uid.domain = SSAM_DOMAIN_SERIALHUB; in surface_kbd_probe()
252 shid->uid.category = SSAM_SSH_TC_KBD; in surface_kbd_probe()
253 shid->uid.target = SSAM_SSH_TID_KIP; in surface_kbd_probe()
254 shid->uid.instance = 0; in surface_kbd_probe()
255 shid->uid.function = 0; in surface_kbd_probe()
257 shid->notif.base.priority = 1; in surface_kbd_probe()
258 shid->notif.base.fn = ssam_kbd_event_fn; in surface_kbd_probe()
259 shid->notif.event.reg = SSAM_EVENT_REGISTRY_SAM; in surface_kbd_probe()
260 shid->notif.event.id.target_category = shid->uid.category; in surface_kbd_probe()
261 shid->notif.event.id.instance = shid->uid.instance; in surface_kbd_probe()
262 shid->notif.event.mask = SSAM_EVENT_MASK_NONE; in surface_kbd_probe()
263 shid->notif.event.flags = 0; in surface_kbd_probe()
265 shid->ops.get_descriptor = ssam_kbd_get_descriptor; in surface_kbd_probe()
266 shid->ops.output_report = skbd_output_report; in surface_kbd_probe()
267 shid->ops.get_feature_report = skbd_get_feature_report; in surface_kbd_probe()
268 shid->ops.set_feature_report = skbd_set_feature_report; in surface_kbd_probe()
270 platform_set_drvdata(pdev, shid); in surface_kbd_probe()
271 return surface_hid_device_add(shid); in surface_kbd_probe()