linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mfd: sprd: Add SPI device ID table
@ 2021-09-22 15:08 Mark Brown
  2021-09-22 16:16 ` Mark Brown
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2021-09-22 15:08 UTC (permalink / raw)
  To: Lee Jones, Orson Zhai, Baolin Wang, Chunyan Zhang
  Cc: linux-kernel, Mark Brown

Currently autoloading for SPI devices does not use the DT ID table, it uses
SPI modalises. Supporting OF modalises is going to be difficult if not
impractical, an attempt was made but has been reverted, so ensure that
module autoloading works for this driver by adding a SPI device ID table.

Fixes: 96c8395e2166 ("spi: Revert modalias changes")
Signed-off-by: Mark Brown <broonie@kernel.org>
---
 drivers/mfd/sprd-sc27xx-spi.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/mfd/sprd-sc27xx-spi.c b/drivers/mfd/sprd-sc27xx-spi.c
index 6b7956604a0f..8b3ed5a0a524 100644
--- a/drivers/mfd/sprd-sc27xx-spi.c
+++ b/drivers/mfd/sprd-sc27xx-spi.c
@@ -230,6 +230,12 @@ static int sprd_pmic_resume(struct device *dev)
 
 static SIMPLE_DEV_PM_OPS(sprd_pmic_pm_ops, sprd_pmic_suspend, sprd_pmic_resume);
 
+static const struct spi_device_id sprd_pmic_spi_ids[] = {
+	{ .name = "sc2371", .driver_data = (unsigned long)&sc2731_data },
+	{},
+};
+MODULE_DEVICE_TABLE(spi, sprd_pmic_spi_ids);
+
 static const struct of_device_id sprd_pmic_match[] = {
 	{ .compatible = "sprd,sc2731", .data = &sc2731_data },
 	{},
@@ -243,6 +249,7 @@ static struct spi_driver sprd_pmic_driver = {
 		.pm = &sprd_pmic_pm_ops,
 	},
 	.probe = sprd_pmic_probe,
+	.id_table = sprd_pmic_spi_ids,
 };
 
 static int __init sprd_pmic_init(void)
-- 
2.20.1


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

* Re: [PATCH] mfd: sprd: Add SPI device ID table
  2021-09-22 15:08 [PATCH] mfd: sprd: Add SPI device ID table Mark Brown
@ 2021-09-22 16:16 ` Mark Brown
  2021-09-22 18:23   ` Lee Jones
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2021-09-22 16:16 UTC (permalink / raw)
  To: Lee Jones, Orson Zhai, Baolin Wang, Chunyan Zhang; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 475 bytes --]

On Wed, Sep 22, 2021 at 04:08:12PM +0100, Mark Brown wrote:
> Currently autoloading for SPI devices does not use the DT ID table, it uses
> SPI modalises. Supporting OF modalises is going to be difficult if not
> impractical, an attempt was made but has been reverted, so ensure that
> module autoloading works for this driver by adding a SPI device ID table.

Hang on, there's a typo and I found a bunch more MFDs that need updates
- I'll resend as part of a bigger series.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH] mfd: sprd: Add SPI device ID table
  2021-09-22 16:16 ` Mark Brown
@ 2021-09-22 18:23   ` Lee Jones
  0 siblings, 0 replies; 5+ messages in thread
From: Lee Jones @ 2021-09-22 18:23 UTC (permalink / raw)
  To: Mark Brown; +Cc: Orson Zhai, Baolin Wang, Chunyan Zhang, linux-kernel

On Wed, 22 Sep 2021, Mark Brown wrote:

> On Wed, Sep 22, 2021 at 04:08:12PM +0100, Mark Brown wrote:
> > Currently autoloading for SPI devices does not use the DT ID table, it uses
> > SPI modalises. Supporting OF modalises is going to be difficult if not
> > impractical, an attempt was made but has been reverted, so ensure that
> > module autoloading works for this driver by adding a SPI device ID table.
> 
> Hang on, there's a typo and I found a bunch more MFDs that need updates
> - I'll resend as part of a bigger series.

Fine.  Dropped.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH] mfd: sprd: Add SPI device ID table
  2022-02-02 14:43 Mark Brown
@ 2022-02-14 13:32 ` Lee Jones
  0 siblings, 0 replies; 5+ messages in thread
From: Lee Jones @ 2022-02-14 13:32 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-kernel, Orson Zhai, Baolin Wang, Chunyan Zhang

On Wed, 02 Feb 2022, Mark Brown wrote:

> Currently autoloading for SPI devices does not use the DT ID table, it uses
> SPI modalises. Supporting OF modalises is going to be difficult if not
> impractical, an attempt was made but has been reverted, so ensure that
> module autoloading works for this driver by adding a SPI device ID table.
> 
> Fixes: 96c8395e2166 ("spi: Revert modalias changes")
> Signed-off-by: Mark Brown <broonie@kernel.org>
> Cc: Orson Zhai <orsonzhai@gmail.com>
> Cc: Baolin Wang <baolin.wang7@gmail.com>
> Cc: Chunyan Zhang <zhang.lyra@gmail.com>
> ---
> 
> Rebased onto v5.17-rc1.
> 
>  drivers/mfd/sprd-sc27xx-spi.c | 6 ++++++
>  1 file changed, 6 insertions(+)

Applied, thanks.

-- 
Lee Jones [李琼斯]
Principal Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* [PATCH] mfd: sprd: Add SPI device ID table
@ 2022-02-02 14:43 Mark Brown
  2022-02-14 13:32 ` Lee Jones
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2022-02-02 14:43 UTC (permalink / raw)
  To: Lee Jones
  Cc: linux-kernel, Mark Brown, Orson Zhai, Baolin Wang, Chunyan Zhang

Currently autoloading for SPI devices does not use the DT ID table, it uses
SPI modalises. Supporting OF modalises is going to be difficult if not
impractical, an attempt was made but has been reverted, so ensure that
module autoloading works for this driver by adding a SPI device ID table.

Fixes: 96c8395e2166 ("spi: Revert modalias changes")
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: Orson Zhai <orsonzhai@gmail.com>
Cc: Baolin Wang <baolin.wang7@gmail.com>
Cc: Chunyan Zhang <zhang.lyra@gmail.com>
---

Rebased onto v5.17-rc1.

 drivers/mfd/sprd-sc27xx-spi.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/mfd/sprd-sc27xx-spi.c b/drivers/mfd/sprd-sc27xx-spi.c
index 55d2c31bdfb2..864031eccd4c 100644
--- a/drivers/mfd/sprd-sc27xx-spi.c
+++ b/drivers/mfd/sprd-sc27xx-spi.c
@@ -239,6 +239,12 @@ static int sprd_pmic_resume(struct device *dev)
 
 static SIMPLE_DEV_PM_OPS(sprd_pmic_pm_ops, sprd_pmic_suspend, sprd_pmic_resume);
 
+static const struct spi_device_id sprd_pmic_spi_ids[] = {
+	{ .name = "sc2731", .driver_data = (unsigned long)&sc2731_data },
+	{},
+};
+MODULE_DEVICE_TABLE(spi, sprd_pmic_spi_ids);
+
 static const struct of_device_id sprd_pmic_match[] = {
 	{ .compatible = "sprd,sc2731", .data = &sc2731_data },
 	{ .compatible = "sprd,sc2730", .data = &sc2730_data },
-- 
2.30.2


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

end of thread, other threads:[~2022-02-14 13:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-22 15:08 [PATCH] mfd: sprd: Add SPI device ID table Mark Brown
2021-09-22 16:16 ` Mark Brown
2021-09-22 18:23   ` Lee Jones
2022-02-02 14:43 Mark Brown
2022-02-14 13:32 ` Lee Jones

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).