From patchwork Thu Oct 6 14:37:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matti Vaittinen X-Patchwork-Id: 613605 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 888A6C433F5 for ; Thu, 6 Oct 2022 14:37:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231489AbiJFOhv (ORCPT ); Thu, 6 Oct 2022 10:37:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229755AbiJFOht (ORCPT ); Thu, 6 Oct 2022 10:37:49 -0400 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A41B2A7AAB; Thu, 6 Oct 2022 07:37:48 -0700 (PDT) Received: by mail-lf1-x133.google.com with SMTP id b2so3007870lfp.6; Thu, 06 Oct 2022 07:37:48 -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; bh=nSpHlKnMonBGCDJ4nQk2Ue66OCa5K5+vPeWv3/hFJOE=; b=IXpggGVZYtF/+damtbWsP1tHFm88rn7TRHulZROeeO126QYxYrSpVxYfP5Xk0t9vg8 hlxOdp1w85VXaT5Z93hs7p8IuHZDsr5oapeSmWB8p+ZerkI3wgO1Niyqxldqgcdpt1nL 4/fSwClk5SdJsdE9xar3jCf0QhsDbgqknVKjh1y29PQZZb/KjQRUFaTuAflodbSB2n+o SOH4ah8qAUgqmOsLgvkPJfeP8JStelWxG2g80XN/bJg/ynKvV8hdU9Ohn6AlGCuXLsbA FA46pzNKSaMvAzW2F/XJoLcUkZwhQVjNei0xLc9dGp09rdqE83gbG2525zpUSghPKBMV JW3Q== 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; bh=nSpHlKnMonBGCDJ4nQk2Ue66OCa5K5+vPeWv3/hFJOE=; b=H/HwZ4I32zwKUb61chg7Jxm2nbdDgSpTOhzEmFARuldNPSca4GAJ2VorwtnKyJnlJu OrRI25Z36yEMKLqt3x/LJZYCZDkhk5bLCTHg70S4v7AFY9Cu3YIGGV3GHAGdu65sd22a fQjLx0Xx6RpYM6vmPz/QDn6O4ccdSaaR9CNPJge41jIaWoeD7lxGCGJooBj3K2YD1DIp pXkbn+osRgsul/vZt1qFGd4W/mhY20e/rY1qby9gVUKrxy7lQOR1JfDtLbIvI18QhreV g6vvUShz+1nVuJWmO3NkJKnu//7n9clIsnYQ14TbwNulbIBTh4600ZnIXBI/6ED5strK 4+Rg== X-Gm-Message-State: ACrzQf3HRIXh1ibaKdwkMixjq/dkZTW90B/89CcTo6SX7htY1Xg8rL1M xvk/LPZ9DUOpmHveNMoYRhY= X-Google-Smtp-Source: AMsMyM7kX49lKVt1xUXI2pYaAZ5BxYNYmf78+4OvUymQl4C3q2pE9zJ73jw/SIe98bBUePxmcVVEnQ== X-Received: by 2002:a05:6512:32ab:b0:4a2:2e49:94c with SMTP id q11-20020a05651232ab00b004a22e49094cmr97808lfe.351.1665067066826; Thu, 06 Oct 2022 07:37:46 -0700 (PDT) Received: from dc75zzyyyyyyyyyyyyyyt-3.rev.dnainternet.fi (dc75zzyyyyyyyyyyyyyyt-3.rev.dnainternet.fi. [2001:14ba:16f3:4a00::1]) by smtp.gmail.com with ESMTPSA id v11-20020a2ea60b000000b0026c36023a9asm1195007ljp.131.2022.10.06.07.37.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Oct 2022 07:37:45 -0700 (PDT) Date: Thu, 6 Oct 2022 17:37:39 +0300 From: Matti Vaittinen To: Matti Vaittinen , Matti Vaittinen Cc: Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Matti Vaittinen , Andy Shevchenko , Jagath Jog J , Nikita Yushchenko , Cosmin Tanislav , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH v2 3/5] dt-bindings: iio: Add KX022A accelerometer Message-ID: <80fa42040f385eb47f4f3c71b9b02f643a643e38.1665066397.git.mazziesaccount@gmail.com> References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: devicetree@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 --- 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 | 67 +++++++++++++++++++ 1 file changed, 67 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..2919c436e46f --- /dev/null +++ b/Documentation/devicetree/bindings/iio/accel/kionix,kx022a.yaml @@ -0,0 +1,67 @@ +# 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 + maxItems: 2 + items: + enum: + - INT1 + - 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>; + }; + };