From patchwork Mon Jun 23 20:49:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 4404471 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 73F4A9F26E for ; Mon, 23 Jun 2014 20:50:08 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5A3D720225 for ; Mon, 23 Jun 2014 20:50:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 286B3201FA for ; Mon, 23 Jun 2014 20:50:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756665AbaFWUuF (ORCPT ); Mon, 23 Jun 2014 16:50:05 -0400 Received: from mail-pb0-f74.google.com ([209.85.160.74]:62704 "EHLO mail-pb0-f74.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756648AbaFWUuB (ORCPT ); Mon, 23 Jun 2014 16:50:01 -0400 Received: by mail-pb0-f74.google.com with SMTP id rq2so830373pbb.1 for ; Mon, 23 Jun 2014 13:50:00 -0700 (PDT) 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=7Hxhq5KEGa0H3NLTT9Lp8FUtUmyISi4FRMU5k3U8lIg=; b=hGuV5zRq9xP9H467mwAodji6Fjj0dvrlpVAsPVIRelJe6covnPGx/VjjJB5d9XCUW0 bSw/SDHImIYlGU2Ck/7sPpfqrOjU5U9Uu1uKCmyIoPfrWcJJBkcwh91Dc0/r6YzfIWG4 ktDmGrQPPhD6OuBaSwKTo6p6LDKb5nsRiimqzaFmhd2tp4R7+MGHRv4g2UzNBvc8+6yT mZWmezTwsfgQqaJBRS3kqmilw26pvPgIilJnMkNtEdt5JsZCVl7dT+KN5JuLsA7+UjFq A0Kb80r3D9ZI6IUpbfnPRE/DPXSN6vCzr3O3sQ6P68ZdkBRY5yCVyt4qc7H80vMTjKZq Poiw== X-Gm-Message-State: ALoCoQlo1W79vBE6BWVynDZkiUr2OH2hMGxfku3fEheLbbEa9M5Qa1yKpBIt+zsjWx07H9v+7BLg X-Received: by 10.66.169.79 with SMTP id ac15mr735502pac.48.1403556600711; Mon, 23 Jun 2014 13:50:00 -0700 (PDT) Received: from corp2gmr1-1.hot.corp.google.com (corp2gmr1-1.hot.corp.google.com [172.24.189.92]) by gmr-mx.google.com with ESMTPS id j5si1394276yhi.1.2014.06.23.13.50.00 for (version=TLSv1.1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 23 Jun 2014 13:50:00 -0700 (PDT) Received: from tictac.mtv.corp.google.com (tictac.mtv.corp.google.com [172.22.72.141]) by corp2gmr1-1.hot.corp.google.com (Postfix) with ESMTP id 74D8E31C6A1; Mon, 23 Jun 2014 13:50:00 -0700 (PDT) Received: by tictac.mtv.corp.google.com (Postfix, from userid 121310) id 15EF780799; Mon, 23 Jun 2014 13:49:59 -0700 (PDT) From: Doug Anderson To: Kukjin Kim Cc: Tomasz Figa , sjg@chromium.org, olof@lixom.net, javier.martinez@collabora.co.uk, ch.naveen@samsung.com, swarren@wwwdotorg.org, khilman@linaro.org, ajaynumb@gmail.com, rahul.sharma@samsung.com, tushar.b@samsung.com, Doug Anderson , ben-linux@fluff.org, robh+dt@kernel.org, pawel.moll@arm.com, mark.rutland@arm.com, ijc+devicetree@hellion.org.uk, galak@codeaurora.org, linux@arm.linux.org.uk, linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] ARM: dts: Add cros_ec to exynos5420-peach-pit and exynos5800-peach-pi Date: Mon, 23 Jun 2014 13:49:36 -0700 Message-Id: <1403556576-8038-1-git-send-email-dianders@chromium.org> X-Mailer: git-send-email 2.0.0.526.g5318336 Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This adds cros_ec to exynos5420-peach-pit and exynos5800-peach-pi, including: * The keyboard * The i2c tunnel * The tps65090 under the i2c tunnel * The battery under the i2c tunnel To add extra motivation, it should be noted that tps65090 is one of the things needed to get display-related FETs turned on for pit and pi. Note that this relies on a few outstanding changes: * Needs (spi: s3c64xx: fix broken "cs_gpios" usage in the driver) and (spi: s3c64xx: for DT platofrms always get the chipselect info from DT node) to work properly and match the documented bindings. See and Signed-off-by: Doug Anderson Tested-by: Javier Martinez Canillas Tested-by: Tushar Behera --- Changes in v2: - Now just one patch since mfd patch landed. - Rebased to ToT linux-next arch/arm/boot/dts/exynos5420-peach-pit.dts | 145 +++++++++++++++++++++++++++++ arch/arm/boot/dts/exynos5800-peach-pi.dts | 145 +++++++++++++++++++++++++++++ 2 files changed, 290 insertions(+) diff --git a/arch/arm/boot/dts/exynos5420-peach-pit.dts b/arch/arm/boot/dts/exynos5420-peach-pit.dts index 7649982..581f385 100644 --- a/arch/arm/boot/dts/exynos5420-peach-pit.dts +++ b/arch/arm/boot/dts/exynos5420-peach-pit.dts @@ -25,6 +25,11 @@ "google,pit", "google,peach","samsung,exynos5420", "samsung,exynos5"; + aliases { + /* Assign 20 so we don't get confused w/ builtin ones */ + i2c20 = "/spi@12d40000/cros-ec@0/i2c-tunnel"; + }; + backlight { compatible = "pwm-backlight"; pwms = <&pwm 0 1000000 0>; @@ -87,6 +92,13 @@ pinctrl-0 = <&usb301_vbus_en>; enable-active-high; }; + + vbat: fixed-regulator { + compatible = "regulator-fixed"; + regulator-name = "vbat-supply"; + regulator-boot-on; + regulator-always-on; + }; }; &dp { @@ -231,6 +243,20 @@ samsung,pin-drv = <0>; }; + ec_irq: ec-irq { + samsung,pins = "gpx1-5"; + samsung,pin-function = <0>; + samsung,pin-pud = <0>; + samsung,pin-drv = <0>; + }; + + tps65090_irq: tps65090-irq { + samsung,pins = "gpx2-5"; + samsung,pin-function = <0>; + samsung,pin-pud = <0>; + samsung,pin-drv = <0>; + }; + dp_hpd_gpio: dp_hpd_gpio { samsung,pins = "gpx2-6"; samsung,pin-function = <0>; @@ -247,6 +273,19 @@ }; &pinctrl_3 { + /* Drive SPI lines at x2 for better integrity */ + spi2-bus { + samsung,pin-drv = <2>; + }; + + /* Drive SPI chip select at x2 for better integrity */ + ec_spi_cs: ec-spi-cs { + samsung,pins = "gpb1-2"; + samsung,pin-function = <1>; + samsung,pin-pud = <0>; + samsung,pin-drv = <2>; + }; + usb300_vbus_en: usb300-vbus-en { samsung,pins = "gph0-0"; samsung,pin-function = <1>; @@ -266,6 +305,111 @@ status = "okay"; }; +&spi_2 { + status = "okay"; + num-cs = <1>; + samsung,spi-src-clk = <0>; + cs-gpios = <&gpb1 2 0>; + + cros_ec: cros-ec@0 { + compatible = "google,cros-ec-spi"; + interrupt-parent = <&gpx1>; + interrupts = <5 0>; + pinctrl-names = "default"; + pinctrl-0 = <&ec_spi_cs &ec_irq>; + reg = <0>; + spi-max-frequency = <3125000>; + + controller-data { + samsung,spi-feedback-delay = <1>; + }; + + i2c-tunnel { + compatible = "google,cros-ec-i2c-tunnel"; + #address-cells = <1>; + #size-cells = <0>; + google,remote-bus = <0>; + + battery: sbs-battery@b { + compatible = "sbs,sbs-battery"; + reg = <0xb>; + sbs,poll-retry-count = <1>; + sbs,i2c-retry-count = <2>; + }; + + power-regulator@48 { + compatible = "ti,tps65090"; + reg = <0x48>; + + /* + * Config irq to disable internal pulls + * even though we run in polling mode. + */ + pinctrl-names = "default"; + pinctrl-0 = <&tps65090_irq>; + + vsys1-supply = <&vbat>; + vsys2-supply = <&vbat>; + vsys3-supply = <&vbat>; + infet1-supply = <&vbat>; + infet2-supply = <&vbat>; + infet3-supply = <&vbat>; + infet4-supply = <&vbat>; + infet5-supply = <&vbat>; + infet6-supply = <&vbat>; + infet7-supply = <&vbat>; + vsys-l1-supply = <&vbat>; + vsys-l2-supply = <&vbat>; + + regulators { + dcdc1 { + ti,enable-ext-control; + }; + dcdc2 { + ti,enable-ext-control; + }; + dcdc3 { + ti,enable-ext-control; + }; + fet1 { + regulator-name = "vcd_led"; + }; + tps65090_fet2: fet2 { + regulator-name = "video_mid"; + regulator-always-on; + }; + fet3 { + regulator-name = "wwan_r"; + regulator-always-on; + }; + fet4 { + regulator-name = "sdcard"; + regulator-always-on; + }; + fet5 { + regulator-name = "camout"; + }; + fet6 { + regulator-name = "lcd_vdd"; + }; + tps65090_fet7: fet7 { + regulator-name = "video_mid_1a"; + regulator-always-on; + }; + ldo1 { + }; + ldo2 { + }; + }; + + charger { + compatible = "ti,tps65090-charger"; + }; + }; + }; + }; +}; + &uart_3 { status = "okay"; }; @@ -287,3 +431,4 @@ timeout-sec = <32>; }; +#include "cros-ec-keyboard.dtsi" diff --git a/arch/arm/boot/dts/exynos5800-peach-pi.dts b/arch/arm/boot/dts/exynos5800-peach-pi.dts index 2c2c137..b2dc290 100644 --- a/arch/arm/boot/dts/exynos5800-peach-pi.dts +++ b/arch/arm/boot/dts/exynos5800-peach-pi.dts @@ -23,6 +23,11 @@ "google,pi", "google,peach", "samsung,exynos5800", "samsung,exynos5"; + aliases { + /* Assign 20 so we don't get confused w/ builtin ones */ + i2c20 = "/spi@12d40000/cros-ec@0/i2c-tunnel"; + }; + backlight { compatible = "pwm-backlight"; pwms = <&pwm 0 1000000 0>; @@ -85,6 +90,13 @@ pinctrl-0 = <&usb301_vbus_en>; enable-active-high; }; + + vbat: fixed-regulator { + compatible = "regulator-fixed"; + regulator-name = "vbat-supply"; + regulator-boot-on; + regulator-always-on; + }; }; &dp { @@ -229,6 +241,20 @@ samsung,pin-drv = <0>; }; + ec_irq: ec-irq { + samsung,pins = "gpx1-5"; + samsung,pin-function = <0>; + samsung,pin-pud = <0>; + samsung,pin-drv = <0>; + }; + + tps65090_irq: tps65090-irq { + samsung,pins = "gpx2-5"; + samsung,pin-function = <0>; + samsung,pin-pud = <0>; + samsung,pin-drv = <0>; + }; + dp_hpd_gpio: dp_hpd_gpio { samsung,pins = "gpx2-6"; samsung,pin-function = <0>; @@ -245,6 +271,19 @@ }; &pinctrl_3 { + /* Drive SPI lines at x2 for better integrity */ + spi2-bus { + samsung,pin-drv = <2>; + }; + + /* Drive SPI chip select at x2 for better integrity */ + ec_spi_cs: ec-spi-cs { + samsung,pins = "gpb1-2"; + samsung,pin-function = <1>; + samsung,pin-pud = <0>; + samsung,pin-drv = <2>; + }; + usb300_vbus_en: usb300-vbus-en { samsung,pins = "gph0-0"; samsung,pin-function = <1>; @@ -264,6 +303,111 @@ status = "okay"; }; +&spi_2 { + status = "okay"; + num-cs = <1>; + samsung,spi-src-clk = <0>; + cs-gpios = <&gpb1 2 0>; + + cros_ec: cros-ec@0 { + compatible = "google,cros-ec-spi"; + interrupt-parent = <&gpx1>; + interrupts = <5 0>; + pinctrl-names = "default"; + pinctrl-0 = <&ec_spi_cs &ec_irq>; + reg = <0>; + spi-max-frequency = <3125000>; + + controller-data { + samsung,spi-feedback-delay = <1>; + }; + + i2c-tunnel { + compatible = "google,cros-ec-i2c-tunnel"; + #address-cells = <1>; + #size-cells = <0>; + google,remote-bus = <0>; + + battery: sbs-battery@b { + compatible = "sbs,sbs-battery"; + reg = <0xb>; + sbs,poll-retry-count = <1>; + sbs,i2c-retry-count = <2>; + }; + + power-regulator@48 { + compatible = "ti,tps65090"; + reg = <0x48>; + + /* + * Config irq to disable internal pulls + * even though we run in polling mode. + */ + pinctrl-names = "default"; + pinctrl-0 = <&tps65090_irq>; + + vsys1-supply = <&vbat>; + vsys2-supply = <&vbat>; + vsys3-supply = <&vbat>; + infet1-supply = <&vbat>; + infet2-supply = <&vbat>; + infet3-supply = <&vbat>; + infet4-supply = <&vbat>; + infet5-supply = <&vbat>; + infet6-supply = <&vbat>; + infet7-supply = <&vbat>; + vsys-l1-supply = <&vbat>; + vsys-l2-supply = <&vbat>; + + regulators { + dcdc1 { + ti,enable-ext-control; + }; + dcdc2 { + ti,enable-ext-control; + }; + dcdc3 { + ti,enable-ext-control; + }; + fet1 { + regulator-name = "vcd_led"; + }; + tps65090_fet2: fet2 { + regulator-name = "video_mid"; + regulator-always-on; + }; + fet3 { + regulator-name = "wwan_r"; + regulator-always-on; + }; + fet4 { + regulator-name = "sdcard"; + regulator-always-on; + }; + fet5 { + regulator-name = "camout"; + }; + fet6 { + regulator-name = "lcd_vdd"; + }; + tps65090_fet7: fet7 { + regulator-name = "video_mid_1a"; + regulator-always-on; + }; + ldo1 { + }; + ldo2 { + }; + }; + + charger { + compatible = "ti,tps65090-charger"; + }; + }; + }; + }; +}; + &uart_3 { status = "okay"; }; @@ -285,3 +429,4 @@ timeout-sec = <32>; }; +#include "cros-ec-keyboard.dtsi"