All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] mtd: Ensure DT compatibles have SPI device IDs
@ 2022-02-02 14:34 Mark Brown
  2022-02-02 14:34 ` [PATCH v2 1/3] mtd: dataflash: Add SPI ID table Mark Brown
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Mark Brown @ 2022-02-02 14:34 UTC (permalink / raw)
  To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra
  Cc: linux-mtd, 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.

v2:
 - Rebase onto v5.17-rc1

Mark Brown (3):
  mtd: dataflash: Add SPI ID table
  mtd: mchp23k256: Add SPI ID table
  mtd: mchp48l640: Add SPI ID table

 drivers/mtd/devices/mchp23k256.c    | 14 ++++++++++++++
 drivers/mtd/devices/mchp48l640.c    | 10 ++++++++++
 drivers/mtd/devices/mtd_dataflash.c |  8 ++++++++
 3 files changed, 32 insertions(+)


base-commit: e783362eb54cd99b2cac8b3a9aeac942e6f6ac07
-- 
2.30.2


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* [PATCH v2 1/3] mtd: dataflash: Add SPI ID table
  2022-02-02 14:34 [PATCH v2 0/3] mtd: Ensure DT compatibles have SPI device IDs Mark Brown
@ 2022-02-02 14:34 ` Mark Brown
  2022-02-03  8:50   ` Michael Walle
  2022-02-02 14:34 ` [PATCH v2 2/3] mtd: mchp23k256: " Mark Brown
  2022-02-02 14:34 ` [PATCH v2 3/3] mtd: mchp48l640: " Mark Brown
  2 siblings, 1 reply; 9+ messages in thread
From: Mark Brown @ 2022-02-02 14:34 UTC (permalink / raw)
  To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra
  Cc: linux-mtd, 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 an id_table listing the
SPI IDs for everything.

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

diff --git a/drivers/mtd/devices/mtd_dataflash.c b/drivers/mtd/devices/mtd_dataflash.c
index 734878abaa23..3ae18cbf5cd1 100644
--- a/drivers/mtd/devices/mtd_dataflash.c
+++ b/drivers/mtd/devices/mtd_dataflash.c
@@ -112,6 +112,13 @@ static const struct of_device_id dataflash_dt_ids[] = {
 MODULE_DEVICE_TABLE(of, dataflash_dt_ids);
 #endif
 
+static const struct spi_device_id dataflash_spi_ids[] = {
+	{ .name = "at45", },
+	{ .name = "dataflash", },
+	{ /* sentinel */ }
+};
+MODULE_DEVICE_TABLE(spi, dataflash_spi_ids);
+
 /* ......................................................................... */
 
 /*
@@ -938,6 +945,7 @@ static struct spi_driver dataflash_driver = {
 
 	.probe		= dataflash_probe,
 	.remove		= dataflash_remove,
+	.id_table	= dataflash_spi_ids,
 
 	/* FIXME:  investigate suspend and resume... */
 };
-- 
2.30.2


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* [PATCH v2 2/3] mtd: mchp23k256: Add SPI ID table
  2022-02-02 14:34 [PATCH v2 0/3] mtd: Ensure DT compatibles have SPI device IDs Mark Brown
  2022-02-02 14:34 ` [PATCH v2 1/3] mtd: dataflash: Add SPI ID table Mark Brown
@ 2022-02-02 14:34 ` Mark Brown
  2022-02-03  8:52   ` Michael Walle
  2022-02-07 15:39   ` Miquel Raynal
  2022-02-02 14:34 ` [PATCH v2 3/3] mtd: mchp48l640: " Mark Brown
  2 siblings, 2 replies; 9+ messages in thread
From: Mark Brown @ 2022-02-02 14:34 UTC (permalink / raw)
  To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra
  Cc: linux-mtd, 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 an id_table listing the
SPI IDs for everything.

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

diff --git a/drivers/mtd/devices/mchp23k256.c b/drivers/mtd/devices/mchp23k256.c
index a8b31bddf14b..1a840db207b5 100644
--- a/drivers/mtd/devices/mchp23k256.c
+++ b/drivers/mtd/devices/mchp23k256.c
@@ -231,6 +231,19 @@ static const struct of_device_id mchp23k256_of_table[] = {
 };
 MODULE_DEVICE_TABLE(of, mchp23k256_of_table);
 
+static const struct spi_device_id mchp23k256_spi_ids[] = {
+	{
+		.name = "mchp23k256",
+		.driver_data = (kernel_ulong_t)&mchp23k256_caps,
+	},
+	{
+		.name = "mchp23lcv1024",
+		.driver_data = (kernel_ulong_t)&mchp23lcv1024_caps,
+	},
+	{}
+};
+MODULE_DEVICE_TABLE(spi, mchp23k256_spi_ids);
+
 static struct spi_driver mchp23k256_driver = {
 	.driver = {
 		.name	= "mchp23k256",
@@ -238,6 +251,7 @@ static struct spi_driver mchp23k256_driver = {
 	},
 	.probe		= mchp23k256_probe,
 	.remove		= mchp23k256_remove,
+	.id_table	= mchp23k256_spi_ids,
 };
 
 module_spi_driver(mchp23k256_driver);
-- 
2.30.2


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* [PATCH v2 3/3] mtd: mchp48l640: Add SPI ID table
  2022-02-02 14:34 [PATCH v2 0/3] mtd: Ensure DT compatibles have SPI device IDs Mark Brown
  2022-02-02 14:34 ` [PATCH v2 1/3] mtd: dataflash: Add SPI ID table Mark Brown
  2022-02-02 14:34 ` [PATCH v2 2/3] mtd: mchp23k256: " Mark Brown
@ 2022-02-02 14:34 ` Mark Brown
  2022-02-03  8:53   ` Michael Walle
  2022-02-07 15:39   ` Miquel Raynal
  2 siblings, 2 replies; 9+ messages in thread
From: Mark Brown @ 2022-02-02 14:34 UTC (permalink / raw)
  To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra
  Cc: linux-mtd, 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 an id_table listing the
SPI IDs for everything.

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

diff --git a/drivers/mtd/devices/mchp48l640.c b/drivers/mtd/devices/mchp48l640.c
index 231a10790196..b9cf2b4415a5 100644
--- a/drivers/mtd/devices/mchp48l640.c
+++ b/drivers/mtd/devices/mchp48l640.c
@@ -359,6 +359,15 @@ static const struct of_device_id mchp48l640_of_table[] = {
 };
 MODULE_DEVICE_TABLE(of, mchp48l640_of_table);
 
+static const struct spi_device_id mchp48l640_spi_ids[] = {
+	{
+		.name = "48l640",
+		.driver_data = (kernel_ulong_t)&mchp48l640_caps,
+	},
+	{}
+};
+MODULE_DEVICE_TABLE(spi, mchp48l640_spi_ids);
+
 static struct spi_driver mchp48l640_driver = {
 	.driver = {
 		.name	= "mchp48l640",
@@ -366,6 +375,7 @@ static struct spi_driver mchp48l640_driver = {
 	},
 	.probe		= mchp48l640_probe,
 	.remove		= mchp48l640_remove,
+	.id_table	= mchp48l640_spi_ids,
 };
 
 module_spi_driver(mchp48l640_driver);
-- 
2.30.2


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: [PATCH v2 1/3] mtd: dataflash: Add SPI ID table
  2022-02-02 14:34 ` [PATCH v2 1/3] mtd: dataflash: Add SPI ID table Mark Brown
@ 2022-02-03  8:50   ` Michael Walle
  0 siblings, 0 replies; 9+ messages in thread
From: Michael Walle @ 2022-02-03  8:50 UTC (permalink / raw)
  To: broonie; +Cc: linux-mtd, miquel.raynal, richard, vigneshr, Michael Walle

> 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 an id_table listing the
> SPI IDs for everything.
> 
> Fixes: 96c8395e2166 ("spi: Revert modalias changes")
> Signed-off-by: Mark Brown <broonie@kernel.org>
> ---
>  drivers/mtd/devices/mtd_dataflash.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/mtd/devices/mtd_dataflash.c b/drivers/mtd/devices/mtd_dataflash.c
> index 734878abaa23..3ae18cbf5cd1 100644
> --- a/drivers/mtd/devices/mtd_dataflash.c
> +++ b/drivers/mtd/devices/mtd_dataflash.c
> @@ -112,6 +112,13 @@ static const struct of_device_id dataflash_dt_ids[] = {
>  MODULE_DEVICE_TABLE(of, dataflash_dt_ids);
>  #endif
>  
> +static const struct spi_device_id dataflash_spi_ids[] = {
> +	{ .name = "at45", },
> +	{ .name = "dataflash", },
> +	{ /* sentinel */ }
> +};
> +MODULE_DEVICE_TABLE(spi, dataflash_spi_ids);
> +
>  /* ......................................................................... */
>  
>  /*
> @@ -938,6 +945,7 @@ static struct spi_driver dataflash_driver = {
>  
>  	.probe		= dataflash_probe,
>  	.remove		= dataflash_remove,
> +	.id_table	= dataflash_spi_ids,
>  
>  	/* FIXME:  investigate suspend and resume... */
>  };
> -- 
> 2.30.2

Looks like a duplicate of 27a030e872925.

-michael

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: [PATCH v2 2/3] mtd: mchp23k256: Add SPI ID table
  2022-02-02 14:34 ` [PATCH v2 2/3] mtd: mchp23k256: " Mark Brown
@ 2022-02-03  8:52   ` Michael Walle
  2022-02-07 15:39   ` Miquel Raynal
  1 sibling, 0 replies; 9+ messages in thread
From: Michael Walle @ 2022-02-03  8:52 UTC (permalink / raw)
  To: broonie; +Cc: linux-mtd, miquel.raynal, richard, vigneshr, Michael Walle

> 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 an id_table listing the
> SPI IDs for everything.
> 
> Fixes: 96c8395e2166 ("spi: Revert modalias changes")
> Signed-off-by: Mark Brown <broonie@kernel.org>
> ---
>  drivers/mtd/devices/mchp23k256.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
> 
> diff --git a/drivers/mtd/devices/mchp23k256.c b/drivers/mtd/devices/mchp23k256.c
> index a8b31bddf14b..1a840db207b5 100644
> --- a/drivers/mtd/devices/mchp23k256.c
> +++ b/drivers/mtd/devices/mchp23k256.c
> @@ -231,6 +231,19 @@ static const struct of_device_id mchp23k256_of_table[] = {
>  };
>  MODULE_DEVICE_TABLE(of, mchp23k256_of_table);
>  
> +static const struct spi_device_id mchp23k256_spi_ids[] = {
> +	{
> +		.name = "mchp23k256",
> +		.driver_data = (kernel_ulong_t)&mchp23k256_caps,
> +	},
> +	{
> +		.name = "mchp23lcv1024",
> +		.driver_data = (kernel_ulong_t)&mchp23lcv1024_caps,
> +	},
> +	{}
> +};
> +MODULE_DEVICE_TABLE(spi, mchp23k256_spi_ids);
> +
>  static struct spi_driver mchp23k256_driver = {
>  	.driver = {
>  		.name	= "mchp23k256",
> @@ -238,6 +251,7 @@ static struct spi_driver mchp23k256_driver = {
>  	},
>  	.probe		= mchp23k256_probe,
>  	.remove		= mchp23k256_remove,
> +	.id_table	= mchp23k256_spi_ids,
>  };
>  
>  module_spi_driver(mchp23k256_driver);

Reviewed-by: Michael Walle <michael@walle.cc>

-michael

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: [PATCH v2 3/3] mtd: mchp48l640: Add SPI ID table
  2022-02-02 14:34 ` [PATCH v2 3/3] mtd: mchp48l640: " Mark Brown
@ 2022-02-03  8:53   ` Michael Walle
  2022-02-07 15:39   ` Miquel Raynal
  1 sibling, 0 replies; 9+ messages in thread
From: Michael Walle @ 2022-02-03  8:53 UTC (permalink / raw)
  To: broonie; +Cc: linux-mtd, miquel.raynal, richard, vigneshr, Michael Walle

> 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 an id_table listing the
> SPI IDs for everything.
> 
> Fixes: 96c8395e2166 ("spi: Revert modalias changes")
> Signed-off-by: Mark Brown <broonie@kernel.org>
> ---
>  drivers/mtd/devices/mchp48l640.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/mtd/devices/mchp48l640.c b/drivers/mtd/devices/mchp48l640.c
> index 231a10790196..b9cf2b4415a5 100644
> --- a/drivers/mtd/devices/mchp48l640.c
> +++ b/drivers/mtd/devices/mchp48l640.c
> @@ -359,6 +359,15 @@ static const struct of_device_id mchp48l640_of_table[] = {
>  };
>  MODULE_DEVICE_TABLE(of, mchp48l640_of_table);
>  
> +static const struct spi_device_id mchp48l640_spi_ids[] = {
> +	{
> +		.name = "48l640",
> +		.driver_data = (kernel_ulong_t)&mchp48l640_caps,
> +	},
> +	{}
> +};
> +MODULE_DEVICE_TABLE(spi, mchp48l640_spi_ids);
> +
>  static struct spi_driver mchp48l640_driver = {
>  	.driver = {
>  		.name	= "mchp48l640",
> @@ -366,6 +375,7 @@ static struct spi_driver mchp48l640_driver = {
>  	},
>  	.probe		= mchp48l640_probe,
>  	.remove		= mchp48l640_remove,
> +	.id_table	= mchp48l640_spi_ids,
>  };
>  
>  module_spi_driver(mchp48l640_driver);

Reviewed-by: Michael Walle <michael@walle.cc>

-michael

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: [PATCH v2 3/3] mtd: mchp48l640: Add SPI ID table
  2022-02-02 14:34 ` [PATCH v2 3/3] mtd: mchp48l640: " Mark Brown
  2022-02-03  8:53   ` Michael Walle
@ 2022-02-07 15:39   ` Miquel Raynal
  1 sibling, 0 replies; 9+ messages in thread
From: Miquel Raynal @ 2022-02-07 15:39 UTC (permalink / raw)
  To: Mark Brown, Miquel Raynal, Richard Weinberger, Vignesh Raghavendra
  Cc: linux-mtd

On Wed, 2022-02-02 at 14:34:04 UTC, 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 an id_table listing the
> SPI IDs for everything.
> 
> Fixes: 96c8395e2166 ("spi: Revert modalias changes")
> Signed-off-by: Mark Brown <broonie@kernel.org>
> Reviewed-by: Michael Walle <michael@walle.cc>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.

Miquel

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

* Re: [PATCH v2 2/3] mtd: mchp23k256: Add SPI ID table
  2022-02-02 14:34 ` [PATCH v2 2/3] mtd: mchp23k256: " Mark Brown
  2022-02-03  8:52   ` Michael Walle
@ 2022-02-07 15:39   ` Miquel Raynal
  1 sibling, 0 replies; 9+ messages in thread
From: Miquel Raynal @ 2022-02-07 15:39 UTC (permalink / raw)
  To: Mark Brown, Miquel Raynal, Richard Weinberger, Vignesh Raghavendra
  Cc: linux-mtd

On Wed, 2022-02-02 at 14:34:03 UTC, 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 an id_table listing the
> SPI IDs for everything.
> 
> Fixes: 96c8395e2166 ("spi: Revert modalias changes")
> Signed-off-by: Mark Brown <broonie@kernel.org>
> Reviewed-by: Michael Walle <michael@walle.cc>

Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks.

Miquel

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

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

end of thread, other threads:[~2022-02-07 16:10 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-02 14:34 [PATCH v2 0/3] mtd: Ensure DT compatibles have SPI device IDs Mark Brown
2022-02-02 14:34 ` [PATCH v2 1/3] mtd: dataflash: Add SPI ID table Mark Brown
2022-02-03  8:50   ` Michael Walle
2022-02-02 14:34 ` [PATCH v2 2/3] mtd: mchp23k256: " Mark Brown
2022-02-03  8:52   ` Michael Walle
2022-02-07 15:39   ` Miquel Raynal
2022-02-02 14:34 ` [PATCH v2 3/3] mtd: mchp48l640: " Mark Brown
2022-02-03  8:53   ` Michael Walle
2022-02-07 15:39   ` Miquel Raynal

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.