Lines Matching refs:hid_ishtp_cl
36 static void report_bad_packet(struct ishtp_cl *hid_ishtp_cl, void *recv_buf, in report_bad_packet() argument
40 struct ishtp_cl_data *client_data = hid_ishtp_cl->client_data; in report_bad_packet()
65 static void process_recv(struct ishtp_cl *hid_ishtp_cl, void *recv_buf, in process_recv() argument
77 struct ishtp_cl_data *client_data = hid_ishtp_cl->client_data; in process_recv()
91 ish_hw_reset(hid_ishtp_cl->dev); in process_recv()
102 report_bad_packet(hid_ishtp_cl, recv_msg, cur_pos, in process_recv()
104 ish_hw_reset(hid_ishtp_cl->dev); in process_recv()
116 report_bad_packet(hid_ishtp_cl, recv_msg, in process_recv()
119 ish_hw_reset(hid_ishtp_cl->dev); in process_recv()
165 report_bad_packet(hid_ishtp_cl, recv_msg, in process_recv()
168 ish_hw_reset(hid_ishtp_cl->dev); in process_recv()
190 report_bad_packet(hid_ishtp_cl, recv_msg, in process_recv()
193 ish_hw_reset(hid_ishtp_cl->dev); in process_recv()
296 report_bad_packet(hid_ishtp_cl, recv_msg, cur_pos, in process_recv()
298 ish_hw_reset(hid_ishtp_cl->dev); in process_recv()
323 struct ishtp_cl *hid_ishtp_cl = device->driver_data; in ish_cl_event_cb() local
328 if (!hid_ishtp_cl) in ish_cl_event_cb()
331 spin_lock_irqsave(&hid_ishtp_cl->in_process_spinlock, flags); in ish_cl_event_cb()
332 while (!list_empty(&hid_ishtp_cl->in_process_list.list)) { in ish_cl_event_cb()
334 hid_ishtp_cl->in_process_list.list.next, in ish_cl_event_cb()
337 spin_unlock_irqrestore(&hid_ishtp_cl->in_process_spinlock, in ish_cl_event_cb()
346 process_recv(hid_ishtp_cl, rb_in_proc->buffer.data, r_length); in ish_cl_event_cb()
349 spin_lock_irqsave(&hid_ishtp_cl->in_process_spinlock, flags); in ish_cl_event_cb()
351 spin_unlock_irqrestore(&hid_ishtp_cl->in_process_spinlock, flags); in ish_cl_event_cb()
395 rv = ishtp_cl_send(client_data->hid_ishtp_cl, buf, len); in hid_ishtp_set_feature()
441 rv = ishtp_cl_send(client_data->hid_ishtp_cl, (uint8_t *)&msg, in hid_ishtp_get_report()
486 static int ishtp_enum_enum_devices(struct ishtp_cl *hid_ishtp_cl) in ishtp_enum_enum_devices() argument
489 struct ishtp_cl_data *client_data = hid_ishtp_cl->client_data; in ishtp_enum_enum_devices()
496 rv = ishtp_cl_send(hid_ishtp_cl, (unsigned char *)&msg, in ishtp_enum_enum_devices()
510 rv = ishtp_cl_send(hid_ishtp_cl, in ishtp_enum_enum_devices()
526 dev_info(&hid_ishtp_cl->device->dev, in ishtp_enum_enum_devices()
542 static int ishtp_get_hid_descriptor(struct ishtp_cl *hid_ishtp_cl, int index) in ishtp_get_hid_descriptor() argument
545 struct ishtp_cl_data *client_data = hid_ishtp_cl->client_data; in ishtp_get_hid_descriptor()
553 rv = ishtp_cl_send(hid_ishtp_cl, (unsigned char *) &msg, in ishtp_get_hid_descriptor()
588 static int ishtp_get_report_descriptor(struct ishtp_cl *hid_ishtp_cl, in ishtp_get_report_descriptor() argument
592 struct ishtp_cl_data *client_data = hid_ishtp_cl->client_data; in ishtp_get_report_descriptor()
600 rv = ishtp_cl_send(hid_ishtp_cl, (unsigned char *) &msg, in ishtp_get_report_descriptor()
637 static int hid_ishtp_cl_init(struct ishtp_cl *hid_ishtp_cl, int reset) in hid_ishtp_cl_init() argument
641 struct ishtp_cl_data *client_data = hid_ishtp_cl->client_data; in hid_ishtp_cl_init()
648 rv = ishtp_cl_link(hid_ishtp_cl, ISHTP_HOST_CLIENT_ID_ANY); in hid_ishtp_cl_init()
657 dev = hid_ishtp_cl->dev; in hid_ishtp_cl_init()
660 hid_ishtp_cl->rx_ring_size = HID_CL_RX_RING_SIZE; in hid_ishtp_cl_init()
661 hid_ishtp_cl->tx_ring_size = HID_CL_TX_RING_SIZE; in hid_ishtp_cl_init()
671 hid_ishtp_cl->fw_client_id = dev->fw_clients[i].client_id; in hid_ishtp_cl_init()
673 hid_ishtp_cl->state = ISHTP_CL_CONNECTING; in hid_ishtp_cl_init()
675 rv = ishtp_cl_connect(hid_ishtp_cl); in hid_ishtp_cl_init()
685 ishtp_register_event_cb(hid_ishtp_cl->device, ish_cl_event_cb); in hid_ishtp_cl_init()
687 rv = ishtp_enum_enum_devices(hid_ishtp_cl); in hid_ishtp_cl_init()
697 rv = ishtp_get_hid_descriptor(hid_ishtp_cl, i); in hid_ishtp_cl_init()
701 rv = ishtp_get_report_descriptor(hid_ishtp_cl, i); in hid_ishtp_cl_init()
723 hid_ishtp_cl->state = ISHTP_CL_DISCONNECTING; in hid_ishtp_cl_init()
724 ishtp_cl_disconnect(hid_ishtp_cl); in hid_ishtp_cl_init()
726 ishtp_cl_unlink(hid_ishtp_cl); in hid_ishtp_cl_init()
736 static void hid_ishtp_cl_deinit(struct ishtp_cl *hid_ishtp_cl) in hid_ishtp_cl_deinit() argument
738 ishtp_cl_unlink(hid_ishtp_cl); in hid_ishtp_cl_deinit()
739 ishtp_cl_flush_queues(hid_ishtp_cl); in hid_ishtp_cl_deinit()
742 ishtp_cl_free(hid_ishtp_cl); in hid_ishtp_cl_deinit()
748 struct ishtp_cl *hid_ishtp_cl; in hid_ishtp_cl_reset_handler() local
755 hid_ishtp_cl = client_data->hid_ishtp_cl; in hid_ishtp_cl_reset_handler()
759 hid_ishtp_cl); in hid_ishtp_cl_reset_handler()
762 hid_ishtp_cl_deinit(hid_ishtp_cl); in hid_ishtp_cl_reset_handler()
764 hid_ishtp_cl = ishtp_cl_allocate(cl_device->ishtp_dev); in hid_ishtp_cl_reset_handler()
765 if (!hid_ishtp_cl) in hid_ishtp_cl_reset_handler()
768 cl_device->driver_data = hid_ishtp_cl; in hid_ishtp_cl_reset_handler()
769 hid_ishtp_cl->client_data = client_data; in hid_ishtp_cl_reset_handler()
770 client_data->hid_ishtp_cl = hid_ishtp_cl; in hid_ishtp_cl_reset_handler()
775 rv = hid_ishtp_cl_init(hid_ishtp_cl, 1); in hid_ishtp_cl_reset_handler()
783 __func__, hid_ishtp_cl); in hid_ishtp_cl_reset_handler()
797 struct ishtp_cl *hid_ishtp_cl; in hid_ishtp_cl_probe() local
813 hid_ishtp_cl = ishtp_cl_allocate(cl_device->ishtp_dev); in hid_ishtp_cl_probe()
814 if (!hid_ishtp_cl) in hid_ishtp_cl_probe()
817 cl_device->driver_data = hid_ishtp_cl; in hid_ishtp_cl_probe()
818 hid_ishtp_cl->client_data = client_data; in hid_ishtp_cl_probe()
819 client_data->hid_ishtp_cl = hid_ishtp_cl; in hid_ishtp_cl_probe()
827 rv = hid_ishtp_cl_init(hid_ishtp_cl, 0); in hid_ishtp_cl_probe()
829 ishtp_cl_free(hid_ishtp_cl); in hid_ishtp_cl_probe()
847 struct ishtp_cl *hid_ishtp_cl = cl_device->driver_data; in hid_ishtp_cl_remove() local
848 struct ishtp_cl_data *client_data = hid_ishtp_cl->client_data; in hid_ishtp_cl_remove()
851 hid_ishtp_cl); in hid_ishtp_cl_remove()
854 hid_ishtp_cl->state = ISHTP_CL_DISCONNECTING; in hid_ishtp_cl_remove()
855 ishtp_cl_disconnect(hid_ishtp_cl); in hid_ishtp_cl_remove()
858 hid_ishtp_cl_deinit(hid_ishtp_cl); in hid_ishtp_cl_remove()
860 hid_ishtp_cl = NULL; in hid_ishtp_cl_remove()
877 struct ishtp_cl *hid_ishtp_cl = cl_device->driver_data; in hid_ishtp_cl_reset() local
878 struct ishtp_cl_data *client_data = hid_ishtp_cl->client_data; in hid_ishtp_cl_reset()
881 hid_ishtp_cl); in hid_ishtp_cl_reset()
901 struct ishtp_cl *hid_ishtp_cl = cl_device->driver_data; in hid_ishtp_cl_suspend() local
902 struct ishtp_cl_data *client_data = hid_ishtp_cl->client_data; in hid_ishtp_cl_suspend()
905 hid_ishtp_cl); in hid_ishtp_cl_suspend()
922 struct ishtp_cl *hid_ishtp_cl = cl_device->driver_data; in hid_ishtp_cl_resume() local
923 struct ishtp_cl_data *client_data = hid_ishtp_cl->client_data; in hid_ishtp_cl_resume()
926 hid_ishtp_cl); in hid_ishtp_cl_resume()