aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pwm/pwm-stm32.c
Commit message (Collapse)AuthorAgeFilesLines
...
* pwm: stm32: Add capture supportFabrice Gasnier2018-05-161-0/+176
| | | | | | | | | | | | | | | | | | | Add support for PMW input mode on pwm-stm32. STM32 timers support period and duty cycle capture as long as they have at least two PWM channels. One capture channel is used for period (rising-edge), one for duty-cycle (falling-edge). When there's only one channel available, only period can be captured. Duty-cycle is simply zero'ed in such a case. Capture requires exclusive access (e.g. no pwm output running at the same time, to protect common prescaler). Timer DMA burst mode (from MFD core) is being used, to take two snapshots of capture registers (upon each period rising edge). Signed-off-by: Fabrice Gasnier <[email protected]> Reviewed-by: Benjamin Gaignard <[email protected]> Acked-by: Thierry Reding <[email protected]> Signed-off-by: Lee Jones <[email protected]>
* pwm: stm32: Protect common prescaler for all channelsFabrice Gasnier2018-03-271-1/+17
| | | | | | | | | | | 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 <[email protected]> Reviewed-by: Benjamin Gaignard <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
* pwm: stm32: Remove unused struct deviceFabrice Gasnier2018-03-271-1/+0
| | | | | | | | | dev is never assigned or used. Remove it. Fixes: 7edf7369205b ("pwm: Add driver for STM32 plaftorm") Signed-off-by: Fabrice Gasnier <[email protected]> Reviewed-by: Benjamin Gaignard <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
* pwm: stm32: Adopt SPDX identifierBenjamin Gaignard2018-03-271-2/+1
| | | | | | | | | Add SPDX identifier to make it easier to determine the license of the file. Signed-off-by: Benjamin Gaignard <[email protected]> Acked-by: Philippe Ombredanne <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
* pwm: Add driver for STM32 plaftormBenjamin Gaignard2017-01-251-0/+397
This driver adds support for PWM driver on STM32 platform. The SoC have multiple instances of the hardware IP and each of them could have small differences: number of channels, complementary output, auto reload register size... version 9: - fix commit message header - remove one space MODULE_ALIAS version 8: - fix comments done by Thierry on version 7 version 6: - change st,breakinput parameter to make it usuable for stm32f7 too. version 4: - detect at probe time hardware capabilities - fix comments done on v2 and v3 - use PWM atomic ops version 2: - only keep one comptatible - use DT parameters to discover hardware block configuration Signed-off-by: Benjamin Gaignard <[email protected]> Acked-by: Thierry Reding <[email protected]> Signed-off-by: Lee Jones <[email protected]>