mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sherry Sun <sherry.sun@nxp.com>
To: sudeep.dutt@intel.com, ashutosh.dixit@intel.com, arnd@arndb.de,
	gregkh@linuxfoundation.org, masahiroy@kernel.org,
	michal.lkml@markovi.net, lee.jones@linaro.org,
	rikard.falkeborn@gmail.com, mst@redhat.co, bp@suse.de,
	jhugo@codeaurora.org, tglx@linutronix.de,
	manivannan.sadhasivam@linaro.org, mgross@linux.intel.com,
	pierre-louis.bossart@linux.intel.com
Cc: linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org,
	linux-imx@nxp.com
Subject: [PATCH 2/3] mic: vop: module autoprobing support for vop drivers
Date: Fri, 25 Sep 2020 15:31:57 +0800	[thread overview]
Message-ID: <20200925073158.8238-3-sherry.sun@nxp.com> (raw)
In-Reply-To: <20200925073158.8238-1-sherry.sun@nxp.com>

Add vop autoprobing support to MODULE_DEVICE_TABLE() by adding info
about struct vop_device_id in devicetable-offsets.c and add a vop entry
point in file2alias.c.

The type argument for MODULE_DEVICE_TABLE(type, name) is vop.

Signed-off-by: Sherry Sun <sherry.sun@nxp.com>
Signed-off-by: Joakim Zhang <qiangqing.zhang@nxp.com>
---
 drivers/misc/mic/bus/vop_bus.h    |  7 +------
 include/linux/mod_devicetable.h   |  7 +++++++
 scripts/mod/devicetable-offsets.c |  4 ++++
 scripts/mod/file2alias.c          | 16 ++++++++++++++++
 4 files changed, 28 insertions(+), 6 deletions(-)

diff --git a/drivers/misc/mic/bus/vop_bus.h b/drivers/misc/mic/bus/vop_bus.h
index d891eacae358..5b4a58757951 100644
--- a/drivers/misc/mic/bus/vop_bus.h
+++ b/drivers/misc/mic/bus/vop_bus.h
@@ -14,16 +14,11 @@
  */
 #include <linux/dmaengine.h>
 #include <linux/interrupt.h>
+#include <linux/mod_devicetable.h>
 
 #include "../common/mic_dev.h"
 
-struct vop_device_id {
-	u32 device;
-	u32 vendor;
-};
-
 #define VOP_DEV_TRNSP 1
-#define VOP_DEV_ANY_ID 0xffffffff
 /*
  * Size of the internal buffer used during DMA's as an intermediate buffer
  * for copy to/from user. Must be an integral number of pages.
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 5b08a473cdba..736cdc236cf9 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -838,4 +838,11 @@ struct mhi_device_id {
 	kernel_ulong_t driver_data;
 };
 
+/* vop */
+struct vop_device_id {
+	__u32 device;
+	__u32 vendor;
+};
+#define VOP_DEV_ANY_ID	0xffffffff
+
 #endif /* LINUX_MOD_DEVICETABLE_H */
diff --git a/scripts/mod/devicetable-offsets.c b/scripts/mod/devicetable-offsets.c
index 27007c18e754..393acaa5302a 100644
--- a/scripts/mod/devicetable-offsets.c
+++ b/scripts/mod/devicetable-offsets.c
@@ -243,5 +243,9 @@ int main(void)
 	DEVID(mhi_device_id);
 	DEVID_FIELD(mhi_device_id, chan);
 
+	DEVID(vop_device_id);
+	DEVID_FIELD(vop_device_id, device);
+	DEVID_FIELD(vop_device_id, vendor);
+
 	return 0;
 }
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 2417dd1dee33..8063b778eedf 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -1368,6 +1368,21 @@ static int do_mhi_entry(const char *filename, void *symval, char *alias)
 	return 1;
 }
 
+/* Looks like: vop:dNvN */
+static int do_vop_entry(const char *filename, void *symval,
+			   char *alias)
+{
+	DEF_FIELD(symval, vop_device_id, device);
+	DEF_FIELD(symval, vop_device_id, vendor);
+
+	strcpy(alias, "vop:");
+	ADD(alias, "d", device != VOP_DEV_ANY_ID, device);
+	ADD(alias, "v", vendor != VOP_DEV_ANY_ID, vendor);
+
+	add_wildcard(alias);
+	return 1;
+}
+
 /* Does namelen bytes of name exactly match the symbol? */
 static bool sym_is(const char *name, unsigned namelen, const char *symbol)
 {
@@ -1442,6 +1457,7 @@ static const struct devtable devtable[] = {
 	{"tee", SIZE_tee_client_device_id, do_tee_entry},
 	{"wmi", SIZE_wmi_device_id, do_wmi_entry},
 	{"mhi", SIZE_mhi_device_id, do_mhi_entry},
+	{"vop", SIZE_vop_device_id, do_vop_entry},
 };
 
 /* Create MODULE_ALIAS() statements.
-- 
2.17.1


  parent reply	other threads:[~2020-09-25  7:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-25  7:31 [PATCH 0/3] Add module autoprobing support for vop and cosm driver Sherry Sun
2020-09-25  7:31 ` [PATCH 1/3] mic: vop: fix a written error in MODULE_DEVICE_TABLE Sherry Sun
2020-09-27 10:28   ` Greg KH
2020-09-27 12:19     ` Sherry Sun
2020-09-27 12:31       ` Greg KH
2020-09-27 12:50         ` Sherry Sun
2020-09-25  7:31 ` Sherry Sun [this message]
2020-09-25  7:31 ` [PATCH 3/3] mic: cosm: module autoprobing support for cosm driver Sherry Sun
2020-09-27 10:29   ` Greg KH
2020-09-27 13:04     ` Sherry Sun

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=20200925073158.8238-3-sherry.sun@nxp.com \
    --to=sherry.sun@nxp.com \
    --cc=arnd@arndb.de \
    --cc=ashutosh.dixit@intel.com \
    --cc=bp@suse.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=jhugo@codeaurora.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=masahiroy@kernel.org \
    --cc=mgross@linux.intel.com \
    --cc=michal.lkml@markovi.net \
    --cc=mst@redhat.co \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=rikard.falkeborn@gmail.com \
    --cc=sudeep.dutt@intel.com \
    --cc=tglx@linutronix.de \
    /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

all inboxes | Powered by JetHome®