linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 0/4] mfd: Ensure DT compatibles have SPI device IDs
@ 2021-09-23 19:46 Mark Brown
  2021-09-23 19:46 ` [PATCH v1 1/4] mfd: altr_a10sr: Add SPI device ID table Mark Brown
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Mark Brown @ 2021-09-23 19:46 UTC (permalink / raw)
  To: Lee Jones; +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 this series
adds SPI IDs where they aren't provided for a given modalias.

Mark Brown (4):
  mfd: altr_a10sr: Add SPI device ID table
  mfd: arizona: Add missing entries SPI to device ID table
  mfd: cpcap: Add SPI device ID table
  mfd: sprd: Add SPI device ID table

 drivers/mfd/altera-a10sr.c    | 8 ++++++++
 drivers/mfd/arizona-spi.c     | 3 +++
 drivers/mfd/motorola-cpcap.c  | 8 ++++++++
 drivers/mfd/sprd-sc27xx-spi.c | 7 +++++++
 4 files changed, 26 insertions(+)


base-commit: e73f0f0ee7541171d89f2e2491130c7771ba58d3
-- 
2.20.1


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

* [PATCH v1 1/4] mfd: altr_a10sr: Add SPI device ID table
  2021-09-23 19:46 [PATCH v1 0/4] mfd: Ensure DT compatibles have SPI device IDs Mark Brown
@ 2021-09-23 19:46 ` Mark Brown
  2021-09-23 19:46 ` [PATCH v1 2/4] mfd: arizona: Add missing entries SPI to " Mark Brown
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 11+ messages in thread
From: Mark Brown @ 2021-09-23 19:46 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel, Mark Brown, Thor Thayer

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: Thor Thayer <thor.thayer@linux.intel.com>
---
 drivers/mfd/altera-a10sr.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/mfd/altera-a10sr.c b/drivers/mfd/altera-a10sr.c
index a3bf64f9afd1..6d04fdd09ca2 100644
--- a/drivers/mfd/altera-a10sr.c
+++ b/drivers/mfd/altera-a10sr.c
@@ -150,6 +150,13 @@ static const struct of_device_id altr_a10sr_spi_of_match[] = {
 	{ .compatible = "altr,a10sr" },
 	{ },
 };
+MODULE_DEVICE_TABLE(of, altr_a10sr_spi_of_match);
+
+static const struct spi_device_id altr_a10sr_spi_ids[] = {
+	{ .name = "a10sr" },
+	{ },
+};
+MODULE_DEVICE_TABLE(spi, altr_a10sr_spi_ids);
 
 static struct spi_driver altr_a10sr_spi_driver = {
 	.probe = altr_a10sr_spi_probe,
@@ -157,5 +164,6 @@ static struct spi_driver altr_a10sr_spi_driver = {
 		.name = "altr_a10sr",
 		.of_match_table = of_match_ptr(altr_a10sr_spi_of_match),
 	},
+	.id_table = altr_a10sr_spi_ids,
 };
 builtin_driver(altr_a10sr_spi_driver, spi_register_driver)
-- 
2.20.1


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

* [PATCH v1 2/4] mfd: arizona: Add missing entries SPI to device ID table
  2021-09-23 19:46 [PATCH v1 0/4] mfd: Ensure DT compatibles have SPI device IDs Mark Brown
  2021-09-23 19:46 ` [PATCH v1 1/4] mfd: altr_a10sr: Add SPI device ID table Mark Brown
@ 2021-09-23 19:46 ` Mark Brown
  2021-09-24  9:24   ` Richard Fitzgerald
  2021-09-23 19:46 ` [PATCH v1 3/4] mfd: cpcap: Add SPI " Mark Brown
  2021-09-23 19:46 ` [PATCH v1 4/4] mfd: sprd: " Mark Brown
  3 siblings, 1 reply; 11+ messages in thread
From: Mark Brown @ 2021-09-23 19:46 UTC (permalink / raw)
  To: Lee Jones; +Cc: linux-kernel, Mark Brown, patches

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 SPI IDs for parts that
only have a compatible listed.

Fixes: 96c8395e2166 ("spi: Revert modalias changes")
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: patches@opensource.cirrus.com
---
 drivers/mfd/arizona-spi.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/mfd/arizona-spi.c b/drivers/mfd/arizona-spi.c
index aa1d6f94ae53..8b44af297b7c 100644
--- a/drivers/mfd/arizona-spi.c
+++ b/drivers/mfd/arizona-spi.c
@@ -216,9 +216,12 @@ static int arizona_spi_remove(struct spi_device *spi)
 }
 
 static const struct spi_device_id arizona_spi_ids[] = {
+	{ "wm1814", WM1814 },
 	{ "wm5102", WM5102 },
 	{ "wm5110", WM5110 },
 	{ "wm8280", WM8280 },
+	{ "wm8997", WM8997 },
+	{ "wm8998", WM8998 },
 	{ "wm1831", WM1831 },
 	{ "cs47l24", CS47L24 },
 	{ },
-- 
2.20.1


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

* [PATCH v1 3/4] mfd: cpcap: Add SPI device ID table
  2021-09-23 19:46 [PATCH v1 0/4] mfd: Ensure DT compatibles have SPI device IDs Mark Brown
  2021-09-23 19:46 ` [PATCH v1 1/4] mfd: altr_a10sr: Add SPI device ID table Mark Brown
  2021-09-23 19:46 ` [PATCH v1 2/4] mfd: arizona: Add missing entries SPI to " Mark Brown
@ 2021-09-23 19:46 ` Mark Brown
  2021-09-23 19:46 ` [PATCH v1 4/4] mfd: sprd: " Mark Brown
  3 siblings, 0 replies; 11+ messages in thread
From: Mark Brown @ 2021-09-23 19:46 UTC (permalink / raw)
  To: Lee Jones; +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/motorola-cpcap.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/drivers/mfd/motorola-cpcap.c b/drivers/mfd/motorola-cpcap.c
index 6fb206da2729..265464b5d7cc 100644
--- a/drivers/mfd/motorola-cpcap.c
+++ b/drivers/mfd/motorola-cpcap.c
@@ -202,6 +202,13 @@ static const struct of_device_id cpcap_of_match[] = {
 };
 MODULE_DEVICE_TABLE(of, cpcap_of_match);
 
+static const struct spi_device_id cpcap_spi_ids[] = {
+	{ .name = "cpcap", },
+	{ .name = "6556002", },
+	{},
+};
+MODULE_DEVICE_TABLE(spi, cpcap_spi_ids);
+
 static const struct regmap_config cpcap_regmap_config = {
 	.reg_bits = 16,
 	.reg_stride = 4,
@@ -342,6 +349,7 @@ static struct spi_driver cpcap_driver = {
 		.pm = &cpcap_pm,
 	},
 	.probe = cpcap_probe,
+	.id_table = cpcap_spi_ids,
 };
 module_spi_driver(cpcap_driver);
 
-- 
2.20.1


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

* [PATCH v1 4/4] mfd: sprd: Add SPI device ID table
  2021-09-23 19:46 [PATCH v1 0/4] mfd: Ensure DT compatibles have SPI device IDs Mark Brown
                   ` (2 preceding siblings ...)
  2021-09-23 19:46 ` [PATCH v1 3/4] mfd: cpcap: Add SPI " Mark Brown
@ 2021-09-23 19:46 ` Mark Brown
  3 siblings, 0 replies; 11+ messages in thread
From: Mark Brown @ 2021-09-23 19:46 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>
---
 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..d2d4c4b2087f 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 = "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 },
 	{},
@@ -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] 11+ messages in thread

* Re: [PATCH v1 2/4] mfd: arizona: Add missing entries SPI to device ID table
  2021-09-23 19:46 ` [PATCH v1 2/4] mfd: arizona: Add missing entries SPI to " Mark Brown
@ 2021-09-24  9:24   ` Richard Fitzgerald
  2021-09-24 11:20     ` Mark Brown
  0 siblings, 1 reply; 11+ messages in thread
From: Richard Fitzgerald @ 2021-09-24  9:24 UTC (permalink / raw)
  To: Mark Brown, Lee Jones; +Cc: linux-kernel, patches

On 23/09/2021 20:46, 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 SPI IDs for parts that
> only have a compatible listed.
> 
> Fixes: 96c8395e2166 ("spi: Revert modalias changes")
> Signed-off-by: Mark Brown <broonie@kernel.org>
> Cc: patches@opensource.cirrus.com
> ---
>   drivers/mfd/arizona-spi.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/mfd/arizona-spi.c b/drivers/mfd/arizona-spi.c
> index aa1d6f94ae53..8b44af297b7c 100644
> --- a/drivers/mfd/arizona-spi.c
> +++ b/drivers/mfd/arizona-spi.c
> @@ -216,9 +216,12 @@ static int arizona_spi_remove(struct spi_device *spi)
>   }
>   
>   static const struct spi_device_id arizona_spi_ids[] = {
> +	{ "wm1814", WM1814 },
>   	{ "wm5102", WM5102 },
>   	{ "wm5110", WM5110 },
>   	{ "wm8280", WM8280 },
> +	{ "wm8997", WM8997 },
> +	{ "wm8998", WM8998 },

WM1814, WM8997 and WM8998 do not have a SPI interface, which is why they
aren't in the table of SPI IDs.

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

* Re: [PATCH v1 2/4] mfd: arizona: Add missing entries SPI to device ID table
  2021-09-24  9:24   ` Richard Fitzgerald
@ 2021-09-24 11:20     ` Mark Brown
  2021-09-27 10:27       ` Charles Keepax
  0 siblings, 1 reply; 11+ messages in thread
From: Mark Brown @ 2021-09-24 11:20 UTC (permalink / raw)
  To: Richard Fitzgerald; +Cc: Lee Jones, linux-kernel, patches

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

On Fri, Sep 24, 2021 at 10:24:17AM +0100, Richard Fitzgerald wrote:
> On 23/09/2021 20:46, 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 SPI IDs for parts that
> > only have a compatible listed.

> >   static const struct spi_device_id arizona_spi_ids[] = {
> > +	{ "wm1814", WM1814 },
> >   	{ "wm5102", WM5102 },
> >   	{ "wm5110", WM5110 },
> >   	{ "wm8280", WM8280 },
> > +	{ "wm8997", WM8997 },
> > +	{ "wm8998", WM8998 },

> WM1814, WM8997 and WM8998 do not have a SPI interface, which is why they
> aren't in the table of SPI IDs.

They're listed as valid DT compatibles for SPI so will now generate
warnings on boot, the driver should not list those compatibles if
they're not valid.

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

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

* Re: [PATCH v1 2/4] mfd: arizona: Add missing entries SPI to device ID table
  2021-09-24 11:20     ` Mark Brown
@ 2021-09-27 10:27       ` Charles Keepax
  2021-09-27 10:55         ` Mark Brown
  0 siblings, 1 reply; 11+ messages in thread
From: Charles Keepax @ 2021-09-27 10:27 UTC (permalink / raw)
  To: Mark Brown; +Cc: Richard Fitzgerald, Lee Jones, linux-kernel, patches

On Fri, Sep 24, 2021 at 12:20:01PM +0100, Mark Brown wrote:
> On Fri, Sep 24, 2021 at 10:24:17AM +0100, Richard Fitzgerald wrote:
> > On 23/09/2021 20:46, 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 SPI IDs for parts that
> > > only have a compatible listed.
> 
> > >   static const struct spi_device_id arizona_spi_ids[] = {
> > > +	{ "wm1814", WM1814 },
> > >   	{ "wm5102", WM5102 },
> > >   	{ "wm5110", WM5110 },
> > >   	{ "wm8280", WM8280 },
> > > +	{ "wm8997", WM8997 },
> > > +	{ "wm8998", WM8998 },
> 
> > WM1814, WM8997 and WM8998 do not have a SPI interface, which is why they
> > aren't in the table of SPI IDs.
> 
> They're listed as valid DT compatibles for SPI so will now generate
> warnings on boot, the driver should not list those compatibles if
> they're not valid.

Yeah we should really be having different lists for SPI and I2C
here I guess. I am happy to have a quick look at doing a patch
for that, unless you particularly want to fix it up?

Thanks,
Charles

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

* Re: [PATCH v1 2/4] mfd: arizona: Add missing entries SPI to device ID table
  2021-09-27 10:27       ` Charles Keepax
@ 2021-09-27 10:55         ` Mark Brown
  2021-09-28  8:05           ` Lee Jones
  0 siblings, 1 reply; 11+ messages in thread
From: Mark Brown @ 2021-09-27 10:55 UTC (permalink / raw)
  To: Charles Keepax; +Cc: Richard Fitzgerald, Lee Jones, linux-kernel, patches

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

On Mon, Sep 27, 2021 at 10:27:54AM +0000, Charles Keepax wrote:

> Yeah we should really be having different lists for SPI and I2C
> here I guess. I am happy to have a quick look at doing a patch
> for that, unless you particularly want to fix it up?

I dropped the patch so please feel free to go ahead.

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

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

* Re: [PATCH v1 2/4] mfd: arizona: Add missing entries SPI to device ID table
  2021-09-27 10:55         ` Mark Brown
@ 2021-09-28  8:05           ` Lee Jones
  2021-09-28 10:01             ` Lee Jones
  0 siblings, 1 reply; 11+ messages in thread
From: Lee Jones @ 2021-09-28  8:05 UTC (permalink / raw)
  To: Mark Brown; +Cc: Charles Keepax, Richard Fitzgerald, linux-kernel, patches

On Mon, 27 Sep 2021, Mark Brown wrote:

> On Mon, Sep 27, 2021 at 10:27:54AM +0000, Charles Keepax wrote:
> 
> > Yeah we should really be having different lists for SPI and I2C
> > here I guess. I am happy to have a quick look at doing a patch
> > for that, unless you particularly want to fix it up?
> 
> I dropped the patch so please feel free to go ahead.

Just this one, or should I drop the set?

-- 
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] 11+ messages in thread

* Re: [PATCH v1 2/4] mfd: arizona: Add missing entries SPI to device ID table
  2021-09-28  8:05           ` Lee Jones
@ 2021-09-28 10:01             ` Lee Jones
  0 siblings, 0 replies; 11+ messages in thread
From: Lee Jones @ 2021-09-28 10:01 UTC (permalink / raw)
  To: Mark Brown; +Cc: Charles Keepax, Richard Fitzgerald, linux-kernel, patches

On Tue, 28 Sep 2021, Lee Jones wrote:

> On Mon, 27 Sep 2021, Mark Brown wrote:
> 
> > On Mon, Sep 27, 2021 at 10:27:54AM +0000, Charles Keepax wrote:
> > 
> > > Yeah we should really be having different lists for SPI and I2C
> > > here I guess. I am happy to have a quick look at doing a patch
> > > for that, unless you particularly want to fix it up?
> > 
> > I dropped the patch so please feel free to go ahead.
> 
> Just this one, or should I drop the set?

Never mind.  I see the new set.

-- 
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] 11+ messages in thread

end of thread, other threads:[~2021-09-28 10:01 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-23 19:46 [PATCH v1 0/4] mfd: Ensure DT compatibles have SPI device IDs Mark Brown
2021-09-23 19:46 ` [PATCH v1 1/4] mfd: altr_a10sr: Add SPI device ID table Mark Brown
2021-09-23 19:46 ` [PATCH v1 2/4] mfd: arizona: Add missing entries SPI to " Mark Brown
2021-09-24  9:24   ` Richard Fitzgerald
2021-09-24 11:20     ` Mark Brown
2021-09-27 10:27       ` Charles Keepax
2021-09-27 10:55         ` Mark Brown
2021-09-28  8:05           ` Lee Jones
2021-09-28 10:01             ` Lee Jones
2021-09-23 19:46 ` [PATCH v1 3/4] mfd: cpcap: Add SPI " Mark Brown
2021-09-23 19:46 ` [PATCH v1 4/4] mfd: sprd: " Mark Brown

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