Skip to content

Commit

Permalink
iio: pulse: Support PWM capture with TI AM3358 eCAP module
Browse files Browse the repository at this point in the history
This IIO driver adds support for PWM capture with the TI eCAP module.
This driver is based on Matt Porter's eCAP driver from January 2014,
which was never merged into the mainline [1]. Like Matt's code, this
driver implements interrupt driven triggered buffer capture. However,
the driver has been updated based on previous suggestions in the IIO
mailing list. Additionally, support for prescalar control and finer
polarity control has been included. Users can now configure the
polarities of CAP1 and CAP2 individually, allowing for the measurement
of a signal's high-time, low-time, or period.

[1] https://marc.info/?l=linux-iio&m=145968010427392&w=2

Signed-off-by: Darren Schachter <dts86@cornell.edu>
  • Loading branch information
daschachter authored and intel-lab-lkp committed Aug 18, 2020
1 parent a1bab93 commit b454a14
Show file tree
Hide file tree
Showing 7 changed files with 613 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/iio/Kconfig
Expand Up @@ -93,6 +93,7 @@ source "drivers/iio/potentiometer/Kconfig"
source "drivers/iio/potentiostat/Kconfig"
source "drivers/iio/pressure/Kconfig"
source "drivers/iio/proximity/Kconfig"
source "drivers/iio/pulse/Kconfig"
source "drivers/iio/resolver/Kconfig"
source "drivers/iio/temperature/Kconfig"

Expand Down
1 change: 1 addition & 0 deletions drivers/iio/Makefile
Expand Up @@ -36,6 +36,7 @@ obj-y += potentiometer/
obj-y += potentiostat/
obj-y += pressure/
obj-y += proximity/
obj-y += pulse/
obj-y += resolver/
obj-y += temperature/
obj-y += trigger/
1 change: 1 addition & 0 deletions drivers/iio/industrialio-core.c
Expand Up @@ -87,6 +87,7 @@ static const char * const iio_chan_type_name_spec[] = {
[IIO_POSITIONRELATIVE] = "positionrelative",
[IIO_PHASE] = "phase",
[IIO_MASSCONCENTRATION] = "massconcentration",
[IIO_PULSE] = "pulse",
};

static const char * const iio_modifier_names[] = {
Expand Down
18 changes: 18 additions & 0 deletions drivers/iio/pulse/Kconfig
@@ -0,0 +1,18 @@
#
# Pulse Capture Devices
#
# When adding new entries keep the list in alphabetical order

menu "Pulse Capture Devices"

config IIO_TIECAP
tristate "TI ECAP Pulse Capture"
depends on ARCH_OMAP2PLUS || ARCH_DAVINCI_DA8XX || ARCH_KEYSTONE || ARCH_K3 || COMPILE_TEST
select IIO_BUFFER
select IIO_TRIGGERED_BUFFER
help
If you say yes here you get support for the TI ECAP peripheral
in pulse capture mode. This driver can also be built as a
module. If so, the module will be called pulse_tiecap.

endmenu
6 changes: 6 additions & 0 deletions drivers/iio/pulse/Makefile
@@ -0,0 +1,6 @@
#
# Makefile for IIO PWM Capture Device
#

# When adding new entries keep the list in alphabetical order
obj-$(CONFIG_IIO_TIECAP) += pulse_tiecap.o

0 comments on commit b454a14

Please sign in to comment.