19 #include <linux/stddef.h>
20 #include <linux/i2c.h>
36 #define TUSB6010_ASYNC_CS 1
37 #define TUSB6010_SYNC_CS 4
38 #define TUSB6010_GPIO_INT 58
39 #define TUSB6010_GPIO_ENABLE 0
40 #define TUSB6010_DMACHAN 0x3f
42 #if defined(CONFIG_USB_MUSB_TUSB6010) || defined(CONFIG_USB_MUSB_TUSB6010_MODULE)
48 static int tusb_set_power(
int state)
83 #ifdef CONFIG_USB_GADGET_MUSB_HDRC
88 .set_power = tusb_set_power,
91 .config = &musb_config,
94 static void __init n8x0_usb_init(
void)
124 static void __init n8x0_usb_init(
void) {}
138 .max_speed_hz = 48000000,
139 .controller_data = &p54spi_mcspi_config,
143 #if defined(CONFIG_MTD_ONENAND_OMAP2) || \
144 defined(CONFIG_MTD_ONENAND_OMAP2_MODULE)
148 .
name =
"bootloader",
179 .parts = onenand_partitions,
186 #if defined(CONFIG_MENELAUS) && \
187 (defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE))
200 #define N8X0_SLOT_SWITCH_GPIO 96
201 #define N810_EMMC_VSD_GPIO 23
202 #define N810_EMMC_VIO_GPIO 9
204 static int slot1_cover_open;
205 static int slot2_cover_open;
206 static struct device *mmc_device;
208 static int n8x0_mmc_switch_slot(
struct device *
dev,
int slot)
210 #ifdef CONFIG_MMC_DEBUG
211 dev_dbg(dev,
"Choose slot %d\n", slot + 1);
217 static int n8x0_mmc_set_power_menelaus(
struct device *
dev,
int slot,
218 int power_on,
int vdd)
222 #ifdef CONFIG_MMC_DEBUG
223 dev_dbg(dev,
"Set slot %d power: %s (vdd %d)\n", slot + 1,
224 power_on ?
"on" :
"off", vdd);
286 static void n810_set_power_emmc(
struct device *dev,
289 dev_dbg(dev,
"Set EMMC power %s\n", power_on ?
"on" :
"off");
304 static int n8x0_mmc_set_power(
struct device *dev,
int slot,
int power_on,
307 if (machine_is_nokia_n800() || slot == 0)
308 return n8x0_mmc_set_power_menelaus(dev, slot, power_on, vdd);
310 n810_set_power_emmc(dev, power_on);
315 static int n8x0_mmc_set_bus_mode(
struct device *dev,
int slot,
int bus_mode)
319 dev_dbg(dev,
"Set slot %d bus mode %s\n", slot + 1,
321 BUG_ON(slot != 0 && slot != 1);
333 if (r != 0 && printk_ratelimit())
334 dev_err(dev,
"MMC: unable to set bus mode for slot %d\n",
339 static int n8x0_mmc_get_cover_state(
struct device *dev,
int slot)
342 BUG_ON(slot != 1 && slot != 2);
344 return slot1_cover_open;
346 return slot2_cover_open;
349 static void n8x0_mmc_callback(
void *
data,
u8 card_mask)
353 if (machine_is_nokia_n800()) {
355 openp = &slot2_cover_open;
359 openp = &slot1_cover_open;
368 #ifdef CONFIG_MMC_OMAP
371 pr_warn(
"MMC: notify cover event not available\n");
375 static int n8x0_mmc_late_init(
struct device *dev)
386 if (machine_is_nokia_n800())
409 if (machine_is_nokia_n800()) {
411 openp = &slot2_cover_open;
414 openp = &slot1_cover_open;
415 slot2_cover_open = 0;
419 if (r == 0xf || r == (0xf & ~bit))
432 static void n8x0_mmc_shutdown(
struct device *dev)
436 if (machine_is_nokia_n800())
445 static void n8x0_mmc_cleanup(
struct device *dev)
451 if (machine_is_nokia_n810()) {
463 .switch_slot = n8x0_mmc_switch_slot,
464 .init = n8x0_mmc_late_init,
465 .cleanup = n8x0_mmc_cleanup,
466 .shutdown = n8x0_mmc_shutdown,
467 .max_freq = 24000000,
470 .set_power = n8x0_mmc_set_power,
471 .set_bus_mode = n8x0_mmc_set_bus_mode,
472 .get_cover_state = n8x0_mmc_get_cover_state,
478 .set_power = n8x0_mmc_set_power,
479 .set_bus_mode = n8x0_mmc_set_bus_mode,
480 .get_cover_state = n8x0_mmc_get_cover_state,
493 static struct gpio n810_emmc_gpios[] __initdata = {
502 if (machine_is_nokia_n810()) {
503 mmc1_data.
slots[0].name =
"external";
511 mmc1_data.
slots[1].name =
"internal";
512 mmc1_data.
slots[1].ban_openended = 1;
520 if (machine_is_nokia_n810()) {
529 mmc_data[0] = &mmc1_data;
530 omap242x_init_mmc(mmc_data);
539 #ifdef CONFIG_MENELAUS
541 static int n8x0_auto_sleep_regulators(
void)
553 pr_err(
"Could not set regulators to sleep on menelaus: %u\n",
560 static int n8x0_auto_voltage_scale(
void)
566 pr_err(
"Could not set VCORE voltage on menelaus: %u\n", ret);
572 static int n8x0_menelaus_late_init(
struct device *dev)
576 ret = n8x0_auto_voltage_scale();
579 ret = n8x0_auto_sleep_regulators();
586 static int n8x0_menelaus_late_init(
struct device *dev)
593 .late_init = n8x0_menelaus_late_init,
596 static struct i2c_board_info __initdata n8x0_i2c_board_info_1[] __initdata = {
600 .platform_data = &n8x0_menelaus_platform_data,
604 static struct aic3x_pdata n810_aic33_data __initdata = {
608 static struct i2c_board_info n810_i2c_board_info_2[] __initdata = {
611 .platform_data = &n810_aic33_data,
615 #ifdef CONFIG_OMAP_MUX
627 .name =
"uart3_rx_irrx.uart3_rx_irrx",
634 static inline void board_serial_init(
void)
649 bdata.pads = serial2_pads;
656 static inline void board_serial_init(
void)
663 static void __init n8x0_init_machine(
void)
672 if (machine_is_nokia_n810())
683 .atag_offset = 0x100,
689 .init_machine = n8x0_init_machine,
696 .atag_offset = 0x100,
702 .init_machine = n8x0_init_machine,
709 .atag_offset = 0x100,
715 .init_machine = n8x0_init_machine,