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: 13013261 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 13F71C43217 for ; Thu, 20 Oct 2022 11:36:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229865AbiJTLgq (ORCPT ); Thu, 20 Oct 2022 07:36:46 -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-Google-Smtp-Source: AMsMyM7pfv+3U0D2awTUfxF/YUO/sMrsauOdaDwhoycBtXutWfHjh5uLFC5DssfiugZvfKGZTMp6KQ== 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: Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org 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>; + }; + };