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: 9410611 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 08D0560585 for ; Thu, 3 Nov 2016 09:15:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E5FF32A953 for ; Thu, 3 Nov 2016 09:15:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DA6242A965; Thu, 3 Nov 2016 09:15:52 +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=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5E4062A953 for ; Thu, 3 Nov 2016 09:15:52 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1c2E6F-0006ch-FG; Thu, 03 Nov 2016 09:14:19 +0000 Received: from mail-lf0-x22b.google.com ([2a00:1450:4010:c07::22b]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1c2E5g-000650-IF for linux-arm-kernel@lists.infradead.org; Thu, 03 Nov 2016 09:13:48 +0000 Received: by mail-lf0-x22b.google.com with SMTP id b14so32490588lfg.2 for ; Thu, 03 Nov 2016 02:13:27 -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=EaliNJshEXd5gBh4lURKa3FHR8dGjlwE+wdOsE6AHqvO0aKsznGD0fOMxqhrD9+Mpb EBHIaY24FA4NY3rLpuflQ9NB56X5gRcXo9LyoOQxHnsd+8kPMq+G408eXVwysuTcwn1e mg248592nQ9M9gin0MZACT3ElxrrBsNu3ep2YwP3lptlo5tCBUDwiriTztuRadSjTIXE khm6iiyGDlKQx8WWRyQqHkUpT7h5Nas9VpqzY3TX+OIgzxKiBTp5Ji6VUI2MHomcudqp 4W3w58lt2QKT8EgUb0NlW55fO/lAKaPJOLoTjKpITDFJKm+TtXejqc+/FINxOgCHYZZl Bzdg== X-Gm-Message-State: ABUngvey7nvE4klEl/ZaCgV/CsSoZAO3ODGalIsP/gzzdTUA0aKmxR96m+6FH+yNN8Kl9MaA 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161103_021345_268038_382CA98D X-CRM114-Status: GOOD ( 15.57 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Brown , Linus Walleij , Stephen Boyd MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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 + }; + }; + }; }; };