Skip to content

Commit

Permalink
Merge tag 'ib-mfd-iio-pwm-4.11' into test
Browse files Browse the repository at this point in the history
Immutable branch between MFD, IIO and PWM due for the v4.11 merge window

Pulled into IIO to allow follow up series of triggered capture for the
STM32 ADCs.
  • Loading branch information
jic23 committed Jan 28, 2017
2 parents 1dc2af8 + 93fbe91 commit 6db0f7c
Show file tree
Hide file tree
Showing 15 changed files with 1,118 additions and 0 deletions.
29 changes: 29 additions & 0 deletions Documentation/ABI/testing/sysfs-bus-iio-timer-stm32
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
What: /sys/bus/iio/devices/triggerX/master_mode_available
KernelVersion: 4.11
Contact: [email protected]
Description:
Reading returns the list possible master modes which are:
- "reset" : The UG bit from the TIMx_EGR register is used as trigger output (TRGO).
- "enable" : The Counter Enable signal CNT_EN is used as trigger output.
- "update" : The update event is selected as trigger output.
For instance a master timer can then be used as a prescaler for a slave timer.
- "compare_pulse" : The trigger output send a positive pulse when the CC1IF flag is to be set.
- "OC1REF" : OC1REF signal is used as trigger output.
- "OC2REF" : OC2REF signal is used as trigger output.
- "OC3REF" : OC3REF signal is used as trigger output.
- "OC4REF" : OC4REF signal is used as trigger output.

What: /sys/bus/iio/devices/triggerX/master_mode
KernelVersion: 4.11
Contact: [email protected]
Description:
Reading returns the current master modes.
Writing set the master mode

What: /sys/bus/iio/devices/triggerX/sampling_frequency
KernelVersion: 4.11
Contact: [email protected]
Description:
Reading returns the current sampling frequency.
Writing an value different of 0 set and start sampling.
Writing 0 stop sampling.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
STMicroelectronics STM32 Timers IIO timer bindings

Must be a sub-node of an STM32 Timers device tree node.
See ../mfd/stm32-timers.txt for details about the parent node.

Required parameters:
- compatible: Must be "st,stm32-timer-trigger".
- reg: Identify trigger hardware block.

Example:
timers@40010000 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "st,stm32-timers";
reg = <0x40010000 0x400>;
clocks = <&rcc 0 160>;
clock-names = "clk_int";

timer@0 {
compatible = "st,stm32-timer-trigger";
reg = <0>;
};
};
46 changes: 46 additions & 0 deletions Documentation/devicetree/bindings/mfd/stm32-timers.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
STM32 Timers driver bindings

This IP provides 3 types of timer along with PWM functionality:
- advanced-control timers consist of a 16-bit auto-reload counter driven by a programmable
prescaler, break input feature, PWM outputs and complementary PWM ouputs channels.
- general-purpose timers consist of a 16-bit or 32-bit auto-reload counter driven by a
programmable prescaler and PWM outputs.
- basic timers consist of a 16-bit auto-reload counter driven by a programmable prescaler.

Required parameters:
- compatible: must be "st,stm32-timers"

- reg: Physical base address and length of the controller's
registers.
- clock-names: Set to "int".
- clocks: Phandle to the clock used by the timer module.
For Clk properties, please refer to ../clock/clock-bindings.txt

Optional parameters:
- resets: Phandle to the parent reset controller.
See ../reset/st,stm32-rcc.txt

Optional subnodes:
- pwm: See ../pwm/pwm-stm32.txt
- timer: See ../iio/timer/stm32-timer-trigger.txt

Example:
timers@40010000 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "st,stm32-timers";
reg = <0x40010000 0x400>;
clocks = <&rcc 0 160>;
clock-names = "clk_int";

pwm {
compatible = "st,stm32-pwm";
pinctrl-0 = <&pwm1_pins>;
pinctrl-names = "default";
};

timer@0 {
compatible = "st,stm32-timer-trigger";
reg = <0>;
};
};
35 changes: 35 additions & 0 deletions Documentation/devicetree/bindings/pwm/pwm-stm32.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
STMicroelectronics STM32 Timers PWM bindings

Must be a sub-node of an STM32 Timers device tree node.
See ../mfd/stm32-timers.txt for details about the parent node.

Required parameters:
- compatible: Must be "st,stm32-pwm".
- pinctrl-names: Set to "default".
- pinctrl-0: List of phandles pointing to pin configuration nodes for PWM module.
For Pinctrl properties see ../pinctrl/pinctrl-bindings.txt

Optional parameters:
- st,breakinput: One or two <index level filter> to describe break input configurations.
"index" indicates on which break input (0 or 1) the configuration
should be applied.
"level" gives the active level (0=low or 1=high) of the input signal
for this configuration.
"filter" gives the filtering value to be applied.

Example:
timers@40010000 {
#address-cells = <1>;
#size-cells = <0>;
compatible = "st,stm32-timers";
reg = <0x40010000 0x400>;
clocks = <&rcc 0 160>;
clock-names = "clk_int";

pwm {
compatible = "st,stm32-pwm";
pinctrl-0 = <&pwm1_pins>;
pinctrl-names = "default";
st,breakinput = <0 1 5>;
};
};
9 changes: 9 additions & 0 deletions drivers/iio/trigger/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,15 @@ config IIO_INTERRUPT_TRIGGER
To compile this driver as a module, choose M here: the
module will be called iio-trig-interrupt.

config IIO_STM32_TIMER_TRIGGER
tristate "STM32 Timer Trigger"
depends on (ARCH_STM32 && OF && MFD_STM32_TIMERS) || COMPILE_TEST
help
Select this option to enable STM32 Timer Trigger

To compile this driver as a module, choose M here: the
module will be called stm32-timer-trigger.

config IIO_TIGHTLOOP_TRIGGER
tristate "A kthread based hammering loop trigger"
depends on IIO_SW_TRIGGER
Expand Down
1 change: 1 addition & 0 deletions drivers/iio/trigger/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@

obj-$(CONFIG_IIO_HRTIMER_TRIGGER) += iio-trig-hrtimer.o
obj-$(CONFIG_IIO_INTERRUPT_TRIGGER) += iio-trig-interrupt.o
obj-$(CONFIG_IIO_STM32_TIMER_TRIGGER) += stm32-timer-trigger.o
obj-$(CONFIG_IIO_SYSFS_TRIGGER) += iio-trig-sysfs.o
obj-$(CONFIG_IIO_TIGHTLOOP_TRIGGER) += iio-trig-loop.o
Loading

0 comments on commit 6db0f7c

Please sign in to comment.