Skip to content

Commit 5f7224c

Browse files
spandruvadaJiri Kosina
authored andcommitted
HID: intel-ish-hid: Move functions related to bus and device
Move function idefinitions related to bus and device to common header file. Also create new function to get fw client id and move ish_hw_reset() from inline to exported function. Signed-off-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 51cbc70 commit 5f7224c

File tree

4 files changed

+38
-16
lines changed

4 files changed

+38
-16
lines changed

drivers/hid/intel-ish-hid/ishtp/bus.c

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,19 @@ struct ishtp_fw_client *ishtp_fw_cl_get_client(struct ishtp_device *dev,
170170
}
171171
EXPORT_SYMBOL(ishtp_fw_cl_get_client);
172172

173+
/**
174+
* ishtp_get_fw_client_id() - Get fw client id
175+
*
176+
* This interface is used to reset HW get FW client id.
177+
*
178+
* Return: firmware client id.
179+
*/
180+
int ishtp_get_fw_client_id(struct ishtp_fw_client *fw_client)
181+
{
182+
return fw_client->client_id;
183+
}
184+
EXPORT_SYMBOL(ishtp_get_fw_client_id);
185+
173186
/**
174187
* ishtp_fw_cl_by_id() - return index to fw_clients for client_id
175188
* @dev: the ishtp device structure
@@ -855,6 +868,19 @@ void *ishtp_trace_callback(struct ishtp_cl_device *cl_device)
855868
}
856869
EXPORT_SYMBOL(ishtp_trace_callback);
857870

871+
/**
872+
* ish_hw_reset() - Call HW reset IPC callback
873+
*
874+
* This interface is used to reset HW in case of error.
875+
*
876+
* Return: value from IPC hw_reset callback
877+
*/
878+
int ish_hw_reset(struct ishtp_device *dev)
879+
{
880+
return dev->ops->hw_reset(dev);
881+
}
882+
EXPORT_SYMBOL(ish_hw_reset);
883+
858884
/**
859885
* ishtp_bus_register() - Function to register bus
860886
*

drivers/hid/intel-ish-hid/ishtp/bus.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,5 @@ void ishtp_recv(struct ishtp_device *dev);
8080
void ishtp_reset_handler(struct ishtp_device *dev);
8181
void ishtp_reset_compl_handler(struct ishtp_device *dev);
8282

83-
void ishtp_put_device(struct ishtp_cl_device *);
84-
void ishtp_get_device(struct ishtp_cl_device *);
85-
86-
void ishtp_set_drvdata(struct ishtp_cl_device *cl_device, void *data);
87-
void *ishtp_get_drvdata(struct ishtp_cl_device *cl_device);
88-
89-
int ishtp_register_event_cb(struct ishtp_cl_device *device,
90-
void (*read_cb)(struct ishtp_cl_device *));
9183
int ishtp_fw_cl_by_uuid(struct ishtp_device *dev, const guid_t *cuuid);
92-
struct ishtp_fw_client *ishtp_fw_cl_get_client(struct ishtp_device *dev,
93-
const guid_t *uuid);
94-
9584
#endif /* _LINUX_ISHTP_CL_BUS_H */

drivers/hid/intel-ish-hid/ishtp/ishtp-dev.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -238,11 +238,6 @@ static inline int ish_ipc_reset(struct ishtp_device *dev)
238238
return dev->ops->ipc_reset(dev);
239239
}
240240

241-
static inline int ish_hw_reset(struct ishtp_device *dev)
242-
{
243-
return dev->ops->hw_reset(dev);
244-
}
245-
246241
/* Exported function */
247242
void ishtp_device_init(struct ishtp_device *dev);
248243
int ishtp_start(struct ishtp_device *dev);

include/linux/intel-ish-client-if.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@
99
#define _INTEL_ISH_CLIENT_IF_H_
1010

1111
struct ishtp_cl_device;
12+
struct ishtp_device;
1213
struct ishtp_cl;
14+
struct ishtp_fw_client;
1315

1416
/* Client state */
1517
enum cl_state {
@@ -95,4 +97,14 @@ void ishtp_set_rx_ring_size(struct ishtp_cl *cl, int size);
9597
void ishtp_set_connection_state(struct ishtp_cl *cl, int state);
9698
void ishtp_cl_set_fw_client_id(struct ishtp_cl *cl, int fw_client_id);
9799

100+
void ishtp_put_device(struct ishtp_cl_device *cl_dev);
101+
void ishtp_get_device(struct ishtp_cl_device *cl_dev);
102+
void ishtp_set_drvdata(struct ishtp_cl_device *cl_device, void *data);
103+
void *ishtp_get_drvdata(struct ishtp_cl_device *cl_device);
104+
int ishtp_register_event_cb(struct ishtp_cl_device *device,
105+
void (*read_cb)(struct ishtp_cl_device *));
106+
struct ishtp_fw_client *ishtp_fw_cl_get_client(struct ishtp_device *dev,
107+
const guid_t *uuid);
108+
int ishtp_get_fw_client_id(struct ishtp_fw_client *fw_client);
109+
int ish_hw_reset(struct ishtp_device *dev);
98110
#endif /* _INTEL_ISH_CLIENT_IF_H_ */

0 commit comments

Comments
 (0)