From patchwork Wed Oct 26 09:23:14 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 9396431 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 AB73160231 for ; Wed, 26 Oct 2016 09:23:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6753A2994B for ; Wed, 26 Oct 2016 09:23:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5C0682994F; Wed, 26 Oct 2016 09:23:30 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, 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 3C54E29950 for ; Wed, 26 Oct 2016 09:23:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754001AbcJZJX0 (ORCPT ); Wed, 26 Oct 2016 05:23:26 -0400 Received: from mail-lf0-f45.google.com ([209.85.215.45]:37300 "EHLO mail-lf0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752101AbcJZJXZ (ORCPT ); Wed, 26 Oct 2016 05:23:25 -0400 Received: by mail-lf0-f45.google.com with SMTP id m193so2882530lfm.4 for ; Wed, 26 Oct 2016 02:23:24 -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; bh=f+pEbfxETUmH4W7c+92jxCwTkIEcyKK2ucFXkhhPcs4=; b=IV/+nYnBGho16b7Qf82pkJFgYAkT7ZV+qu5nCCHcLEViTPO9D+l3LuqLAdZBW9/fJq PWwTUwAU9hcR1b6XoInAlStEoGJ65VGHBNvBlCNIiyB4/fvIdllVGplx0HV4Ieg76h/x mq8GD7nRzSdgBBQEcX4Tk58DN95oYed5uHSys= 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; bh=f+pEbfxETUmH4W7c+92jxCwTkIEcyKK2ucFXkhhPcs4=; b=HtfCE7M5OwYjMwcOhBiR6Qkks8mvqejUaIhK+sqZBR4b5euRmgh/sl6MkTV5xElYbL IaoWX1Hj3ksnhMHdu2vi2IiC9xG/QwVZWEVLItpdwFyo5lCGKuF6GdP8mdNeQ5693kO+ oSgOaSu0TIRC1/O24rAkZdOXzEhcOPye7Ke54UKIp6qW1FuVWaZLNbiDXd9gN6XRir6Z 15zosM3uOBPdJDrGER3uuJ0i+fKYwmvZkZVzeeE3HyuD2XIja0XQxF/aPj/gBACQIFUa 2Pgrhel7MsZjDsXtLOGHodTl5Y018LKVVrCmy0NXl3HbfSWh+Hrty/rdhj5rz2h101PA XsuA== X-Gm-Message-State: ABUngvdYP+I6U+g9ux5PyXb703PkC4HwjEAaCr4Ni40Ix5FgQG2Ng2KSVZXjMT2tsakP1Qlg X-Received: by 10.25.159.141 with SMTP id i135mr807050lfe.123.1477473798603; Wed, 26 Oct 2016 02:23:18 -0700 (PDT) Received: from linuslaptop.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id u14sm210035lja.46.2016.10.26.02.23.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Oct 2016 02:23:18 -0700 (PDT) From: Linus Walleij To: linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Andy Gross Cc: Stephen Boyd , Bjorn Andersson , David Brown , Linus Walleij Subject: [PATCH v3] ARM: dts: Add gyro and accel to APQ8060 Dragonboard Date: Wed, 26 Oct 2016 11:23:14 +0200 Message-Id: <1477473794-26030-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.7.4 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: - Should be fine to apply now: all bindings and requirements are merged. 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 6c0038398ef2..1d76b7415f08 100644 --- a/arch/arm/boot/dts/qcom-apq8060-dragonboard.dts +++ b/arch/arm/boot/dts/qcom-apq8060-dragonboard.dts @@ -167,6 +167,14 @@ bias-pull-up; }; }; + + /* Interrupt line for the KXSD9 accelerometer */ + dragon_kxsd9_gpios: kxsd9 { + irq { + pins = "gpio57"; /* IRQ line */ + bias-pull-up; + }; + }; }; qcom,ssbi@500000 { @@ -210,6 +218,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"; @@ -319,6 +336,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_gpio>; + 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 + }; + }; + }; }; };