From 7bc35b56f3e1548d039964d44e181c29398432b4 Mon Sep 17 00:00:00 2001 From: Dmitry Artamonow Date: Fri, 20 Feb 2009 10:16:01 +0100 Subject: [ARM] 5407/1: SA1100: drop broken for ages iPAQ h3800 support Code has never been in buildable state since initial merge. Signed-off-by: Dmitry Artamonow Signed-off-by: Russell King --- arch/arm/mach-sa1100/h3600.c | 392 ------------------------------------------- 1 file changed, 392 deletions(-) (limited to 'arch/arm/mach-sa1100/h3600.c') diff --git a/arch/arm/mach-sa1100/h3600.c b/arch/arm/mach-sa1100/h3600.c index af25a78d705d..b9aaa45c6ca4 100644 --- a/arch/arm/mach-sa1100/h3600.c +++ b/arch/arm/mach-sa1100/h3600.c @@ -42,14 +42,7 @@ #include #include - -#if defined (CONFIG_SA1100_H3600) || defined (CONFIG_SA1100_H3100) #include -#endif - -#ifdef CONFIG_SA1100_H3800 -#include -#endif #include "generic.h" @@ -519,388 +512,3 @@ MACHINE_END #endif /* CONFIG_SA1100_H3600 */ -#ifdef CONFIG_SA1100_H3800 - -#define SET_ASIC1(x) \ - do {if (setp) { H3800_ASIC1_GPIO_OUT |= (x); } else { H3800_ASIC1_GPIO_OUT &= ~(x); }} while(0) - -#define SET_ASIC2(x) \ - do {if (setp) { H3800_ASIC2_GPIOPIOD |= (x); } else { H3800_ASIC2_GPIOPIOD &= ~(x); }} while(0) - -#define CLEAR_ASIC1(x) \ - do {if (setp) { H3800_ASIC1_GPIO_OUT &= ~(x); } else { H3800_ASIC1_GPIO_OUT |= (x); }} while(0) - -#define CLEAR_ASIC2(x) \ - do {if (setp) { H3800_ASIC2_GPIOPIOD &= ~(x); } else { H3800_ASIC2_GPIOPIOD |= (x); }} while(0) - - -/* - On screen enable, we get - - h3800_video_power_on(1) - LCD controller starts - h3800_video_lcd_enable(1) - - On screen disable, we get - - h3800_video_lcd_enable(0) - LCD controller stops - h3800_video_power_on(0) -*/ - - -static void h3800_video_power_on(int setp) -{ - if (setp) { - H3800_ASIC1_GPIO_OUT |= GPIO1_LCD_ON; - msleep(30); - H3800_ASIC1_GPIO_OUT |= GPIO1_VGL_ON; - msleep(5); - H3800_ASIC1_GPIO_OUT |= GPIO1_VGH_ON; - msleep(50); - H3800_ASIC1_GPIO_OUT |= GPIO1_LCD_5V_ON; - msleep(5); - } else { - msleep(5); - H3800_ASIC1_GPIO_OUT &= ~GPIO1_LCD_5V_ON; - msleep(50); - H3800_ASIC1_GPIO_OUT &= ~GPIO1_VGL_ON; - msleep(5); - H3800_ASIC1_GPIO_OUT &= ~GPIO1_VGH_ON; - msleep(100); - H3800_ASIC1_GPIO_OUT &= ~GPIO1_LCD_ON; - } -} - -static void h3800_video_lcd_enable(int setp) -{ - if (setp) { - msleep(17); // Wait one from before turning on - H3800_ASIC1_GPIO_OUT |= GPIO1_LCD_PCI; - } else { - H3800_ASIC1_GPIO_OUT &= ~GPIO1_LCD_PCI; - msleep(30); // Wait before turning off - } -} - - -static void h3800_control_egpio(enum ipaq_egpio_type x, int setp) -{ - switch (x) { - case IPAQ_EGPIO_LCD_POWER: - h3800_video_power_on(setp); - break; - case IPAQ_EGPIO_LCD_ENABLE: - h3800_video_lcd_enable(setp); - break; - case IPAQ_EGPIO_CODEC_NRESET: - case IPAQ_EGPIO_AUDIO_ON: - case IPAQ_EGPIO_QMUTE: - printk("%s: error - should not be called\n", __func__); - break; - case IPAQ_EGPIO_OPT_NVRAM_ON: - SET_ASIC2(GPIO2_OPT_ON_NVRAM); - break; - case IPAQ_EGPIO_OPT_ON: - SET_ASIC2(GPIO2_OPT_ON); - break; - case IPAQ_EGPIO_CARD_RESET: - SET_ASIC2(GPIO2_OPT_PCM_RESET); - break; - case IPAQ_EGPIO_OPT_RESET: - SET_ASIC2(GPIO2_OPT_RESET); - break; - case IPAQ_EGPIO_IR_ON: - CLEAR_ASIC1(GPIO1_IR_ON_N); - break; - case IPAQ_EGPIO_IR_FSEL: - break; - case IPAQ_EGPIO_RS232_ON: - SET_ASIC1(GPIO1_RS232_ON); - break; - case IPAQ_EGPIO_VPP_ON: - H3800_ASIC2_FlashWP_VPP_ON = setp; - break; - } -} - -static unsigned long h3800_read_egpio(void) -{ - return H3800_ASIC1_GPIO_OUT | (H3800_ASIC2_GPIOPIOD << 16); -} - -/* We need to fix ASIC2 GPIO over suspend/resume. At the moment, - it doesn't appear that ASIC1 GPIO has the same problem */ - -static int h3800_pm_callback(int req) -{ - static u16 asic1_data; - static u16 asic2_data; - int result = 0; - - printk("%s %d\n", __func__, req); - - switch (req) { - case PM_RESUME: - MSC2 = (MSC2 & 0x0000ffff) | 0xE4510000; /* Set MSC2 correctly */ - - H3800_ASIC2_GPIOPIOD = asic2_data; - H3800_ASIC2_GPIODIR = GPIO2_PEN_IRQ - | GPIO2_SD_DETECT - | GPIO2_EAR_IN_N - | GPIO2_USB_DETECT_N - | GPIO2_SD_CON_SLT; - - H3800_ASIC1_GPIO_OUT = asic1_data; - - if (ipaq_model_ops.pm_callback_aux) - result = ipaq_model_ops.pm_callback_aux(req); - break; - - case PM_SUSPEND: - if (ipaq_model_ops.pm_callback_aux && - ((result = ipaq_model_ops.pm_callback_aux(req)) != 0)) - return result; - - asic1_data = H3800_ASIC1_GPIO_OUT; - asic2_data = H3800_ASIC2_GPIOPIOD; - break; - default: - printk("%s: unrecognized PM callback\n", __func__); - break; - } - return result; -} - -static struct ipaq_model_ops h3800_model_ops __initdata = { - .generic_name = "3800", - .control = h3800_control_egpio, - .read = h3800_read_egpio, - .pm_callback = h3800_pm_callback -}; - -#define MAX_ASIC_ISR_LOOPS 20 - -/* The order of these is important - see #include */ -static u32 kpio_irq_mask[] = { - KPIO_KEY_ALL, - KPIO_SPI_INT, - KPIO_OWM_INT, - KPIO_ADC_INT, - KPIO_UART_0_INT, - KPIO_UART_1_INT, - KPIO_TIMER_0_INT, - KPIO_TIMER_1_INT, - KPIO_TIMER_2_INT -}; - -static u32 gpio_irq_mask[] = { - GPIO2_PEN_IRQ, - GPIO2_SD_DETECT, - GPIO2_EAR_IN_N, - GPIO2_USB_DETECT_N, - GPIO2_SD_CON_SLT, -}; - -static void h3800_IRQ_demux(unsigned int irq, struct irq_desc *desc) -{ - int i; - - if (0) printk("%s: interrupt received\n", __func__); - - desc->chip->ack(irq); - - for (i = 0; i < MAX_ASIC_ISR_LOOPS && (GPLR & GPIO_H3800_ASIC); i++) { - u32 irq; - int j; - - /* KPIO */ - irq = H3800_ASIC2_KPIINTFLAG; - if (0) printk("%s KPIO 0x%08X\n", __func__, irq); - for (j = 0; j < H3800_KPIO_IRQ_COUNT; j++) - if (irq & kpio_irq_mask[j]) - handle_edge_irq(H3800_KPIO_IRQ_COUNT + j, irq_desc + H3800_KPIO_IRQ_COUNT + j); - - /* GPIO2 */ - irq = H3800_ASIC2_GPIINTFLAG; - if (0) printk("%s GPIO 0x%08X\n", __func__, irq); - for (j = 0; j < H3800_GPIO_IRQ_COUNT; j++) - if (irq & gpio_irq_mask[j]) - handle_edge_irq(H3800_GPIO_IRQ_COUNT + j, irq_desc + H3800_GPIO_IRQ_COUNT + j); - } - - if (i >= MAX_ASIC_ISR_LOOPS) - printk("%s: interrupt processing overrun\n", __func__); - - /* For level-based interrupts */ - desc->chip->unmask(irq); - -} - -static struct irqaction h3800_irq = { - .name = "h3800_asic", - .handler = h3800_IRQ_demux, - .flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL, -}; - -u32 kpio_int_shadow = 0; - - -/* mask_ack <- IRQ is first serviced. - mask <- IRQ is disabled. - unmask <- IRQ is enabled - - The INTCLR registers are poorly documented. I believe that writing - a "1" to the register clears the specific interrupt, but the documentation - indicates writing a "0" clears the interrupt. In any case, they shouldn't - be read (that's the INTFLAG register) - */ - -static void h3800_mask_ack_kpio_irq(unsigned int irq) -{ - u32 mask = kpio_irq_mask[irq - H3800_KPIO_IRQ_START]; - kpio_int_shadow &= ~mask; - H3800_ASIC2_KPIINTSTAT = kpio_int_shadow; - H3800_ASIC2_KPIINTCLR = mask; -} - -static void h3800_mask_kpio_irq(unsigned int irq) -{ - u32 mask = kpio_irq_mask[irq - H3800_KPIO_IRQ_START]; - kpio_int_shadow &= ~mask; - H3800_ASIC2_KPIINTSTAT = kpio_int_shadow; -} - -static void h3800_unmask_kpio_irq(unsigned int irq) -{ - u32 mask = kpio_irq_mask[irq - H3800_KPIO_IRQ_START]; - kpio_int_shadow |= mask; - H3800_ASIC2_KPIINTSTAT = kpio_int_shadow; -} - -static void h3800_mask_ack_gpio_irq(unsigned int irq) -{ - u32 mask = gpio_irq_mask[irq - H3800_GPIO_IRQ_START]; - H3800_ASIC2_GPIINTSTAT &= ~mask; - H3800_ASIC2_GPIINTCLR = mask; -} - -static void h3800_mask_gpio_irq(unsigned int irq) -{ - u32 mask = gpio_irq_mask[irq - H3800_GPIO_IRQ_START]; - H3800_ASIC2_GPIINTSTAT &= ~mask; - } - -static void h3800_unmask_gpio_irq(unsigned int irq) -{ - u32 mask = gpio_irq_mask[irq - H3800_GPIO_IRQ_START]; - H3800_ASIC2_GPIINTSTAT |= mask; -} - -static void __init h3800_init_irq(void) -{ - int i; - - /* Initialize standard IRQs */ - sa1100_init_irq(); - - /* Disable all IRQs and set up clock */ - H3800_ASIC2_KPIINTSTAT = 0; /* Disable all interrupts */ - H3800_ASIC2_GPIINTSTAT = 0; - - H3800_ASIC2_KPIINTCLR = 0; /* Clear all KPIO interrupts */ - H3800_ASIC2_GPIINTCLR = 0; /* Clear all GPIO interrupts */ - -// H3800_ASIC2_KPIINTCLR = 0xffff; /* Clear all KPIO interrupts */ -// H3800_ASIC2_GPIINTCLR = 0xffff; /* Clear all GPIO interrupts */ - - H3800_ASIC2_CLOCK_Enable |= ASIC2_CLOCK_EX0; /* 32 kHZ crystal on */ - H3800_ASIC2_INTR_ClockPrescale |= ASIC2_INTCPS_SET; - H3800_ASIC2_INTR_ClockPrescale = ASIC2_INTCPS_CPS(0x0e) | ASIC2_INTCPS_SET; - H3800_ASIC2_INTR_TimerSet = 1; - -#if 0 - for (i = 0; i < H3800_KPIO_IRQ_COUNT; i++) { - int irq = i + H3800_KPIO_IRQ_START; - irq_desc[irq].valid = 1; - irq_desc[irq].probe_ok = 1; - set_irq_chip(irq, &h3800_kpio_irqchip); - } - - for (i = 0; i < H3800_GPIO_IRQ_COUNT; i++) { - int irq = i + H3800_GPIO_IRQ_START; - irq_desc[irq].valid = 1; - irq_desc[irq].probe_ok = 1; - set_irq_chip(irq, &h3800_gpio_irqchip); - } -#endif - set_irq_type(IRQ_GPIO_H3800_ASIC, IRQ_TYPE_EDGE_RISING); - set_irq_chained_handler(IRQ_GPIO_H3800_ASIC, h3800_IRQ_demux); -} - - -#define ASIC1_OUTPUTS 0x7fff /* First 15 bits are used */ - -static void __init h3800_map_io(void) -{ - h3xxx_map_io(); - - /* Add wakeup on AC plug/unplug */ - PWER |= PWER_GPIO12; - - /* Initialize h3800-specific values here */ - GPCR = 0x0fffffff; /* All outputs are set low by default */ - GAFR = GPIO_H3800_CLK_OUT | - GPIO_LDD15 | GPIO_LDD14 | GPIO_LDD13 | GPIO_LDD12 | - GPIO_LDD11 | GPIO_LDD10 | GPIO_LDD9 | GPIO_LDD8; - GPDR = GPIO_H3800_CLK_OUT | - GPIO_H3600_COM_RTS | GPIO_H3600_L3_CLOCK | - GPIO_H3600_L3_MODE | GPIO_H3600_L3_DATA | - GPIO_LDD15 | GPIO_LDD14 | GPIO_LDD13 | GPIO_LDD12 | - GPIO_LDD11 | GPIO_LDD10 | GPIO_LDD9 | GPIO_LDD8; - TUCR = TUCR_3_6864MHz; /* Seems to be used only for the Bluetooth UART */ - - /* Fix the memory bus */ - MSC2 = (MSC2 & 0x0000ffff) | 0xE4510000; - - /* Set up ASIC #1 */ - H3800_ASIC1_GPIO_DIR = ASIC1_OUTPUTS; /* All outputs */ - H3800_ASIC1_GPIO_MASK = ASIC1_OUTPUTS; /* No interrupts */ - H3800_ASIC1_GPIO_SLEEP_MASK = ASIC1_OUTPUTS; - H3800_ASIC1_GPIO_SLEEP_DIR = ASIC1_OUTPUTS; - H3800_ASIC1_GPIO_SLEEP_OUT = GPIO1_EAR_ON_N; - H3800_ASIC1_GPIO_BATT_FAULT_DIR = ASIC1_OUTPUTS; - H3800_ASIC1_GPIO_BATT_FAULT_OUT = GPIO1_EAR_ON_N; - - H3800_ASIC1_GPIO_OUT = GPIO1_IR_ON_N - | GPIO1_RS232_ON - | GPIO1_EAR_ON_N; - - /* Set up ASIC #2 */ - H3800_ASIC2_GPIOPIOD = GPIO2_IN_Y1_N | GPIO2_IN_X1_N; - H3800_ASIC2_GPOBFSTAT = GPIO2_IN_Y1_N | GPIO2_IN_X1_N; - - H3800_ASIC2_GPIODIR = GPIO2_PEN_IRQ - | GPIO2_SD_DETECT - | GPIO2_EAR_IN_N - | GPIO2_USB_DETECT_N - | GPIO2_SD_CON_SLT; - - /* TODO : Set sleep states & battery fault states */ - - /* Clear VPP Enable */ - H3800_ASIC2_FlashWP_VPP_ON = 0; - ipaq_model_ops = h3800_model_ops; -} - -MACHINE_START(H3800, "Compaq iPAQ H3800") - .phys_io = 0x80000000, - .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc, - .boot_params = 0xc0000100, - .map_io = h3800_map_io, - .init_irq = h3800_init_irq, - .timer = &sa1100_timer, - .init_machine = h3xxx_mach_init, -MACHINE_END - -#endif /* CONFIG_SA1100_H3800 */ -- cgit v1.2.3 From f110b3f2a61d26329290036dac3d70a6733099de Mon Sep 17 00:00:00 2001 From: Dmitry Artamonow Date: Sun, 15 Mar 2009 19:09:50 +0100 Subject: [ARM] 5424/1: h3600: clean up mtd partitions table Right now iPaq h3600's default MTD partitions table is a mess. It has two #ifdefs with #else, giving total 3 variants, depending on your kernel config. Replace all this with simple two-partitions scheme (bootloader + rootfs), that used by both shipped WindowsCE and most of the linux distributions (Familiar, Angstrom) Signed-off-by: Dmitry Artamonow Signed-off-by: Russell King --- arch/arm/mach-sa1100/h3600.c | 34 +--------------------------------- 1 file changed, 1 insertion(+), 33 deletions(-) (limited to 'arch/arm/mach-sa1100/h3600.c') diff --git a/arch/arm/mach-sa1100/h3600.c b/arch/arm/mach-sa1100/h3600.c index b9aaa45c6ca4..4920b89d149c 100644 --- a/arch/arm/mach-sa1100/h3600.c +++ b/arch/arm/mach-sa1100/h3600.c @@ -56,41 +56,9 @@ static struct mtd_partition h3xxx_partitions[] = { .offset = 0, .mask_flags = MTD_WRITEABLE, /* force read-only */ }, { -#ifdef CONFIG_MTD_2PARTS_IPAQ - .name = "H3XXX root jffs2", + .name = "H3XXX rootfs", .size = MTDPART_SIZ_FULL, .offset = 0x00040000, -#else - .name = "H3XXX kernel", - .size = 0x00080000, - .offset = 0x00040000, - }, { - .name = "H3XXX params", - .size = 0x00040000, - .offset = 0x000C0000, - }, { -#ifdef CONFIG_JFFS2_FS - .name = "H3XXX root jffs2", - .size = MTDPART_SIZ_FULL, - .offset = 0x00100000, -#else - .name = "H3XXX initrd", - .size = 0x00100000, - .offset = 0x00100000, - }, { - .name = "H3XXX root cramfs", - .size = 0x00300000, - .offset = 0x00200000, - }, { - .name = "H3XXX usr cramfs", - .size = 0x00800000, - .offset = 0x00500000, - }, { - .name = "H3XXX usr local", - .size = MTDPART_SIZ_FULL, - .offset = 0x00d00000, -#endif -#endif } }; -- cgit v1.2.3 From ddcd8c09001e66f78488bfc238ed5bd8441d4496 Mon Sep 17 00:00:00 2001 From: Dmitry Artamonow Date: Sun, 15 Mar 2009 19:11:21 +0100 Subject: [ARM] 5425/1: h3600: first stage of ipaq_model_ops cleanup Remove unused fields and associated funtions-accesors. Signed-off-by: Dmitry Artamonow Signed-off-by: Russell King --- arch/arm/mach-sa1100/h3600.c | 38 ------------------------- arch/arm/mach-sa1100/include/mach/h3600.h | 46 ------------------------------- 2 files changed, 84 deletions(-) (limited to 'arch/arm/mach-sa1100/h3600.c') diff --git a/arch/arm/mach-sa1100/h3600.c b/arch/arm/mach-sa1100/h3600.c index 4920b89d149c..9f13f5bd57a2 100644 --- a/arch/arm/mach-sa1100/h3600.c +++ b/arch/arm/mach-sa1100/h3600.c @@ -227,12 +227,6 @@ static void __init h3xxx_map_io(void) sa1100fb_lcd_power = h3xxx_lcd_power; } -static __inline__ void do_blank(int setp) -{ - if (ipaq_model_ops.blank_callback) - ipaq_model_ops.blank_callback(1-setp); -} - /************************* H3100 *************************/ #ifdef CONFIG_SA1100_H3100 @@ -250,7 +244,6 @@ static void h3100_control_egpio(enum ipaq_egpio_type x, int setp) case IPAQ_EGPIO_LCD_POWER: egpio |= EGPIO_H3600_LCD_ON; gpio |= GPIO_H3100_LCD_3V_ON; - do_blank(setp); break; case IPAQ_EGPIO_LCD_ENABLE: break; @@ -304,23 +297,8 @@ static void h3100_control_egpio(enum ipaq_egpio_type x, int setp) } } -static unsigned long h3100_read_egpio(void) -{ - return h3100_egpio; -} - -static int h3100_pm_callback(int req) -{ - if (ipaq_model_ops.pm_callback_aux) - return ipaq_model_ops.pm_callback_aux(req); - return 0; -} - static struct ipaq_model_ops h3100_model_ops __initdata = { - .generic_name = "3100", .control = h3100_control_egpio, - .read = h3100_read_egpio, - .pm_callback = h3100_pm_callback }; #define H3100_DIRECT_EGPIO (GPIO_H3100_BT_ON \ @@ -381,7 +359,6 @@ static void h3600_control_egpio(enum ipaq_egpio_type x, int setp) EGPIO_H3600_LCD_PCI | EGPIO_H3600_LCD_5V_ON | EGPIO_H3600_LVDD_ON; - do_blank(setp); break; case IPAQ_EGPIO_LCD_ENABLE: break; @@ -432,23 +409,8 @@ static void h3600_control_egpio(enum ipaq_egpio_type x, int setp) } } -static unsigned long h3600_read_egpio(void) -{ - return h3600_egpio; -} - -static int h3600_pm_callback(int req) -{ - if (ipaq_model_ops.pm_callback_aux) - return ipaq_model_ops.pm_callback_aux(req); - return 0; -} - static struct ipaq_model_ops h3600_model_ops __initdata = { - .generic_name = "3600", .control = h3600_control_egpio, - .read = h3600_read_egpio, - .pm_callback = h3600_pm_callback }; static void __init h3600_map_io(void) diff --git a/arch/arm/mach-sa1100/include/mach/h3600.h b/arch/arm/mach-sa1100/include/mach/h3600.h index e692ab3dd79f..8e8ccfc2f463 100644 --- a/arch/arm/mach-sa1100/include/mach/h3600.h +++ b/arch/arm/mach-sa1100/include/mach/h3600.h @@ -94,21 +94,11 @@ enum ipaq_egpio_type { }; struct ipaq_model_ops { - const char *generic_name; void (*control)(enum ipaq_egpio_type, int); - unsigned long (*read)(void); - void (*blank_callback)(int blank); - int (*pm_callback)(int req); /* Primary model callback */ - int (*pm_callback_aux)(int req); /* Secondary callback (used by HAL modules) */ }; extern struct ipaq_model_ops ipaq_model_ops; -static __inline__ const char * h3600_generic_name(void) -{ - return ipaq_model_ops.generic_name; -} - static __inline__ void assign_h3600_egpio(enum ipaq_egpio_type x, int level) { if (ipaq_model_ops.control) @@ -127,42 +117,6 @@ static __inline__ void set_h3600_egpio(enum ipaq_egpio_type x) ipaq_model_ops.control(x,1); } -static __inline__ unsigned long read_h3600_egpio(void) -{ - if (ipaq_model_ops.read) - return ipaq_model_ops.read(); - return 0; -} - -static __inline__ int h3600_register_blank_callback(void (*f)(int)) -{ - ipaq_model_ops.blank_callback = f; - return 0; -} - -static __inline__ void h3600_unregister_blank_callback(void (*f)(int)) -{ - ipaq_model_ops.blank_callback = NULL; -} - - -static __inline__ int h3600_register_pm_callback(int (*f)(int)) -{ - ipaq_model_ops.pm_callback_aux = f; - return 0; -} - -static __inline__ void h3600_unregister_pm_callback(int (*f)(int)) -{ - ipaq_model_ops.pm_callback_aux = NULL; -} - -static __inline__ int h3600_power_management(int req) -{ - if (ipaq_model_ops.pm_callback) - return ipaq_model_ops.pm_callback(req); - return 0; -} #endif /* ASSEMBLY */ -- cgit v1.2.3 From 104a416d80fca22284319b06eff87b6f632a3649 Mon Sep 17 00:00:00 2001 From: Dmitry Artamonow Date: Sun, 15 Mar 2009 19:13:16 +0100 Subject: [ARM] 5426/1: h3600: remove clr_h3600_egpio/set_h3600_egpio helpers Replace all occurences with assign_h3600_egpio. Also simplify code a bit by replacing couple of if-else statements with one-line equivalents. Signed-off-by: Dmitry Artamonow Signed-off-by: Russell King --- arch/arm/mach-sa1100/h3600.c | 6 +----- arch/arm/mach-sa1100/include/mach/h3600.h | 13 ------------- drivers/pcmcia/sa1100_h3600.c | 23 ++++++++++------------- 3 files changed, 11 insertions(+), 31 deletions(-) (limited to 'arch/arm/mach-sa1100/h3600.c') diff --git a/arch/arm/mach-sa1100/h3600.c b/arch/arm/mach-sa1100/h3600.c index 9f13f5bd57a2..1fa0f58c07b0 100644 --- a/arch/arm/mach-sa1100/h3600.c +++ b/arch/arm/mach-sa1100/h3600.c @@ -92,11 +92,7 @@ static int h3600_irda_set_power(struct device *dev, unsigned int state) static void h3600_irda_set_speed(struct device *dev, unsigned int speed) { - if (speed < 4000000) { - clr_h3600_egpio(IPAQ_EGPIO_IR_FSEL); - } else { - set_h3600_egpio(IPAQ_EGPIO_IR_FSEL); - } + assign_h3600_egpio(IPAQ_EGPIO_IR_FSEL, !(speed < 4000000)); } static struct irda_platform_data h3600_irda_data = { diff --git a/arch/arm/mach-sa1100/include/mach/h3600.h b/arch/arm/mach-sa1100/include/mach/h3600.h index 8e8ccfc2f463..33fc4bcfd3ee 100644 --- a/arch/arm/mach-sa1100/include/mach/h3600.h +++ b/arch/arm/mach-sa1100/include/mach/h3600.h @@ -105,19 +105,6 @@ static __inline__ void assign_h3600_egpio(enum ipaq_egpio_type x, int level) ipaq_model_ops.control(x,level); } -static __inline__ void clr_h3600_egpio(enum ipaq_egpio_type x) -{ - if (ipaq_model_ops.control) - ipaq_model_ops.control(x,0); -} - -static __inline__ void set_h3600_egpio(enum ipaq_egpio_type x) -{ - if (ipaq_model_ops.control) - ipaq_model_ops.control(x,1); -} - - #endif /* ASSEMBLY */ #endif /* _INCLUDE_H3600_H_ */ diff --git a/drivers/pcmcia/sa1100_h3600.c b/drivers/pcmcia/sa1100_h3600.c index 6de4e1b41d60..0cc3748f3758 100644 --- a/drivers/pcmcia/sa1100_h3600.c +++ b/drivers/pcmcia/sa1100_h3600.c @@ -37,9 +37,9 @@ static void h3600_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt) soc_pcmcia_free_irqs(skt, irqs, ARRAY_SIZE(irqs)); /* Disable CF bus: */ - clr_h3600_egpio(IPAQ_EGPIO_OPT_NVRAM_ON); - clr_h3600_egpio(IPAQ_EGPIO_OPT_ON); - set_h3600_egpio(IPAQ_EGPIO_OPT_RESET); + assign_h3600_egpio(IPAQ_EGPIO_OPT_NVRAM_ON, 0); + assign_h3600_egpio(IPAQ_EGPIO_OPT_ON, 0); + assign_h3600_egpio(IPAQ_EGPIO_OPT_RESET, 1); } static void @@ -79,10 +79,7 @@ h3600_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_state_ return -1; } - if (state->flags & SS_RESET) - set_h3600_egpio(IPAQ_EGPIO_CARD_RESET); - else - clr_h3600_egpio(IPAQ_EGPIO_CARD_RESET); + assign_h3600_egpio(IPAQ_EGPIO_CARD_RESET, !!(state->flags & SS_RESET)); /* Silently ignore Vpp, output enable, speaker enable. */ @@ -92,9 +89,9 @@ h3600_pcmcia_configure_socket(struct soc_pcmcia_socket *skt, const socket_state_ static void h3600_pcmcia_socket_init(struct soc_pcmcia_socket *skt) { /* Enable CF bus: */ - set_h3600_egpio(IPAQ_EGPIO_OPT_NVRAM_ON); - set_h3600_egpio(IPAQ_EGPIO_OPT_ON); - clr_h3600_egpio(IPAQ_EGPIO_OPT_RESET); + assign_h3600_egpio(IPAQ_EGPIO_OPT_NVRAM_ON, 1); + assign_h3600_egpio(IPAQ_EGPIO_OPT_ON, 1); + assign_h3600_egpio(IPAQ_EGPIO_OPT_RESET, 0); msleep(10); @@ -112,10 +109,10 @@ static void h3600_pcmcia_socket_suspend(struct soc_pcmcia_socket *skt) * socket 0 then socket 1. */ if (skt->nr == 1) { - clr_h3600_egpio(IPAQ_EGPIO_OPT_ON); - clr_h3600_egpio(IPAQ_EGPIO_OPT_NVRAM_ON); + assign_h3600_egpio(IPAQ_EGPIO_OPT_ON, 0); + assign_h3600_egpio(IPAQ_EGPIO_OPT_NVRAM_ON, 0); /* hmm, does this suck power? */ - set_h3600_egpio(IPAQ_EGPIO_OPT_RESET); + assign_h3600_egpio(IPAQ_EGPIO_OPT_RESET, 1); } } -- cgit v1.2.3 From 607b067e161185d5c441aa366ff9fccd4fd676cb Mon Sep 17 00:00:00 2001 From: Dmitry Artamonow Date: Sun, 15 Mar 2009 19:14:27 +0100 Subject: [ARM] 5427/1: h3600: ipaq_model_ops final cleanup Since now ipaq_model_ops used only for accessing h3600 EGPIOs, drop it completely and use assign_h3600_egpio() directly. Signed-off-by: Dmitry Artamonow Signed-off-by: Russell King --- arch/arm/mach-sa1100/h3600.c | 16 ++++------------ arch/arm/mach-sa1100/include/mach/h3600.h | 12 +----------- 2 files changed, 5 insertions(+), 23 deletions(-) (limited to 'arch/arm/mach-sa1100/h3600.c') diff --git a/arch/arm/mach-sa1100/h3600.c b/arch/arm/mach-sa1100/h3600.c index 1fa0f58c07b0..0eb2f159578b 100644 --- a/arch/arm/mach-sa1100/h3600.c +++ b/arch/arm/mach-sa1100/h3600.c @@ -46,8 +46,8 @@ #include "generic.h" -struct ipaq_model_ops ipaq_model_ops; -EXPORT_SYMBOL(ipaq_model_ops); +void (*assign_h3600_egpio)(enum ipaq_egpio_type x, int level); +EXPORT_SYMBOL(assign_h3600_egpio); static struct mtd_partition h3xxx_partitions[] = { { @@ -293,10 +293,6 @@ static void h3100_control_egpio(enum ipaq_egpio_type x, int setp) } } -static struct ipaq_model_ops h3100_model_ops __initdata = { - .control = h3100_control_egpio, -}; - #define H3100_DIRECT_EGPIO (GPIO_H3100_BT_ON \ | GPIO_H3100_GPIO3 \ | GPIO_H3100_QMUTE \ @@ -322,7 +318,7 @@ static void __init h3100_map_io(void) GAFR &= ~H3100_DIRECT_EGPIO; H3100_EGPIO = h3100_egpio; - ipaq_model_ops = h3100_model_ops; + assign_h3600_egpio = h3100_control_egpio; } MACHINE_START(H3100, "Compaq iPAQ H3100") @@ -405,10 +401,6 @@ static void h3600_control_egpio(enum ipaq_egpio_type x, int setp) } } -static struct ipaq_model_ops h3600_model_ops __initdata = { - .control = h3600_control_egpio, -}; - static void __init h3600_map_io(void) { h3xxx_map_io(); @@ -423,7 +415,7 @@ static void __init h3600_map_io(void) GPIO_LDD11 | GPIO_LDD10 | GPIO_LDD9 | GPIO_LDD8; H3600_EGPIO = h3600_egpio; /* Maintains across sleep? */ - ipaq_model_ops = h3600_model_ops; + assign_h3600_egpio = h3600_control_egpio; } MACHINE_START(H3600, "Compaq iPAQ H3600") diff --git a/arch/arm/mach-sa1100/include/mach/h3600.h b/arch/arm/mach-sa1100/include/mach/h3600.h index 33fc4bcfd3ee..2827faa47421 100644 --- a/arch/arm/mach-sa1100/include/mach/h3600.h +++ b/arch/arm/mach-sa1100/include/mach/h3600.h @@ -93,17 +93,7 @@ enum ipaq_egpio_type { IPAQ_EGPIO_LCD_ENABLE, /* Enable/disable LCD controller */ }; -struct ipaq_model_ops { - void (*control)(enum ipaq_egpio_type, int); -}; - -extern struct ipaq_model_ops ipaq_model_ops; - -static __inline__ void assign_h3600_egpio(enum ipaq_egpio_type x, int level) -{ - if (ipaq_model_ops.control) - ipaq_model_ops.control(x,level); -} +extern void (*assign_h3600_egpio)(enum ipaq_egpio_type x, int level); #endif /* ASSEMBLY */ -- cgit v1.2.3