linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
To: jikos@kernel.org, benjamin.tissoires@redhat.com
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Subject: [PATCH v2 10/10] HID: intel-ish-hid: Add interface function for PCI device pointer
Date: Mon, 18 Mar 2019 12:14:28 -0700	[thread overview]
Message-ID: <20190318191428.6527-11-srinivas.pandruvada@linux.intel.com> (raw)
In-Reply-To: <20190318191428.6527-1-srinivas.pandruvada@linux.intel.com>

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 <srinivas.pandruvada@linux.intel.com>
---
 drivers/hid/intel-ish-hid/ishtp/bus.c | 13 +++++++++++++
 include/linux/intel-ish-client-if.h   |  2 ++
 2 files changed, 15 insertions(+)

diff --git a/drivers/hid/intel-ish-hid/ishtp/bus.c b/drivers/hid/intel-ish-hid/ishtp/bus.c
index 66a485a41481..fb8ca12955b4 100644
--- a/drivers/hid/intel-ish-hid/ishtp/bus.c
+++ b/drivers/hid/intel-ish-hid/ishtp/bus.c
@@ -855,6 +855,19 @@ struct device *ishtp_device(struct ishtp_cl_device *device)
 }
 EXPORT_SYMBOL(ishtp_device);
 
+/**
+ * ishtp_get_pci_device() - Return PCI device dev pointer
+ * This interface is used to return PCI device pointer
+ * from ishtp_cl_device instance.
+ *
+ * Return: device *.
+ */
+struct device *ishtp_get_pci_device(struct ishtp_cl_device *device)
+{
+	return device->ishtp_dev->devc;
+}
+EXPORT_SYMBOL(ishtp_get_pci_device);
+
 /**
  * ishtp_trace_callback() - Return trace callback
  *
diff --git a/include/linux/intel-ish-client-if.h b/include/linux/intel-ish-client-if.h
index e98bfbb1e07e..16255c2ca2f4 100644
--- a/include/linux/intel-ish-client-if.h
+++ b/include/linux/intel-ish-client-if.h
@@ -77,6 +77,8 @@ int ishtp_register_event_cb(struct ishtp_cl_device *device,
 struct device *ishtp_device(struct ishtp_cl_device *cl_device);
 /* Trace interface for clients */
 void *ishtp_trace_callback(struct ishtp_cl_device *cl_device);
+/* Get device pointer of PCI device for DMA acces */
+struct device *ishtp_get_pci_device(struct ishtp_cl_device *cl_device);
 
 struct ishtp_cl *ishtp_cl_allocate(struct ishtp_cl_device *cl_device);
 void ishtp_cl_free(struct ishtp_cl *cl);
-- 
2.17.2


  parent reply	other threads:[~2019-03-18 19:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-18 19:14 [PATCH v2 00/10] HID: intel-ish-hid: Clean up external interfaces Srinivas Pandruvada
2019-03-18 19:14 ` [PATCH v2 01/10] HID: intel-ish-hid: Add match callback to ishtp bus type Srinivas Pandruvada
2019-03-18 19:14 ` [PATCH v2 02/10] HID: intel-ish-hid: Hide members of struct ishtp_cl_device Srinivas Pandruvada
2019-03-18 19:14 ` [PATCH v2 03/10] HID: intel-ish-hid: Simplify ishtp_cl_link() Srinivas Pandruvada
2019-03-18 19:14 ` [PATCH v2 04/10] HID: intel-ish-hid: Move driver registry functions Srinivas Pandruvada
2019-03-18 19:14 ` [PATCH v2 05/10] HID: intel-ish-hid: Store ishtp_cl_device instance in device Srinivas Pandruvada
2019-03-18 19:14 ` [PATCH v2 06/10] HID: intel-ish-hid: Move the common functions from client.h Srinivas Pandruvada
2019-03-18 19:14 ` [PATCH v2 07/10] HID: intel-ish-hid: Add interface functions for struct ishtp_cl Srinivas Pandruvada
2019-03-18 19:14 ` [PATCH v2 08/10] HID: intel-ish-hid: Move functions related to bus and device Srinivas Pandruvada
2019-03-18 19:14 ` [PATCH v2 09/10] HID: intel-ish-hid: Use the new interface functions in HID ish client Srinivas Pandruvada
2019-03-18 19:14 ` Srinivas Pandruvada [this message]
2019-03-19 10:59 ` [PATCH v2 00/10] HID: intel-ish-hid: Clean up external interfaces Jiri Kosina

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190318191428.6527-11-srinivas.pandruvada@linux.intel.com \
    --to=srinivas.pandruvada@linux.intel.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=jikos@kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).