From patchwork Mon Nov 7 08:44:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 81012 Delivered-To: patch@linaro.org Received: by 10.140.97.165 with SMTP id m34csp902024qge; Mon, 7 Nov 2016 00:44:56 -0800 (PST) X-Received: by 10.98.74.18 with SMTP id x18mr11487255pfa.58.1478508296863; Mon, 07 Nov 2016 00:44:56 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q125si29950577pfb.256.2016.11.07.00.44.56; Mon, 07 Nov 2016 00:44:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752286AbcKGIo4 (ORCPT + 9 others); Mon, 7 Nov 2016 03:44:56 -0500 Received: from mail-lf0-f46.google.com ([209.85.215.46]:33303 "EHLO mail-lf0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750981AbcKGIoz (ORCPT ); Mon, 7 Nov 2016 03:44:55 -0500 Received: by mail-lf0-f46.google.com with SMTP id c13so107350263lfg.0 for ; Mon, 07 Nov 2016 00:44:54 -0800 (PST) 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=kPcXDxr41+sEo1IC2h48nODUU7gklUg5Ri1bZzC8ogk=; b=R6kRfNdcwQM+e/asFjY6Gnd/iq/91oaplzrlFo3mpCOMGc9DrYbsqnMETRWWylNrb2 DNTpy3hGnGsa7kePodmknZUHR++u6CtT1fdkhzp2dCfaUIVDjiKLRxtsQlGednv8XTBQ hTAWnYOH0Z3igpbNi8UgV5GRgDU5v1+aQ3ZuU= 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=kPcXDxr41+sEo1IC2h48nODUU7gklUg5Ri1bZzC8ogk=; b=lbjKr9O0uFksTrVL1XjGjJL4ew3MocAQi2sX6Q/aQWT3UdZp85+mkOGVYpLrt5m1Vp srYWsglvwdqsG+fRBAPZbaOgPUEbKhujb8Z0VEjEJWR09HbVeqcNW1ahadBHM/8eSQTm jdNmp2fUGcx05YSmHGpQGms5LJ2KbL2RxJEpzXIxWpnIGQ3pFn9usfAhTd88gihA7QBp skeTokNnkTTw+Yv7Ro59R0HgN0pAtjGxy/UyVUjwhEs8jfIc2Vcs3JRt4TvQjP8LiLL2 CCUulu9m/Yq3YU1RJYV6hME9QbgDmVGdgtrTNSKDPtkzG4b8qUAuFNt2eDxmCUTE3HYx 6g0A== X-Gm-Message-State: ABUngvdN0vZfRD39hYJYFHZk3qBLHqGcJnMf0YbS2P2tzFElPHdskzSx5XfId/GXn5Mq0H8X X-Received: by 10.25.161.137 with SMTP id k131mr2881735lfe.90.1478508293734; Mon, 07 Nov 2016 00:44:53 -0800 (PST) Received: from linuslaptop.ideon.se ([85.235.10.227]) by smtp.gmail.com with ESMTPSA id u126sm4864313lja.12.2016.11.07.00.44.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Nov 2016 00:44:53 -0800 (PST) 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 v4] ARM: dts: Add gyro and accel to APQ8060 Dragonboard Date: Mon, 7 Nov 2016 09:44:44 +0100 Message-Id: <1478508284-10847-3-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1478508284-10847-1-git-send-email-linus.walleij@linaro.org> References: <1478508284-10847-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 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 --- ChangeLog v3->v4: - Use interrupts-extended - Add Bjorn's ACK. 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 | 52 ++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) -- 2.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Acked-by: Bjorn Andersson diff --git a/arch/arm/boot/dts/qcom-apq8060-dragonboard.dts b/arch/arm/boot/dts/qcom-apq8060-dragonboard.dts index ea660ffa03ea..39d9e6ddefed 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,41 @@ 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. + */ + interrupts-extended = <&pm8058 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 + }; + }; + }; }; };