16 #include <linux/export.h>
20 #include <linux/sched.h>
21 #include <linux/bitops.h>
28 #include <linux/types.h>
35 #include <asm/setup.h>
38 #include <asm/sizes.h>
61 static unsigned long balloon3_pin_config[]
__initdata = {
75 static unsigned long balloon3_irq_enabled;
77 static unsigned long balloon3_features_present =
84 return (balloon3_features_present & (1 << feature)) ? 1 : 0;
100 #if defined(CONFIG_PCMCIA_PXA2XX) || defined(CONFIG_PCMCIA_PXA2XX_MODULE)
101 static unsigned long balloon3_cf_pin_config[]
__initdata = {
114 static void __init balloon3_cf_init(
void)
122 static inline void balloon3_cf_init(
void) {}
128 #if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
132 .offset = 0x00000000,
140 .parts = balloon3_nor_partitions,
141 .nr_parts =
ARRAY_SIZE(balloon3_nor_partitions)
145 static struct resource balloon3_flash_resource = {
152 .
name =
"physmap-flash",
154 .resource = &balloon3_flash_resource,
157 .platform_data = balloon3_flash_data,
160 static void __init balloon3_nor_init(
void)
165 static inline void balloon3_nor_init(
void) {}
171 #if defined(CONFIG_TOUCHSCREEN_UCB1400) || \
172 defined(CONFIG_TOUCHSCREEN_UCB1400_MODULE)
173 static unsigned long balloon3_ac97_pin_config[] __initdata = {
188 .
name =
"ucb1400_core",
191 .platform_data = &vpac270_ucb1400_pdata,
195 static void __init balloon3_ts_init(
void)
205 static inline void balloon3_ts_init(
void) {}
211 #if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
212 static unsigned long balloon3_lcd_pin_config[] __initdata = {
234 .
modes = balloon3_lcd_modes,
239 static void balloon3_backlight_power(
int on)
244 static void __init balloon3_lcd_init(
void)
255 pr_err(
"Requesting BKL-ON GPIO failed!\n");
261 pr_err(
"Setting BKL-ON GPIO direction failed!\n");
275 static inline void balloon3_lcd_init(
void) {}
281 #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
282 static unsigned long balloon3_mmc_pin_config[] __initdata = {
293 .gpio_card_detect = -1,
296 .detect_delay_ms = 200,
299 static void __init balloon3_mmc_init(
void)
305 static inline void balloon3_mmc_init(
void) {}
311 #if defined(CONFIG_USB_PXA27X)||defined(CONFIG_USB_PXA27X_MODULE)
312 static void balloon3_udc_command(
int cmd)
320 static int balloon3_udc_is_connected(
void)
327 .udc_is_connected = balloon3_udc_is_connected,
331 static void __init balloon3_udc_init(
void)
337 static inline void balloon3_udc_init(
void) {}
343 #if defined(CONFIG_IRDA) || defined(CONFIG_IRDA_MODULE)
348 static void __init balloon3_irda_init(
void)
353 static inline void balloon3_irda_init(
void) {}
359 #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
360 static unsigned long balloon3_uhc_pin_config[] __initdata = {
370 static void __init balloon3_uhc_init(
void)
378 static inline void balloon3_uhc_init(
void) {}
384 #if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
385 static unsigned long balloon3_led_pin_config[] __initdata = {
390 struct gpio_led balloon3_gpio_leds[] = {
392 .
name =
"balloon3:green:idle",
393 .default_trigger =
"heartbeat",
397 .name =
"balloon3:green:nand",
398 .default_trigger =
"nand-disk",
405 .
leds = balloon3_gpio_leds,
413 .platform_data = &balloon3_gpio_led_info,
417 struct gpio_led balloon3_pcf_gpio_leds[] = {
419 .
name =
"balloon3:green:led0",
423 .name =
"balloon3:green:led1",
427 .name =
"balloon3:orange:led2",
431 .name =
"balloon3:orange:led3",
435 .name =
"balloon3:orange:led4",
439 .name =
"balloon3:orange:led5",
443 .name =
"balloon3:red:led6",
447 .name =
"balloon3:red:led7",
454 .
leds = balloon3_pcf_gpio_leds,
455 .num_leds =
ARRAY_SIZE(balloon3_pcf_gpio_leds),
462 .platform_data = &balloon3_pcf_gpio_led_info,
466 static void __init balloon3_leds_init(
void)
473 static inline void balloon3_leds_init(
void) {}
479 static void balloon3_mask_irq(
struct irq_data *
d)
482 balloon3_irq_enabled &= ~(1 << balloon3_irq);
486 static void balloon3_unmask_irq(
struct irq_data *
d)
489 balloon3_irq_enabled |= (1 << balloon3_irq);
493 static struct irq_chip balloon3_irq_chip = {
495 .irq_ack = balloon3_mask_irq,
496 .irq_mask = balloon3_mask_irq,
497 .irq_unmask = balloon3_unmask_irq,
500 static void balloon3_irq_handler(
unsigned int irq,
struct irq_desc *
desc)
503 balloon3_irq_enabled;
516 pending &= pending - 1;
519 balloon3_irq_enabled;
523 static void __init balloon3_init_irq(
void)
530 irq_set_chip_and_handler(irq, &balloon3_irq_chip,
538 pr_debug(
"%s: chained handler installed - irq %d automatically "
545 #if defined(CONFIG_GPIO_PCF857X) || defined(CONFIG_GPIO_PCF857X_MODULE)
557 .platform_data = &balloon3_pcf857x_pdata,
561 static void __init balloon3_i2c_init(
void)
567 static inline void balloon3_i2c_init(
void) {}
573 #if defined(CONFIG_MTD_NAND_PLATFORM)||defined(CONFIG_MTD_NAND_PLATFORM_MODULE)
574 static void balloon3_nand_cmd_ctl(
struct mtd_info *mtd,
int cmd,
unsigned int ctrl)
577 uint8_t balloon3_ctl_set = 0, balloon3_ctl_clr = 0;
590 if (balloon3_ctl_clr)
593 if (balloon3_ctl_set)
603 static void balloon3_nand_select_chip(
struct mtd_info *mtd,
int chip)
619 static int balloon3_nand_dev_ready(
struct mtd_info *mtd)
634 pr_warn(
"The FPGA code, version 0x%04x, is too old. "
635 "NAND support might be broken in this version!", ver);
686 .nr_partitions =
ARRAY_SIZE(balloon3_partition_info),
687 .partitions = balloon3_partition_info,
692 .dev_ready = balloon3_nand_dev_ready,
693 .select_chip = balloon3_nand_select_chip,
694 .cmd_ctrl = balloon3_nand_cmd_ctl,
695 .probe = balloon3_nand_probe,
696 .remove = balloon3_nand_remove,
700 static struct resource balloon3_nand_resource[] = {
710 .num_resources =
ARRAY_SIZE(balloon3_nand_resource),
711 .resource = balloon3_nand_resource,
714 .platform_data = &balloon3_nand_pdata,
718 static void __init balloon3_nand_init(
void)
723 static inline void balloon3_nand_init(
void) {}
729 #if defined(CONFIG_REGULATOR_MAX1586) || \
730 defined(CONFIG_REGULATOR_MAX1586_MODULE)
737 .name =
"vcc_core range",
743 .consumer_supplies = balloon3_max1587a_consumers,
744 .num_consumer_supplies =
ARRAY_SIZE(balloon3_max1587a_consumers),
751 .platform_data = &balloon3_max1587a_v3_info,
756 .
subdevs = balloon3_max1587a_subdevs,
757 .num_subdevs =
ARRAY_SIZE(balloon3_max1587a_subdevs),
761 static struct i2c_board_info __initdata balloon3_pi2c_board_info[] = {
764 .platform_data = &balloon3_max1587a_info,
768 static void __init balloon3_pmic_init(
void)
774 static inline void balloon3_pmic_init(
void) {}
780 static void __init balloon3_init(
void)
791 balloon3_irda_init();
793 balloon3_leds_init();
795 balloon3_nand_init();
797 balloon3_pmic_init();
804 static struct map_desc balloon3_io_desc[] __initdata = {
813 static void __init balloon3_map_io(
void)
821 .map_io = balloon3_map_io,
823 .init_irq = balloon3_init_irq,
826 .init_machine = balloon3_init,
827 .atag_offset = 0x100,