linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mfd: dln2: Add cell for initializing DLN2 ADC
@ 2021-10-18 11:25 Noralf Trønnes
  2021-10-21 12:04 ` Lee Jones
  0 siblings, 1 reply; 2+ messages in thread
From: Noralf Trønnes @ 2021-10-18 11:25 UTC (permalink / raw)
  To: lee.jones; +Cc: linux-kernel, Jack Andersen, stable, Noralf Trønnes

From: Jack Andersen <jackoalan@gmail.com>

This patch extends the DLN2 driver; adding cell for adc_dln2 module.

The original patch[1] fell through the cracks when the driver was added
so ADC has never actually been usable. That patch did not have ACPI
support which was added in v5.9, so the oldest supported version this
current patch can be backported to is 5.10.

[1] https://www.spinics.net/lists/linux-iio/msg33975.html

Cc: <stable@vger.kernel.org> # 5.10+
Signed-off-by: Jack Andersen <jackoalan@gmail.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
---
 drivers/mfd/dln2.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/drivers/mfd/dln2.c b/drivers/mfd/dln2.c
index 83e676a096dc..852129ea0766 100644
--- a/drivers/mfd/dln2.c
+++ b/drivers/mfd/dln2.c
@@ -50,6 +50,7 @@ enum dln2_handle {
 	DLN2_HANDLE_GPIO,
 	DLN2_HANDLE_I2C,
 	DLN2_HANDLE_SPI,
+	DLN2_HANDLE_ADC,
 	DLN2_HANDLES
 };
 
@@ -653,6 +654,7 @@ enum {
 	DLN2_ACPI_MATCH_GPIO	= 0,
 	DLN2_ACPI_MATCH_I2C	= 1,
 	DLN2_ACPI_MATCH_SPI	= 2,
+	DLN2_ACPI_MATCH_ADC	= 3,
 };
 
 static struct dln2_platform_data dln2_pdata_gpio = {
@@ -683,6 +685,16 @@ static struct mfd_cell_acpi_match dln2_acpi_match_spi = {
 	.adr = DLN2_ACPI_MATCH_SPI,
 };
 
+/* Only one ADC port supported */
+static struct dln2_platform_data dln2_pdata_adc = {
+	.handle = DLN2_HANDLE_ADC,
+	.port = 0,
+};
+
+static struct mfd_cell_acpi_match dln2_acpi_match_adc = {
+	.adr = DLN2_ACPI_MATCH_ADC,
+};
+
 static const struct mfd_cell dln2_devs[] = {
 	{
 		.name = "dln2-gpio",
@@ -702,6 +714,12 @@ static const struct mfd_cell dln2_devs[] = {
 		.platform_data = &dln2_pdata_spi,
 		.pdata_size = sizeof(struct dln2_platform_data),
 	},
+	{
+		.name = "dln2-adc",
+		.acpi_match = &dln2_acpi_match_adc,
+		.platform_data = &dln2_pdata_adc,
+		.pdata_size = sizeof(struct dln2_platform_data),
+	},
 };
 
 static void dln2_stop(struct dln2_dev *dln2)
-- 
2.33.0


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

* Re: [PATCH] mfd: dln2: Add cell for initializing DLN2 ADC
  2021-10-18 11:25 [PATCH] mfd: dln2: Add cell for initializing DLN2 ADC Noralf Trønnes
@ 2021-10-21 12:04 ` Lee Jones
  0 siblings, 0 replies; 2+ messages in thread
From: Lee Jones @ 2021-10-21 12:04 UTC (permalink / raw)
  To: Noralf Trønnes; +Cc: linux-kernel, Jack Andersen, stable

On Mon, 18 Oct 2021, Noralf Trønnes wrote:

> From: Jack Andersen <jackoalan@gmail.com>
> 
> This patch extends the DLN2 driver; adding cell for adc_dln2 module.
> 
> The original patch[1] fell through the cracks when the driver was added
> so ADC has never actually been usable. That patch did not have ACPI
> support which was added in v5.9, so the oldest supported version this
> current patch can be backported to is 5.10.
> 
> [1] https://www.spinics.net/lists/linux-iio/msg33975.html
> 
> Cc: <stable@vger.kernel.org> # 5.10+
> Signed-off-by: Jack Andersen <jackoalan@gmail.com>
> Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
> ---
>  drivers/mfd/dln2.c | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)

Applied, thanks.

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

end of thread, other threads:[~2021-10-21 12:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-18 11:25 [PATCH] mfd: dln2: Add cell for initializing DLN2 ADC Noralf Trønnes
2021-10-21 12:04 ` 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).