summaryrefslogtreecommitdiffstats
path: root/target/linux/omap24xx/patches-2.6.37/300-nokia-board.patch
diff options
context:
space:
mode:
Diffstat (limited to 'target/linux/omap24xx/patches-2.6.37/300-nokia-board.patch')
-rw-r--r--target/linux/omap24xx/patches-2.6.37/300-nokia-board.patch857
1 files changed, 0 insertions, 857 deletions
diff --git a/target/linux/omap24xx/patches-2.6.37/300-nokia-board.patch b/target/linux/omap24xx/patches-2.6.37/300-nokia-board.patch
deleted file mode 100644
index d8c48b83b9..0000000000
--- a/target/linux/omap24xx/patches-2.6.37/300-nokia-board.patch
+++ /dev/null
@@ -1,857 +0,0 @@
----
- arch/arm/mach-omap1/board-nokia770.c | 16 +
- arch/arm/mach-omap2/Kconfig | 10
- arch/arm/mach-omap2/Makefile | 2
- arch/arm/mach-omap2/board-n8x0-lcd.c | 127 ++++++++++++
- arch/arm/mach-omap2/board-n8x0-usb.c | 175 +++++++++++++++++
- arch/arm/mach-omap2/board-n8x0.c | 355 ++++++++++++++++++++++++++---------
- arch/arm/mach-omap2/control.c | 2
- arch/arm/mach-omap2/serial.c | 8
- 8 files changed, 608 insertions(+), 87 deletions(-)
-
-Index: linux-2.6.37/arch/arm/mach-omap1/board-nokia770.c
-===================================================================
---- linux-2.6.37.orig/arch/arm/mach-omap1/board-nokia770.c 2011-01-05 01:50:19.000000000 +0100
-+++ linux-2.6.37/arch/arm/mach-omap1/board-nokia770.c 2011-01-28 18:09:59.378233620 +0100
-@@ -36,6 +36,7 @@
- #include <plat/lcd_mipid.h>
- #include <plat/mmc.h>
- #include <plat/clock.h>
-+#include <plat/cbus.h>
-
- #define ADS7846_PENDOWN_GPIO 15
-
-@@ -95,8 +96,23 @@
- .resource = nokia770_kp_resources,
- };
-
-+static struct cbus_host_platform_data nokia770_cbus_data = {
-+ .clk_gpio = OMAP_MPUIO(11),
-+ .dat_gpio = OMAP_MPUIO(10),
-+ .sel_gpio = OMAP_MPUIO(9),
-+};
-+
-+static struct platform_device nokia770_cbus_device = {
-+ .name = "cbus",
-+ .id = -1,
-+ .dev = {
-+ .platform_data = &nokia770_cbus_data,
-+ },
-+};
-+
- static struct platform_device *nokia770_devices[] __initdata = {
- &nokia770_kp_device,
-+ &nokia770_cbus_device,
- };
-
- static void mipid_shutdown(struct mipid_platform_data *pdata)
-Index: linux-2.6.37/arch/arm/mach-omap2/board-n8x0.c
-===================================================================
---- linux-2.6.37.orig/arch/arm/mach-omap2/board-n8x0.c 2011-01-05 01:50:19.000000000 +0100
-+++ linux-2.6.37/arch/arm/mach-omap2/board-n8x0.c 2011-01-28 18:13:25.864968462 +0100
-@@ -18,9 +18,13 @@
- #include <linux/io.h>
- #include <linux/stddef.h>
- #include <linux/i2c.h>
-+#include <linux/platform_device.h>
- #include <linux/spi/spi.h>
-+#include <linux/spi/tsc2005.h>
-+#include <linux/input.h>
- #include <linux/usb/musb.h>
- #include <sound/tlv320aic3x.h>
-+#include <linux/i2c/lm8323.h>
-
- #include <asm/mach/arch.h>
- #include <asm/mach-types.h>
-@@ -33,6 +37,8 @@
- #include <plat/onenand.h>
- #include <plat/mmc.h>
- #include <plat/serial.h>
-+#include <plat/cbus.h>
-+#include <plat/gpio-switch.h>
-
- #include "mux.h"
-
-@@ -40,109 +46,162 @@
- static int slot2_cover_open;
- static struct device *mmc_device;
-
--#define TUSB6010_ASYNC_CS 1
--#define TUSB6010_SYNC_CS 4
--#define TUSB6010_GPIO_INT 58
--#define TUSB6010_GPIO_ENABLE 0
--#define TUSB6010_DMACHAN 0x3f
-+#define RX51_TSC2005_RESET_GPIO 94
-+#define RX51_TSC2005_IRQ_GPIO 106
-+#define OMAP_TAG_NOKIA_BT 0x4e01
-+
-+/* We map the FN key as LALT to workaround an X keycode problem.
-+ * The XKB map needs to be adjusted to support this. */
-+#define MAP_FN_AS_LEFTALT
-+
-+static s16 rx44_keymap[LM8323_KEYMAP_SIZE] = {
-+ [0x01] = KEY_Q,
-+ [0x02] = KEY_K,
-+ [0x03] = KEY_O,
-+ [0x04] = KEY_P,
-+ [0x05] = KEY_BACKSPACE,
-+ [0x06] = KEY_A,
-+ [0x07] = KEY_S,
-+ [0x08] = KEY_D,
-+ [0x09] = KEY_F,
-+ [0x0a] = KEY_G,
-+ [0x0b] = KEY_H,
-+ [0x0c] = KEY_J,
-+
-+ [0x11] = KEY_W,
-+ [0x12] = KEY_F4,
-+ [0x13] = KEY_L,
-+ [0x14] = KEY_APOSTROPHE,
-+ [0x16] = KEY_Z,
-+ [0x17] = KEY_X,
-+ [0x18] = KEY_C,
-+ [0x19] = KEY_V,
-+ [0x1a] = KEY_B,
-+ [0x1b] = KEY_N,
-+ [0x1c] = KEY_LEFTSHIFT, /* Actually, this is both shift keys */
-+ [0x1f] = KEY_F7,
-+
-+ [0x21] = KEY_E,
-+ [0x22] = KEY_SEMICOLON,
-+ [0x23] = KEY_MINUS,
-+ [0x24] = KEY_EQUAL,
-+#ifdef MAP_FN_AS_LEFTALT
-+ [0x2b] = KEY_LEFTALT,
-+#else
-+ [0x2b] = KEY_FN,
-+#endif
-+ [0x2c] = KEY_M,
-+ [0x2f] = KEY_F8,
-
--#if defined(CONFIG_USB_TUSB6010) || \
-- defined(CONFIG_USB_TUSB6010_MODULE)
--/*
-- * Enable or disable power to TUSB6010. When enabling, turn on 3.3 V and
-- * 1.5 V voltage regulators of PM companion chip. Companion chip will then
-- * provide then PGOOD signal to TUSB6010 which will release it from reset.
-- */
--static int tusb_set_power(int state)
--{
-- int i, retval = 0;
-+ [0x31] = KEY_R,
-+ [0x32] = KEY_RIGHTCTRL,
-+ [0x34] = KEY_SPACE,
-+ [0x35] = KEY_COMMA,
-+ [0x37] = KEY_UP,
-+ [0x3c] = KEY_COMPOSE,
-+ [0x3f] = KEY_F6,
-+
-+ [0x41] = KEY_T,
-+ [0x44] = KEY_DOT,
-+ [0x46] = KEY_RIGHT,
-+ [0x4f] = KEY_F5,
-+ [0x51] = KEY_Y,
-+ [0x53] = KEY_DOWN,
-+ [0x55] = KEY_ENTER,
-+ [0x5f] = KEY_ESC,
-+
-+ [0x61] = KEY_U,
-+ [0x64] = KEY_LEFT,
-+
-+ [0x71] = KEY_I,
-+ [0x75] = KEY_KPENTER,
-+};
-+
-+static struct lm8323_platform_data lm8323_pdata = {
-+ .repeat = 0, /* Repeat is handled in userspace for now. */
-+ .keymap = rx44_keymap,
-+ .size_x = 8,
-+ .size_y = 12,
-+ .debounce_time = 12,
-+ .active_time = 500,
-+
-+ .name = "Internal keyboard",
-+ .pwm_names[0] = "n810::keyboard",
-+ .pwm_names[1] = "n810::cover",
-+ //.pwm1_name = "n810::keyboard",
-+ //.pwm2_name = "n810::cover",
-+};
-+
-+struct omap_bluetooth_config {
-+ u8 chip_type;
-+ u8 bt_wakeup_gpio;
-+ u8 host_wakeup_gpio;
-+ u8 reset_gpio;
-+ u8 bt_uart;
-+ u8 bd_addr[6];
-+ u8 bt_sysclk;
-+};
-+
-+static struct platform_device n8x0_bt_device = {
-+ .name = "hci_h4p",
-+ .id = -1,
-+ .num_resources = 0,
-+};
-+
-+void __init n8x0_bt_init(void)
-+{
-+ const struct omap_bluetooth_config *bt_config;
-+
-+ bt_config = (void *) omap_get_config(OMAP_TAG_NOKIA_BT,
-+ struct omap_bluetooth_config);
-+ n8x0_bt_device.dev.platform_data = (void *) bt_config;
-+ if (platform_device_register(&n8x0_bt_device) < 0)
-+ BUG();
-+}
-
-- if (state) {
-- gpio_set_value(TUSB6010_GPIO_ENABLE, 1);
-- msleep(1);
-+static struct omap2_mcspi_device_config mipid_mcspi_config = {
-+ .turbo_mode = 0,
-+ .single_channel = 1,
-+};
-
-- /* Wait until TUSB6010 pulls INT pin down */
-- i = 100;
-- while (i && gpio_get_value(TUSB6010_GPIO_INT)) {
-- msleep(1);
-- i--;
-- }
-+static int slot1_cover_open;
-+static int slot2_cover_open;
-+static struct device *mmc_device;
-
-- if (!i) {
-- printk(KERN_ERR "tusb: powerup failed\n");
-- retval = -ENODEV;
-- }
-- } else {
-- gpio_set_value(TUSB6010_GPIO_ENABLE, 0);
-- msleep(10);
-- }
-
-- return retval;
--}
--
--static struct musb_hdrc_config musb_config = {
-- .multipoint = 1,
-- .dyn_fifo = 1,
-- .num_eps = 16,
-- .ram_bits = 12,
-+static struct omap2_mcspi_device_config p54spi_mcspi_config = {
-+ .turbo_mode = 0,
-+ .single_channel = 1,
- };
-
--static struct musb_hdrc_platform_data tusb_data = {
--#if defined(CONFIG_USB_MUSB_OTG)
-- .mode = MUSB_OTG,
--#elif defined(CONFIG_USB_MUSB_PERIPHERAL)
-- .mode = MUSB_PERIPHERAL,
--#else /* defined(CONFIG_USB_MUSB_HOST) */
-- .mode = MUSB_HOST,
-+#ifdef CONFIG_MACH_NOKIA_N8X0_LCD
-+extern struct mipid_platform_data n8x0_mipid_platform_data;
- #endif
-- .set_power = tusb_set_power,
-- .min_power = 25, /* x2 = 50 mA drawn from VBUS as peripheral */
-- .power = 100, /* Max 100 mA VBUS for host mode */
-- .config = &musb_config,
--};
-
--static void __init n8x0_usb_init(void)
-+#ifdef CONFIG_TOUCHSCREEN_TSC2005
-+static struct tsc2005_platform_data tsc2005_config;
-+static void rx51_tsc2005_set_reset(bool enable)
- {
-- int ret = 0;
-- static char announce[] __initdata = KERN_INFO "TUSB 6010\n";
--
-- /* PM companion chip power control pin */
-- ret = gpio_request(TUSB6010_GPIO_ENABLE, "TUSB6010 enable");
-- if (ret != 0) {
-- printk(KERN_ERR "Could not get TUSB power GPIO%i\n",
-- TUSB6010_GPIO_ENABLE);
-- return;
-- }
-- gpio_direction_output(TUSB6010_GPIO_ENABLE, 0);
--
-- tusb_set_power(0);
--
-- ret = tusb6010_setup_interface(&tusb_data, TUSB6010_REFCLK_19, 2,
-- TUSB6010_ASYNC_CS, TUSB6010_SYNC_CS,
-- TUSB6010_GPIO_INT, TUSB6010_DMACHAN);
-- if (ret != 0)
-- goto err;
--
-- printk(announce);
--
-- return;
--
--err:
-- gpio_free(TUSB6010_GPIO_ENABLE);
-+ gpio_set_value(RX51_TSC2005_RESET_GPIO, enable);
- }
--#else
--
--static void __init n8x0_usb_init(void) {}
--
--#endif /*CONFIG_USB_TUSB6010 */
--
-
--static struct omap2_mcspi_device_config p54spi_mcspi_config = {
-+static struct omap2_mcspi_device_config tsc2005_mcspi_config = {
- .turbo_mode = 0,
- .single_channel = 1,
- };
-+#endif
-
- static struct spi_board_info n800_spi_board_info[] __initdata = {
-+#ifdef CONFIG_MACH_NOKIA_N8X0_LCD
-+ {
-+ .modalias = "lcd_mipid",
-+ .bus_num = 1,
-+ .chip_select = 1,
-+ .max_speed_hz = 4000000,
-+ .controller_data= &mipid_mcspi_config,
-+ .platform_data = &n8x0_mipid_platform_data,
-+ },
-+#endif
- {
- .modalias = "p54spi",
- .bus_num = 2,
-@@ -150,8 +209,60 @@
- .max_speed_hz = 48000000,
- .controller_data = &p54spi_mcspi_config,
- },
-+ {
-+ .modalias = "tsc2005",
-+ .bus_num = 1,
-+ .chip_select = 0,
-+ .irq = OMAP_GPIO_IRQ(RX51_TSC2005_IRQ_GPIO),
-+ .max_speed_hz = 6000000,
-+ .controller_data = &tsc2005_mcspi_config,
-+ .platform_data = &tsc2005_config,
-+ },
- };
-
-+static void __init tsc2005_set_config(void)
-+{
-+ const struct omap_lcd_config *conf;
-+
-+ conf = omap_get_config(OMAP_TAG_LCD, struct omap_lcd_config);
-+ if (conf != NULL) {
-+#ifdef CONFIG_TOUCHSCREEN_TSC2005
-+ if (strcmp(conf->panel_name, "lph8923") == 0) {
-+ tsc2005_config.ts_x_plate_ohm = 180;
-+ tsc2005_config.ts_hw_avg = 0;
-+ tsc2005_config.ts_ignore_last = 0;
-+ tsc2005_config.ts_touch_pressure = 1500;
-+ tsc2005_config.ts_stab_time = 100;
-+ tsc2005_config.ts_pressure_max = 2048;
-+ tsc2005_config.ts_pressure_fudge = 2;
-+ tsc2005_config.ts_x_max = 4096;
-+ tsc2005_config.ts_x_fudge = 4;
-+ tsc2005_config.ts_y_max = 4096;
-+ tsc2005_config.ts_y_fudge = 7;
-+ tsc2005_config.set_reset = rx51_tsc2005_set_reset;
-+ } else if (strcmp(conf->panel_name, "ls041y3") == 0) {
-+ tsc2005_config.ts_x_plate_ohm = 280;
-+ tsc2005_config.ts_hw_avg = 0;
-+ tsc2005_config.ts_ignore_last = 0;
-+ tsc2005_config.ts_touch_pressure = 1500;
-+ tsc2005_config.ts_stab_time = 1000;
-+ tsc2005_config.ts_pressure_max = 2048;
-+ tsc2005_config.ts_pressure_fudge = 2;
-+ tsc2005_config.ts_x_max = 4096;
-+ tsc2005_config.ts_x_fudge = 4;
-+ tsc2005_config.ts_y_max = 4096;
-+ tsc2005_config.ts_y_fudge = 7;
-+ tsc2005_config.set_reset = rx51_tsc2005_set_reset;
-+ } else {
-+ printk(KERN_ERR "Unknown panel type, set default "
-+ "touchscreen configuration\n");
-+ tsc2005_config.ts_x_plate_ohm = 200;
-+ tsc2005_config.ts_stab_time = 100;
-+ }
-+#endif
-+ }
-+}
-+
- #if defined(CONFIG_MTD_ONENAND_OMAP2) || \
- defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
-
-@@ -184,6 +295,20 @@
- },
- };
-
-+static struct cbus_host_platform_data n8x0_cbus_data = {
-+ .clk_gpio = 66,
-+ .dat_gpio = 65,
-+ .sel_gpio = 64,
-+};
-+
-+static struct platform_device n8x0_cbus_device = {
-+ .name = "cbus",
-+ .id = -1,
-+ .dev = {
-+ .platform_data = &n8x0_cbus_data,
-+ },
-+};
-+
- static struct omap_onenand_platform_data board_onenand_data = {
- .cs = 0,
- .gpio_irq = 26,
-@@ -626,6 +751,11 @@
-
- static struct i2c_board_info n810_i2c_board_info_2[] __initdata = {
- {
-+ I2C_BOARD_INFO("lm8323", 0x45),
-+ .irq = OMAP_GPIO_IRQ(109),
-+ .platform_data = &lm8323_pdata,
-+ },
-+ {
- I2C_BOARD_INFO("tlv320aic3x", 0x18),
- .platform_data = &n810_aic33_data,
- },
-@@ -657,10 +787,62 @@
- #define board_mux NULL
- #endif
-
-+#ifdef CONFIG_MACH_NOKIA_N8X0_LCD
-+extern void n8x0_mipid_init(void);
-+extern void n8x0_blizzard_init(void);
-+#else
-+#define n8x0_mipid_init() 0
-+#define n8x0_blizzard_init() 0
-+#endif
-+
-+extern void n8x0_usb_init(void);
-+
-+static struct omap_gpio_switch n8x0_gpio_switches[] __initdata = {
-+ {
-+ .name = "headphone",
-+ .gpio = -1,
-+ .debounce_rising = 200,
-+ .debounce_falling = 200,
-+ }, {
-+ .name = "cam_act",
-+ .gpio = -1,
-+ .debounce_rising = 200,
-+ .debounce_falling = 200,
-+ }, {
-+ .name = "cam_turn",
-+ .gpio = -1,
-+ .debounce_rising = 100,
-+ .debounce_falling = 100,
-+ }, {
-+ .name = "slide",
-+ .gpio = -1,
-+ .debounce_rising = 200,
-+ .debounce_falling = 200,
-+ }, {
-+ .name = "kb_lock",
-+ .gpio = -1,
-+ .debounce_rising = 200,
-+ .debounce_falling = 200,
-+ },
-+};
-+
-+static void __init n8x0_gpio_switches_init(void)
-+{
-+ /* The switches are actually registered through ATAG mechanism.
-+ * This just updates the parameters (thus .gpio is -1) */
-+ omap_register_gpio_switches(n8x0_gpio_switches,
-+ ARRAY_SIZE(n8x0_gpio_switches));
-+}
-+
- static void __init n8x0_init_machine(void)
- {
- omap2420_mux_init(board_mux, OMAP_PACKAGE_ZAC);
-+ n8x0_gpio_switches_init();
-+ platform_device_register(&n8x0_cbus_device);
-+ n8x0_bt_init();
-+
- /* FIXME: add n810 spi devices */
-+ tsc2005_set_config();
- spi_register_board_info(n800_spi_board_info,
- ARRAY_SIZE(n800_spi_board_info));
- omap_register_i2c_bus(1, 400, n8x0_i2c_board_info_1,
-@@ -671,6 +853,10 @@
- ARRAY_SIZE(n810_i2c_board_info_2));
-
- omap_serial_init();
-+
-+ n8x0_mipid_init();
-+ n8x0_blizzard_init();
-+
- n8x0_onenand_init();
- n8x0_mmc_init();
- n8x0_usb_init();
-Index: linux-2.6.37/arch/arm/mach-omap2/board-n8x0-lcd.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.37/arch/arm/mach-omap2/board-n8x0-lcd.c 2011-01-28 18:10:37.941647955 +0100
-@@ -0,0 +1,127 @@
-+/*
-+ * linux/arch/arm/mach-omap2/board-n8x0.c
-+ *
-+ * Copyright (C) 2005-2009 Nokia Corporation
-+ * Author: Juha Yrjola <juha.yrjola@nokia.com>
-+ *
-+ * Modified from mach-omap2/board-generic.c
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License version 2 as
-+ * published by the Free Software Foundation.
-+ */
-+
-+#include <linux/clk.h>
-+#include <linux/delay.h>
-+#include <linux/gpio.h>
-+#include <linux/omapfb.h>
-+
-+#include <plat/lcd_mipid.h>
-+#include <plat/blizzard.h>
-+
-+#include <../drivers/cbus/tahvo.h>
-+
-+#define N8X0_BLIZZARD_POWERDOWN_GPIO 15
-+
-+// MIPID LCD Panel
-+
-+static void mipid_shutdown(struct mipid_platform_data *pdata)
-+{
-+ if (pdata->nreset_gpio != -1) {
-+ pr_info("shutdown LCD\n");
-+ gpio_set_value(pdata->nreset_gpio, 0);
-+ msleep(120);
-+ }
-+}
-+
-+struct mipid_platform_data n8x0_mipid_platform_data = {
-+ .shutdown = mipid_shutdown,
-+};
-+
-+void __init n8x0_mipid_init(void)
-+{
-+ const struct omap_lcd_config *conf;
-+
-+ conf = omap_get_config(OMAP_TAG_LCD, struct omap_lcd_config);
-+ if (conf != NULL) {
-+ n8x0_mipid_platform_data.nreset_gpio = conf->nreset_gpio;
-+ n8x0_mipid_platform_data.data_lines = conf->data_lines;
-+ printk(KERN_INFO "N8x0 MIPID config loaded");
-+ }
-+ else
-+ printk(KERN_INFO "N8x0 MIPID config not provided");
-+}
-+
-+
-+// Epson Blizzard LCD Controller
-+
-+static struct {
-+ struct clk *sys_ck;
-+} blizzard;
-+
-+static int blizzard_get_clocks(void)
-+{
-+ blizzard.sys_ck = clk_get(0, "osc_ck");
-+ if (IS_ERR(blizzard.sys_ck)) {
-+ printk(KERN_ERR "can't get Blizzard clock\n");
-+ return PTR_ERR(blizzard.sys_ck);
-+ }
-+ return 0;
-+}
-+
-+static unsigned long blizzard_get_clock_rate(struct device *dev)
-+{
-+ return clk_get_rate(blizzard.sys_ck);
-+}
-+
-+static void blizzard_enable_clocks(int enable)
-+{
-+ if (enable)
-+ clk_enable(blizzard.sys_ck);
-+ else
-+ clk_disable(blizzard.sys_ck);
-+}
-+
-+static void blizzard_power_up(struct device *dev)
-+{
-+ /* Vcore to 1.475V */
-+ tahvo_set_clear_reg_bits(0x07, 0, 0xf);
-+ msleep(10);
-+
-+ blizzard_enable_clocks(1);
-+ gpio_set_value(N8X0_BLIZZARD_POWERDOWN_GPIO, 1);
-+}
-+
-+static void blizzard_power_down(struct device *dev)
-+{
-+ gpio_set_value(N8X0_BLIZZARD_POWERDOWN_GPIO, 0);
-+ blizzard_enable_clocks(0);
-+
-+ /* Vcore to 1.005V */
-+ tahvo_set_clear_reg_bits(0x07, 0xf, 0);
-+}
-+
-+static struct blizzard_platform_data n8x0_blizzard_data = {
-+ .power_up = blizzard_power_up,
-+ .power_down = blizzard_power_down,
-+ .get_clock_rate = blizzard_get_clock_rate,
-+ .te_connected = 1,
-+};
-+
-+void __init n8x0_blizzard_init(void)
-+{
-+ int r;
-+
-+ r = gpio_request(N8X0_BLIZZARD_POWERDOWN_GPIO, "Blizzard pd");
-+ if (r < 0)
-+ {
-+ printk(KERN_ERR "Can't get N8x0 Blizzard powerdown GPIO %d\n", N8X0_BLIZZARD_POWERDOWN_GPIO);
-+ return;
-+ }
-+ gpio_direction_output(N8X0_BLIZZARD_POWERDOWN_GPIO, 1);
-+
-+ blizzard_get_clocks();
-+ omapfb_set_ctrl_platform_data(&n8x0_blizzard_data);
-+
-+ printk(KERN_INFO "N8x0 Blizzard initialized");
-+}
-Index: linux-2.6.37/arch/arm/mach-omap2/board-n8x0-usb.c
-===================================================================
---- /dev/null 1970-01-01 00:00:00.000000000 +0000
-+++ linux-2.6.37/arch/arm/mach-omap2/board-n8x0-usb.c 2011-01-28 18:09:59.378233620 +0100
-@@ -0,0 +1,175 @@
-+/*
-+ * linux/arch/arm/mach-omap2/board-n8x0-usb.c
-+ *
-+ * Copyright (C) 2006 Nokia Corporation
-+ * Author: Juha Yrjola
-+ *
-+ * This program is free software; you can redistribute it and/or modify
-+ * it under the terms of the GNU General Public License version 2 as
-+ * published by the Free Software Foundation.
-+ */
-+
-+#include <linux/types.h>
-+#include <linux/delay.h>
-+#include <linux/platform_device.h>
-+#include <linux/clk.h>
-+#include <linux/err.h>
-+#include <linux/gpio.h>
-+#include <linux/usb/musb.h>
-+
-+#include <plat/gpmc.h>
-+
-+#define TUSB_ASYNC_CS 1
-+#define TUSB_SYNC_CS 4
-+#define GPIO_TUSB_INT 58
-+#define GPIO_TUSB_ENABLE 0
-+
-+static int tusb_set_power(int state);
-+static int tusb_set_clock(struct clk *osc_ck, int state);
-+
-+#if defined(CONFIG_USB_MUSB_OTG)
-+# define BOARD_MODE MUSB_OTG
-+#elif defined(CONFIG_USB_MUSB_PERIPHERAL)
-+# define BOARD_MODE MUSB_PERIPHERAL
-+#else /* defined(CONFIG_USB_MUSB_HOST) */
-+# define BOARD_MODE MUSB_HOST
-+#endif
-+
-+static struct musb_hdrc_eps_bits musb_eps[] = {
-+ { "ep1_tx", 5, },
-+ { "ep1_rx", 5, },
-+ { "ep2_tx", 5, },
-+ { "ep2_rx", 5, },
-+ { "ep3_tx", 3, },
-+ { "ep3_rx", 3, },
-+ { "ep4_tx", 3, },
-+ { "ep4_rx", 3, },
-+ { "ep5_tx", 2, },
-+ { "ep5_rx", 2, },
-+ { "ep6_tx", 2, },
-+ { "ep6_rx", 2, },
-+ { "ep7_tx", 2, },
-+ { "ep7_rx", 2, },
-+ { "ep8_tx", 2, },
-+ { "ep8_rx", 2, },
-+ { "ep9_tx", 2, },
-+ { "ep9_rx", 2, },
-+ { "ep10_tx", 2, },
-+ { "ep10_rx", 2, },
-+ { "ep11_tx", 2, },
-+ { "ep11_rx", 2, },
-+ { "ep12_tx", 2, },
-+ { "ep12_rx", 2, },
-+ { "ep13_tx", 2, },
-+ { "ep13_rx", 2, },
-+ { "ep14_tx", 2, },
-+ { "ep14_rx", 2, },
-+ { "ep15_tx", 2, },
-+ { "ep15_rx", 2, },
-+};
-+
-+static struct musb_hdrc_config musb_config = {
-+ .multipoint = 1,
-+ .dyn_fifo = 1,
-+ .soft_con = 1,
-+ .dma = 1,
-+ .num_eps = 16,
-+ .dma_channels = 7,
-+ .ram_bits = 12,
-+ .eps_bits = musb_eps,
-+};
-+
-+static struct musb_hdrc_platform_data tusb_data = {
-+ .mode = BOARD_MODE,
-+ .set_power = tusb_set_power,
-+ .set_clock = tusb_set_clock,
-+ .min_power = 25, /* x2 = 50 mA drawn from VBUS as peripheral */
-+ .power = 100, /* Max 100 mA VBUS for host mode */
-+ .clock = "osc_ck",
-+ .config = &musb_config,
-+};
-+
-+/*
-+ * Enable or disable power to TUSB6010. When enabling, turn on 3.3 V and
-+ * 1.5 V voltage regulators of PM companion chip. Companion chip will then
-+ * provide then PGOOD signal to TUSB6010 which will release it from reset.
-+ */
-+static int tusb_set_power(int state)
-+{
-+ int i, retval = 0;
-+
-+ if (state) {
-+ gpio_set_value(GPIO_TUSB_ENABLE, 1);
-+ msleep(1);
-+
-+ /* Wait until TUSB6010 pulls INT pin down */
-+ i = 100;
-+ while (i && gpio_get_value(GPIO_TUSB_INT)) {
-+ msleep(1);
-+ i--;
-+ }
-+
-+ if (!i) {
-+ printk(KERN_ERR "tusb: powerup failed\n");
-+ retval = -ENODEV;
-+ }
-+ } else {
-+ gpio_set_value(GPIO_TUSB_ENABLE, 0);
-+ msleep(10);
-+ }
-+
-+ return retval;
-+}
-+
-+static int osc_ck_on;
-+
-+static int tusb_set_clock(struct clk *osc_ck, int state)
-+{
-+ if (state) {
-+ if (osc_ck_on > 0)
-+ return -ENODEV;
-+
-+ //omap2_block_sleep();
-+ clk_enable(osc_ck);
-+ osc_ck_on = 1;
-+ } else {
-+ if (osc_ck_on == 0)
-+ return -ENODEV;
-+
-+ clk_disable(osc_ck);
-+ osc_ck_on = 0;
-+ //omap2_allow_sleep();
-+ }
-+
-+ return 0;
-+}
-+
-+void __init n8x0_usb_init(void)
-+{
-+ int ret = 0;
-+ static char announce[] __initdata = KERN_INFO "TUSB 6010\n";
-+
-+ /* PM companion chip power control pin */
-+ ret = gpio_request(GPIO_TUSB_ENABLE, "TUSB6010 enable");
-+ if (ret != 0) {
-+ printk(KERN_ERR "Could not get TUSB power GPIO%i\n",
-+ GPIO_TUSB_ENABLE);
-+ return;
-+ }
-+ gpio_direction_output(GPIO_TUSB_ENABLE, 0);
-+
-+ tusb_set_power(0);
-+
-+ ret = tusb6010_setup_interface(&tusb_data, TUSB6010_REFCLK_19, 2,
-+ TUSB_ASYNC_CS, TUSB_SYNC_CS,
-+ GPIO_TUSB_INT, 0x3f);
-+ if (ret != 0)
-+ goto err;
-+
-+ printk(announce);
-+
-+ return;
-+
-+err:
-+ gpio_free(GPIO_TUSB_ENABLE);
-+}
-Index: linux-2.6.37/arch/arm/mach-omap2/control.c
-===================================================================
---- linux-2.6.37.orig/arch/arm/mach-omap2/control.c 2011-01-05 01:50:19.000000000 +0100
-+++ linux-2.6.37/arch/arm/mach-omap2/control.c 2011-01-28 18:09:59.378233620 +0100
-@@ -172,6 +172,7 @@
- return __raw_readw(OMAP_CTRL_REGADDR(offset));
- }
-
-+EXPORT_SYMBOL_GPL(omap_ctrl_readl);
- u32 omap_ctrl_readl(u16 offset)
- {
- return __raw_readl(OMAP_CTRL_REGADDR(offset));
-@@ -187,6 +188,7 @@
- __raw_writew(val, OMAP_CTRL_REGADDR(offset));
- }
-
-+EXPORT_SYMBOL_GPL(omap_ctrl_writel);
- void omap_ctrl_writel(u32 val, u16 offset)
- {
- __raw_writel(val, OMAP_CTRL_REGADDR(offset));
-Index: linux-2.6.37/arch/arm/mach-omap2/Kconfig
-===================================================================
---- linux-2.6.37.orig/arch/arm/mach-omap2/Kconfig 2011-01-05 01:50:19.000000000 +0100
-+++ linux-2.6.37/arch/arm/mach-omap2/Kconfig 2011-01-28 18:09:59.378233620 +0100
-@@ -210,6 +210,16 @@
- select MACH_NOKIA_N810
- select MACH_NOKIA_N810_WIMAX
-
-+config MACH_NOKIA_N8X0_LCD
-+ bool
-+ depends on MACH_NOKIA_N8X0 && FB_OMAP_LCDC_BLIZZARD && FB_OMAP_LCD_MIPID
-+ default y
-+
-+config MACH_NOKIA_N8X0_USB
-+ bool
-+ depends on MACH_NOKIA_N8X0 && MACH_OMAP2_TUSB6010
-+ default y
-+
- config MACH_NOKIA_RX51
- bool "Nokia RX-51 board"
- depends on ARCH_OMAP3
-Index: linux-2.6.37/arch/arm/mach-omap2/Makefile
-===================================================================
---- linux-2.6.37.orig/arch/arm/mach-omap2/Makefile 2011-01-05 01:50:19.000000000 +0100
-+++ linux-2.6.37/arch/arm/mach-omap2/Makefile 2011-01-28 18:09:59.378233620 +0100
-@@ -139,6 +139,8 @@
- hsmmc.o \
- board-flash.o
- obj-$(CONFIG_MACH_NOKIA_N8X0) += board-n8x0.o
-+obj-$(CONFIG_MACH_NOKIA_N8X0_LCD) += board-n8x0-lcd.o
-+obj-$(CONFIG_MACH_NOKIA_N8X0_USB) += board-n8x0-usb.o
- obj-$(CONFIG_MACH_NOKIA_RX51) += board-rx51.o \
- board-rx51-sdram.o \
- board-rx51-peripherals.o \