linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v7 0/5] iio: magnetometer: ak8975: Add gpio reset support
@ 2020-05-28 14:56 Jonathan Albrieux
  2020-05-28 14:56 ` [PATCH v7 1/5] dt-bindings: iio: magnetometer: ak8975: reword gpios, add interrupts, fix style Jonathan Albrieux
  0 siblings, 1 reply; 2+ messages in thread
From: Jonathan Albrieux @ 2020-05-28 14:56 UTC (permalink / raw)
  To: linux-kernel
  Cc: ~postmarketos/upstreaming, Jonathan Albrieux, Andy Shevchenko,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Hartmut Knaack, Jonathan Cameron, Lars-Peter Clausen,
	Linus Walleij, open list:IIO SUBSYSTEM AND DRIVERS,
	Peter Meerwald-Stadler

v7:
 - fix documentation style, removing documentation unnecessary parts

v6:
 - reword documentation for gpios, add interrupt documentation
https://lore.kernel.org/linux-iio/20200525151117.32540-1-jonathan.albrieux@gmail.com/

v5:
 - add maintainer
https://lore.kernel.org/linux-iio/20200520163417.27805-1-jonathan.albrieux@gmail.com/

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/20200520073125.30808-1-jonathan.albrieux@gmail.com/

v3:
 - fix patch messages style
 - align reset gpio comment to kernel doc reccomendation
 - introduce changelog
https://lore.kernel.org/linux-iio/20200519124402.26076-1-jonathan.albrieux@gmail.com/

v2:
 - rewording of reset gpio comment and patch messages to better clarify
   reset gpio behaviour
https://lore.kernel.org/linux-iio/20200518133645.19127-1-jonathan.albrieux@gmail.com/

v1:
 - initial patch submission
https://lore.kernel.org/linux-iio/20200519065749.4624-1-jonathan.albrieux@gmail.com/

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


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

* [PATCH v7 1/5] dt-bindings: iio: magnetometer: ak8975: reword gpios, add interrupts, fix style
  2020-05-28 14:56 [PATCH v7 0/5] iio: magnetometer: ak8975: Add gpio reset support Jonathan Albrieux
@ 2020-05-28 14:56 ` Jonathan Albrieux
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Albrieux @ 2020-05-28 14:56 UTC (permalink / raw)
  To: linux-kernel
  Cc: ~postmarketos/upstreaming, Jonathan Albrieux, Andy Shevchenko,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Hartmut Knaack, Jonathan Cameron, Lars-Peter Clausen,
	Linus Walleij, open list:IIO SUBSYSTEM AND DRIVERS,
	Peter Meerwald-Stadler, Jonathan Cameron, Rob Herring

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

Signed-off-by: Jonathan Albrieux <jonathan.albrieux@gmail.com>
Reviewed-by: Rob Herring <robh@kernel.org>
---
 .../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


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

end of thread, other threads:[~2020-05-28 14:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-28 14:56 [PATCH v7 0/5] iio: magnetometer: ak8975: Add gpio reset support Jonathan Albrieux
2020-05-28 14:56 ` [PATCH v7 1/5] dt-bindings: iio: magnetometer: ak8975: reword gpios, add interrupts, fix style Jonathan Albrieux

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