Re: [PATCH 2/2] ARM: dts: Add cros_ec to exynos5420-peach-pit and exynos5800-peach-pi

2014-06-17 Thread Javier Martinez Canillas
On 06/13/2014 08:13 PM, Doug Anderson wrote:
 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 cros-ec-keyboard.dtsi in order to compile properly.  See
   (ARM: dts: Create a cros-ec-keyboard fragment) at
   https://patchwork.kernel.org/patch/4297451/.
 * Needs (mfd: cros_ec: spi: Fix end of transfer on devices with no
   spi-msg-delay) from this series to work properly.
 * 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
   https://patchwork.kernel.org/patch/4346701/ and
   https://patchwork.kernel.org/patch/4346711/
 
 Signed-off-by: Doug Anderson diand...@chromium.org
 ---
  arch/arm/boot/dts/exynos5420-peach-pit.dts | 146 
 +
  arch/arm/boot/dts/exynos5800-peach-pi.dts  | 146 
 +
  2 files changed, 292 insertions(+)
 

After applying all the dependencies and this patch, I see that cros-ec-spi
driver is probed and also the keyboard is working on my Peach pit when testing
with: $ evtest /dev/input/event0

Tested-by: Javier Martinez Canillas javier.marti...@collabora.co.uk

Best regards,
Javier
--
To unsubscribe from this list: send the line unsubscribe linux-samsung-soc in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/2] ARM: dts: Add cros_ec to exynos5420-peach-pit and exynos5800-peach-pi

2014-06-13 Thread Doug Anderson
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 cros-ec-keyboard.dtsi in order to compile properly.  See
  (ARM: dts: Create a cros-ec-keyboard fragment) at
  https://patchwork.kernel.org/patch/4297451/.
* Needs (mfd: cros_ec: spi: Fix end of transfer on devices with no
  spi-msg-delay) from this series to work properly.
* 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
  https://patchwork.kernel.org/patch/4346701/ and
  https://patchwork.kernel.org/patch/4346711/

Signed-off-by: Doug Anderson diand...@chromium.org
---
 arch/arm/boot/dts/exynos5420-peach-pit.dts | 146 +
 arch/arm/boot/dts/exynos5800-peach-pi.dts  | 146 +
 2 files changed, 292 insertions(+)

diff --git a/arch/arm/boot/dts/exynos5420-peach-pit.dts 
b/arch/arm/boot/dts/exynos5420-peach-pit.dts
index 1c5b8f9..67b7c32 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@12d4/cros-ec@0/i2c-tunnel;
+   };
+
memory {
reg = 0x2000 0x8000;
};
@@ -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;
+   };
 };
 
 pinctrl_0 {
@@ -111,6 +123,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;
+   };
+
hdmi_hpd_irq: hdmi-hpd-irq {
samsung,pins = gpx3-7;
samsung,pin-function = 0;
@@ -127,6 +153,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;
@@ -189,6 +228,111 @@
};
 };
 
+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;
+