Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] slimbus: generate MODULE_ALIAS() from MODULE_DEVICE_TABLE()
@ 2024-06-06 13:36 Masahiro Yamada
  2024-07-29  6:06 ` Masahiro Yamada
  2024-08-01 13:22 ` Srinivas Kandagatla
  0 siblings, 2 replies; 3+ messages in thread
From: Masahiro Yamada @ 2024-06-06 13:36 UTC (permalink / raw)
  To: alsa-devel, Srinivas Kandagatla
  Cc: linux-kernel, Masahiro Yamada, Nathan Chancellor, Nicolas Schier,
	linux-kbuild

Commit 9e663f4811c6 ("slimbus: core: add support to uevent") added the
MODALIAS=slim:* uevent variable, but modpost does not generate the
corresponding MODULE_ALIAS().

To support automatic module loading, slimbus drivers still need to
manually add MODULE_ALIAS("slim:<manf_id>:<prod_code>:*"), as seen in
sound/soc/codecs/wcd9335.c.

To automate this, make modpost generate the proper MODULE_ALIAS() from
MODULE_DEVICE_TABLE(slim, ).

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 scripts/mod/devicetable-offsets.c |  4 ++++
 scripts/mod/file2alias.c          | 11 +++++++++++
 2 files changed, 15 insertions(+)

diff --git a/scripts/mod/devicetable-offsets.c b/scripts/mod/devicetable-offsets.c
index 518200813d4e..9c7b404defbd 100644
--- a/scripts/mod/devicetable-offsets.c
+++ b/scripts/mod/devicetable-offsets.c
@@ -153,6 +153,10 @@ int main(void)
 	DEVID_FIELD(i3c_device_id, part_id);
 	DEVID_FIELD(i3c_device_id, extra_info);
 
+	DEVID(slim_device_id);
+	DEVID_FIELD(slim_device_id, manf_id);
+	DEVID_FIELD(slim_device_id, prod_code);
+
 	DEVID(spi_device_id);
 	DEVID_FIELD(spi_device_id, name);
 
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index 5d1c61fa5a55..99dce93a4188 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -960,6 +960,16 @@ static int do_i3c_entry(const char *filename, void *symval,
 	return 1;
 }
 
+static int do_slim_entry(const char *filename, void *symval, char *alias)
+{
+	DEF_FIELD(symval, slim_device_id, manf_id);
+	DEF_FIELD(symval, slim_device_id, prod_code);
+
+	sprintf(alias, "slim:%x:%x:*", manf_id, prod_code);
+
+	return 1;
+}
+
 /* Looks like: spi:S */
 static int do_spi_entry(const char *filename, void *symval,
 			char *alias)
@@ -1555,6 +1565,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},
+	{"slim", SIZE_slim_device_id, do_slim_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.43.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] slimbus: generate MODULE_ALIAS() from MODULE_DEVICE_TABLE()
  2024-06-06 13:36 [PATCH] slimbus: generate MODULE_ALIAS() from MODULE_DEVICE_TABLE() Masahiro Yamada
@ 2024-07-29  6:06 ` Masahiro Yamada
  2024-08-01 13:22 ` Srinivas Kandagatla
  1 sibling, 0 replies; 3+ messages in thread
From: Masahiro Yamada @ 2024-07-29  6:06 UTC (permalink / raw)
  To: alsa-devel, Srinivas Kandagatla
  Cc: linux-kernel, Nathan Chancellor, Nicolas Schier, linux-kbuild

Hi Srinivas,


Any comments?



On Thu, Jun 6, 2024 at 10:36 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> Commit 9e663f4811c6 ("slimbus: core: add support to uevent") added the
> MODALIAS=slim:* uevent variable, but modpost does not generate the
> corresponding MODULE_ALIAS().
>
> To support automatic module loading, slimbus drivers still need to
> manually add MODULE_ALIAS("slim:<manf_id>:<prod_code>:*"), as seen in
> sound/soc/codecs/wcd9335.c.
>
> To automate this, make modpost generate the proper MODULE_ALIAS() from
> MODULE_DEVICE_TABLE(slim, ).
>
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
> ---
>
>  scripts/mod/devicetable-offsets.c |  4 ++++
>  scripts/mod/file2alias.c          | 11 +++++++++++
>  2 files changed, 15 insertions(+)
>
> diff --git a/scripts/mod/devicetable-offsets.c b/scripts/mod/devicetable-offsets.c
> index 518200813d4e..9c7b404defbd 100644
> --- a/scripts/mod/devicetable-offsets.c
> +++ b/scripts/mod/devicetable-offsets.c
> @@ -153,6 +153,10 @@ int main(void)
>         DEVID_FIELD(i3c_device_id, part_id);
>         DEVID_FIELD(i3c_device_id, extra_info);
>
> +       DEVID(slim_device_id);
> +       DEVID_FIELD(slim_device_id, manf_id);
> +       DEVID_FIELD(slim_device_id, prod_code);
> +
>         DEVID(spi_device_id);
>         DEVID_FIELD(spi_device_id, name);
>
> diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
> index 5d1c61fa5a55..99dce93a4188 100644
> --- a/scripts/mod/file2alias.c
> +++ b/scripts/mod/file2alias.c
> @@ -960,6 +960,16 @@ static int do_i3c_entry(const char *filename, void *symval,
>         return 1;
>  }
>
> +static int do_slim_entry(const char *filename, void *symval, char *alias)
> +{
> +       DEF_FIELD(symval, slim_device_id, manf_id);
> +       DEF_FIELD(symval, slim_device_id, prod_code);
> +
> +       sprintf(alias, "slim:%x:%x:*", manf_id, prod_code);
> +
> +       return 1;
> +}
> +
>  /* Looks like: spi:S */
>  static int do_spi_entry(const char *filename, void *symval,
>                         char *alias)
> @@ -1555,6 +1565,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},
> +       {"slim", SIZE_slim_device_id, do_slim_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.43.0
>


-- 
Best Regards
Masahiro Yamada

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] slimbus: generate MODULE_ALIAS() from MODULE_DEVICE_TABLE()
  2024-06-06 13:36 [PATCH] slimbus: generate MODULE_ALIAS() from MODULE_DEVICE_TABLE() Masahiro Yamada
  2024-07-29  6:06 ` Masahiro Yamada
@ 2024-08-01 13:22 ` Srinivas Kandagatla
  1 sibling, 0 replies; 3+ messages in thread
From: Srinivas Kandagatla @ 2024-08-01 13:22 UTC (permalink / raw)
  To: alsa-devel, Masahiro Yamada
  Cc: linux-kernel, Nathan Chancellor, Nicolas Schier, linux-kbuild


On Thu, 06 Jun 2024 22:36:14 +0900, Masahiro Yamada wrote:
> Commit 9e663f4811c6 ("slimbus: core: add support to uevent") added the
> MODALIAS=slim:* uevent variable, but modpost does not generate the
> corresponding MODULE_ALIAS().
> 
> To support automatic module loading, slimbus drivers still need to
> manually add MODULE_ALIAS("slim:<manf_id>:<prod_code>:*"), as seen in
> sound/soc/codecs/wcd9335.c.
> 
> [...]

Applied, thanks!

[1/1] slimbus: generate MODULE_ALIAS() from MODULE_DEVICE_TABLE()
      commit: 9b6e704955fa8db55d11f2e7be5d723c8186ffc6

Best regards,
-- 
Srinivas Kandagatla <srinivas.kandagatla@linaro.org>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-08-01 13:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-06 13:36 [PATCH] slimbus: generate MODULE_ALIAS() from MODULE_DEVICE_TABLE() Masahiro Yamada
2024-07-29  6:06 ` Masahiro Yamada
2024-08-01 13:22 ` Srinivas Kandagatla

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox