All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iio: adc: stm32-dfsdm: Add support for stm32mp1
@ 2018-05-02 13:05 ` Fabrice Gasnier
  0 siblings, 0 replies; 13+ messages in thread
From: Fabrice Gasnier @ 2018-05-02 13:05 UTC (permalink / raw)
  To: jic23, robh+dt, alexandre.torgue
  Cc: mark.rutland, mcoquelin.stm32, lars, knaack.h, pmeerw,
	fabrice.gasnier, linux-iio, devicetree, linux-arm-kernel,
	linux-kernel, benjamin.gaignard, arnaud.pouliquen

Add support for DFSDM (Digital Filter For Sigma Delta Modulators)
to STM32MP1. This variant is close to STM32H7 DFSDM, it implements
6 filter instances. Registers map is also increased.

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
---
 .../bindings/iio/adc/st,stm32-dfsdm-adc.txt         |  7 +++++--
 drivers/iio/adc/stm32-dfsdm-core.c                  | 21 +++++++++++++++++++++
 2 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.txt b/Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.txt
index ed7520d..75ba25d 100644
--- a/Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.txt
+++ b/Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.txt
@@ -8,14 +8,16 @@ It is mainly targeted for:
 - PDM microphones (audio digital microphone)
 
 It features up to 8 serial digital interfaces (SPI or Manchester) and
-up to 4 filters on stm32h7.
+up to 4 filters on stm32h7 or 6 filters on stm32mp1.
 
 Each child node match with a filter instance.
 
 Contents of a STM32 DFSDM root node:
 ------------------------------------
 Required properties:
-- compatible: Should be "st,stm32h7-dfsdm".
+- compatible: Should be one of:
+  "st,stm32h7-dfsdm"
+  "st,stm32mp1-dfsdm"
 - reg: Offset and length of the DFSDM block register set.
 - clocks: IP and serial interfaces clocking. Should be set according
 		to rcc clock ID and "clock-names".
@@ -45,6 +47,7 @@ Required properties:
 	"st,stm32-dfsdm-adc" for sigma delta ADCs
 	"st,stm32-dfsdm-dmic" for audio digital microphone.
 - reg: Specifies the DFSDM filter instance used.
+	Valid values are from 0 to 3 on stm32h7, 0 to 5 on stm32mp1.
 - interrupts: IRQ lines connected to each DFSDM filter instance.
 - st,adc-channels:	List of single-ended channels muxed for this ADC.
 			valid values:
diff --git a/drivers/iio/adc/stm32-dfsdm-core.c b/drivers/iio/adc/stm32-dfsdm-core.c
index e50efdc..d924e6c 100644
--- a/drivers/iio/adc/stm32-dfsdm-core.c
+++ b/drivers/iio/adc/stm32-dfsdm-core.c
@@ -25,6 +25,8 @@ struct stm32_dfsdm_dev_data {
 
 #define STM32H7_DFSDM_NUM_FILTERS	4
 #define STM32H7_DFSDM_NUM_CHANNELS	8
+#define STM32MP1_DFSDM_NUM_FILTERS	6
+#define STM32MP1_DFSDM_NUM_CHANNELS	8
 
 static bool stm32_dfsdm_volatile_reg(struct device *dev, unsigned int reg)
 {
@@ -61,6 +63,21 @@ static bool stm32_dfsdm_volatile_reg(struct device *dev, unsigned int reg)
 	.regmap_cfg = &stm32h7_dfsdm_regmap_cfg,
 };
 
+static const struct regmap_config stm32mp1_dfsdm_regmap_cfg = {
+	.reg_bits = 32,
+	.val_bits = 32,
+	.reg_stride = sizeof(u32),
+	.max_register = 0x7fc,
+	.volatile_reg = stm32_dfsdm_volatile_reg,
+	.fast_io = true,
+};
+
+static const struct stm32_dfsdm_dev_data stm32mp1_dfsdm_data = {
+	.num_filters = STM32MP1_DFSDM_NUM_FILTERS,
+	.num_channels = STM32MP1_DFSDM_NUM_CHANNELS,
+	.regmap_cfg = &stm32mp1_dfsdm_regmap_cfg,
+};
+
 struct dfsdm_priv {
 	struct platform_device *pdev; /* platform device */
 
@@ -243,6 +260,10 @@ static int stm32_dfsdm_parse_of(struct platform_device *pdev,
 		.compatible = "st,stm32h7-dfsdm",
 		.data = &stm32h7_dfsdm_data,
 	},
+	{
+		.compatible = "st,stm32mp1-dfsdm",
+		.data = &stm32mp1_dfsdm_data,
+	},
 	{}
 };
 MODULE_DEVICE_TABLE(of, stm32_dfsdm_of_match);
-- 
1.9.1

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

* [PATCH] iio: adc: stm32-dfsdm: Add support for stm32mp1
@ 2018-05-02 13:05 ` Fabrice Gasnier
  0 siblings, 0 replies; 13+ messages in thread
From: Fabrice Gasnier @ 2018-05-02 13:05 UTC (permalink / raw)
  To: jic23, robh+dt, alexandre.torgue
  Cc: mark.rutland, devicetree, benjamin.gaignard, lars,
	mcoquelin.stm32, linux-iio, arnaud.pouliquen, linux-kernel,
	pmeerw, knaack.h, fabrice.gasnier, linux-arm-kernel

Add support for DFSDM (Digital Filter For Sigma Delta Modulators)
to STM32MP1. This variant is close to STM32H7 DFSDM, it implements
6 filter instances. Registers map is also increased.

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
---
 .../bindings/iio/adc/st,stm32-dfsdm-adc.txt         |  7 +++++--
 drivers/iio/adc/stm32-dfsdm-core.c                  | 21 +++++++++++++++++++++
 2 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.txt b/Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.txt
index ed7520d..75ba25d 100644
--- a/Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.txt
+++ b/Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.txt
@@ -8,14 +8,16 @@ It is mainly targeted for:
 - PDM microphones (audio digital microphone)
 
 It features up to 8 serial digital interfaces (SPI or Manchester) and
-up to 4 filters on stm32h7.
+up to 4 filters on stm32h7 or 6 filters on stm32mp1.
 
 Each child node match with a filter instance.
 
 Contents of a STM32 DFSDM root node:
 ------------------------------------
 Required properties:
-- compatible: Should be "st,stm32h7-dfsdm".
+- compatible: Should be one of:
+  "st,stm32h7-dfsdm"
+  "st,stm32mp1-dfsdm"
 - reg: Offset and length of the DFSDM block register set.
 - clocks: IP and serial interfaces clocking. Should be set according
 		to rcc clock ID and "clock-names".
@@ -45,6 +47,7 @@ Required properties:
 	"st,stm32-dfsdm-adc" for sigma delta ADCs
 	"st,stm32-dfsdm-dmic" for audio digital microphone.
 - reg: Specifies the DFSDM filter instance used.
+	Valid values are from 0 to 3 on stm32h7, 0 to 5 on stm32mp1.
 - interrupts: IRQ lines connected to each DFSDM filter instance.
 - st,adc-channels:	List of single-ended channels muxed for this ADC.
 			valid values:
diff --git a/drivers/iio/adc/stm32-dfsdm-core.c b/drivers/iio/adc/stm32-dfsdm-core.c
index e50efdc..d924e6c 100644
--- a/drivers/iio/adc/stm32-dfsdm-core.c
+++ b/drivers/iio/adc/stm32-dfsdm-core.c
@@ -25,6 +25,8 @@ struct stm32_dfsdm_dev_data {
 
 #define STM32H7_DFSDM_NUM_FILTERS	4
 #define STM32H7_DFSDM_NUM_CHANNELS	8
+#define STM32MP1_DFSDM_NUM_FILTERS	6
+#define STM32MP1_DFSDM_NUM_CHANNELS	8
 
 static bool stm32_dfsdm_volatile_reg(struct device *dev, unsigned int reg)
 {
@@ -61,6 +63,21 @@ static bool stm32_dfsdm_volatile_reg(struct device *dev, unsigned int reg)
 	.regmap_cfg = &stm32h7_dfsdm_regmap_cfg,
 };
 
+static const struct regmap_config stm32mp1_dfsdm_regmap_cfg = {
+	.reg_bits = 32,
+	.val_bits = 32,
+	.reg_stride = sizeof(u32),
+	.max_register = 0x7fc,
+	.volatile_reg = stm32_dfsdm_volatile_reg,
+	.fast_io = true,
+};
+
+static const struct stm32_dfsdm_dev_data stm32mp1_dfsdm_data = {
+	.num_filters = STM32MP1_DFSDM_NUM_FILTERS,
+	.num_channels = STM32MP1_DFSDM_NUM_CHANNELS,
+	.regmap_cfg = &stm32mp1_dfsdm_regmap_cfg,
+};
+
 struct dfsdm_priv {
 	struct platform_device *pdev; /* platform device */
 
@@ -243,6 +260,10 @@ static int stm32_dfsdm_parse_of(struct platform_device *pdev,
 		.compatible = "st,stm32h7-dfsdm",
 		.data = &stm32h7_dfsdm_data,
 	},
+	{
+		.compatible = "st,stm32mp1-dfsdm",
+		.data = &stm32mp1_dfsdm_data,
+	},
 	{}
 };
 MODULE_DEVICE_TABLE(of, stm32_dfsdm_of_match);
-- 
1.9.1

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

* [PATCH] iio: adc: stm32-dfsdm: Add support for stm32mp1
@ 2018-05-02 13:05 ` Fabrice Gasnier
  0 siblings, 0 replies; 13+ messages in thread
From: Fabrice Gasnier @ 2018-05-02 13:05 UTC (permalink / raw)
  To: linux-arm-kernel

Add support for DFSDM (Digital Filter For Sigma Delta Modulators)
to STM32MP1. This variant is close to STM32H7 DFSDM, it implements
6 filter instances. Registers map is also increased.

Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
---
 .../bindings/iio/adc/st,stm32-dfsdm-adc.txt         |  7 +++++--
 drivers/iio/adc/stm32-dfsdm-core.c                  | 21 +++++++++++++++++++++
 2 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.txt b/Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.txt
index ed7520d..75ba25d 100644
--- a/Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.txt
+++ b/Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.txt
@@ -8,14 +8,16 @@ It is mainly targeted for:
 - PDM microphones (audio digital microphone)
 
 It features up to 8 serial digital interfaces (SPI or Manchester) and
-up to 4 filters on stm32h7.
+up to 4 filters on stm32h7 or 6 filters on stm32mp1.
 
 Each child node match with a filter instance.
 
 Contents of a STM32 DFSDM root node:
 ------------------------------------
 Required properties:
-- compatible: Should be "st,stm32h7-dfsdm".
+- compatible: Should be one of:
+  "st,stm32h7-dfsdm"
+  "st,stm32mp1-dfsdm"
 - reg: Offset and length of the DFSDM block register set.
 - clocks: IP and serial interfaces clocking. Should be set according
 		to rcc clock ID and "clock-names".
@@ -45,6 +47,7 @@ Required properties:
 	"st,stm32-dfsdm-adc" for sigma delta ADCs
 	"st,stm32-dfsdm-dmic" for audio digital microphone.
 - reg: Specifies the DFSDM filter instance used.
+	Valid values are from 0 to 3 on stm32h7, 0 to 5 on stm32mp1.
 - interrupts: IRQ lines connected to each DFSDM filter instance.
 - st,adc-channels:	List of single-ended channels muxed for this ADC.
 			valid values:
diff --git a/drivers/iio/adc/stm32-dfsdm-core.c b/drivers/iio/adc/stm32-dfsdm-core.c
index e50efdc..d924e6c 100644
--- a/drivers/iio/adc/stm32-dfsdm-core.c
+++ b/drivers/iio/adc/stm32-dfsdm-core.c
@@ -25,6 +25,8 @@ struct stm32_dfsdm_dev_data {
 
 #define STM32H7_DFSDM_NUM_FILTERS	4
 #define STM32H7_DFSDM_NUM_CHANNELS	8
+#define STM32MP1_DFSDM_NUM_FILTERS	6
+#define STM32MP1_DFSDM_NUM_CHANNELS	8
 
 static bool stm32_dfsdm_volatile_reg(struct device *dev, unsigned int reg)
 {
@@ -61,6 +63,21 @@ static bool stm32_dfsdm_volatile_reg(struct device *dev, unsigned int reg)
 	.regmap_cfg = &stm32h7_dfsdm_regmap_cfg,
 };
 
+static const struct regmap_config stm32mp1_dfsdm_regmap_cfg = {
+	.reg_bits = 32,
+	.val_bits = 32,
+	.reg_stride = sizeof(u32),
+	.max_register = 0x7fc,
+	.volatile_reg = stm32_dfsdm_volatile_reg,
+	.fast_io = true,
+};
+
+static const struct stm32_dfsdm_dev_data stm32mp1_dfsdm_data = {
+	.num_filters = STM32MP1_DFSDM_NUM_FILTERS,
+	.num_channels = STM32MP1_DFSDM_NUM_CHANNELS,
+	.regmap_cfg = &stm32mp1_dfsdm_regmap_cfg,
+};
+
 struct dfsdm_priv {
 	struct platform_device *pdev; /* platform device */
 
@@ -243,6 +260,10 @@ static int stm32_dfsdm_parse_of(struct platform_device *pdev,
 		.compatible = "st,stm32h7-dfsdm",
 		.data = &stm32h7_dfsdm_data,
 	},
+	{
+		.compatible = "st,stm32mp1-dfsdm",
+		.data = &stm32mp1_dfsdm_data,
+	},
 	{}
 };
 MODULE_DEVICE_TABLE(of, stm32_dfsdm_of_match);
-- 
1.9.1

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

* Re: [PATCH] iio: adc: stm32-dfsdm: Add support for stm32mp1
  2018-05-02 13:05 ` Fabrice Gasnier
  (?)
@ 2018-05-06 17:56   ` Jonathan Cameron
  -1 siblings, 0 replies; 13+ messages in thread
From: Jonathan Cameron @ 2018-05-06 17:56 UTC (permalink / raw)
  To: Fabrice Gasnier
  Cc: robh+dt, alexandre.torgue, mark.rutland, mcoquelin.stm32, lars,
	knaack.h, pmeerw, linux-iio, devicetree, linux-arm-kernel,
	linux-kernel, benjamin.gaignard, arnaud.pouliquen

On Wed, 2 May 2018 15:05:23 +0200
Fabrice Gasnier <fabrice.gasnier@st.com> wrote:

> Add support for DFSDM (Digital Filter For Sigma Delta Modulators)
> to STM32MP1. This variant is close to STM32H7 DFSDM, it implements
> 6 filter instances. Registers map is also increased.
> 
> Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Looks good to me. I'd like to give a little more time for others
to comment however.  Give me a poke if I seem to have forgotten
about it.

Jonathan

> ---
>  .../bindings/iio/adc/st,stm32-dfsdm-adc.txt         |  7 +++++--
>  drivers/iio/adc/stm32-dfsdm-core.c                  | 21 +++++++++++++++++++++
>  2 files changed, 26 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.txt b/Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.txt
> index ed7520d..75ba25d 100644
> --- a/Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.txt
> +++ b/Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.txt
> @@ -8,14 +8,16 @@ It is mainly targeted for:
>  - PDM microphones (audio digital microphone)
>  
>  It features up to 8 serial digital interfaces (SPI or Manchester) and
> -up to 4 filters on stm32h7.
> +up to 4 filters on stm32h7 or 6 filters on stm32mp1.
>  
>  Each child node match with a filter instance.
>  
>  Contents of a STM32 DFSDM root node:
>  ------------------------------------
>  Required properties:
> -- compatible: Should be "st,stm32h7-dfsdm".
> +- compatible: Should be one of:
> +  "st,stm32h7-dfsdm"
> +  "st,stm32mp1-dfsdm"
>  - reg: Offset and length of the DFSDM block register set.
>  - clocks: IP and serial interfaces clocking. Should be set according
>  		to rcc clock ID and "clock-names".
> @@ -45,6 +47,7 @@ Required properties:
>  	"st,stm32-dfsdm-adc" for sigma delta ADCs
>  	"st,stm32-dfsdm-dmic" for audio digital microphone.
>  - reg: Specifies the DFSDM filter instance used.
> +	Valid values are from 0 to 3 on stm32h7, 0 to 5 on stm32mp1.
>  - interrupts: IRQ lines connected to each DFSDM filter instance.
>  - st,adc-channels:	List of single-ended channels muxed for this ADC.
>  			valid values:
> diff --git a/drivers/iio/adc/stm32-dfsdm-core.c b/drivers/iio/adc/stm32-dfsdm-core.c
> index e50efdc..d924e6c 100644
> --- a/drivers/iio/adc/stm32-dfsdm-core.c
> +++ b/drivers/iio/adc/stm32-dfsdm-core.c
> @@ -25,6 +25,8 @@ struct stm32_dfsdm_dev_data {
>  
>  #define STM32H7_DFSDM_NUM_FILTERS	4
>  #define STM32H7_DFSDM_NUM_CHANNELS	8
> +#define STM32MP1_DFSDM_NUM_FILTERS	6
> +#define STM32MP1_DFSDM_NUM_CHANNELS	8
>  
>  static bool stm32_dfsdm_volatile_reg(struct device *dev, unsigned int reg)
>  {
> @@ -61,6 +63,21 @@ static bool stm32_dfsdm_volatile_reg(struct device *dev, unsigned int reg)
>  	.regmap_cfg = &stm32h7_dfsdm_regmap_cfg,
>  };
>  
> +static const struct regmap_config stm32mp1_dfsdm_regmap_cfg = {
> +	.reg_bits = 32,
> +	.val_bits = 32,
> +	.reg_stride = sizeof(u32),
> +	.max_register = 0x7fc,
> +	.volatile_reg = stm32_dfsdm_volatile_reg,
> +	.fast_io = true,
> +};
> +
> +static const struct stm32_dfsdm_dev_data stm32mp1_dfsdm_data = {
> +	.num_filters = STM32MP1_DFSDM_NUM_FILTERS,
> +	.num_channels = STM32MP1_DFSDM_NUM_CHANNELS,
> +	.regmap_cfg = &stm32mp1_dfsdm_regmap_cfg,
> +};
> +
>  struct dfsdm_priv {
>  	struct platform_device *pdev; /* platform device */
>  
> @@ -243,6 +260,10 @@ static int stm32_dfsdm_parse_of(struct platform_device *pdev,
>  		.compatible = "st,stm32h7-dfsdm",
>  		.data = &stm32h7_dfsdm_data,
>  	},
> +	{
> +		.compatible = "st,stm32mp1-dfsdm",
> +		.data = &stm32mp1_dfsdm_data,
> +	},
>  	{}
>  };
>  MODULE_DEVICE_TABLE(of, stm32_dfsdm_of_match);

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

* Re: [PATCH] iio: adc: stm32-dfsdm: Add support for stm32mp1
@ 2018-05-06 17:56   ` Jonathan Cameron
  0 siblings, 0 replies; 13+ messages in thread
From: Jonathan Cameron @ 2018-05-06 17:56 UTC (permalink / raw)
  To: Fabrice Gasnier
  Cc: robh+dt, alexandre.torgue, mark.rutland, mcoquelin.stm32, lars,
	knaack.h, pmeerw, linux-iio, devicetree, linux-arm-kernel,
	linux-kernel, benjamin.gaignard, arnaud.pouliquen

On Wed, 2 May 2018 15:05:23 +0200
Fabrice Gasnier <fabrice.gasnier@st.com> wrote:

> Add support for DFSDM (Digital Filter For Sigma Delta Modulators)
> to STM32MP1. This variant is close to STM32H7 DFSDM, it implements
> 6 filter instances. Registers map is also increased.
> 
> Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Looks good to me. I'd like to give a little more time for others
to comment however.  Give me a poke if I seem to have forgotten
about it.

Jonathan

> ---
>  .../bindings/iio/adc/st,stm32-dfsdm-adc.txt         |  7 +++++--
>  drivers/iio/adc/stm32-dfsdm-core.c                  | 21 +++++++++++++++++++++
>  2 files changed, 26 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.txt b/Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.txt
> index ed7520d..75ba25d 100644
> --- a/Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.txt
> +++ b/Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.txt
> @@ -8,14 +8,16 @@ It is mainly targeted for:
>  - PDM microphones (audio digital microphone)
>  
>  It features up to 8 serial digital interfaces (SPI or Manchester) and
> -up to 4 filters on stm32h7.
> +up to 4 filters on stm32h7 or 6 filters on stm32mp1.
>  
>  Each child node match with a filter instance.
>  
>  Contents of a STM32 DFSDM root node:
>  ------------------------------------
>  Required properties:
> -- compatible: Should be "st,stm32h7-dfsdm".
> +- compatible: Should be one of:
> +  "st,stm32h7-dfsdm"
> +  "st,stm32mp1-dfsdm"
>  - reg: Offset and length of the DFSDM block register set.
>  - clocks: IP and serial interfaces clocking. Should be set according
>  		to rcc clock ID and "clock-names".
> @@ -45,6 +47,7 @@ Required properties:
>  	"st,stm32-dfsdm-adc" for sigma delta ADCs
>  	"st,stm32-dfsdm-dmic" for audio digital microphone.
>  - reg: Specifies the DFSDM filter instance used.
> +	Valid values are from 0 to 3 on stm32h7, 0 to 5 on stm32mp1.
>  - interrupts: IRQ lines connected to each DFSDM filter instance.
>  - st,adc-channels:	List of single-ended channels muxed for this ADC.
>  			valid values:
> diff --git a/drivers/iio/adc/stm32-dfsdm-core.c b/drivers/iio/adc/stm32-dfsdm-core.c
> index e50efdc..d924e6c 100644
> --- a/drivers/iio/adc/stm32-dfsdm-core.c
> +++ b/drivers/iio/adc/stm32-dfsdm-core.c
> @@ -25,6 +25,8 @@ struct stm32_dfsdm_dev_data {
>  
>  #define STM32H7_DFSDM_NUM_FILTERS	4
>  #define STM32H7_DFSDM_NUM_CHANNELS	8
> +#define STM32MP1_DFSDM_NUM_FILTERS	6
> +#define STM32MP1_DFSDM_NUM_CHANNELS	8
>  
>  static bool stm32_dfsdm_volatile_reg(struct device *dev, unsigned int reg)
>  {
> @@ -61,6 +63,21 @@ static bool stm32_dfsdm_volatile_reg(struct device *dev, unsigned int reg)
>  	.regmap_cfg = &stm32h7_dfsdm_regmap_cfg,
>  };
>  
> +static const struct regmap_config stm32mp1_dfsdm_regmap_cfg = {
> +	.reg_bits = 32,
> +	.val_bits = 32,
> +	.reg_stride = sizeof(u32),
> +	.max_register = 0x7fc,
> +	.volatile_reg = stm32_dfsdm_volatile_reg,
> +	.fast_io = true,
> +};
> +
> +static const struct stm32_dfsdm_dev_data stm32mp1_dfsdm_data = {
> +	.num_filters = STM32MP1_DFSDM_NUM_FILTERS,
> +	.num_channels = STM32MP1_DFSDM_NUM_CHANNELS,
> +	.regmap_cfg = &stm32mp1_dfsdm_regmap_cfg,
> +};
> +
>  struct dfsdm_priv {
>  	struct platform_device *pdev; /* platform device */
>  
> @@ -243,6 +260,10 @@ static int stm32_dfsdm_parse_of(struct platform_device *pdev,
>  		.compatible = "st,stm32h7-dfsdm",
>  		.data = &stm32h7_dfsdm_data,
>  	},
> +	{
> +		.compatible = "st,stm32mp1-dfsdm",
> +		.data = &stm32mp1_dfsdm_data,
> +	},
>  	{}
>  };
>  MODULE_DEVICE_TABLE(of, stm32_dfsdm_of_match);

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

* [PATCH] iio: adc: stm32-dfsdm: Add support for stm32mp1
@ 2018-05-06 17:56   ` Jonathan Cameron
  0 siblings, 0 replies; 13+ messages in thread
From: Jonathan Cameron @ 2018-05-06 17:56 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, 2 May 2018 15:05:23 +0200
Fabrice Gasnier <fabrice.gasnier@st.com> wrote:

> Add support for DFSDM (Digital Filter For Sigma Delta Modulators)
> to STM32MP1. This variant is close to STM32H7 DFSDM, it implements
> 6 filter instances. Registers map is also increased.
> 
> Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
Looks good to me. I'd like to give a little more time for others
to comment however.  Give me a poke if I seem to have forgotten
about it.

Jonathan

> ---
>  .../bindings/iio/adc/st,stm32-dfsdm-adc.txt         |  7 +++++--
>  drivers/iio/adc/stm32-dfsdm-core.c                  | 21 +++++++++++++++++++++
>  2 files changed, 26 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.txt b/Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.txt
> index ed7520d..75ba25d 100644
> --- a/Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.txt
> +++ b/Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.txt
> @@ -8,14 +8,16 @@ It is mainly targeted for:
>  - PDM microphones (audio digital microphone)
>  
>  It features up to 8 serial digital interfaces (SPI or Manchester) and
> -up to 4 filters on stm32h7.
> +up to 4 filters on stm32h7 or 6 filters on stm32mp1.
>  
>  Each child node match with a filter instance.
>  
>  Contents of a STM32 DFSDM root node:
>  ------------------------------------
>  Required properties:
> -- compatible: Should be "st,stm32h7-dfsdm".
> +- compatible: Should be one of:
> +  "st,stm32h7-dfsdm"
> +  "st,stm32mp1-dfsdm"
>  - reg: Offset and length of the DFSDM block register set.
>  - clocks: IP and serial interfaces clocking. Should be set according
>  		to rcc clock ID and "clock-names".
> @@ -45,6 +47,7 @@ Required properties:
>  	"st,stm32-dfsdm-adc" for sigma delta ADCs
>  	"st,stm32-dfsdm-dmic" for audio digital microphone.
>  - reg: Specifies the DFSDM filter instance used.
> +	Valid values are from 0 to 3 on stm32h7, 0 to 5 on stm32mp1.
>  - interrupts: IRQ lines connected to each DFSDM filter instance.
>  - st,adc-channels:	List of single-ended channels muxed for this ADC.
>  			valid values:
> diff --git a/drivers/iio/adc/stm32-dfsdm-core.c b/drivers/iio/adc/stm32-dfsdm-core.c
> index e50efdc..d924e6c 100644
> --- a/drivers/iio/adc/stm32-dfsdm-core.c
> +++ b/drivers/iio/adc/stm32-dfsdm-core.c
> @@ -25,6 +25,8 @@ struct stm32_dfsdm_dev_data {
>  
>  #define STM32H7_DFSDM_NUM_FILTERS	4
>  #define STM32H7_DFSDM_NUM_CHANNELS	8
> +#define STM32MP1_DFSDM_NUM_FILTERS	6
> +#define STM32MP1_DFSDM_NUM_CHANNELS	8
>  
>  static bool stm32_dfsdm_volatile_reg(struct device *dev, unsigned int reg)
>  {
> @@ -61,6 +63,21 @@ static bool stm32_dfsdm_volatile_reg(struct device *dev, unsigned int reg)
>  	.regmap_cfg = &stm32h7_dfsdm_regmap_cfg,
>  };
>  
> +static const struct regmap_config stm32mp1_dfsdm_regmap_cfg = {
> +	.reg_bits = 32,
> +	.val_bits = 32,
> +	.reg_stride = sizeof(u32),
> +	.max_register = 0x7fc,
> +	.volatile_reg = stm32_dfsdm_volatile_reg,
> +	.fast_io = true,
> +};
> +
> +static const struct stm32_dfsdm_dev_data stm32mp1_dfsdm_data = {
> +	.num_filters = STM32MP1_DFSDM_NUM_FILTERS,
> +	.num_channels = STM32MP1_DFSDM_NUM_CHANNELS,
> +	.regmap_cfg = &stm32mp1_dfsdm_regmap_cfg,
> +};
> +
>  struct dfsdm_priv {
>  	struct platform_device *pdev; /* platform device */
>  
> @@ -243,6 +260,10 @@ static int stm32_dfsdm_parse_of(struct platform_device *pdev,
>  		.compatible = "st,stm32h7-dfsdm",
>  		.data = &stm32h7_dfsdm_data,
>  	},
> +	{
> +		.compatible = "st,stm32mp1-dfsdm",
> +		.data = &stm32mp1_dfsdm_data,
> +	},
>  	{}
>  };
>  MODULE_DEVICE_TABLE(of, stm32_dfsdm_of_match);

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

* Re: [PATCH] iio: adc: stm32-dfsdm: Add support for stm32mp1
  2018-05-02 13:05 ` Fabrice Gasnier
@ 2018-05-07 20:51   ` Rob Herring
  -1 siblings, 0 replies; 13+ messages in thread
From: Rob Herring @ 2018-05-07 20:51 UTC (permalink / raw)
  To: Fabrice Gasnier
  Cc: jic23, alexandre.torgue, mark.rutland, mcoquelin.stm32, lars,
	knaack.h, pmeerw, linux-iio, devicetree, linux-arm-kernel,
	linux-kernel, benjamin.gaignard, arnaud.pouliquen

On Wed, May 02, 2018 at 03:05:23PM +0200, Fabrice Gasnier wrote:
> Add support for DFSDM (Digital Filter For Sigma Delta Modulators)
> to STM32MP1. This variant is close to STM32H7 DFSDM, it implements
> 6 filter instances. Registers map is also increased.
> 
> Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
> ---
>  .../bindings/iio/adc/st,stm32-dfsdm-adc.txt         |  7 +++++--
>  drivers/iio/adc/stm32-dfsdm-core.c                  | 21 +++++++++++++++++++++
>  2 files changed, 26 insertions(+), 2 deletions(-)

Reviewed-by: Rob Herring <robh@kernel.org>

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

* [PATCH] iio: adc: stm32-dfsdm: Add support for stm32mp1
@ 2018-05-07 20:51   ` Rob Herring
  0 siblings, 0 replies; 13+ messages in thread
From: Rob Herring @ 2018-05-07 20:51 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, May 02, 2018 at 03:05:23PM +0200, Fabrice Gasnier wrote:
> Add support for DFSDM (Digital Filter For Sigma Delta Modulators)
> to STM32MP1. This variant is close to STM32H7 DFSDM, it implements
> 6 filter instances. Registers map is also increased.
> 
> Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
> ---
>  .../bindings/iio/adc/st,stm32-dfsdm-adc.txt         |  7 +++++--
>  drivers/iio/adc/stm32-dfsdm-core.c                  | 21 +++++++++++++++++++++
>  2 files changed, 26 insertions(+), 2 deletions(-)

Reviewed-by: Rob Herring <robh@kernel.org>

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

* Re: [PATCH] iio: adc: stm32-dfsdm: Add support for stm32mp1
  2018-05-07 20:51   ` Rob Herring
@ 2018-05-12  9:33     ` Jonathan Cameron
  -1 siblings, 0 replies; 13+ messages in thread
From: Jonathan Cameron @ 2018-05-12  9:33 UTC (permalink / raw)
  To: Rob Herring
  Cc: Fabrice Gasnier, alexandre.torgue, mark.rutland, mcoquelin.stm32,
	lars, knaack.h, pmeerw, linux-iio, devicetree, linux-arm-kernel,
	linux-kernel, benjamin.gaignard, arnaud.pouliquen

On Mon, 7 May 2018 15:51:51 -0500
Rob Herring <robh@kernel.org> wrote:

> On Wed, May 02, 2018 at 03:05:23PM +0200, Fabrice Gasnier wrote:
> > Add support for DFSDM (Digital Filter For Sigma Delta Modulators)
> > to STM32MP1. This variant is close to STM32H7 DFSDM, it implements
> > 6 filter instances. Registers map is also increased.
> > 
> > Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
> > ---
> >  .../bindings/iio/adc/st,stm32-dfsdm-adc.txt         |  7 +++++--
> >  drivers/iio/adc/stm32-dfsdm-core.c                  | 21 +++++++++++++++++++++
> >  2 files changed, 26 insertions(+), 2 deletions(-)  
> 
> Reviewed-by: Rob Herring <robh@kernel.org>
Applied.   Whilst doing this I note that I'm getting a few sparse
warnings for this driver that would be nice to clean up...

  CHECK   drivers/iio/adc/stm32-dfsdm-adc.c
drivers/iio/adc/stm32-dfsdm-adc.c:503:21: warning: expression using sizeof(void)
drivers/iio/adc/stm32-dfsdm-adc.c:503:21: warning: expression using sizeof(void)

Which is mystifying at first glance... Something deep and dirty in the min macro
but I can't see what..

drivers/iio/adc/stm32-dfsdm-adc.c:680:5: warning: symbol 'stm32_dfsdm_get_buff_cb' was not declared. Should it be static?
drivers/iio/adc/stm32-dfsdm-adc.c:703:5: warning: symbol 'stm32_dfsdm_release_buff_cb' was not declared. Should it be static?

Are rather more obvious

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

* [PATCH] iio: adc: stm32-dfsdm: Add support for stm32mp1
@ 2018-05-12  9:33     ` Jonathan Cameron
  0 siblings, 0 replies; 13+ messages in thread
From: Jonathan Cameron @ 2018-05-12  9:33 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, 7 May 2018 15:51:51 -0500
Rob Herring <robh@kernel.org> wrote:

> On Wed, May 02, 2018 at 03:05:23PM +0200, Fabrice Gasnier wrote:
> > Add support for DFSDM (Digital Filter For Sigma Delta Modulators)
> > to STM32MP1. This variant is close to STM32H7 DFSDM, it implements
> > 6 filter instances. Registers map is also increased.
> > 
> > Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
> > ---
> >  .../bindings/iio/adc/st,stm32-dfsdm-adc.txt         |  7 +++++--
> >  drivers/iio/adc/stm32-dfsdm-core.c                  | 21 +++++++++++++++++++++
> >  2 files changed, 26 insertions(+), 2 deletions(-)  
> 
> Reviewed-by: Rob Herring <robh@kernel.org>
Applied.   Whilst doing this I note that I'm getting a few sparse
warnings for this driver that would be nice to clean up...

  CHECK   drivers/iio/adc/stm32-dfsdm-adc.c
drivers/iio/adc/stm32-dfsdm-adc.c:503:21: warning: expression using sizeof(void)
drivers/iio/adc/stm32-dfsdm-adc.c:503:21: warning: expression using sizeof(void)

Which is mystifying at first glance... Something deep and dirty in the min macro
but I can't see what..

drivers/iio/adc/stm32-dfsdm-adc.c:680:5: warning: symbol 'stm32_dfsdm_get_buff_cb' was not declared. Should it be static?
drivers/iio/adc/stm32-dfsdm-adc.c:703:5: warning: symbol 'stm32_dfsdm_release_buff_cb' was not declared. Should it be static?

Are rather more obvious

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

* Re: [PATCH] iio: adc: stm32-dfsdm: Add support for stm32mp1
  2018-05-12  9:33     ` Jonathan Cameron
  (?)
@ 2018-05-15 15:23       ` Fabrice Gasnier
  -1 siblings, 0 replies; 13+ messages in thread
From: Fabrice Gasnier @ 2018-05-15 15:23 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: Rob Herring, alexandre.torgue, mark.rutland, mcoquelin.stm32,
	lars, knaack.h, pmeerw, linux-iio, devicetree, linux-arm-kernel,
	linux-kernel, benjamin.gaignard, arnaud.pouliquen

On 05/12/2018 11:33 AM, Jonathan Cameron wrote:
> On Mon, 7 May 2018 15:51:51 -0500
> Rob Herring <robh@kernel.org> wrote:
> 
>> On Wed, May 02, 2018 at 03:05:23PM +0200, Fabrice Gasnier wrote:
>>> Add support for DFSDM (Digital Filter For Sigma Delta Modulators)
>>> to STM32MP1. This variant is close to STM32H7 DFSDM, it implements
>>> 6 filter instances. Registers map is also increased.
>>>
>>> Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
>>> ---
>>>  .../bindings/iio/adc/st,stm32-dfsdm-adc.txt         |  7 +++++--
>>>  drivers/iio/adc/stm32-dfsdm-core.c                  | 21 +++++++++++++++++++++
>>>  2 files changed, 26 insertions(+), 2 deletions(-)  
>>
>> Reviewed-by: Rob Herring <robh@kernel.org>
> Applied.   Whilst doing this I note that I'm getting a few sparse
> warnings for this driver that would be nice to clean up...
> 
>   CHECK   drivers/iio/adc/stm32-dfsdm-adc.c
> drivers/iio/adc/stm32-dfsdm-adc.c:503:21: warning: expression using sizeof(void)
> drivers/iio/adc/stm32-dfsdm-adc.c:503:21: warning: expression using sizeof(void)
> 
> Which is mystifying at first glance... Something deep and dirty in the min macro
> but I can't see what..

Hi Jonathan,

I just sent a patch to clean bellow warning. But this is more obscure
regarding min macro...

Many thanks,
Fabrice

> 
> drivers/iio/adc/stm32-dfsdm-adc.c:680:5: warning: symbol 'stm32_dfsdm_get_buff_cb' was not declared. Should it be static?
> drivers/iio/adc/stm32-dfsdm-adc.c:703:5: warning: symbol 'stm32_dfsdm_release_buff_cb' was not declared. Should it be static?
> 
> Are rather more obvious
> 

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

* Re: [PATCH] iio: adc: stm32-dfsdm: Add support for stm32mp1
@ 2018-05-15 15:23       ` Fabrice Gasnier
  0 siblings, 0 replies; 13+ messages in thread
From: Fabrice Gasnier @ 2018-05-15 15:23 UTC (permalink / raw)
  To: Jonathan Cameron
  Cc: mark.rutland, Rob Herring, benjamin.gaignard, lars,
	alexandre.torgue, devicetree, linux-iio, pmeerw,
	arnaud.pouliquen, linux-kernel, mcoquelin.stm32, knaack.h,
	linux-arm-kernel

On 05/12/2018 11:33 AM, Jonathan Cameron wrote:
> On Mon, 7 May 2018 15:51:51 -0500
> Rob Herring <robh@kernel.org> wrote:
> 
>> On Wed, May 02, 2018 at 03:05:23PM +0200, Fabrice Gasnier wrote:
>>> Add support for DFSDM (Digital Filter For Sigma Delta Modulators)
>>> to STM32MP1. This variant is close to STM32H7 DFSDM, it implements
>>> 6 filter instances. Registers map is also increased.
>>>
>>> Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
>>> ---
>>>  .../bindings/iio/adc/st,stm32-dfsdm-adc.txt         |  7 +++++--
>>>  drivers/iio/adc/stm32-dfsdm-core.c                  | 21 +++++++++++++++++++++
>>>  2 files changed, 26 insertions(+), 2 deletions(-)  
>>
>> Reviewed-by: Rob Herring <robh@kernel.org>
> Applied.   Whilst doing this I note that I'm getting a few sparse
> warnings for this driver that would be nice to clean up...
> 
>   CHECK   drivers/iio/adc/stm32-dfsdm-adc.c
> drivers/iio/adc/stm32-dfsdm-adc.c:503:21: warning: expression using sizeof(void)
> drivers/iio/adc/stm32-dfsdm-adc.c:503:21: warning: expression using sizeof(void)
> 
> Which is mystifying at first glance... Something deep and dirty in the min macro
> but I can't see what..

Hi Jonathan,

I just sent a patch to clean bellow warning. But this is more obscure
regarding min macro...

Many thanks,
Fabrice

> 
> drivers/iio/adc/stm32-dfsdm-adc.c:680:5: warning: symbol 'stm32_dfsdm_get_buff_cb' was not declared. Should it be static?
> drivers/iio/adc/stm32-dfsdm-adc.c:703:5: warning: symbol 'stm32_dfsdm_release_buff_cb' was not declared. Should it be static?
> 
> Are rather more obvious
> 

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

* [PATCH] iio: adc: stm32-dfsdm: Add support for stm32mp1
@ 2018-05-15 15:23       ` Fabrice Gasnier
  0 siblings, 0 replies; 13+ messages in thread
From: Fabrice Gasnier @ 2018-05-15 15:23 UTC (permalink / raw)
  To: linux-arm-kernel

On 05/12/2018 11:33 AM, Jonathan Cameron wrote:
> On Mon, 7 May 2018 15:51:51 -0500
> Rob Herring <robh@kernel.org> wrote:
> 
>> On Wed, May 02, 2018 at 03:05:23PM +0200, Fabrice Gasnier wrote:
>>> Add support for DFSDM (Digital Filter For Sigma Delta Modulators)
>>> to STM32MP1. This variant is close to STM32H7 DFSDM, it implements
>>> 6 filter instances. Registers map is also increased.
>>>
>>> Signed-off-by: Fabrice Gasnier <fabrice.gasnier@st.com>
>>> ---
>>>  .../bindings/iio/adc/st,stm32-dfsdm-adc.txt         |  7 +++++--
>>>  drivers/iio/adc/stm32-dfsdm-core.c                  | 21 +++++++++++++++++++++
>>>  2 files changed, 26 insertions(+), 2 deletions(-)  
>>
>> Reviewed-by: Rob Herring <robh@kernel.org>
> Applied.   Whilst doing this I note that I'm getting a few sparse
> warnings for this driver that would be nice to clean up...
> 
>   CHECK   drivers/iio/adc/stm32-dfsdm-adc.c
> drivers/iio/adc/stm32-dfsdm-adc.c:503:21: warning: expression using sizeof(void)
> drivers/iio/adc/stm32-dfsdm-adc.c:503:21: warning: expression using sizeof(void)
> 
> Which is mystifying at first glance... Something deep and dirty in the min macro
> but I can't see what..

Hi Jonathan,

I just sent a patch to clean bellow warning. But this is more obscure
regarding min macro...

Many thanks,
Fabrice

> 
> drivers/iio/adc/stm32-dfsdm-adc.c:680:5: warning: symbol 'stm32_dfsdm_get_buff_cb' was not declared. Should it be static?
> drivers/iio/adc/stm32-dfsdm-adc.c:703:5: warning: symbol 'stm32_dfsdm_release_buff_cb' was not declared. Should it be static?
> 
> Are rather more obvious
> 

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

end of thread, other threads:[~2018-05-15 15:24 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-02 13:05 [PATCH] iio: adc: stm32-dfsdm: Add support for stm32mp1 Fabrice Gasnier
2018-05-02 13:05 ` Fabrice Gasnier
2018-05-02 13:05 ` Fabrice Gasnier
2018-05-06 17:56 ` Jonathan Cameron
2018-05-06 17:56   ` Jonathan Cameron
2018-05-06 17:56   ` Jonathan Cameron
2018-05-07 20:51 ` Rob Herring
2018-05-07 20:51   ` Rob Herring
2018-05-12  9:33   ` Jonathan Cameron
2018-05-12  9:33     ` Jonathan Cameron
2018-05-15 15:23     ` Fabrice Gasnier
2018-05-15 15:23       ` Fabrice Gasnier
2018-05-15 15:23       ` Fabrice Gasnier

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.