devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/5] Add STM32H7 DAC driver
@ 2017-04-06 16:11 Fabrice Gasnier
       [not found] ` <1491495116-7209-1-git-send-email-fabrice.gasnier-qxv4g6HH51o@public.gmane.org>
                   ` (2 more replies)
  0 siblings, 3 replies; 14+ messages in thread
From: Fabrice Gasnier @ 2017-04-06 16:11 UTC (permalink / raw)
  To: jic23, linux, robh+dt, linux-arm-kernel, devicetree, linux-kernel
  Cc: mark.rutland, benjamin.gaignard, lars, alexandre.torgue,
	linux-iio, pmeerw, mcoquelin.stm32, knaack.h, fabrice.gasnier,
	benjamin.gaignard

This patchset adds support for the STM32H7 DAC controller

It's a 12-bit, voltage output digital-to-analog converter. It has two
output channels, each with its own converter, trigger sources and
waveform generator.

Each channel can be used independently, so common resources are managed
in stm32-dac-core driver (e.g. clock, reset, regulator, registers).
One IIO device is instantiated per DAC output channel, in stm32-dac
driver, so each channel can have its own trigger.

Please find bellow basic examples, using this driver to:
- generate DC voltage output on channel1
- generate a triangle waveform on channel2

# set max DC voltage / enable / min DC voltage / disable on out1:
cd /sys/bus/iio/devices/iio\:device0
echo 4095 > out_voltage1_raw
echo 1 > out_voltage1_powerdown
echo 0 > out_voltage1_raw
echo 0 > out_voltage1_powerdown
cat out_voltage_powerdown_mode_available
Hi-Z enable

# configure timer trigger, and set triangle waveform with half
# amplitude and DC offset on out2:
cd /sys/bus/iio/devices/trigger9
cat name
tim2_trgo
echo 10000 > sampling_frequency

cd /sys/bus/iio/devices/iio\:device1
echo triangle > out_voltage2_wavetype
echo 2047 > out_voltage2_amplitude
echo 1024 > out_voltage2_offset
echo tim2_trgo > trigger/current_trigger
echo 1 > out_voltage2_powerdown

---
Changes in v2:
- Update dt binding, use 'reg' property to select channel
- Use 'powerdown' attribute instead of 'enable'
- Added set_trigger callback
- Use 'offset' attribute in waveform generation mode to add DC offset
- rework ABI for waveform generation mode
- Various typos, comments

Fabrice Gasnier (5):
  dt-bindings: iio: stm32-dac: Add support for STM32 DAC
  iio: dac: add support for stm32 DAC
  iio: trigger: add set_trigger callback to notify device
  iio: dac: stm32: add support for trigger events
  iio: dac: stm32: add support for waveform generator

 Documentation/ABI/testing/sysfs-bus-iio-dac-stm32  |  16 +
 .../devicetree/bindings/iio/dac/st,stm32-dac.txt   |  61 ++
 drivers/iio/dac/Kconfig                            |  18 +
 drivers/iio/dac/Makefile                           |   2 +
 drivers/iio/dac/stm32-dac-core.c                   | 180 ++++++
 drivers/iio/dac/stm32-dac-core.h                   |  63 ++
 drivers/iio/dac/stm32-dac.c                        | 631 +++++++++++++++++++++
 drivers/iio/industrialio-trigger.c                 |   6 +
 include/linux/iio/iio.h                            |   2 +
 9 files changed, 979 insertions(+)
 create mode 100644 Documentation/ABI/testing/sysfs-bus-iio-dac-stm32
 create mode 100644 Documentation/devicetree/bindings/iio/dac/st,stm32-dac.txt
 create mode 100644 drivers/iio/dac/stm32-dac-core.c
 create mode 100644 drivers/iio/dac/stm32-dac-core.h
 create mode 100644 drivers/iio/dac/stm32-dac.c

-- 
1.9.1

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

end of thread, other threads:[~2017-04-14 15:28 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-06 16:11 [PATCH v2 0/5] Add STM32H7 DAC driver Fabrice Gasnier
     [not found] ` <1491495116-7209-1-git-send-email-fabrice.gasnier-qxv4g6HH51o@public.gmane.org>
2017-04-06 16:11   ` [PATCH v2 1/5] dt-bindings: iio: stm32-dac: Add support for STM32 DAC Fabrice Gasnier
2017-04-06 16:11   ` [PATCH v2 2/5] iio: dac: add support for stm32 DAC Fabrice Gasnier
     [not found]     ` <1491495116-7209-3-git-send-email-fabrice.gasnier-qxv4g6HH51o@public.gmane.org>
2017-04-09  8:39       ` Jonathan Cameron
2017-04-10 15:56         ` Fabrice Gasnier
2017-04-06 16:11   ` [PATCH v2 4/5] iio: dac: stm32: add support for trigger events Fabrice Gasnier
     [not found]     ` <1491495116-7209-5-git-send-email-fabrice.gasnier-qxv4g6HH51o@public.gmane.org>
2017-04-09  9:04       ` Jonathan Cameron
2017-04-10 16:37         ` Fabrice Gasnier
2017-04-06 16:11 ` [PATCH v2 3/5] iio: trigger: add set_trigger callback to notify device Fabrice Gasnier
     [not found]   ` <1491495116-7209-4-git-send-email-fabrice.gasnier-qxv4g6HH51o@public.gmane.org>
2017-04-09  8:45     ` Jonathan Cameron
2017-04-06 16:11 ` [PATCH v2 5/5] iio: dac: stm32: add support for waveform generator Fabrice Gasnier
     [not found]   ` <1491495116-7209-6-git-send-email-fabrice.gasnier-qxv4g6HH51o@public.gmane.org>
2017-04-09  9:34     ` Jonathan Cameron
2017-04-10 16:43       ` Fabrice Gasnier
     [not found]         ` <779a0082-3760-75c4-2fd3-b8a5b70dbaf8-qxv4g6HH51o@public.gmane.org>
2017-04-14 15:28           ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).