Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 0e568a1

Browse files
spandruvadaJiri Kosina
authored andcommitted
HID: intel-ish-hid: Add interface function for PCI device pointer
Instead of directly accessing PCI device poitner via struct ishtp_cl, create interface function for same. This is required for DMA transfer. Signed-off-by: Srinivas Pandruvada <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 29b06d1 commit 0e568a1

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

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

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -855,6 +855,19 @@ struct device *ishtp_device(struct ishtp_cl_device *device)
855855
}
856856
EXPORT_SYMBOL(ishtp_device);
857857

858+
/**
859+
* ishtp_get_pci_device() - Return PCI device dev pointer
860+
* This interface is used to return PCI device pointer
861+
* from ishtp_cl_device instance.
862+
*
863+
* Return: device *.
864+
*/
865+
struct device *ishtp_get_pci_device(struct ishtp_cl_device *device)
866+
{
867+
return device->ishtp_dev->devc;
868+
}
869+
EXPORT_SYMBOL(ishtp_get_pci_device);
870+
858871
/**
859872
* ishtp_trace_callback() - Return trace callback
860873
*

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ int ishtp_register_event_cb(struct ishtp_cl_device *device,
7777
struct device *ishtp_device(struct ishtp_cl_device *cl_device);
7878
/* Trace interface for clients */
7979
void *ishtp_trace_callback(struct ishtp_cl_device *cl_device);
80+
/* Get device pointer of PCI device for DMA acces */
81+
struct device *ishtp_get_pci_device(struct ishtp_cl_device *cl_device);
8082

8183
struct ishtp_cl *ishtp_cl_allocate(struct ishtp_cl_device *cl_device);
8284
void ishtp_cl_free(struct ishtp_cl *cl);

0 commit comments

Comments
 (0)