2020-05-28 14:59:50

by Jonathan Albrieux

[permalink] [raw]
Subject: [PATCH v7 0/5] iio: magnetometer: ak8975: Add gpio reset support

v7:
- fix documentation style, removing documentation unnecessary parts

v6:
- reword documentation for gpios, add interrupt documentation
https://lore.kernel.org/linux-iio/[email protected]/

v5:
- add maintainer
https://lore.kernel.org/linux-iio/[email protected]/

v4:
- fix some typo
- use gpio's dt-bindings for more clarity in documentation
- set compatible properties without vendor prefix as deprecated
https://lore.kernel.org/linux-iio/[email protected]/

v3:
- fix patch messages style
- align reset gpio comment to kernel doc reccomendation
- introduce changelog
https://lore.kernel.org/linux-iio/[email protected]/

v2:
- rewording of reset gpio comment and patch messages to better clarify
reset gpio behaviour
https://lore.kernel.org/linux-iio/[email protected]/

v1:
- initial patch submission
https://lore.kernel.org/linux-iio/[email protected]/

Convert documentation from txt format to yaml. Add documentation about
reset-gpio.

Deassert reset on ak8975_power_on(), assert reset on ak8975_power_off().

Without reset's deassertion during ak8975_power_on(), driver's probe fails
on ak8975_who_i_am() while checking for device identity for AK09911 chip.

AK09911 has an active low reset gpio to handle register's reset.
AK09911 datasheet says that, if not used, reset pin should be connected
to VID. This patch emulates this situation.

JonnyMe (5):
dt-bindings: iio: magnetometer: ak8975: reword gpios, add interrupts,
fix style
dt-bindings: iio: magnetometer: ak8975: convert format to yaml, add
maintainer
dt-bindings: iio: magnetometer: ak8975: add gpio reset support
iio: magnetometer: ak8975: Fix typo, uniform measurement unit style
iio: magnetometer: ak8975: Add gpio reset support

.../bindings/iio/magnetometer/ak8975.txt | 30 -------
.../iio/magnetometer/asahi-kasei,ak8975.yaml | 84 +++++++++++++++++++
drivers/iio/magnetometer/ak8975.c | 22 ++++-
3 files changed, 104 insertions(+), 32 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/iio/magnetometer/ak8975.txt
create mode 100644 Documentation/devicetree/bindings/iio/magnetometer/asahi-kasei,ak8975.yaml

--
2.17.1


2020-05-28 15:02:34

by Jonathan Albrieux

[permalink] [raw]
Subject: [PATCH v7 1/5] dt-bindings: iio: magnetometer: ak8975: reword gpios, add interrupts, fix style

Reword gpios documentation, add interrupt documentation and fix styles.
Update example to use interrupts instead of gpios.

Signed-off-by: Jonathan Albrieux <[email protected]>
Reviewed-by: Rob Herring <[email protected]>
---
.../bindings/iio/magnetometer/ak8975.txt | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/Documentation/devicetree/bindings/iio/magnetometer/ak8975.txt b/Documentation/devicetree/bindings/iio/magnetometer/ak8975.txt
index aa67ceb0d4e0..0576b9df0bf2 100644
--- a/Documentation/devicetree/bindings/iio/magnetometer/ak8975.txt
+++ b/Documentation/devicetree/bindings/iio/magnetometer/ak8975.txt
@@ -2,21 +2,28 @@

Required properties:

- - compatible : should be "asahi-kasei,ak8975"
- - reg : the I2C address of the magnetometer
+ - compatible : should be "asahi-kasei,ak8975".
+ - reg : the I2C address of the magnetometer.

Optional properties:

- - gpios : should be device tree identifier of the magnetometer DRDY pin
- - vdd-supply: an optional regulator that needs to be on to provide VDD
- - mount-matrix: an optional 3x3 mounting rotation matrix
+ - gpios : AK8975 has a "Data ready" pin (DRDY) which informs that data
+ is ready to be read and is possible to listen on it. If used,
+ this should be active high. Prefer interrupt over this.
+
+ - interrupts : interrupt for DRDY pin. Triggered on rising edge.
+
+ - vdd-supply: an optional regulator that needs to be on to provide VDD.
+
+ - mount-matrix: an optional 3x3 mounting rotation matrix.

Example:

ak8975@c {
compatible = "asahi-kasei,ak8975";
reg = <0x0c>;
- gpios = <&gpj0 7 0>;
+ interrupt-parent = <&gpio6>;
+ interrupts = <15 IRQ_TYPE_EDGE_RISING>;
vdd-supply = <&ldo_3v3_gnss>;
mount-matrix = "-0.984807753012208", /* x0 */
"0", /* y0 */
--
2.17.1