From patchwork Thu Oct 20 11:36:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 6163 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp56421wrr; Thu, 20 Oct 2022 04:42:33 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6U4p4h50Rthd1uAuEMfaut3cudKVmgAVAz8kvfTv0qjhirHxYYaALuzp+kjx1caNeW7dRl X-Received: by 2002:a17:907:2d1e:b0:78e:2c3b:559f with SMTP id gs30-20020a1709072d1e00b0078e2c3b559fmr10532119ejc.435.1666266153129; Thu, 20 Oct 2022 04:42:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666266153; cv=none; d=google.com; s=arc-20160816; b=IOxkMpLXNkmbhlktzJsLx2EWXCNl1o0pzxZ5bFkN0ANiZJn3Xaw8f1j2WPpZQB96uP R2vff6NeMaGghv/FYZBIl0EXFdBK9rMEP4bObH5saK+waol8UErazAC1ZnRhGX2hcgLO ysvHJj4hR538mnijqBW6mwX5nkqYmYZ8MnqDoYPd9NeGb6JNAtQ6PYrYEqbx9faebHt/ x4Napt4XeBjx2TXVv9KSfdQpVbLGUhvNBRJn08+FCELYetVfd0txN9o/ZDKZ6AZcVVAz e8fAYdBeynLrzLIrGIDFbO3OoTaNEvDCj82+4z6FYYGbWt/wp3KGYrBX1wqM1un376a0 da1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=gZoVF05Q2xZgx3y72bMOuq/IRllwtgg80T41Y5gIALE=; b=BV9SbFHW8xH1m6OrY/DRW+dkd2Dj8IjCuVkxNIUi113F7MmZav/68za9vMrWJaRXe0 qH9diMhdqu+oSsFFmzoXY7gtubFOs/0B95LGlUpBy28aAi/OAe6UYQRF4C9fJkzkA6gD hjgC9KCEiiOkES6U3SwlBxQhP854hMqaQ7pKSE8FSgX0ptOaq8vHkbLDqA6yzB8WwPpT kgures8rbhegl/nfW9j+3WorxQCbhENQn4lVNk+fe8LWMPXp18H+zAFUnEy5YZ5R90zb DwT7y1xgx3Gz8+QAtpEdc1EeAOCUAwc/ltBHyMYkUS+b2XL704mRwLjeaYY1Pl4Xx9hB 7zJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=FWJgVvXq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l13-20020a170906794d00b00781d6cda765si18296310ejo.913.2022.10.20.04.42.07; Thu, 20 Oct 2022 04:42:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=FWJgVvXq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230142AbiJTLgs (ORCPT + 99 others); Thu, 20 Oct 2022 07:36:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231381AbiJTLge (ORCPT ); Thu, 20 Oct 2022 07:36:34 -0400 Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93EE617651C; Thu, 20 Oct 2022 04:36:31 -0700 (PDT) Received: by mail-lj1-x229.google.com with SMTP id i17so24967193lja.3; Thu, 20 Oct 2022 04:36:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=gZoVF05Q2xZgx3y72bMOuq/IRllwtgg80T41Y5gIALE=; b=FWJgVvXqzr0lJCjJx+U29KrVBkJXspt70ojqE/VRcwueis8vNY41xu0FT0AII4rHz9 Ndf5FsIuLdDg1aJGYuuS7bpvhLdgZZDyoLiDI0EP97/6nLz44y6HzS5NjlMuEZnsar8R fnTO2MQTnb+oNH2MD0J9CnTZeNTDLTMEjBJnKCVhC9LOdN5HFoqBarH7na4OOmrs7cQ6 eGBMUg53DwMZ6BWHgoZa+jiOw8Co2Yo585iFVwy0NKidfzWFKdUZg7cI6/x3xROjqgiy Y0y9HwOKcsmzVN0MCIODFirN05i0q67A7zcE2q7a5sPUWzjXmvNbHqbxCoxmUSNb4c0I TwKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=gZoVF05Q2xZgx3y72bMOuq/IRllwtgg80T41Y5gIALE=; b=L2sd2l7NLm+zTs2odaVpMmwqQCfpyS6FalUy494FN23CqYjo9w8q9JwOCXoYYxanbt t50RCm/svUwy7Q4XmxMeYTpIfoDiAfqqojGu+5F6g2X7B/eW8NaCcWrs/DlnyiJ/pvmi Mzk0Zm+s1y+opvq/c0ncZdI/3ZgFyVFukWWx3XD6tzcjSKIjRRbhk4VrdAxkP9ROeBkk W88g4E6oQEe4Q0svZgmY9lTDkDC/jnPyvjR5HCaLNVS87LWeEhoN9GJWd+D786dp0dy0 bDfMH1dO9oy1/tFjt+/lhuYveeSr7REjDRHXPAlak6BEAp7EKtjcOyoDdlgZELiTBpbQ WvGQ== X-Gm-Message-State: ACrzQf0AC0I2SDf0FdaxyprckCOzoGgmD3mt4t3K+uNu/Q0Sar73rskl 5wRShAf10cJd7qafioz6m80zXAh8pKo= X-Received: by 2002:a2e:b989:0:b0:26f:b595:d428 with SMTP id p9-20020a2eb989000000b0026fb595d428mr4529036ljp.169.1666265789012; Thu, 20 Oct 2022 04:36:29 -0700 (PDT) Received: from dc75zzyyyyyyyyyyyyycy-3.rev.dnainternet.fi (dc75zzyyyyyyyyyyyyycy-3.rev.dnainternet.fi. [2001:14ba:16f3:4a00::4]) by smtp.gmail.com with ESMTPSA id 11-20020a05651c128b00b0026fa9e19197sm2874548ljc.36.2022.10.20.04.36.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Oct 2022 04:36:28 -0700 (PDT) Date: Thu, 20 Oct 2022 14:36:23 +0300 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Matti Vaittinen , Andy Shevchenko , Nikita Yushchenko , Dmitry Rokosov , Jagath Jog J , Cosmin Tanislav , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 1/3] dt-bindings: iio: Add KX022A accelerometer Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747206698053342489?= X-GMAIL-MSGID: =?utf-8?q?1747206698053342489?= KX022A is a 3-axis Accelerometer from ROHM/Kionix. The sensor features include variable ODRs, I2C and SPI control, FIFO/LIFO with watermark IRQ, tap/motion detection, wake-up & back-to-sleep events, four acceleration ranges (2, 4, 8 and 16g) and probably some other cool features. Add the basic device tree description for the accelerometer. Only basic accelerometer features are considered as of now - new properties may or may not be needed in the future when rest of the features are supported. Signed-off-by: Matti Vaittinen Reviewed-by: Krzysztof Kozlowski --- v2 => v3 as suggested by Krzysztof: - better check interrupt-names RFCv1 => v2: Based on a review by Krzysztof: - fix a typo from commit message - const compatible - drop unnecessary descriptions/words - io_vdd-supply => io-vdd-supply - fix the binding example indentiation Also, - change my email address - support both INT pins --- .../bindings/iio/accel/kionix,kx022a.yaml | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/accel/kionix,kx022a.yaml diff --git a/Documentation/devicetree/bindings/iio/accel/kionix,kx022a.yaml b/Documentation/devicetree/bindings/iio/accel/kionix,kx022a.yaml new file mode 100644 index 000000000000..986df1a6ff0a --- /dev/null +++ b/Documentation/devicetree/bindings/iio/accel/kionix,kx022a.yaml @@ -0,0 +1,65 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/accel/kionix,kx022a.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: ROHM/Kionix KX022A Accelerometer + +maintainers: + - Matti Vaittinen + +description: | + KX022A is a 3-axis accelerometer supporting +/- 2G, 4G, 8G and 16G ranges, + output data-rates from 0.78Hz to 1600Hz and a hardware-fifo buffering. + KX022A can be accessed either via I2C or SPI. + +properties: + compatible: + const: kionix,kx022a + + reg: + maxItems: 1 + + interrupts: + minItems: 1 + maxItems: 2 + + interrupt-names: + minItems: 1 + items: + - enum: [INT1, INT2] + - const: INT2 + + vdd-supply: true + io-vdd-supply: true + + mount-matrix: + description: | + an optional 3x3 mounting rotation matrix. + +required: + - compatible + - reg + - interrupts + +additionalProperties: false + +examples: + - | + #include + i2c { + #address-cells = <1>; + #size-cells = <0>; + accel@1f { + compatible = "kionix,kx022a"; + reg = <0x1f>; + + interrupt-parent = <&gpio1>; + interrupts = <29 IRQ_TYPE_LEVEL_LOW>; + interrupt-names = "INT1"; + + io-vdd-supply = <&iovdd>; + vdd-supply = <&vdd>; + }; + };