From patchwork Sun Nov 29 21:54:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 334470 Delivered-To: patch@linaro.org Received: by 2002:a92:5e16:0:0:0:0:0 with SMTP id s22csp4125370ilb; Sun, 29 Nov 2020 13:55:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJwhWZJdnvZ7SEttgudPPBk3LQCfD91D1Y5JfGosZpRyVTc1cR4qEAaA1f5GNP5milyuGBi1 X-Received: by 2002:a50:8f64:: with SMTP id 91mr18731975edy.310.1606686920590; Sun, 29 Nov 2020 13:55:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606686920; cv=none; d=google.com; s=arc-20160816; b=AthkmzNQUoox7X3yb2OgLo+wy+krkX70/f+xEn2sfNb5wtkdUwfsi3a7l27maGJZs4 gw/JuMWPVAO6GmK3EoT+rRvOVW/NYTJTJBxwCg0IGHiNGXussmtMtaLVR0Lz5ISQPARM pYCN7/ljlHCxtEuoFDvZ+t3TfqweY/hma9yrbavoUMwhPQgF6AyvioJlmAHXWRCUuv4m 69jhD8CRojrjhXelTO9MgB3ot5I4xeIKtwnPCVtxQO2qP/ldt1rLGPqH5s64QN90gD+P SJ5rcSW+MvJbNpvCHXlkSxYqf2CYwcIvnTjspPB7Rjgt2YZiKsg3R4kcmSA+22+kSPfu KLLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=22v+25uLTpzoU6j998AK5X4aT/wXdw1+Ijxp1BLCpE8=; b=ENkUBmvLghiuGLgsGNCX35BEaK3VtVvsuhFayFARgFW7HrZzHVP7/znBmSTsZomDyo haDJ5lxYoz0XXLohNA2+Jm8qNOgmouCCEc2zq1DH3DGIU2s4wanDP37QjR/O4mUfUBUs No2JTAMifxWVzqcmAoupxZzvTPHqY6cMYcEldTwxtKnV12HuCpVWneiM/HxUtrE3KF7A KTGYklHUaQ5td/0DQufOhk9TUT5/kmnnkK95k3c3mfzFzIiggAMYYII6SBpgH4vBbAwk e1oU6QDF0j07XtX0C9Hhu33pr2tou51eeXxZq9fG+1vVMYYKHEMaxLZARBAgqO0zWeEk Pbjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=A8NUZbje; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m11si10281548eda.522.2020.11.29.13.55.20; Sun, 29 Nov 2020 13:55:20 -0800 (PST) Received-SPF: pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=A8NUZbje; spf=pass (google.com: domain of devicetree-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727992AbgK2VzO (ORCPT + 6 others); Sun, 29 Nov 2020 16:55:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726512AbgK2VzL (ORCPT ); Sun, 29 Nov 2020 16:55:11 -0500 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 14C94C0613D2 for ; Sun, 29 Nov 2020 13:54:31 -0800 (PST) Received: by mail-lf1-x12d.google.com with SMTP id z21so17007076lfe.12 for ; Sun, 29 Nov 2020 13:54:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=22v+25uLTpzoU6j998AK5X4aT/wXdw1+Ijxp1BLCpE8=; b=A8NUZbjezyMvrsQv/uqg7rzmqp2cVN8OcJVFDHRBvPy2ys5HPVB8vr/QAg/4hBjY9F /l7h0ctiklIIVnMNzgKhHjZoO4DItwuY9tjQBWsURDkfLzoyzw0BWbTuyKnxN+svZGZq iXaY8M5BNPXdb6uoQ0NX8Pf+a5I/TbUpVelpVs7t2tIjl8+v5lfZKigHISQBCnj+Y6HT cIhdSSkODDq+rOqvNQqY28XVNo1pPfFZghIU9ba5V4k+TN3pcqCQtA3FJ5UG+zGy658p 6wu/OHAgRpkUSR6GH+28HZy9mWNlNaj+2dlWeHp2ctLsKb4Dnk2GhlmA8lqY+7jCHmCC xH5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=22v+25uLTpzoU6j998AK5X4aT/wXdw1+Ijxp1BLCpE8=; b=khIRP2X1FWdj90dg9osvhXgmWdAM3knzoUNl+IYYni6qF/OSe+eQbSbHDh/D3k3IZG 9ShJWyLjZ/WOQsaIX8oXBMyawEnkDn7XjxPtLrx1mdVPQureXuFxGzeUV2zr+Rnfj5nv h7BYeOFaJWU4MTvS6XHJwPchVDdlIu4Fgjtk5TNfnD/NYkrb11G6sV661HORAF0BtQoe +q2vTpTIJOzRofn0Tnz4ivnj/E56E5KfQwhAXyaPjrSd0fguFobMCTNkwsJAgsR0vvso BKM6ec4QSiEBH1z8QH55+edTK6UC+JKwNTX4s/iqjw1IGpNhr/6bO0pEyPP92mPr/lx8 SRnA== X-Gm-Message-State: AOAM532ycTgKBdFqhmTTg1cK0BvWzm1WW8cudybCG6nZM5Q3dmHboKvr XHAfvGg0+K7knWDg6bjKZsQjdg== X-Received: by 2002:a19:8a46:: with SMTP id m67mr7791662lfd.515.1606686869439; Sun, 29 Nov 2020 13:54:29 -0800 (PST) Received: from localhost.bredbandsbolaget (c-92d7225c.014-348-6c756e10.bbcust.telenor.se. [92.34.215.146]) by smtp.gmail.com with ESMTPSA id b18sm2268654ljp.124.2020.11.29.13.54.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Nov 2020 13:54:28 -0800 (PST) From: Linus Walleij To: Jonathan Cameron , linux-iio@vger.kernel.org Cc: Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , Linus Walleij , devicetree@vger.kernel.org, phone-devel@vger.kernel.org Subject: [PATCH 1/2 v4] iio: accel: yamaha-yas530: Add DT bindings Date: Sun, 29 Nov 2020 22:54:20 +0100 Message-Id: <20201129215421.1177990-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org This adds device tree bindings for the Yamaha YAS530 family of magnetometers/compass sensors. Cc: devicetree@vger.kernel.org Cc: phone-devel@vger.kernel.org Signed-off-by: Linus Walleij --- ChangeLog v3->v4: - Rename the bindings and file yas530 after the first introduced component in the family. - Simplify conditional logic using the if: not: YAML constructions. - Use the possibility to set a property to false to just remvove reset GPIOs and interrupts from variants that do not have them. ChangeLog v2->v3: - Restrict to cover the YAS53x variants, it turns out that YAS529 is a very different component from the others so keep that for a separate document when/if needed. - Rename the file and binding yamaha,53x.yaml - Use - if: clauses to restrict some properties. - Fix some spelling mistakes. - Restrict the nodename to be "magnetometer@[0-9a-f]" ChangeLog v1->v2: - Add Yamaha to the vendor list, I was surprised to find they were not yet listed. --- .../iio/magnetometer/yamaha,yas530.yaml | 112 ++++++++++++++++++ .../devicetree/bindings/vendor-prefixes.yaml | 2 + 2 files changed, 114 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/magnetometer/yamaha,yas530.yaml -- 2.26.2 Reviewed-by: Rob Herring diff --git a/Documentation/devicetree/bindings/iio/magnetometer/yamaha,yas530.yaml b/Documentation/devicetree/bindings/iio/magnetometer/yamaha,yas530.yaml new file mode 100644 index 000000000000..4b0ef1ef5445 --- /dev/null +++ b/Documentation/devicetree/bindings/iio/magnetometer/yamaha,yas530.yaml @@ -0,0 +1,112 @@ +# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/magnetometer/yamaha,yas530.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Yamaha YAS530 family of magnetometer sensors + +maintainers: + - Linus Walleij + +description: + The Yamaha YAS530 magnetometers is a line of 3-axis magnetometers + first introduced by Yamaha in 2009 with the YAS530. They are successors + of Yamaha's first magnetometer YAS529. Over the years this magnetometer + has been miniaturized and appeared in a number of different variants. + +properties: + $nodename: + pattern: '^magnetometer@[0-9a-f]+$' + + compatible: + items: + - enum: + - yamaha,yas530 + - yamaha,yas532 + - yamaha,yas533 + - yamaha,yas535 + - yamaha,yas536 + - yamaha,yas537 + - yamaha,yas539 + + reg: + maxItems: 1 + + reset-gpios: + maxItems: 1 + description: The YAS530 sensor has a RSTN pin used to reset + the logic inside the sensor. This GPIO line should connect + to that pin and be marked as GPIO_ACTIVE_LOW. + + interrupts: + maxItems: 1 + description: Interrupt for INT pin for interrupt generation. + The polarity, whether the interrupt is active on the rising + or the falling edge, is software-configurable in the hardware. + + vdd-supply: + description: An optional regulator providing core power supply + on the VDD pin, typically 1.8 V or 3.0 V. + + iovdd-supply: + description: An optional regulator providing I/O power supply + for the I2C interface on the IOVDD pin, typically 1.8 V. + + mount-matrix: + description: An optional 3x3 mounting rotation matrix. + +allOf: + - if: + not: + properties: + compatible: + items: + const: yamaha,yas530 + then: + properties: + reset-gpios: false + + - if: + properties: + compatible: + items: + const: yamaha,yas539 + then: + properties: + interrupts: false + +required: + - compatible + - reg + +additionalProperties: false + +examples: + - | + #include + #include + i2c-0 { + #address-cells = <1>; + #size-cells = <0>; + + magnetometer@2e { + compatible = "yamaha,yas530"; + reg = <0x2e>; + vdd-supply = <&ldo1_reg>; + iovdd-supply = <&ldo2_reg>; + reset-gpios = <&gpio6 12 GPIO_ACTIVE_LOW>; + interrupts = <&gpio6 13 IRQ_TYPE_EDGE_RISING>; + }; + }; + + i2c-1 { + #address-cells = <1>; + #size-cells = <0>; + + magnetometer@2e { + compatible = "yamaha,yas539"; + reg = <0x2e>; + vdd-supply = <&ldo1_reg>; + }; + }; diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml index 2735be1a8470..0340674c72bd 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml @@ -1210,6 +1210,8 @@ patternProperties: description: Shenzhen Xunlong Software CO.,Limited "^xylon,.*": description: Xylon + "^yamaha,.*": + description: Yamaha Corporation "^ylm,.*": description: Shenzhen Yangliming Electronic Technology Co., Ltd. "^yna,.*":