linux/drivers/hid/intel-ish-hid
Even Xu a3a44d2d3a HID: Intel-ish-hid: Ishtp: Add helper functions for client connection
For every ishtp client driver during initialization state, the flow is:
1 - Allocate an ISHTP client instance
2 - Reserve a host id and link the client instance
3 - Search a firmware client using UUID and get related
    client information
4 - Bind firmware client id to the ISHTP client instance
5 - Set the state the ISHTP client instance to CONNECTING
6 - Send connect request to firmware
7 - Register event callback for messages from the firmware

During deinitizalization state, the flow is:
9 - Set the state the ISHTP client instance to ISHTP_CL_DISCONNECTING
10 - Issue disconnect request to firmware
11 - Unlike the client instance
12 - Flush message queue
13 - Free ISHTP client instance

Step 2-7 are identical to the steps of client driver initialization
and driver reset flow, but reallocation of the RX/TX ring buffers
can be avoided in reset flow.

Also for step 9-12, they are identical to the steps of client driver
failure handling after connect request, driver reset flow and
driver removing.

So, add two helper functions to simplify client driver code.
ishtp_cl_establish_connection()
ishtp_cl_destroy_connection()

No functional changes are expected.

Signed-off-by: Even Xu <even.xu@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
2023-12-06 11:33:45 +01:00
..
ipc HID: intel-ish-hid: ipc: Disable and reenable ACPI GPE bit 2023-10-05 12:50:35 +02:00
ishtp HID: Intel-ish-hid: Ishtp: Add helper functions for client connection 2023-12-06 11:33:45 +01:00
ishtp-fw-loader.c HID: intel-ish-hid: Use dma_alloc_coherent for firmware update 2022-03-14 10:39:04 +01:00
ishtp-hid-client.c ID: intel-ish-hid: hid-client: drop unexpected word "the" in the comments 2022-07-21 11:56:10 +02:00
ishtp-hid.c HID: intel-ish-hid: Constify lowlevel HID driver 2023-02-06 15:08:44 +01:00
ishtp-hid.h HID: ishtp-hid-clientHID: ishtp-hid-client: Fix comment typo 2022-08-25 11:35:44 +02:00
Kconfig HID: stop drivers from selecting CONFIG_HID 2023-01-18 16:14:04 +01:00
Makefile treewide: prefix header search paths with $(srctree)/ 2019-05-18 11:49:57 +09:00