From patchwork Sat Dec 12 12:13:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 342874 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp1391609jai; Sat, 12 Dec 2020 04:16:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJwKXIsfCk4NVYOk7kiIRiDtOdUC3on6VQ3ue4K+tx98ZixDdjxY1gp7R4Q0P0fvLvZz8wiO X-Received: by 2002:a17:906:3553:: with SMTP id s19mr14476599eja.95.1607775362338; Sat, 12 Dec 2020 04:16:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607775362; cv=none; d=google.com; s=arc-20160816; b=fTisaqL61WODSLcO+sDdmfTJtlZ9pBpmSCSM34Xv+goDO8pyyBf0/0LVFvyxBHekj+ 8JCpdXzRmmYoBwgPdpnYvRP/dIAiIY+sjrJjhHT89rN0MHG0koXtVS7i600rcvfTDvAV jtvBt55hHtI5MPPSH+Q+pqjQdZchnRSTEHwtFbi8gsAQiuORS34CjeFdq4xwVeB8gep/ i1Lxyn33WXrQ5WiJAX/bY7g16T4Ply40hEB9n516LpJN4zg0ifh2JSmHBt/3d8Hx5OtG sDrWQT2dw3WND0hTuwdHWcjnEotDOUyTfREBksV8Ad+KvHN39E5VMxX+jNWhZafXjgAT w6Hg== 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=nH64bs/o0u6lD1dT5BmfJm1SGgsk3D4ncZDVO5xop3Y=; b=raC1lo9xl70z0DeGK+hBjYCj0UhEJuO/iTXqWzaBKLf2x9QZqInMvFaT2yTnu96eTq 4NdStFx5RUuy/mt0uZ1OvTjbJ1vpJyTCy0+ct+uflywVyfjd97xUWKdxFznBzyfF0kv0 4AAwmUJyaziYW/Ejg5t5f2lWrqKKq5xz0yYYhODWf0b8BfMK9eWy6GIoRCEy8Pu9a2ZE Bar14NoYj/WPtCSRmW72E/I/34xqzdLgAGuZzRvP7LaanHS6XKr44WSmKxcG1a9K+SIx c9KiFzScconXQ6TxDjkbTmWqlkc5ATbRyYIh/oS1n0xH0hdXacb2dnJ+xPc8j1gBeXo0 tGoA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AFkPSFp4; 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 u9si6380571edd.596.2020.12.12.04.16.01; Sat, 12 Dec 2020 04:16:02 -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=AFkPSFp4; 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 S1726950AbgLLMOp (ORCPT + 7 others); Sat, 12 Dec 2020 07:14:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726696AbgLLMOp (ORCPT ); Sat, 12 Dec 2020 07:14:45 -0500 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D61FFC0613D3 for ; Sat, 12 Dec 2020 04:14:04 -0800 (PST) Received: by mail-lf1-x12a.google.com with SMTP id a9so18267585lfh.2 for ; Sat, 12 Dec 2020 04:14:04 -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=nH64bs/o0u6lD1dT5BmfJm1SGgsk3D4ncZDVO5xop3Y=; b=AFkPSFp4VUzxlohcoezcykgpogd8aLGnlWDilPZGEDPAe0BYyV8AP+cN47rbyWyfnK RCVdzZk+osB4vv+VfiRNfeswLY7KIPyTu0zOs7Vp9+jpgWRZA2on+LBb+0esTNexSWsT Hhi3L2QglppNR0gPj2zag/oljXdjwK3XMnf27wyRN1Pk5/scViahp6otZQtdhuF8z5N8 pTYkkZ/J6ZKE1Su0E8/aOOcf7F30rOAeqJHQdCJedArijGQHrxngyF6MjdDJHGNljBGA 2NEw5c2KcgI011hYbXb+9RZqvgxDSPff5UvNKoaO7PagAdkNbQv7U3bfYvLEqSC3y3mL HM4Q== 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=nH64bs/o0u6lD1dT5BmfJm1SGgsk3D4ncZDVO5xop3Y=; b=ha54nczwkgvOisLdUDFsEXowF3KxKXaKqHcH40Q30wmfqYfynwTygLRyBl8vV+q3dL t3bxF/LX20THfCb6J63FI8RHECtmcq9bVcmGD1lYoLC0eXE/5qGV79mfiM1QxltKnded VQbs01tlXOslWjlwFjBMUyJ5VQ5Ekjc2wSTKsxrX2aYRmc++OAK4q6nzzbC4ddJDzNwi HdmcLMeOGY6xgPMw/C8a8Pe1fG0kPvAf2IIUN7I60LyHyLacllKI9kttF1RYKRE3A/2s pLA6LD9H1XOswOXptw8FYwhfChxuCZrPEru1d3PCWY673zUf2nzPSkGIbVKbTBb1DTXt ZcKw== X-Gm-Message-State: AOAM5319rTRrugyiO5+AoSa/tCVa6xwXEnlFtdyGowx6VTlWmWE5pKxl /ohFTl4D5vbhAy7+XD9UJf7lFw== X-Received: by 2002:a05:6512:33a8:: with SMTP id i8mr6551509lfg.5.1607775243192; Sat, 12 Dec 2020 04:14:03 -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 136sm1222766lfb.62.2020.12.12.04.14.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 12 Dec 2020 04:14:02 -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, Andy Shevchenko , Jonathan Bakker , Rob Herring Subject: [PATCH 1/2 v5] iio: accel: yamaha-yas530: Add DT bindings Date: Sat, 12 Dec 2020 13:13:56 +0100 Message-Id: <20201212121357.2762397-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 Cc: Andy Shevchenko Cc: Jonathan Bakker Reviewed-by: Rob Herring Signed-off-by: Linus Walleij --- ChangeLog v4->v5: - Collect Rob's Reviewed-by tag. 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 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,.*":