Skip to content

New driver for ams AS5600 Position Sensor

Aditya Dutt linux-devicetree linux-doc linux-iio lkml oe-kbuild-all 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2dt-bindings: iio: position: Add ams AS5600 Position SensorDocumentation/devicetree/bindings/iio/position/ams,as5600.yaml+42 -01 reply
2/2iio: position: Add support for ams AS5600 angle sensorDocumentation/iio/as5600.rst Documentation/iio/index.rst MAINTAINERS +3 more+477 -03 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchFrank Zago
1/2
2/2A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] New driver for ams AS5600 Position Sensor

This patch series adds support for the ams AS5600 Position Sensor.

The AS5600 is a Hall-based rotary magnetic position sensor using planar sensors that convert the magnetic field component perpendicular to the surface of the chip into a voltage, or a numerical value available through i2c.

The driver registers the chip as an IIO_ANGL device.
It also exposes the raw registers through debugfs for further configuration.

Datasheet: https://ams-osram.com/products/sensor-solutions/position-sensors/ams-as5600-position-sensor

---

This patch is based on the work done by Frank Zago:
v2: https://lore.kernel.org/all/[email protected]/
v1: https://lore.kernel.org/all/[email protected]/

I have done the changes suggested by Jonathan Cameron in the follow-ups.

I picked this up because there has been no progress on this since 2021 and Frank Zago has previously stated he isn't trying to upstream his drivers:
https://lore.kernel.org/all/[email protected]/

Currently, I have not added support for:
- OUT (PWM)
- PGO (GPIO used for OTP)
- DIR (GPIO used for clockwise/anti-clockwise detection)

I have tested this on a Beaglebone Black with as5600 support compiled as a kernel module (m) as well as in-kernel (y).

changes since Frank Zago's v2:
- direct register access in debugfs is now raw register access without any mappings as suggested by Jonathan Cameron
- added device tree support and bindings
- in as5600_probe(), reading ZPOS and MPOS should be a word not a byte
- removed "Read then write" behavior in as5600_reg_access_write() since register access is now raw, reading and manipulating the correct bits and writing is now the duty of userspace.
- changed "Datasheet" links to the product page instead of the direct PDF since the PDF links are not stable

Aditya Dutt (2):
dt-bindings: iio: position: Add ams AS5600 Position Sensor
iio: position: Add support for ams AS5600 angle sensor

 .../bindings/iio/position/ams,as5600.yaml     |  42 ++
 Documentation/iio/as5600.rst                  |  84 ++++
 Documentation/iio/index.rst                   |   1 +
 MAINTAINERS                                   |   8 +
 drivers/iio/position/Kconfig                  |  10 +
 drivers/iio/position/Makefile                 |   1 +
 drivers/iio/position/as5600.c                 | 373 ++++++++++++++++++
 7 files changed, 519 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/position/ams,as5600.yaml
 create mode 100644 Documentation/iio/as5600.rst
 create mode 100644 drivers/iio/position/as5600.c
Signature · 1 line
2.34.1