},
};
-static struct resource i2c_resource1[] = {
- [0] = {
- .start = INT_I2C,
- .end = INT_I2C,
- .flags = IORESOURCE_IRQ,
- },
- [1] = {
- .start = TEGRA_I2C_BASE,
- .end = TEGRA_I2C_BASE + TEGRA_I2C_SIZE-1,
- .flags = IORESOURCE_MEM,
- },
-};
-
-static struct resource i2c_resource2[] = {
- [0] = {
- .start = INT_I2C2,
- .end = INT_I2C2,
- .flags = IORESOURCE_IRQ,
- },
- [1] = {
- .start = TEGRA_I2C2_BASE,
- .end = TEGRA_I2C2_BASE + TEGRA_I2C2_SIZE-1,
- .flags = IORESOURCE_MEM,
- },
-};
-
-static struct resource i2c_resource3[] = {
- [0] = {
- .start = INT_I2C3,
- .end = INT_I2C3,
- .flags = IORESOURCE_IRQ,
- },
- [1] = {
- .start = TEGRA_I2C3_BASE,
- .end = TEGRA_I2C3_BASE + TEGRA_I2C3_SIZE-1,
- .flags = IORESOURCE_MEM,
- },
-};
-
-static struct resource i2c_resource4[] = {
- [0] = {
- .start = INT_DVC,
- .end = INT_DVC,
- .flags = IORESOURCE_IRQ,
- },
- [1] = {
- .start = TEGRA_DVC_BASE,
- .end = TEGRA_DVC_BASE + TEGRA_DVC_SIZE-1,
- .flags = IORESOURCE_MEM,
- },
-};
-
-static struct platform_device tegra_i2c_device1 = {
- .name = "tegra-i2c",
- .id = 0,
- .resource = i2c_resource1,
- .num_resources = ARRAY_SIZE(i2c_resource1),
- .dev = {
- .platform_data = 0,
- },
-};
-
-static struct platform_device tegra_i2c_device2 = {
- .name = "tegra-i2c",
- .id = 1,
- .resource = i2c_resource2,
- .num_resources = ARRAY_SIZE(i2c_resource2),
- .dev = {
- .platform_data = 0,
- },
-};
-
-static struct platform_device tegra_i2c_device3 = {
- .name = "tegra-i2c",
- .id = 2,
- .resource = i2c_resource3,
- .num_resources = ARRAY_SIZE(i2c_resource3),
- .dev = {
- .platform_data = 0,
- },
-};
-
-static struct platform_device tegra_i2c_device4 = {
- .name = "tegra-i2c",
- .id = 3,
- .resource = i2c_resource4,
- .num_resources = ARRAY_SIZE(i2c_resource4),
- .dev = {
- .platform_data = 0,
- },
-};
-
static int __init olympus_init_i2c(void)
{
- int ret;
-
if (!machine_is_olympus())
return 0;
- ret = platform_device_register(&tegra_i2c_device1);
- ret = platform_device_register(&tegra_i2c_device2);
- ret = platform_device_register(&tegra_i2c_device3);
- ret = platform_device_register(&tegra_i2c_device4);
-
tegra_gpio_enable(OLYMPUS_TOUCH_IRQ_GPIO);
gpio_request(OLYMPUS_TOUCH_IRQ_GPIO, "touch_irq");
gpio_direction_input(OLYMPUS_TOUCH_IRQ_GPIO);
i2c_register_board_info(0, sholes_i2c_bus1_board_info, 1);
i2c_register_board_info(3, olympus_i2c_bus4_board_info, 1);
- if (ret != 0)
- return ret;
return 0;
}
+++ /dev/null
-/*
- * arch/arm/mach-tegra/board-olympus-sdhci.c
- *
- * Copyright (C) 2010 Google, Inc.
- *
- * This software is licensed under the terms of the GNU General Public
- * License version 2, as published by the Free Software Foundation, and
- * may be copied, distributed, and modified under those terms.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- */
-
-#include <linux/resource.h>
-#include <linux/platform_device.h>
-#include <linux/delay.h>
-#include <linux/gpio.h>
-#include <asm/mach-types.h>
-#include <mach/irqs.h>
-#include <mach/iomap.h>
-#include <mach/sdhci.h>
-#include <mach/pinmux.h>
-
-#include "gpio-names.h"
-
-static struct resource sdhci_resource1[] = {
- [0] = {
- .start = INT_SDMMC1,
- .end = INT_SDMMC1,
- .flags = IORESOURCE_IRQ,
- },
- [1] = {
- .start = TEGRA_SDMMC1_BASE,
- .end = TEGRA_SDMMC1_BASE + TEGRA_SDMMC1_SIZE-1,
- .flags = IORESOURCE_MEM,
- },
-};
-
-static struct resource sdhci_resource2[] = {
- [0] = {
- .start = INT_SDMMC2,
- .end = INT_SDMMC2,
- .flags = IORESOURCE_IRQ,
- },
- [1] = {
- .start = TEGRA_SDMMC2_BASE,
- .end = TEGRA_SDMMC2_BASE + TEGRA_SDMMC2_SIZE-1,
- .flags = IORESOURCE_MEM,
- },
-};
-
-static struct resource sdhci_resource3[] = {
- [0] = {
- .start = INT_SDMMC3,
- .end = INT_SDMMC3,
- .flags = IORESOURCE_IRQ,
- },
- [1] = {
- .start = TEGRA_SDMMC3_BASE,
- .end = TEGRA_SDMMC3_BASE + TEGRA_SDMMC3_SIZE-1,
- .flags = IORESOURCE_MEM,
- },
-};
-
-static struct resource sdhci_resource4[] = {
- [0] = {
- .start = INT_SDMMC4,
- .end = INT_SDMMC4,
- .flags = IORESOURCE_IRQ,
- },
- [1] = {
- .start = TEGRA_SDMMC4_BASE,
- .end = TEGRA_SDMMC4_BASE + TEGRA_SDMMC4_SIZE-1,
- .flags = IORESOURCE_MEM,
- },
-};
-
-static struct tegra_sdhci_platform_data tegra_sdhci_platform_data1 = {
- .clk_id = NULL,
- .force_hs = 0,
- .cd_gpio = TEGRA_GPIO_PI5,
- .wp_gpio = TEGRA_GPIO_PH1,
- .power_gpio = TEGRA_GPIO_PT3,
-};
-
-static struct tegra_sdhci_platform_data tegra_sdhci_platform_data2 = {
- .clk_id = NULL,
- .force_hs = 0,
-};
-
-static struct tegra_sdhci_platform_data tegra_sdhci_platform_data3 = {
- .clk_id = NULL,
- .force_hs = 0,
-};
-
-static struct tegra_sdhci_platform_data tegra_sdhci_platform_data4 = {
- .clk_id = NULL,
- .force_hs = 0,
-};
-
-static struct platform_device tegra_sdhci_device1 = {
- .name = "sdhci-tegra",
- .id = 0,
- .resource = sdhci_resource1,
- .num_resources = ARRAY_SIZE(sdhci_resource1),
- .dev = {
- .platform_data = &tegra_sdhci_platform_data1,
- },
-};
-
-static struct platform_device tegra_sdhci_device2 = {
- .name = "sdhci-tegra",
- .id = 1,
- .resource = sdhci_resource2,
- .num_resources = ARRAY_SIZE(sdhci_resource2),
- .dev = {
- .platform_data = &tegra_sdhci_platform_data2,
- },
-};
-
-static struct platform_device tegra_sdhci_device3 = {
- .name = "sdhci-tegra",
- .id = 2,
- .resource = sdhci_resource3,
- .num_resources = ARRAY_SIZE(sdhci_resource3),
- .dev = {
- .platform_data = &tegra_sdhci_platform_data3,
- },
-};
-
-static struct platform_device tegra_sdhci_device4 = {
- .name = "sdhci-tegra",
- .id = 3,
- .resource = sdhci_resource4,
- .num_resources = ARRAY_SIZE(sdhci_resource4),
- .dev = {
- .platform_data = &tegra_sdhci_platform_data4,
- },
-};
-
-static int __init olympus_init_sdhci(void)
-{
- int ret;
-
- if (!machine_is_olympus())
- return 0;
-
- ret = platform_device_register(&tegra_sdhci_device1);
- ret = platform_device_register(&tegra_sdhci_device2);
- ret = platform_device_register(&tegra_sdhci_device3);
- ret = platform_device_register(&tegra_sdhci_device4);
- if (ret != 0)
- return ret;
-
- return 0;
-}
-
-device_initcall(olympus_init_sdhci);
-
#include <mach/iomap.h>
#include <mach/irqs.h>
#include <mach/iomap.h>
+#include <mach/sdhci.h>
+#include <mach/gpio.h>
#include <linux/usb/android_composite.h>
#include "board.h"
#include "board-olympus.h"
#include "gpio-names.h"
+#include "devices.h"
/* NVidia bootloader tags */
#define ATAG_NVIDIA 0x41000801
&hsuart,
};
+static struct tegra_sdhci_platform_data olympus_sdhci_platform_data3 = {
+ .clk_id = NULL,
+ .force_hs = 0,
+};
+
+static struct tegra_sdhci_platform_data olympus_sdhci_platform_data4 = {
+ .clk_id = NULL,
+ .force_hs = 0,
+ .cd_gpio = TEGRA_GPIO_PH2,
+ .wp_gpio = TEGRA_GPIO_PH3,
+ .power_gpio = TEGRA_GPIO_PI6,
+};
+
+
+static void olympus_sdhci_init(void)
+{
+ /* TODO: setup GPIOs for cd, wd, and power */
+ tegra_sdhci_device3.dev.platform_data = &olympus_sdhci_platform_data3;
+ tegra_sdhci_device4.dev.platform_data = &olympus_sdhci_platform_data4;
+
+
+ platform_device_register(&tegra_sdhci_device3);
+ platform_device_register(&tegra_sdhci_device4);
+}
+
+
static void __init tegra_olympus_fixup(struct machine_desc *desc, struct tag *tags,
char **cmdline, struct meminfo *mi)
{
olympus_pinmux_init();
+ olympus_sdhci_init();
+
platform_add_devices(olympus_devices, ARRAY_SIZE(olympus_devices));
}