linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 00/13] Add support for AD7091R-2/-4/-8
@ 2023-12-07 18:35 Marcelo Schmitt
  2023-12-07 18:37 ` [PATCH v3 01/13] scripts: checkpatch: Add __aligned to the list of attribute notes Marcelo Schmitt
                   ` (13 more replies)
  0 siblings, 14 replies; 34+ messages in thread
From: Marcelo Schmitt @ 2023-12-07 18:35 UTC (permalink / raw)
  To: apw, joe, dwaipayanray1, lukas.bulwahn, paul.cercueil,
	Michael.Hennerich, lars, jic23, robh+dt, krzysztof.kozlowski+dt,
	conor+dt, dan.carpenter, marcelo.schmitt1
  Cc: linux-iio, devicetree, linux-kernel

From: Marcelo Schmitt <marcelo.schmitt1@gmail.com>

----------------- Updates -----------------

Applied all changes suggested to the previous series.

I tried to better explain the changes but, since there is a fair amount of
rework in ad7091-base and ad7091r5, it may be hard to get the reasoning for the
early patches before looking at the patch for ad7091r8.

Change log v2 -> v3:
- Split alert fix patch into 2 fix patches and one alignment cleanup patch
- Corrected Fixes tag format
- Moved MAINTAINERS update to the end of the series
- Reworded some commit messages to provide context and make their goal clearer
- Removed erroneous gmail sign off
- Created container struct to store chip_info, regmap_config, and callbacks
  specific to each ADC design
- Created callbacks for chip specific tasks such as setting device operation mode
- Dropped the chip type enum struct
- Applied suggestions related to device tree documentation
- Added __aligned to list the of checkpatch attribute notes
- Other code style tidy ups.

I see regmap's interface for reading device registers under /sys/kernel/debug/regmap/.
I can read all registers but can't write to any of them unless I force define
REGMAP_ALLOW_WRITE_DEBUGFS.

When testing events for this driver I often write to device registers
to set different rising/falling thresholds. I do something like this:
# echo 0x17 0x100 > /sys/kernel/debug/iio/iio:device0/direct_reg_access

I tried read/writing to files under iio:device events directory but always
get segmentation fault. I must be forgetting to implement something.
What am I missing?

Thanks
Marcelo

----------------- Context -----------------

This series adds support for AD7091R-2/-4/-8 ADCs which can do single shot
or sequenced readings. Threshold events are also supported.
Overall, AD7091R-2/-4/-8 are very similar to AD7091R-5 except they use SPI interface.

Changes have been tested with raspberrypi and eval board on raspberrypi kernel
6.7-rc3 from raspberrypi fork.
Link: https://wiki.analog.com/resources/tools-software/linux-drivers/iio-adc/ad7091r8

Marcelo Schmitt (13):
  scripts: checkpatch: Add __aligned to the list of attribute notes
  iio: adc: ad7091r: Populate device driver data field
  iio: adc: ad7091r: Set alert bit in config register
  iio: adc: ad7091r: Align arguments to function call parenthesis
  iio: adc: ad7091r: Move generic AD7091R code to base driver and header
    file
  iio: adc: ad7091r: Move chip init data to container struct
  iio: adc: ad7091r: Set device mode through chip_info callback
  iio: adc: ad7091r: Enable internal vref if external vref is not
    supplied
  iio: adc: ad7091r: Add chip_info callback to get conversion result
    channel
  dt-bindings: iio: Add AD7091R-8
  iio: adc: Split AD7091R-5 config symbol
  iio: adc: Add support for AD7091R-8
  MAINTAINERS: Add MAINTAINERS entry for AD7091R

 .../bindings/iio/adc/adi,ad7091r8.yaml        |  99 +++++++
 MAINTAINERS                                   |  12 +
 drivers/iio/adc/Kconfig                       |  16 ++
 drivers/iio/adc/Makefile                      |   4 +-
 drivers/iio/adc/ad7091r-base.c                | 141 ++++------
 drivers/iio/adc/ad7091r-base.h                |  78 +++++-
 drivers/iio/adc/ad7091r5.c                    | 119 ++++----
 drivers/iio/adc/ad7091r8.c                    | 261 ++++++++++++++++++
 scripts/checkpatch.pl                         |   1 +
 9 files changed, 597 insertions(+), 134 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/iio/adc/adi,ad7091r8.yaml
 create mode 100644 drivers/iio/adc/ad7091r8.c

-- 
2.42.0


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

end of thread, other threads:[~2023-12-10 20:00 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-07 18:35 [PATCH v3 00/13] Add support for AD7091R-2/-4/-8 Marcelo Schmitt
2023-12-07 18:37 ` [PATCH v3 01/13] scripts: checkpatch: Add __aligned to the list of attribute notes Marcelo Schmitt
2023-12-07 18:56   ` Joe Perches
2023-12-08 12:21     ` Marcelo Schmitt
2023-12-07 18:37 ` [PATCH v3 02/13] iio: adc: ad7091r: Populate device driver data field Marcelo Schmitt
2023-12-07 23:18   ` David Lechner
2023-12-08 12:16     ` Marcelo Schmitt
2023-12-07 18:38 ` [PATCH v3 03/13] iio: adc: ad7091r: Set alert bit in config register Marcelo Schmitt
2023-12-10 12:13   ` Jonathan Cameron
2023-12-07 18:39 ` [PATCH v3 04/13] iio: adc: ad7091r: Align arguments to function call parenthesis Marcelo Schmitt
2023-12-07 18:40 ` [PATCH v3 05/13] iio: adc: ad7091r: Move generic AD7091R code to base driver and header file Marcelo Schmitt
2023-12-07 18:40 ` [PATCH v3 06/13] iio: adc: ad7091r: Move chip init data to container struct Marcelo Schmitt
2023-12-08 12:28   ` [PATCH v3 6/13] " kernel test robot
2023-12-07 18:41 ` [PATCH v3 07/13] iio: adc: ad7091r: Set device mode through chip_info callback Marcelo Schmitt
2023-12-10 12:35   ` Jonathan Cameron
2023-12-07 18:41 ` [PATCH v3 08/13] iio: adc: ad7091r: Enable internal vref if external vref is not supplied Marcelo Schmitt
2023-12-10 12:22   ` Jonathan Cameron
2023-12-07 18:41 ` [PATCH v3 09/13] iio: adc: ad7091r: Add chip_info callback to get conversion result channel Marcelo Schmitt
2023-12-07 18:42 ` [PATCH v3 10/13] dt-bindings: iio: Add AD7091R-8 Marcelo Schmitt
2023-12-07 23:56   ` David Lechner
2023-12-08 13:28     ` Marcelo Schmitt
2023-12-08 14:50       ` David Lechner
2023-12-10 12:26       ` Jonathan Cameron
2023-12-08  8:05   ` Krzysztof Kozlowski
2023-12-08 13:29     ` Marcelo Schmitt
2023-12-07 18:42 ` [PATCH v3 11/13] iio: adc: Split AD7091R-5 config symbol Marcelo Schmitt
2023-12-07 18:42 ` [PATCH v3 12/13] iio: adc: Add support for AD7091R-8 Marcelo Schmitt
2023-12-10 12:33   ` Jonathan Cameron
2023-12-10 19:54     ` Marcelo Schmitt
2023-12-07 18:43 ` [PATCH v3 13/13] MAINTAINERS: Add MAINTAINERS entry for AD7091R Marcelo Schmitt
2023-12-07 18:58   ` Joe Perches
2023-12-08 12:12     ` Marcelo Schmitt
2023-12-07 23:26 ` [PATCH v3 00/13] Add support for AD7091R-2/-4/-8 David Lechner
2023-12-08 13:50   ` Marcelo Schmitt

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).