2021-09-24 14:36:56

by Mark Brown

[permalink] [raw]
Subject: [PATCH v2 0/3] mfd: Ensure DT compatibles have SPI device IDs

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.

v2:
- Drop the arizona patch since the code is apparently intentional and
shouldn't autoload on SPI.

Mark Brown (3):
mfd: altr_a10sr: Add SPI 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/motorola-cpcap.c | 8 ++++++++
drivers/mfd/sprd-sc27xx-spi.c | 7 +++++++
3 files changed, 23 insertions(+)


base-commit: e73f0f0ee7541171d89f2e2491130c7771ba58d3
--
2.20.1


2021-09-24 14:37:15

by Mark Brown

[permalink] [raw]
Subject: [PATCH v2 1/3] mfd: altr_a10sr: Add SPI device ID table

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 <[email protected]>
Cc: Thor Thayer <[email protected]>
---
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

2021-09-24 14:38:19

by Mark Brown

[permalink] [raw]
Subject: [PATCH v2 3/3] mfd: sprd: Add SPI device ID table

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 <[email protected]>
Cc: Orson Zhai <[email protected]>
Cc: Baolin Wang <[email protected]>
Cc: Chunyan Zhang <[email protected]>
---
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

2021-09-24 14:39:54

by Mark Brown

[permalink] [raw]
Subject: [PATCH v2 2/3] mfd: cpcap: Add SPI device ID table

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 <[email protected]>
---
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

2021-09-26 01:19:09

by Baolin Wang

[permalink] [raw]
Subject: Re: [PATCH v2 3/3] mfd: sprd: Add SPI device ID table

On Fri, Sep 24, 2021 at 10:34 PM Mark Brown <[email protected]> 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 <[email protected]>
> Cc: Orson Zhai <[email protected]>
> Cc: Baolin Wang <[email protected]>
> Cc: Chunyan Zhang <[email protected]>

Thanks Mark.
Reviewed-by: Baolin Wang <[email protected]>

--
Baolin Wang

2021-10-06 08:08:45

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH v2 1/3] mfd: altr_a10sr: Add SPI device ID table

On Fri, 24 Sep 2021, 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 <[email protected]>
> Cc: Thor Thayer <[email protected]>
> ---
> drivers/mfd/altera-a10sr.c | 8 ++++++++
> 1 file changed, 8 insertions(+)

Applied, thanks.

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

2021-10-06 08:10:53

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH v2 2/3] mfd: cpcap: Add SPI device ID table

On Fri, 24 Sep 2021, 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 <[email protected]>
> ---
> drivers/mfd/motorola-cpcap.c | 8 ++++++++
> 1 file changed, 8 insertions(+)

Applied, thanks.

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

2021-10-06 08:14:42

by Lee Jones

[permalink] [raw]
Subject: Re: [PATCH v2 3/3] mfd: sprd: Add SPI device ID table

On Fri, 24 Sep 2021, 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 <[email protected]>
> Cc: Orson Zhai <[email protected]>
> Cc: Baolin Wang <[email protected]>
> Cc: Chunyan Zhang <[email protected]>
> ---
> drivers/mfd/sprd-sc27xx-spi.c | 7 +++++++
> 1 file changed, 7 insertions(+)

Applied, thanks.

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