12 #include <linux/kernel.h>
17 #include <linux/i2c.h>
32 #include <linux/input.h>
48 #include <mach/hardware.h>
50 #include <mach/devices.h>
51 #include <mach/irqs.h>
59 static struct gpio_led snowball_led_array[] = {
62 .default_trigger =
"heartbeat",
68 .leds = snowball_led_array,
75 .platform_data = &snowball_led_data,
80 .supply_name =
"EN-3V3",
82 .microvolts = 3300000,
85 .startup_delay = 5000,
89 .name =
"reg-fixed-voltage",
92 .platform_data = &snowball_gpio_en_3v3_data,
114 .config_reg = {0x00, 0x1E, 0x80, 0x01,
137 .debounce_interval = 50,
146 .debounce_interval = 50,
155 .debounce_interval = 50,
164 .debounce_interval = 50,
173 .debounce_interval = 50,
179 .buttons = snowball_key_array,
187 .platform_data = &snowball_key_data,
198 static struct resource sbnet_res[] = {
200 .name =
"smsc911x-memory",
201 .start = (0x5000 << 16),
202 .
end = (0x5000 << 16) + 0xffff,
215 .resource = sbnet_res,
217 .platform_data = &snowball_sbnet_cfg,
227 .gpio = &ab8500_gpio_pdata,
228 .codec = &ab8500_codec_pdata,
244 static void mop500_tc35892_init(
struct tc3589x *
tc3589x,
unsigned int base)
249 parent = tc3589x->
dev;
256 .setup = mop500_tc35892_init,
261 .gpio = &mop500_tc35892_gpio_data,
284 .label =
"lp5521_pri",
285 .led_config = &lp5521_pri_led[0],
309 .label =
"lp5521_sec",
310 .led_config = &lp5521_sec_led[0],
319 .platform_data = &mop500_tc35892_data,
324 .platform_data = &mop500_tps61052_data,
328 #define NUM_PRE_V60_I2C0_DEVICES 1
334 .platform_data = &lp5521_pri_data,
339 .platform_data = &lp5521_sec_data,
347 static void __init mop500_i2c_init(
struct device *parent)
357 .desc =
"SFH7741 Proximity Sensor",
366 static int mop500_prox_activate(
struct device *
dev);
367 static void mop500_prox_deactivate(
struct device *
dev);
370 .buttons = mop500_gpio_keys,
372 .enable = mop500_prox_activate,
373 .disable = mop500_prox_deactivate,
380 .platform_data = &mop500_gpio_keys_data,
384 static int mop500_prox_activate(
struct device *
dev)
388 if (IS_ERR(prox_regulator)) {
391 return PTR_ERR(prox_regulator);
397 static void mop500_prox_deactivate(
struct device *dev)
438 .mem_to_engine = &u8500_hash_dma_cfg_tx,
444 &mop500_gpio_keys_device,
447 #ifdef CONFIG_STE_DMA40
469 #ifdef CONFIG_STE_DMA40
472 .dma_rx_param = &ssp0_dma_cfg_rx,
473 .dma_tx_param = &ssp0_dma_cfg_tx,
483 static void __init mop500_spi_init(
struct device *parent)
488 #ifdef CONFIG_STE_DMA40
545 #ifdef CONFIG_STE_DMA40
547 .dma_rx_param = &uart0_dma_cfg_rx,
548 .dma_tx_param = &uart0_dma_cfg_tx,
553 #ifdef CONFIG_STE_DMA40
555 .dma_rx_param = &uart1_dma_cfg_rx,
556 .dma_tx_param = &uart1_dma_cfg_tx,
561 #ifdef CONFIG_STE_DMA40
563 .dma_rx_param = &uart2_dma_cfg_rx,
564 .dma_tx_param = &uart2_dma_cfg_tx,
568 static void __init mop500_uart_init(
struct device *parent)
575 static void __init u8500_cryp1_hash1_init(
struct device *parent)
585 &snowball_gpio_en_3v3_regulator_dev,
588 static void __init mop500_init_machine(
void)
599 for (i = 0; i <
ARRAY_SIZE(mop500_platform_devs); i++)
600 mop500_platform_devs[i]->dev.
parent = parent;
605 mop500_i2c_init(parent);
607 mop500_spi_init(parent);
609 mop500_uart_init(parent);
611 u8500_cryp1_hash1_init(parent);
625 static void __init snowball_init_machine(
void)
633 for (i = 0; i <
ARRAY_SIZE(snowball_platform_devs); i++)
634 snowball_platform_devs[i]->dev.
parent = parent;
639 mop500_i2c_init(parent);
641 mop500_spi_init(parent);
643 mop500_uart_init(parent);
649 static void __init hrefv60_init_machine(
void)
665 for (i = 0; i <
ARRAY_SIZE(mop500_platform_devs); i++)
666 mop500_platform_devs[i]->dev.
parent = parent;
671 mop500_i2c_init(parent);
673 mop500_spi_init(parent);
675 mop500_uart_init(parent);
693 .atag_offset = 0x100,
700 .init_machine = mop500_init_machine,
704 MACHINE_START(HREFV60,
"ST-Ericsson U8500 Platform HREFv60+")
705 .atag_offset = 0x100,
711 .init_machine = hrefv60_init_machine,
716 .atag_offset = 0x100,
723 .init_machine = snowball_init_machine,
727 #ifdef CONFIG_MACH_UX500_DT
729 struct of_dev_auxdata u8500_auxdata_lookup[] __initdata = {
733 OF_DEV_AUXDATA(
"arm,pl011", 0x80120000,
"uart0", &uart0_plat),
734 OF_DEV_AUXDATA(
"arm,pl011", 0x80121000,
"uart1", &uart1_plat),
735 OF_DEV_AUXDATA(
"arm,pl011", 0x80007000,
"uart2", &uart2_plat),
737 OF_DEV_AUXDATA(
"arm,pl022", 0x80002000,
"ssp0", &ssp0_plat),
743 OF_DEV_AUXDATA(
"st,nomadik-gpio", 0x8012e000,
"gpio.0",
NULL),
744 OF_DEV_AUXDATA(
"st,nomadik-gpio", 0x8012e080,
"gpio.1",
NULL),
745 OF_DEV_AUXDATA(
"st,nomadik-gpio", 0x8000e000,
"gpio.2",
NULL),
746 OF_DEV_AUXDATA(
"st,nomadik-gpio", 0x8000e080,
"gpio.3",
NULL),
747 OF_DEV_AUXDATA(
"st,nomadik-gpio", 0x8000e100,
"gpio.4",
NULL),
748 OF_DEV_AUXDATA(
"st,nomadik-gpio", 0x8000e180,
"gpio.5",
NULL),
749 OF_DEV_AUXDATA(
"st,nomadik-gpio", 0x8011e000,
"gpio.6",
NULL),
750 OF_DEV_AUXDATA(
"st,nomadik-gpio", 0x8011e080,
"gpio.7",
NULL),
751 OF_DEV_AUXDATA(
"st,nomadik-gpio", 0xa03fe000,
"gpio.8",
NULL),
752 OF_DEV_AUXDATA(
"st,nomadik-i2c", 0x80004000,
"nmk-i2c.0",
NULL),
753 OF_DEV_AUXDATA(
"st,nomadik-i2c", 0x80122000,
"nmk-i2c.1",
NULL),
754 OF_DEV_AUXDATA(
"st,nomadik-i2c", 0x80128000,
"nmk-i2c.2",
NULL),
755 OF_DEV_AUXDATA(
"st,nomadik-i2c", 0x80110000,
"nmk-i2c.3",
NULL),
756 OF_DEV_AUXDATA(
"st,nomadik-i2c", 0x8012a000,
"nmk-i2c.4",
NULL),
758 OF_DEV_AUXDATA(
"stericsson,nmk_pinctrl", 0,
"pinctrl-db8500",
NULL),
760 OF_DEV_AUXDATA(
"stericsson,ux500-msp-i2s", 0x80123000,
762 OF_DEV_AUXDATA(
"stericsson,ux500-msp-i2s", 0x80124000,
764 OF_DEV_AUXDATA(
"stericsson,ux500-msp-i2s", 0x80117000,
766 OF_DEV_AUXDATA(
"stericsson,ux500-msp-i2s", 0x80125000,
771 static const struct of_device_id u8500_local_bus_nodes[] = {
774 { .compatible =
"stericsson,db8500-prcmu", },
775 { .compatible =
"simple-bus"},
779 static void __init u8500_init_machine(
void)
795 for (i = 0; i <
ARRAY_SIZE(mop500_platform_devs); i++)
796 mop500_platform_devs[i]->dev.
parent = parent;
799 of_platform_populate(
NULL, u8500_local_bus_nodes, u8500_auxdata_lookup, parent);
835 static const char * u8500_dt_board_compat[] = {
836 "calaosystems,snowball-a9500",
837 "st-ericsson,hrefv60+",
839 "st-ericsson,mop500",
844 DT_MACHINE_START(U8500_DT,
"ST-Ericsson U8500 platform (Device Tree Support)")
851 .init_machine = u8500_init_machine,
853 .dt_compat = u8500_dt_board_compat,