[ARM] tegra: Add w1 support to stingray board files
authorRebecca Schultz Zavin <rebecca@android.com>
Mon, 21 Jun 2010 22:39:58 +0000 (15:39 -0700)
committerColin Cross <ccross@android.com>
Wed, 6 Oct 2010 23:33:10 +0000 (16:33 -0700)
Change-Id: I422d70ce5875dda11a29a5d30fa39c37776ca9e4
Signed-off-by: Andrei Warkentin <andreiw@motorola.com>
arch/arm/mach-tegra/board-stingray-pinmux.c
arch/arm/mach-tegra/board-stingray.c

index 7c8c1c6be5eeabc23ff5feb3c0231fd28375fe12..fcea39e8496aee06f03e9497a9675c30f8d0118b 100644 (file)
@@ -102,7 +102,7 @@ static __initdata struct tegra_pingroup_config stingray_pinmux[] = {
        {TEGRA_PINGROUP_LVP0,  TEGRA_MUX_DISPLAYA,      TEGRA_PUPD_PULL_UP,   TEGRA_TRI_NORMAL},
        {TEGRA_PINGROUP_LVP1,  TEGRA_MUX_DISPLAYA,      TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_NORMAL},
        {TEGRA_PINGROUP_LVS,   TEGRA_MUX_DISPLAYA,      TEGRA_PUPD_PULL_UP,   TEGRA_TRI_NORMAL},
-       {TEGRA_PINGROUP_OWC,   TEGRA_MUX_OWR,           TEGRA_PUPD_PULL_UP,   TEGRA_TRI_TRISTATE},
+       {TEGRA_PINGROUP_OWC,   TEGRA_MUX_OWR,           TEGRA_PUPD_PULL_UP,   TEGRA_TRI_NORMAL},
        {TEGRA_PINGROUP_PMC,   TEGRA_MUX_PWR_ON,        TEGRA_PUPD_NORMAL,    TEGRA_TRI_NORMAL},
        {TEGRA_PINGROUP_PTA,   TEGRA_MUX_RSVD4,         TEGRA_PUPD_NORMAL,    TEGRA_TRI_NORMAL},
        {TEGRA_PINGROUP_RM,    TEGRA_MUX_RSVD2,         TEGRA_PUPD_NORMAL,    TEGRA_TRI_NORMAL},
@@ -126,7 +126,7 @@ static __initdata struct tegra_pingroup_config stingray_pinmux[] = {
        {TEGRA_PINGROUP_SPIH,  TEGRA_MUX_SPI2,          TEGRA_PUPD_NORMAL,    TEGRA_TRI_NORMAL},
        {TEGRA_PINGROUP_UAA,   TEGRA_MUX_ULPI,          TEGRA_PUPD_PULL_UP,   TEGRA_TRI_TRISTATE},
        {TEGRA_PINGROUP_UAB,   TEGRA_MUX_ULPI,          TEGRA_PUPD_PULL_UP,   TEGRA_TRI_TRISTATE},
-       {TEGRA_PINGROUP_UAC,   TEGRA_MUX_OWR,           TEGRA_PUPD_NORMAL,    TEGRA_TRI_TRISTATE},
+       {TEGRA_PINGROUP_UAC,   TEGRA_MUX_RSVD2,         TEGRA_PUPD_NORMAL,    TEGRA_TRI_NORMAL},
        {TEGRA_PINGROUP_UAD,   TEGRA_MUX_IRDA,          TEGRA_PUPD_PULL_UP,   TEGRA_TRI_NORMAL},
        {TEGRA_PINGROUP_UCA,   TEGRA_MUX_UARTC,         TEGRA_PUPD_PULL_UP,   TEGRA_TRI_NORMAL},
        {TEGRA_PINGROUP_UCB,   TEGRA_MUX_UARTC,         TEGRA_PUPD_PULL_UP,   TEGRA_TRI_NORMAL},
index c9d44eca83804edf900d7644cb2880b44683123a..3483faa74aa82cc78d4e2c59c326823d2317216a 100644 (file)
@@ -35,6 +35,7 @@
 #include <asm/setup.h>
 
 #include <mach/io.h>
+#include <mach/w1.h>
 #include <mach/iomap.h>
 #include <mach/irqs.h>
 #include <mach/iomap.h>
@@ -317,6 +318,28 @@ static struct platform_device bcm4329_rfkill = {
        .id = -1,
 };
 
+static struct tegra_w1_timings tegra_w1_platform_timings = {
+       .tsu = 0x1,
+       .trelease = 0xf,
+       .trdv = 0xf,
+       .tlow0 = 0x3c,
+       .tlow1 = 0x1,
+       .tslot = 0x77,
+
+       .tpdl = 0x78,
+       .tpdh = 0x1e,
+       .trstl = 0x1df,
+       .trsth = 0x1df,
+
+       .rdsclk = 0x7,
+       .psclk = 0x50,
+};
+
+static struct tegra_w1_platform_data tegra_w1_pdata = {
+       .clk_id = NULL,
+       .timings = &tegra_w1_platform_timings,
+};
+
 static struct platform_device *stingray_devices[] __initdata = {
        &debug_uart,
        &tegra_otg,
@@ -412,6 +435,11 @@ static int __init parse_tag_bdaddr(const struct tag *tag)
 
 __tagtable(ATAG_BDADDR, parse_tag_bdaddr);
 
+static void stingray_w1_init(void)
+{
+       tegra_w1_device.dev.platform_data = &tegra_w1_pdata;
+       platform_device_register(&tegra_w1_device);
+}
 
 static void __init tegra_stingray_fixup(struct machine_desc *desc, struct tag *tags,
                                 char **cmdline, struct meminfo *mi)
@@ -521,6 +549,7 @@ static void __init tegra_stingray_init(void)
        stingray_spi_init();
        stingray_panel_init();
        stingray_sdhci_init();
+       stingray_w1_init();
        stingray_sensors_init();
        stingray_wlan_init();
 }