From patchwork Thu Nov 3 09:13:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 9410601 X-Patchwork-Delegate: agross@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id AE6C360585 for ; Thu, 3 Nov 2016 09:13:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 933812A959 for ; Thu, 3 Nov 2016 09:13:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 881552A953; Thu, 3 Nov 2016 09:13:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F219A2A948 for ; Thu, 3 Nov 2016 09:13:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755009AbcKCJN2 (ORCPT ); Thu, 3 Nov 2016 05:13:28 -0400 Received: from mail-lf0-f49.google.com ([209.85.215.49]:33516 "EHLO mail-lf0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756821AbcKCJN1 (ORCPT ); Thu, 3 Nov 2016 05:13:27 -0400 Received: by mail-lf0-f49.google.com with SMTP id c13so32510056lfg.0 for ; Thu, 03 Nov 2016 02:13:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=uADQG1jP9+cQ7PMbJQlBz8b9U6Dk69QElhZLNQW9Xjc=; b=OgqLd2cRrfyc6vnaHmC9dvQZdOMOXt84bSwsIW2cjmBXwqUnywieP0o8QuUJ3mfWBK U1b8jjrRl/YTIDoVQWcpqUQBqBkk2kDi6sQAZzHZkh/9lUijJ9C0mXsPdlVVPRGNtyza KvoU8QK1Nn+zyje8scyDjbn+Zj2cwdLouOnQ4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=uADQG1jP9+cQ7PMbJQlBz8b9U6Dk69QElhZLNQW9Xjc=; b=KKijhMvucaHjA9kIsVQWOoMil8xlIXPfFKVXU31OJw/HfV7uuxdxaE1PlHESZ1wmsN jrgsvqKG6PtNVzqxbN/ehS8GdGHMGXYlesArgF+Xy/DamytaHMa8flGbkiMm3xK/f0Ls if4O8zQPWDg1k7cqhKtRNvbtQyfOJv/eE+XQkmbD+nb1YsfdqvoigQ0gHAzzhYAceEGG KZrJ1pKTroxWsgojaZ7yPT3tx79hoZyLUP3wiYP86PZw6IvPJpXlJbZf84o+81v4Omuu FD7q6QGLpHSl6/GCx2WBWCqvxtioA0+yuv0k4JXJsoWJ/4IRkxkWQm60L6fBG0IfiLjq 3hvw== X-Gm-Message-State: ABUngveShEDEoeAk3gMx5eHDMm8yuTe+VPHzL4ynkudnwRGZWPCvuLBBX97yPf36DpfJ0kQq X-Received: by 10.25.67.2 with SMTP id q2mr5009872lfa.22.1478164405452; Thu, 03 Nov 2016 02:13:25 -0700 (PDT) Received: from linuslaptop.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id 89sm1221976lja.42.2016.11.03.02.13.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Nov 2016 02:13:24 -0700 (PDT) From: Linus Walleij To: linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Andy Gross , Bjorn Andersson Cc: Stephen Boyd , David Brown , Linus Walleij Subject: [PATCH 3/3] ARM: dts: Add gyro and accel to APQ8060 Dragonboard Date: Thu, 3 Nov 2016 10:13:10 +0100 Message-Id: <1478164390-21613-3-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1478164390-21613-1-git-send-email-linus.walleij@linaro.org> References: <1478164390-21613-1-git-send-email-linus.walleij@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This adds the MPU-3050 gyroscope and the KXSD9 accelerometer to the Qualcomm APQ8060 Dragonboard. The KXSD9 is mounted beyond the MPU-3050 and appear as a subdevice beyond it. We set up the required GPIO and interrupt lines to make the devices work. Signed-off-by: Linus Walleij Acked-by: Bjorn Andersson --- ChangeLog v2->v3: - Move the interrupt to the pm8058 alias to reflect the two patches properly specifying the PMIC as interrupt parent. ChangeLog v1->v2: - Use the new I2C mux gate bindings from Peter Rosin (merged to the I2C subsystem) --- arch/arm/boot/dts/qcom-apq8060-dragonboard.dts | 53 ++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/arch/arm/boot/dts/qcom-apq8060-dragonboard.dts b/arch/arm/boot/dts/qcom-apq8060-dragonboard.dts index ea660ffa03ea..c1b99c9cb318 100644 --- a/arch/arm/boot/dts/qcom-apq8060-dragonboard.dts +++ b/arch/arm/boot/dts/qcom-apq8060-dragonboard.dts @@ -220,6 +220,14 @@ function = "ebi2"; }; }; + + /* Interrupt line for the KXSD9 accelerometer */ + dragon_kxsd9_gpios: kxsd9 { + irq { + pins = "gpio57"; /* IRQ line */ + bias-pull-up; + }; + }; }; qcom,ssbi@500000 { @@ -272,6 +280,15 @@ power-source = ; }; }; + dragon_mpu3050_gpios: mpu3050-gpios { + pinconf { + pins = "gpio17"; + function = "normal"; + input-enable; + bias-disable; + power-source = ; + }; + }; dragon_sdcc3_gpios: sdcc3-gpios { pinconf { pins = "gpio22"; @@ -389,6 +406,42 @@ vddd-supply = <&pm8058_lvs0>; // 1.8V vdda-supply = <&pm8058_l14>; // 2.85V }; + mpu3050@68 { + compatible = "invensense,mpu3050"; + reg = <0x68>; + /* + * GPIO17 has interrupt 208 on the + * PM8058, it is pulled high by a 10k + * resistor to VLOGIC so needs to be + * active low/falling edge. + */ + interrupt-parent = <&pm8058>; + interrupts = <208 IRQ_TYPE_EDGE_FALLING>; + pinctrl-names = "default"; + pinctrl-0 = <&dragon_mpu3050_gpios>; + vlogic-supply = <&pm8058_lvs0>; // 1.8V + vdd-supply = <&pm8058_l14>; // 2.85V + + /* + * The MPU-3050 acts as a hub for the + * accelerometer. + */ + i2c-gate { + #address-cells = <1>; + #size-cells = <0>; + + kxsd9@18 { + compatible = "kionix,kxsd9"; + reg = <0x18>; + interrupt-parent = <&tlmm>; + interrupts = <57 IRQ_TYPE_EDGE_FALLING>; + pinctrl-names = "default"; + pinctrl-0 = <&dragon_kxsd9_gpios>; + iovdd-supply = <&pm8058_lvs0>; // 1.8V + vdd-supply = <&pm8058_l14>; // 2.85V + }; + }; + }; }; };