Re: [PATCH 5/7] iio: adc: stm32-dfsdm: misc style improvements and fixes

2018-04-23 Thread Fabrice Gasnier
On 02/24/2018 02:03 PM, Jonathan Cameron wrote: > On Fri, 23 Feb 2018 13:50:59 +0100 > Fabrice Gasnier wrote: > >> Misc fixes & style improvements: >> - checkpatch warns about line over 80 characters. >> - remove extra spaces and a blank line (e.g. checkpatch

[PATCH] ARM: dts: stm32: Add DAC support to stm32mp157c

2018-04-18 Thread Fabrice Gasnier
Add support for DAC (Digital to Analog Converter) to STM32MP157C. STM32MP157C DAC has two output channels. Signed-off-by: Fabrice Gasnier --- arch/arm/boot/dts/stm32mp157c.dtsi | 24 1 file changed, 24 insertions(+) diff --git a/arch/arm/boot/dts/stm32mp157c.dtsi b

[PATCH 2/3] iio: adc: stm32-adc: add support for STM32MP1

2018-04-18 Thread Fabrice Gasnier
Add support for STM32MP1 ADC. It's quite similar to STM32H7 ADC. Introduce new compatible to handle variants of this hardware such as vregready flag, trigger list, interrupts, clock rate. Signed-off-by: Fabrice Gasnier --- drivers/iio/adc/stm32-adc-core.c

[PATCH 1/3] dt-bindings: iio: stm32-adc: add support for STM32MP1.

2018-04-18 Thread Fabrice Gasnier
Document support for STM32MP1 ADC. It's quite similar to STM32H7 ADC. Introduce "st,stm32mp1-adc" compatible to handle variants of this hardware such as vregready flag, interrupts, clock rate. Signed-off-by: Fabrice Gasnier --- Documentation/devicetree/bindings/iio/adc/st,st

[PATCH 3/3] ARM: dts: stm32: Add ADC support to stm32mp157c

2018-04-18 Thread Fabrice Gasnier
stm32mp157c has an ADC block with two physical ADCs. Signed-off-by: Fabrice Gasnier --- arch/arm/boot/dts/stm32mp157c.dtsi | 32 1 file changed, 32 insertions(+) diff --git a/arch/arm/boot/dts/stm32mp157c.dtsi b/arch/arm/boot/dts/stm32mp157c.dtsi index bc3eddc

[PATCH 0/3] Add support for STM32MP1 ADC

2018-04-18 Thread Fabrice Gasnier
Add support for STM32MP1 Analog to Digital Converter variant. It's quite similar to STM32H7 ADC and re-use most of existing driver. Fabrice Gasnier (3): dt-bindings: iio: stm32-adc: add support for STM32MP1. iio: adc: stm32-adc: add support for STM32MP1 ARM: dts: stm32: Add ADC suppo

[PATCH] ARM: dts: stm32: Add vrefbuf support to stm32mp157c

2018-04-18 Thread Fabrice Gasnier
stm32mp157c has vrefbuf regulator that can provide analog reference voltage from 1500mV to 2500mV. Signed-off-by: Fabrice Gasnier --- arch/arm/boot/dts/stm32mp157c.dtsi | 9 + 1 file changed, 9 insertions(+) diff --git a/arch/arm/boot/dts/stm32mp157c.dtsi b/arch/arm/boot/dts

[PATCH] ARM: dts: stm32: Add LPtimer support to stm32mp157c

2018-04-18 Thread Fabrice Gasnier
Add LPtimer definitions, depending on features they provide: - lptimer1 & 2 can act as PWM, trigger and encoder/counter - lptimer3 can act as PWM and trigger - lptimer4 & 5 can act as PWM Signed-off-by: Fabrice Gasnier --- arch/arm/boot/dts/stm32mp157c.dt

[PATCH 3/4] ARM: dts: stm32: add PWM and triggers on stm32mp157c-ev1 board

2018-04-17 Thread Fabrice Gasnier
stm32mp157c evaluation board has TIM2_CH4, TIM8_CH4 and TIM12_CH1 available on GPIO expansion connector. Add PWM and associated triggers (for ADC/DAC) on these timers. Keep them disabled so these pins can be used as GPIOs by default. Signed-off-by: Fabrice Gasnier --- arch/arm/boot/dts

[PATCH 4/4] ARM: dts: stm32: enable timer trigger 6 on stm32mp157c-ed1

2018-04-17 Thread Fabrice Gasnier
Enable timer 6 on stm32mp157c-ed1 that can serve as trigger for ADC for instance. Signed-off-by: Fabrice Gasnier --- arch/arm/boot/dts/stm32mp157c-ed1.dts | 7 +++ 1 file changed, 7 insertions(+) diff --git a/arch/arm/boot/dts/stm32mp157c-ed1.dts b/arch/arm/boot/dts/stm32mp157c-ed1.dts

[PATCH 0/4] Add STM32 timers to stm32mp157c

2018-04-17 Thread Fabrice Gasnier
This series adds support for STM32 timers to stm32mp157c. These timers can act PWM, trigger and/or encoder. Populate stm32mp157c SOC and ed1/ev1 boards. Fabrice Gasnier (4): ARM: dts: stm32: add timers support to stm32mp157c ARM: dts: stm32: add PWM pins used on stm32mp157c-ev1 board ARM

[PATCH 2/4] ARM: dts: stm32: add PWM pins used on stm32mp157c-ev1 board

2018-04-17 Thread Fabrice Gasnier
stm32mp157c evaluation board has following PWM pins available on GPIO expansion connector: - TIM2_CH4 (PA3) - TIM8_CH4 (PI2) - TIM12_CH1 (PH6) Signed-off-by: Fabrice Gasnier --- arch/arm/boot/dts/stm32mp157-pinctrl.dtsi | 27 +++ 1 file changed, 27 insertions(+) diff

[PATCH 1/4] ARM: dts: stm32: add timers support to stm32mp157c

2018-04-17 Thread Fabrice Gasnier
Add PWM and trigger support to stm32mp157c. Signed-off-by: Fabrice Gasnier --- arch/arm/boot/dts/stm32mp157c.dtsi | 283 + 1 file changed, 283 insertions(+) diff --git a/arch/arm/boot/dts/stm32mp157c.dtsi b/arch/arm/boot/dts/stm32mp157c.dtsi index bc3eddc

[PATCH v5 1/6] dt-bindings: mfd: stm32-timers: add support for dmas

2018-04-17 Thread Fabrice Gasnier
-wide to avoid shortage on DMA request lines as there's significant amount of timer instances that can request up to 7 channels. Signed-off-by: Fabrice Gasnier Reviewed-by: Rob Herring Reviewed-by: Benjamin Gaignard --- .../devicetree/bindings/mfd/stm32-timers.txt

[PATCH v5 4/6] pwm: stm32: improve capture by tuning counter prescaler

2018-04-17 Thread Fabrice Gasnier
argin). - Do a 2nd capture, with scaled capture window. This increases accuracy, especially at high rates. Signed-off-by: Fabrice Gasnier Reviewed-by: Benjamin Gaignard Acked-by: Thierry Reding --- Changes in v2: - Adopt DMA read from MFD core. --- drivers/pwm/pwm-stm32.c

[PATCH v5 3/6] pwm: stm32: add capture support

2018-04-17 Thread Fabrice Gasnier
Signed-off-by: Fabrice Gasnier Reviewed-by: Benjamin Gaignard Acked-by: Thierry Reding --- Changes in v3: - update stm32_timers_dma_burst_read() call: don't pass ddata structure, use MFD parent device structure instead since MFD core update. Changes in v2: - DMA handling has been mo

[PATCH v5 2/6] mfd: stm32-timers: add support for dmas

2018-04-17 Thread Fabrice Gasnier
for instance (but not limited to). Signed-off-by: Fabrice Gasnier Reviewed-by: Benjamin Gaignard --- Changes in v5: - fix warning on dma_mapping_error() that doesn't return an error code. - move stm32_timers_dma struct to header file as discussed with Lee. This allows to remove alloc for

[PATCH v5 5/6] pwm: stm32: use input prescaler to improve period capture

2018-04-17 Thread Fabrice Gasnier
Using input prescaler, capture unit will trigger DMA once every configurable /2, /4 or /8 events (rising edge). This helps improve period (only) capture accuracy at high rates. Signed-off-by: Fabrice Gasnier Reviewed-by: Benjamin Gaignard Acked-by: Thierry Reding --- Changes in v2: - Adopt DMA

[PATCH v5 6/6] ARM: dts: stm32: Enable pwm3 input capture on stm32f429i-eval

2018-04-17 Thread Fabrice Gasnier
Enable pwm3 input capture on stm32f429i-eval, by using DMA. Signed-off-by: Fabrice Gasnier Reviewed-by: Benjamin Gaignard --- arch/arm/boot/dts/stm32429i-eval.dts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/boot/dts/stm32429i-eval.dts b/arch/arm/boot/dts/stm32429i-eval.dts

[PATCH v5 0/6] Add support for PWM input capture on STM32

2018-04-17 Thread Fabrice Gasnier
exported routine prototype now use generic device struct, more various comments (see patch 2 changelog). Resend v2: - Add collected Acks Changes in v2: - Abstract DMA handling from child driver: move it to MFD core - Rework pwm capture routines to adopt this change - Comment on optional dma support

Re: [PATCH v4 2/6] mfd: stm32-timers: add support for dmas

2018-04-17 Thread Fabrice Gasnier
On 04/17/2018 12:10 PM, Lee Jones wrote: > On Tue, 17 Apr 2018, Fabrice Gasnier wrote: > >> On 04/17/2018 09:12 AM, Lee Jones wrote: >>> On Mon, 16 Apr 2018, Fabrice Gasnier wrote: >>> >>>> STM32 Timers can support up to 7 DMA requests: >

Re: [PATCH v4 2/6] mfd: stm32-timers: add support for dmas

2018-04-17 Thread Fabrice Gasnier
On 04/17/2018 09:12 AM, Lee Jones wrote: > On Mon, 16 Apr 2018, Fabrice Gasnier wrote: > >> STM32 Timers can support up to 7 DMA requests: >> - 4 channels, update, compare and trigger. >> Optionally request part, or all DMAs from stm32-timers MFD core. >> >>

[PATCH v4 0/6] Add support for PWM input capture on STM32

2018-04-16 Thread Fabrice Gasnier
stract DMA handling from child driver: move it to MFD core - Rework pwm capture routines to adopt this change - Comment on optional dma support, beautify DMAs probe Fabrice Gasnier (6): dt-bindings: mfd: stm32-timers: add support for dmas mfd: stm32-timers: add support for dmas pwm: stm32: ad

[PATCH v4 3/6] pwm: stm32: add capture support

2018-04-16 Thread Fabrice Gasnier
Signed-off-by: Fabrice Gasnier Reviewed-by: Benjamin Gaignard Acked-by: Thierry Reding --- Changes in v3: - update stm32_timers_dma_burst_read() call: don't pass ddata structure, use MFD parent device structure instead since MFD core update. Changes in v2: - DMA handling has been mo

[PATCH v4 4/6] pwm: stm32: improve capture by tuning counter prescaler

2018-04-16 Thread Fabrice Gasnier
argin). - Do a 2nd capture, with scaled capture window. This increases accuracy, especially at high rates. Signed-off-by: Fabrice Gasnier Reviewed-by: Benjamin Gaignard Acked-by: Thierry Reding --- Changes in v2: - Adopt DMA read from MFD core. --- drivers/pwm/pwm-stm32.c

[PATCH v4 2/6] mfd: stm32-timers: add support for dmas

2018-04-16 Thread Fabrice Gasnier
for instance (but not limited to). Signed-off-by: Fabrice Gasnier Reviewed-by: Benjamin Gaignard --- Changes in v4: - Lee's comments: Add kerneldoc header, better format comments. Changes in v3: - Basically Lee's comments: - rather create a struct stm32_timers_dma, and place a reference

[PATCH v4 5/6] pwm: stm32: use input prescaler to improve period capture

2018-04-16 Thread Fabrice Gasnier
Using input prescaler, capture unit will trigger DMA once every configurable /2, /4 or /8 events (rising edge). This helps improve period (only) capture accuracy at high rates. Signed-off-by: Fabrice Gasnier Reviewed-by: Benjamin Gaignard Acked-by: Thierry Reding --- Changes in v2: - Adopt DMA

[PATCH v4 6/6] ARM: dts: stm32: Enable pwm3 input capture on stm32f429i-eval

2018-04-16 Thread Fabrice Gasnier
Enable pwm3 input capture on stm32f429i-eval, by using DMA. Signed-off-by: Fabrice Gasnier Reviewed-by: Benjamin Gaignard --- arch/arm/boot/dts/stm32429i-eval.dts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/boot/dts/stm32429i-eval.dts b/arch/arm/boot/dts/stm32429i-eval.dts

[PATCH v4 1/6] dt-bindings: mfd: stm32-timers: add support for dmas

2018-04-16 Thread Fabrice Gasnier
-wide to avoid shortage on DMA request lines as there's significant amount of timer instances that can request up to 7 channels. Signed-off-by: Fabrice Gasnier Reviewed-by: Rob Herring Reviewed-by: Benjamin Gaignard --- .../devicetree/bindings/mfd/stm32-timers.txt

Re: [PATCH v3 2/6] mfd: stm32-timers: add support for dmas

2018-04-16 Thread Fabrice Gasnier
On 04/16/2018 04:47 PM, Lee Jones wrote: > On Mon, 16 Apr 2018, Fabrice Gasnier wrote: > >> On 04/16/2018 02:22 PM, Lee Jones wrote: >>> On Fri, 30 Mar 2018, Fabrice Gasnier wrote: >>> >>>> STM32 Timers can support up to 7 DMA requests: >

Re: [PATCH v3 2/6] mfd: stm32-timers: add support for dmas

2018-04-16 Thread Fabrice Gasnier
On 04/16/2018 02:22 PM, Lee Jones wrote: > On Fri, 30 Mar 2018, Fabrice Gasnier wrote: > >> STM32 Timers can support up to 7 DMA requests: >> - 4 channels, update, compare and trigger. >> Optionally request part, or all DMAs from stm32-timers MFD core. >> >>

[PATCH v3 2/6] mfd: stm32-timers: add support for dmas

2018-03-30 Thread Fabrice Gasnier
for instance (but not limited to). Signed-off-by: Fabrice Gasnier Reviewed-by: Benjamin Gaignard --- Changes in v3: - Basically Lee's comments: - rather create a struct stm32_timers_dma, and place a reference to it in existing ddata (instead of adding priv struct). - rather use a struct d

[PATCH v3 4/6] pwm: stm32: improve capture by tuning counter prescaler

2018-03-30 Thread Fabrice Gasnier
argin). - Do a 2nd capture, with scaled capture window. This increases accuracy, especially at high rates. Signed-off-by: Fabrice Gasnier Reviewed-by: Benjamin Gaignard Acked-by: Thierry Reding --- Changes in v2: - Adopt DMA read from MFD core. --- drivers/pwm/pwm-stm32.c

[PATCH v3 3/6] pwm: stm32: add capture support

2018-03-30 Thread Fabrice Gasnier
Signed-off-by: Fabrice Gasnier Reviewed-by: Benjamin Gaignard Acked-by: Thierry Reding --- Changes in v3: - update stm32_timers_dma_burst_read() call: don't pass ddata structure, use MFD parent device structure instead since MFD core update. Changes in v2: - DMA handling has been mo

[PATCH v3 6/6] ARM: dts: stm32: Enable pwm3 input capture on stm32f429i-eval

2018-03-30 Thread Fabrice Gasnier
Enable pwm3 input capture on stm32f429i-eval, by using DMA. Signed-off-by: Fabrice Gasnier Reviewed-by: Benjamin Gaignard --- arch/arm/boot/dts/stm32429i-eval.dts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/boot/dts/stm32429i-eval.dts b/arch/arm/boot/dts/stm32429i-eval.dts

[PATCH v3 5/6] pwm: stm32: use input prescaler to improve period capture

2018-03-30 Thread Fabrice Gasnier
Using input prescaler, capture unit will trigger DMA once every configurable /2, /4 or /8 events (rising edge). This helps improve period (only) capture accuracy at high rates. Signed-off-by: Fabrice Gasnier Reviewed-by: Benjamin Gaignard Acked-by: Thierry Reding --- Changes in v2: - Adopt DMA

[PATCH v3 0/6] Add support for PWM input capture on STM32

2018-03-30 Thread Fabrice Gasnier
port, beautify DMAs probe Fabrice Gasnier (6): dt-bindings: mfd: stm32-timers: add support for dmas mfd: stm32-timers: add support for dmas pwm: stm32: add capture support pwm: stm32: improve capture by tuning counter prescaler pwm: stm32: use input prescaler to improve period capture ARM

[PATCH v3 1/6] dt-bindings: mfd: stm32-timers: add support for dmas

2018-03-30 Thread Fabrice Gasnier
-wide to avoid shortage on DMA request lines as there's significant amount of timer instances that can request up to 7 channels. Signed-off-by: Fabrice Gasnier Reviewed-by: Rob Herring Reviewed-by: Benjamin Gaignard --- .../devicetree/bindings/mfd/stm32-timers.txt

Re: [RESEND PATCH v2 4/8] mfd: stm32-timers: add support for dmas

2018-03-29 Thread Fabrice Gasnier
On 03/29/2018 04:31 PM, Lee Jones wrote: > On Thu, 29 Mar 2018, Fabrice Gasnier wrote: > >> On 03/29/2018 02:59 PM, Lee Jones wrote: >>> On Wed, 28 Mar 2018, Fabrice Gasnier wrote: >>> >>>> On 03/28/2018 05:22 PM, Lee Jones wrote: >&g

Re: [RESEND PATCH v2 4/8] mfd: stm32-timers: add support for dmas

2018-03-29 Thread Fabrice Gasnier
On 03/29/2018 02:59 PM, Lee Jones wrote: > On Wed, 28 Mar 2018, Fabrice Gasnier wrote: > >> On 03/28/2018 05:22 PM, Lee Jones wrote: >>> On Wed, 14 Feb 2018, Fabrice Gasnier wrote: >>> >>>> STM32 Timers can support up to 7 DMA requests: >

Re: [RESEND PATCH v2 4/8] mfd: stm32-timers: add support for dmas

2018-03-28 Thread Fabrice Gasnier
On 03/28/2018 05:22 PM, Lee Jones wrote: > On Wed, 14 Feb 2018, Fabrice Gasnier wrote: > >> STM32 Timers can support up to 7 DMA requests: >> - 4 channels, update, compare and trigger. >> Optionally request part, or all DMAs from stm32-timers MFD core. >> >>

Re: [RESEND PATCH v2 0/8] Add support for PWM input capture on STM32

2018-03-23 Thread Fabrice Gasnier
On 02/14/2018 11:04 AM, Fabrice Gasnier wrote: > This series adds support for capture to stm32-pwm driver. > Capture is based on DMAs. > - First two patches are precursor patches > - Subsequent two patches add support for requesting DMAs to MFD core > - Next three patches add supp

Re: [RESEND PATCH 2/3] pwm: stm32: LPTimer: use 3 cells xlate

2018-03-23 Thread Fabrice Gasnier
On 02/23/2018 02:36 PM, Fabrice Gasnier wrote: > From: Gerald Baeza > > STM32 Low-Power Timer supports generic 3 cells pwm to encode > PWM number, period and polarity. > > Signed-off-by: Gerald Baeza > Signed-off-by: Fabrice Gasnier > --- > drivers/pwm/pwm-stm32-lp

[PATCH 2/2] iio: adc: stm32-dfsdm: fix sample rate for div2 spi clock

2018-03-13 Thread Fabrice Gasnier
When channel clk source is set to "CLKOUT_F" or "CLKOUT_R" (e.g. div2), sample rate is currently set to half the requested value. Fixes: eca949800d2d ("IIO: ADC: add stm32 DFSDM support for PDM microphone") Signed-off-by: Fabrice Gasnier --- drivers/

[PATCH 0/2] iio: stm32-dfsdm-adc: fix filter & rate setting

2018-03-13 Thread Fabrice Gasnier
This series brings fixes to STM32 DFSDM ADC driver. Fabrice Gasnier (2): iio: adc: stm32-dfsdm: fix successive oversampling settings iio: adc: stm32-dfsdm: fix sample rate for div2 spi clock drivers/iio/adc/stm32-dfsdm-adc.c | 17 ++--- 1 file changed, 14 insertions(+), 3

[PATCH 1/2] iio: adc: stm32-dfsdm: fix successive oversampling settings

2018-03-13 Thread Fabrice Gasnier
16kHz (again): sample rate will remain 8kHz without error Fixes: e2e6771c6462 ("IIO: ADC: add STM32 DFSDM sigma delta ADC support") Signed-off-by: Fabrice Gasnier --- drivers/iio/adc/stm32-dfsdm-adc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/iio/adc/

Re: [PATCH 5/7] iio: adc: stm32-dfsdm: misc style improvements and fixes

2018-02-27 Thread Fabrice Gasnier
On 02/24/2018 02:03 PM, Jonathan Cameron wrote: > On Fri, 23 Feb 2018 13:50:59 +0100 > Fabrice Gasnier wrote: > >> Misc fixes & style improvements: >> - checkpatch warns about line over 80 characters. >> - remove extra spaces and a blank line (e.g. checkpatch

[RESEND PATCH 2/3] pwm: stm32: LPTimer: use 3 cells xlate

2018-02-23 Thread Fabrice Gasnier
From: Gerald Baeza STM32 Low-Power Timer supports generic 3 cells pwm to encode PWM number, period and polarity. Signed-off-by: Gerald Baeza Signed-off-by: Fabrice Gasnier --- drivers/pwm/pwm-stm32-lp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/pwm/pwm-stm32-lp.c b

[RESEND PATCH 0/3] Add pwm-cells on STM32 LPTimer

2018-02-23 Thread Fabrice Gasnier
Add missing generic #pwm-cells on STM32 LPTimer to allow initialization of channel, period and polarity. Fabrice Gasnier (1): ARM: dts: stm32: update pwm-cells for LPTimer on stm32h743 Gerald Baeza (2): dt-bindings: pwm-stm32-lp: add #pwm-cells pwm: stm32: LPTimer: use 3 cells xlate

[RESEND PATCH 3/3] ARM: dts: stm32: update pwm-cells for LPTimer on stm32h743

2018-02-23 Thread Fabrice Gasnier
LPTimer pwm cells should be updated to 3, to allow initialization of channel, period and polarity. Signed-off-by: Fabrice Gasnier --- arch/arm/boot/dts/stm32h743.dtsi | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/arm/boot/dts/stm32h743.dtsi b/arch/arm/boot/dts/stm32h743.dtsi

[RESEND PATCH 1/3] dt-bindings: pwm-stm32-lp: add #pwm-cells

2018-02-23 Thread Fabrice Gasnier
From: Gerald Baeza STM32 Low-Power Timer supports generic 3 cells pwm to encode PWM number, period and polarity. Signed-off-by: Gerald Baeza Signed-off-by: Fabrice Gasnier Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/pwm/pwm-stm32-lp.txt | 3 +++ 1 file changed, 3

[PATCH 5/7] iio: adc: stm32-dfsdm: misc style improvements and fixes

2018-02-23 Thread Fabrice Gasnier
Misc fixes & style improvements: - checkpatch warns about line over 80 characters. - remove extra spaces and a blank line (e.g. checkpatch --strict) - remove bad error message always printed in probe routine. Signed-off-by: Fabrice Gasnier --- drivers/iio/adc/stm32-dfsdm-adc.c | 9

[PATCH 1/7] iio: adc: stm32-dfsdm: fix compatible data use

2018-02-23 Thread Fabrice Gasnier
Fix use of compatible data: stm32h7 regmap configuration is statically used. Rather use regmap_cfg from compatible data. Fixes: bed73904e76f ("IIO: ADC: add stm32 DFSDM core support") Signed-off-by: Fabrice Gasnier --- drivers/iio/adc/stm32-dfsdm-core.c | 2 +- 1 file changed, 1

[PATCH 6/7] iio: adc: stm32-dfsdm: add check on max filter id

2018-02-23 Thread Fabrice Gasnier
reg property should be checked against number of available filters. BTW, dfsdm->num_fls wasn't used. But it can be used for this purpose. This prevents using data out of allocated dfsdm->fl_list array. Signed-off-by: Fabrice Gasnier --- drivers/iio/adc/stm32-dfsdm-adc.c | 4 ++-- 1 f

[PATCH 3/7] iio: adc: stm32-dfsdm: fix clock source selection

2018-02-23 Thread Fabrice Gasnier
Add missing clock source selection. In case "audio" clock is provided, it's unused currently: "dfsdm" clock is wrongly used by default. Fixes: bed73904e76f ("IIO: ADC: add stm32 DFSDM core support") Signed-off-by: Fabrice Gasnier --- drivers/iio/adc/stm32-d

[PATCH 4/7] iio: adc: stm32-dfsdm: fix multiple channel initialization

2018-02-23 Thread Fabrice Gasnier
work properly (e.g. unique 'ch_id' is used). Converting any other channel result in conversion timeout. Fix it by getting rid of 'ch_id', use chan->channel instead. Signed-off-by: Fabrice Gasnier --- drivers/iio/adc/stm32-dfsdm-adc.c | 39 +---

[PATCH 2/7] iio: adc: stm32-dfsdm: fix call to stop channel

2018-02-23 Thread Fabrice Gasnier
stm32_dfsdm_stop_channel must be called with channel id, not filter id. Fixes: e2e6771c6462 ("IIO: ADC: add STM32 DFSDM sigma delta ADC support") Signed-off-by: Fabrice Gasnier --- drivers/iio/adc/stm32-dfsdm-adc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/d

[PATCH 7/7] iio: adc: stm32-dfsdm: add check on spi-max-frequency

2018-02-23 Thread Fabrice Gasnier
spi-max-frequency is requested for SPI master mode (only), to tune output clock. It may happen requested frequency isn't reachable. Add explicit check, so probe fails with error in this case. Otherwise, output clock may simply be silently turned off (conversions fail). Signed-off-by: Fa

[PATCH 0/7] iio: adc: stm32-dfsdm: misc fixes and improvements

2018-02-23 Thread Fabrice Gasnier
This series brings some fixes and improvements to STM32 DFSDM driver. Fabrice Gasnier (7): iio: adc: stm32-dfsdm: fix compatible data use iio: adc: stm32-dfsdm: fix call to stop channel iio: adc: stm32-dfsdm: fix clock source selection iio: adc: stm32-dfsdm: fix multiple channel

[PATCH] dt-bindings: iio: adc: stm32-dfsdm: fix types, add missing pinctrl

2018-02-23 Thread Fabrice Gasnier
uot;. BTW, make the description complete by describing both rising/falling edges as described in reference manuals. Fixes: 6c82f947fc97 ("IIO: add DT bindings for stm32 DFSDM filter") Signed-off-by: Fabrice Gasnier --- Documentation/devicetree/bindings/iio/adc/st,stm32-dfsdm-adc.tx

[PATCH] dt-bindings: iio: adc: sd-modulator: fix io-channel-cells

2018-02-23 Thread Fabrice Gasnier
c modulator") Signed-off-by: Fabrice Gasnier --- Documentation/devicetree/bindings/iio/adc/sigma-delta-modulator.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/iio/adc/sigma-delta-modulator.txt b/Documentation/devicetree/bi

[RESEND PATCH v2 5/8] pwm: stm32: add capture support

2018-02-14 Thread Fabrice Gasnier
Signed-off-by: Fabrice Gasnier Reviewed-by: Benjamin Gaignard --- Changes in v2: - DMA handling has been moved to MFD core. Rework capture routines to use it. --- drivers/pwm/pwm-stm32.c | 176 +++ include/linux/mfd/stm32-timers.h | 11 +++ 2 fil

[RESEND PATCH v2 8/8] ARM: dts: stm32: Enable pwm3 input capture on stm32f429i-eval

2018-02-14 Thread Fabrice Gasnier
Enable pwm3 input capture on stm32f429i-eval, by using DMA. Signed-off-by: Fabrice Gasnier Reviewed-by: Benjamin Gaignard --- arch/arm/boot/dts/stm32429i-eval.dts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/boot/dts/stm32429i-eval.dts b/arch/arm/boot/dts/stm32429i-eval.dts

[RESEND PATCH v2 7/8] pwm: stm32: use input prescaler to improve period capture

2018-02-14 Thread Fabrice Gasnier
Using input prescaler, capture unit will trigger DMA once every configurable /2, /4 or /8 events (rising edge). This helps improve period (only) capture accuracy at high rates. Signed-off-by: Fabrice Gasnier Reviewed-by: Benjamin Gaignard --- Changes in v2: - Adopt DMA read from MFD core

[RESEND PATCH v2 0/8] Add support for PWM input capture on STM32

2018-02-14 Thread Fabrice Gasnier
-eval board. --- Resend v2: - Add collected Acks Changes in v2: - Abstract DMA handling from child driver: move it to MFD core - Rework pwm capture routines to adopt this change - Comment on optional dma support, beautify DMAs probe Fabrice Gasnier (8): pwm: stm32: fix, remove unused struct device

[RESEND PATCH v2 2/8] pwm: stm32: protect common prescaler for all channels

2018-02-14 Thread Fabrice Gasnier
There may be a race, when configuring two pwm channels, with different prescaler values, when there's no active channel yet. Add mutex lock to avoid concurrent access on pwm apply state. This is also precursor patch for pwm capture support. Signed-off-by: Fabrice Gasnier Reviewed-by: Ben

[RESEND PATCH v2 6/8] pwm: stm32: improve capture by tuning counter prescaler

2018-02-14 Thread Fabrice Gasnier
argin). - Do a 2nd capture, with scaled capture window. This increases accuracy, especially at high rates. Signed-off-by: Fabrice Gasnier Reviewed-by: Benjamin Gaignard --- Changes in v2: - Adopt DMA read from MFD core. --- drivers/pwm/pwm-stm32.c | 24 +++- 1 file change

[RESEND PATCH v2 1/8] pwm: stm32: fix, remove unused struct device

2018-02-14 Thread Fabrice Gasnier
dev is never assigned nor used. remove it. Fixes: 7edf7369205b ("pwm: Add driver for STM32 plaftorm") Signed-off-by: Fabrice Gasnier Reviewed-by: Benjamin Gaignard --- drivers/pwm/pwm-stm32.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/pwm/pwm-stm32.c b/drivers/pwm/p

[RESEND PATCH v2 3/8] dt-bindings: mfd: stm32-timers: add support for dmas

2018-02-14 Thread Fabrice Gasnier
-wide to avoid shortage on DMA request lines as there's significant amount of timer instances that can request up to 7 channels. Signed-off-by: Fabrice Gasnier Reviewed-by: Rob Herring Reviewed-by: Benjamin Gaignard --- .../devicetree/bindings/mfd/stm32-timers.txt

[RESEND PATCH v2 4/8] mfd: stm32-timers: add support for dmas

2018-02-14 Thread Fabrice Gasnier
for instance (but not limited to). Signed-off-by: Fabrice Gasnier Reviewed-by: Benjamin Gaignard --- Changes in v2: - Abstract DMA handling from child driver: move it to MFD core - Add comments on optional dma support --- drivers/mfd/stm32-timers.c | 215

Re: [PATCH v2 0/8] Add support for PWM input capture on STM32

2018-02-14 Thread Fabrice Gasnier
On 01/26/2018 04:11 PM, Fabrice Gasnier wrote: > This series adds support for capture to stm32-pwm driver. > Capture is based on DMAs. > - First two patches are precursor patches > - Subsequent two patches add support for requesting DMAs to MFD core > - Next three patches add supp

[PATCH] regulator: stm32-vrefbuf: fix check on ready flag

2018-02-08 Thread Fabrice Gasnier
stm32_vrefbuf_enable() wrongly checks VRR bit: 0 stands for not ready, 1 for ready. It currently checks the opposite. This makes enable routine to exit immediately without waiting for ready flag. Fixes: 0cdbf481e927 ("regulator: Add support for stm32-vrefbuf") Signed-off-by: Fabri

[PATCH 2/3] pwm: stm32: LPTimer: use 3 cells xlate

2018-02-01 Thread Fabrice Gasnier
From: Gerald Baeza STM32 Low-Power Timer supports generic 3 cells pwm to encode PWM number, period and polarity. Signed-off-by: Gerald Baeza Signed-off-by: Fabrice Gasnier --- drivers/pwm/pwm-stm32-lp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/pwm/pwm-stm32-lp.c b

[PATCH 0/3] Add pwm-cells on STM32 LPTimer

2018-02-01 Thread Fabrice Gasnier
Add missing generic #pwm-cells on STM32 LPTimer to allow initialization of channel, period and polarity. Fabrice Gasnier (1): ARM: dts: stm32: update pwm-cells for LPTimer on stm32h743 Gerald Baeza (2): dt-bindings: pwm-stm32-lp: add #pwm-cells pwm: stm32: LPTimer: use 3 cells xlate

[PATCH 1/3] dt-bindings: pwm-stm32-lp: add #pwm-cells

2018-02-01 Thread Fabrice Gasnier
From: Gerald Baeza STM32 Low-Power Timer supports generic 3 cells pwm to encode PWM number, period and polarity. Signed-off-by: Gerald Baeza Signed-off-by: Fabrice Gasnier --- Documentation/devicetree/bindings/pwm/pwm-stm32-lp.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a

[PATCH 3/3] ARM: dts: stm32: update pwm-cells for LPTimer on stm32h743

2018-02-01 Thread Fabrice Gasnier
LPTimer pwm cells should be updated to 3, to allow initialization of channel, period and polarity. Signed-off-by: Fabrice Gasnier --- arch/arm/boot/dts/stm32h743.dtsi | 5 + 1 file changed, 5 insertions(+) diff --git a/arch/arm/boot/dts/stm32h743.dtsi b/arch/arm/boot/dts/stm32h743.dtsi

[PATCH v2 0/8] Add support for PWM input capture on STM32

2018-01-26 Thread Fabrice Gasnier
-eval board. --- Changes in v2: - Abstract DMA handling from child driver: move it to MFD core - Rework pwm capture routines to adopt this change - Comment on optional dma support, beautify DMAs probe Fabrice Gasnier (8): pwm: stm32: fix, remove unused struct device pwm: stm32: protect common

[PATCH v2 7/8] pwm: stm32: use input prescaler to improve period capture

2018-01-26 Thread Fabrice Gasnier
Using input prescaler, capture unit will trigger DMA once every configurable /2, /4 or /8 events (rising edge). This helps improve period (only) capture accuracy at high rates. Signed-off-by: Fabrice Gasnier --- Changes in v2: - Adopt DMA read from MFD core. --- drivers/pwm/pwm-stm32.c

[PATCH v2 3/8] dt-bindings: mfd: stm32-timers: add support for dmas

2018-01-26 Thread Fabrice Gasnier
-wide to avoid shortage on DMA request lines as there's significant amount of timer instances that can request up to 7 channels. Signed-off-by: Fabrice Gasnier --- .../devicetree/bindings/mfd/stm32-timers.txt | 20 1 file changed, 20 insertions(+) diff --

[PATCH v2 8/8] ARM: dts: stm32: Enable pwm3 input capture on stm32f429i-eval

2018-01-26 Thread Fabrice Gasnier
Enable pwm3 input capture on stm32f429i-eval, by using DMA. Signed-off-by: Fabrice Gasnier --- arch/arm/boot/dts/stm32429i-eval.dts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/boot/dts/stm32429i-eval.dts b/arch/arm/boot/dts/stm32429i-eval.dts index 293ecb9..d5498dd 100644

[PATCH v2 1/8] pwm: stm32: fix, remove unused struct device

2018-01-26 Thread Fabrice Gasnier
dev is never assigned nor used. remove it. Fixes: 7edf7369205b ("pwm: Add driver for STM32 plaftorm") Signed-off-by: Fabrice Gasnier --- drivers/pwm/pwm-stm32.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/pwm/pwm-stm32.c b/drivers/pwm/pwm-stm32.c index 6139512..5952

[PATCH v2 4/8] mfd: stm32-timers: add support for dmas

2018-01-26 Thread Fabrice Gasnier
for instance (but not limited to). Signed-off-by: Fabrice Gasnier --- Changes in v2: - Abstract DMA handling from child driver: move it to MFD core - Add comments on optional dma support --- drivers/mfd/stm32-timers.c | 215 ++- include/linux/mfd/stm32

[PATCH v2 5/8] pwm: stm32: add capture support

2018-01-26 Thread Fabrice Gasnier
Signed-off-by: Fabrice Gasnier --- Changes in v2: - DMA handling has been moved to MFD core. Rework capture routines to use it. --- drivers/pwm/pwm-stm32.c | 176 +++ include/linux/mfd/stm32-timers.h | 11 +++ 2 files changed, 187 insertions(+) di

[PATCH v2 6/8] pwm: stm32: improve capture by tuning counter prescaler

2018-01-26 Thread Fabrice Gasnier
argin). - Do a 2nd capture, with scaled capture window. This increases accuracy, especially at high rates. Signed-off-by: Fabrice Gasnier --- Changes in v2: - Adopt DMA read from MFD core. --- drivers/pwm/pwm-stm32.c | 24 +++- 1 file changed, 23 insertions(+), 1 deletion(-)

[PATCH v2 2/8] pwm: stm32: protect common prescaler for all channels

2018-01-26 Thread Fabrice Gasnier
There may be a race, when configuring two pwm channels, with different prescaler values, when there's no active channel yet. Add mutex lock to avoid concurrent access on pwm apply state. This is also precursor patch for pwm capture support. Signed-off-by: Fabrice Gasnier --- drivers/pw

Re: [PATCH 4/8] mfd: stm32-timers: add support for dmas

2018-01-24 Thread Fabrice Gasnier
On 01/24/2018 03:56 PM, Lee Jones wrote: > On Wed, 24 Jan 2018, Fabrice Gasnier wrote: >> On 01/23/2018 05:41 PM, Lee Jones wrote: >>> On Tue, 23 Jan 2018, Fabrice Gasnier wrote: >>>> On 01/23/2018 04:30 PM, Lee Jones wrote: >>>>> On Tue, 23 Jan 2018,

Re: [PATCH 4/8] mfd: stm32-timers: add support for dmas

2018-01-24 Thread Fabrice Gasnier
On 01/23/2018 05:41 PM, Lee Jones wrote: > On Tue, 23 Jan 2018, Fabrice Gasnier wrote: >> On 01/23/2018 04:30 PM, Lee Jones wrote: >>> On Tue, 23 Jan 2018, Fabrice Gasnier wrote: >>> >>>> On 01/23/2018 02:32 PM, Lee Jones wrote: >>>>> On Tue,

[PATCH] iio: adc: stm32: fix stm32h7_adc_enable error handling

2018-01-23 Thread Fabrice Gasnier
support for STM32H7") Signed-off-by: Fabrice Gasnier --- drivers/iio/adc/stm32-adc.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/iio/adc/stm32-adc.c b/drivers/iio/adc/stm32-adc.c index ca3b865..8177a92 100644 --- a/drivers/iio/adc/stm32-adc.c +++ b/drivers/iio/

Re: [PATCH 4/8] mfd: stm32-timers: add support for dmas

2018-01-23 Thread Fabrice Gasnier
On 01/23/2018 04:30 PM, Lee Jones wrote: > On Tue, 23 Jan 2018, Fabrice Gasnier wrote: > >> On 01/23/2018 02:32 PM, Lee Jones wrote: >>> On Tue, 16 Jan 2018, Fabrice Gasnier wrote: >>> >>>> STM32 Timers can support up to 7 dma requests: &g

Re: [PATCH 4/8] mfd: stm32-timers: add support for dmas

2018-01-23 Thread Fabrice Gasnier
On 01/23/2018 02:32 PM, Lee Jones wrote: > On Tue, 16 Jan 2018, Fabrice Gasnier wrote: > >> STM32 Timers can support up to 7 dma requests: >> 4 channels, update, compare and trigger. >> Optionally request part, or all dmas from stm32-timers MFD core. >> Also,

[PATCH 2/8] pwm: stm32: protect common prescaler for all channels

2018-01-16 Thread Fabrice Gasnier
There may be a race, when configuring two pwm channels, with different prescaler values, when there's no active channel yet. Add mutex lock to avoid concurrent access on pwm apply state. This is also precursor patch for pwm capture support. Signed-off-by: Fabrice Gasnier --- drivers/pw

[PATCH 8/8] ARM: dts: stm32: Enable pwm3 input capture on stm32f429i-eval

2018-01-16 Thread Fabrice Gasnier
Enable pwm3 input capture on stm32f429i-eval, by using DMA. Signed-off-by: Fabrice Gasnier --- arch/arm/boot/dts/stm32429i-eval.dts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/boot/dts/stm32429i-eval.dts b/arch/arm/boot/dts/stm32429i-eval.dts index 293ecb9..d5498dd 100644

[PATCH 7/8] pwm: stm32: use input prescaler to improve period capture

2018-01-16 Thread Fabrice Gasnier
Using input prescaler, capture unit will trigger DMA once every configurable /2, /4 or /8 events (rising edge). This can help improve period (only) capture accuracy. Signed-off-by: Fabrice Gasnier --- drivers/pwm/pwm-stm32.c | 67 ++-- include/linux

[PATCH 4/8] mfd: stm32-timers: add support for dmas

2018-01-16 Thread Fabrice Gasnier
STM32 Timers can support up to 7 dma requests: 4 channels, update, compare and trigger. Optionally request part, or all dmas from stm32-timers MFD core. Also, keep reference of device's bus address to allow child drivers to transfer data from/to device by using dma. Signed-off-by: Fabrice Ga

[PATCH 0/8] Add support for PWM input capture on STM32

2018-01-16 Thread Fabrice Gasnier
-eval board. Fabrice Gasnier (8): pwm: stm32: fix, remove unused struct device pwm: stm32: protect common prescaler for all channels dt-bindings: mfd: stm32-timers: add support for dmas mfd: stm32-timers: add support for dmas pwm: stm32: add capture support pwm: stm32: improve capture by

[PATCH 5/8] pwm: stm32: add capture support

2018-01-16 Thread Fabrice Gasnier
Signed-off-by: Fabrice Gasnier --- drivers/pwm/pwm-stm32.c | 301 ++- include/linux/mfd/stm32-timers.h | 16 +++ 2 files changed, 314 insertions(+), 3 deletions(-) diff --git a/drivers/pwm/pwm-stm32.c b/drivers/pwm/pwm-stm32.c index 3ac55df..b9c7e8

[PATCH 6/8] pwm: stm32: improve capture by tuning counter prescaler

2018-01-16 Thread Fabrice Gasnier
argin). - Do a 2nd capture, with scaled capture window. This increases accuracy, especially at high rates. Signed-off-by: Fabrice Gasnier --- drivers/pwm/pwm-stm32.c | 26 +- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/drivers/pwm/pwm-stm32.c b/drivers/pw

[PATCH 3/8] dt-bindings: mfd: stm32-timers: add support for dmas

2018-01-16 Thread Fabrice Gasnier
-wide to avoid shortage on DMA request lines as there's significant amount of timer instances that can request up to 7 channels. Signed-off-by: Fabrice Gasnier --- .../devicetree/bindings/mfd/stm32-timers.txt | 20 1 file changed, 20 insertions(+) diff --

[PATCH 1/8] pwm: stm32: fix, remove unused struct device

2018-01-16 Thread Fabrice Gasnier
dev is never assigned nor used. remove it. Fixes: 7edf7369205b ("pwm: Add driver for STM32 plaftorm") Signed-off-by: Fabrice Gasnier --- drivers/pwm/pwm-stm32.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/pwm/pwm-stm32.c b/drivers/pwm/pwm-stm32.c index 6139512..5952

[PATCH] iio: adc: stm32: fix scan of multiple channels with DMA

2018-01-05 Thread Fabrice Gasnier
Fix buffer period size, by taking scan channels number into account. Fixes: 2763ea0585c9 ("iio: adc: stm32: add optional dma support") Signed-off-by: Fabrice Gasnier --- drivers/iio/adc/stm32-adc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/iio/adc/stm32

<    1   2   3   4   5   6   7   >