From: Vaishnav M A <vaishnav@beagleboard.org>
To: johan@kernel.org
Cc: ribalda@kernel.org, robh@kernel.org, gregkh@linuxfoundation.org,
jirislaby@kernel.org, masahiroy@kernel.org,
andriy.shevchenko@linux.intel.com, linux-kernel@vger.kernel.org,
linux-serial@vger.kernel.org, linux-kbuild@vger.kernel.org,
jkridner@beagleboard.org, drew@beagleboard.org,
robertcnelson@beagleboard.org, vaishnav@beagleboard.org
Subject: [RFC PATCH 2/5] file2alias: Support for serdev devices
Date: Mon, 26 Oct 2020 23:27:15 +0530 [thread overview]
Message-ID: <20201026175718.965773-3-vaishnav@beagleboard.org> (raw)
In-Reply-To: <20201026175718.965773-1-vaishnav@beagleboard.org>
This patch allows file2alias to generate the proper module headers to
support serdev modalias drivers.
Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Signed-off-by: Vaishnav M A <vaishnav@beagleboard.org>
---
scripts/mod/devicetable-offsets.c | 3 +++
scripts/mod/file2alias.c | 10 ++++++++++
2 files changed, 13 insertions(+)
diff --git a/scripts/mod/devicetable-offsets.c b/scripts/mod/devicetable-offsets.c
index 27007c18e754..732cd03e911d 100644
--- a/scripts/mod/devicetable-offsets.c
+++ b/scripts/mod/devicetable-offsets.c
@@ -152,6 +152,9 @@ int main(void)
DEVID_FIELD(i3c_device_id, part_id);
DEVID_FIELD(i3c_device_id, extra_info);
+ DEVID(serdev_device_id);
+ DEVID_FIELD(serdev_device_id, name);
+
DEVID(spi_device_id);
DEVID_FIELD(spi_device_id, name);
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 2417dd1dee33..540fee036d9d 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -947,6 +947,15 @@ static int do_spi_entry(const char *filename, void *symval,
return 1;
}
+static int do_serdev_entry(const char *filename, void *symval,
+ char *alias)
+{
+ DEF_FIELD_ADDR(symval, serdev_device_id, name);
+ sprintf(alias, SERDEV_MODULE_PREFIX "%s", *name);
+
+ return 1;
+}
+
static const struct dmifield {
const char *prefix;
int field;
@@ -1420,6 +1429,7 @@ static const struct devtable devtable[] = {
{"rpmsg", SIZE_rpmsg_device_id, do_rpmsg_entry},
{"i2c", SIZE_i2c_device_id, do_i2c_entry},
{"i3c", SIZE_i3c_device_id, do_i3c_entry},
+ {"serdev", SIZE_serdev_device_id, do_serdev_entry},
{"spi", SIZE_spi_device_id, do_spi_entry},
{"dmi", SIZE_dmi_system_id, do_dmi_entry},
{"platform", SIZE_platform_device_id, do_platform_entry},
--
2.25.1
next prev parent reply other threads:[~2020-10-26 17:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-26 17:57 [RFC PATCH 0/5] Add serdev_device_id for platform instantiation Vaishnav M A
2020-10-26 17:57 ` [RFC PATCH 1/5] serdev: Add serdev_device_id Vaishnav M A
2020-10-26 17:57 ` Vaishnav M A [this message]
2020-10-26 17:57 ` [RFC PATCH 3/5] serdev: add of_ helper to get serdev controller Vaishnav M A
2020-10-26 17:57 ` [RFC PATCH 4/5] gnss: ubx add MODULE_DEVICE_TABLE(serdev) Vaishnav M A
2020-10-26 17:57 ` [RFC PATCH 5/5] gnss: change of_property_read to device_property_read Vaishnav M A
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=20201026175718.965773-3-vaishnav@beagleboard.org \
--to=vaishnav@beagleboard.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=drew@beagleboard.org \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=jkridner@beagleboard.org \
--cc=johan@kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=masahiroy@kernel.org \
--cc=ribalda@kernel.org \
--cc=robertcnelson@beagleboard.org \
--cc=robh@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).