All pastes #771279 Raw Edit

Diff

public text v1 · immutable
·published 2007-11-12 22:07 UTC
rendered paste body
Index: kernel26/arch/arm/mach-pxa/hx4700/hx4700_bt.c===================================================================--- kernel26.orig/arch/arm/mach-pxa/hx4700/hx4700_bt.c	2007-11-12 22:49:56.000000000 +0100+++ kernel26/arch/arm/mach-pxa/hx4700/hx4700_bt.c	2007-11-12 22:53:47.000000000 +0100@@ -12,6 +12,7 @@ #include <linux/fs.h> #include <linux/leds.h> +#include <asm/gpio.h> #include <asm/hardware.h> #include <asm/arch/serial.h> #include <asm/arch/hx4700.h>@@ -32,7 +33,7 @@  	case PXA_UART_CFG_POST_STARTUP: 		/* pre-serial-up hardware configuration */-		hx4700_egpio_enable( EGPIO5_BT_3V3_ON );+		gpio_set_value(EGPIO5_BT_3V3_ON, 1); 		SET_HX4700_GPIO( CPU_BT_RESET_N, 0 ); 		mdelay(1); 		SET_HX4700_GPIO( CPU_BT_RESET_N, 1 );@@ -49,7 +50,7 @@ 		break;  	case PXA_UART_CFG_PRE_SHUTDOWN:-		hx4700_egpio_disable( EGPIO5_BT_3V3_ON );+		gpio_set_value(EGPIO5_BT_3V3_ON, 0); 		mdelay(1); 		led_trigger_event_shared(hx4700_radio_trig, LED_OFF); 		break;Index: kernel26/arch/arm/mach-pxa/hx4700/hx4700_core.c===================================================================--- kernel26.orig/arch/arm/mach-pxa/hx4700/hx4700_core.c	2007-11-12 22:49:56.000000000 +0100+++ kernel26/arch/arm/mach-pxa/hx4700/hx4700_core.c	2007-11-12 22:53:47.000000000 +0100@@ -26,51 +26,10 @@ #include <linux/mfd/asic3_base.h> #include <asm/hardware/ipaq-asic3.h> -#define EGPIO_OFFSET	0-#define EGPIO_BASE	(PXA_CS5_PHYS+EGPIO_OFFSET)--volatile u_int16_t *egpios;-u_int16_t egpio_reg;- static int htc_bootloader = 0;	/* Is the stock HTC bootloader installed? */ static u32 save[4]; static u32 save2[13]; -/*- * may make sense to put egpios elsewhere, but they're here now- * since they share some of the same address space with the TI WLAN- *- * EGPIO register is write-only- */--void-hx4700_egpio_enable( u_int16_t bits )-{-	unsigned long flags;--	local_irq_save(flags);--	egpio_reg |= bits;-	*egpios = egpio_reg;--	local_irq_restore(flags);-}-EXPORT_SYMBOL(hx4700_egpio_enable);--void-hx4700_egpio_disable( u_int16_t bits )-{-	unsigned long flags;--	local_irq_save(flags);--	egpio_reg &= ~bits;-	*egpios = egpio_reg;--	local_irq_restore(flags);-}-EXPORT_SYMBOL(hx4700_egpio_disable);- #ifdef CONFIG_PM static int hx4700_suspend(struct platform_device *pdev, pm_message_t state) {@@ -101,7 +60,6 @@ 	 * */ 	asic3_set_clock_cdex(&hx4700_asic3.dev, 0xffff, 0x21c2); -	*egpios = 0;	/* turn off all egpio power */ 	/* 	 * Note that WEP1 wake up event is used by bootldr to set the 	 * LEDS when power is applied/removed for charging.@@ -165,7 +123,7 @@  static int hx4700_resume(struct platform_device *pdev) {-	hx4700_egpio_enable(0);+	gpio_set_value(EGPIO0_VCC_3V3_EN, 1); 	return 0; } #else@@ -264,10 +222,6 @@  	printk( KERN_NOTICE "hx4700 Core Hardware Driver\n" ); -	egpios = (volatile u_int16_t *)ioremap_nocache( EGPIO_BASE, sizeof *egpios );-	if (!egpios)-		return -ENODEV;- 	/* Is the stock HTC bootloader installed? */  	bootldr = (u32 *) ioremap(PXA_CS0_PHYS, 1024 * 1024);@@ -310,8 +264,6 @@ 	iounmap(bootldr);  	ret = device_create_file(&pdev->dev, &dev_attr_auto_brightness);-	if (ret)-		iounmap(egpios);  	return ret; }@@ -323,8 +275,6 @@  	device_remove_file(&pdev->dev, &dev_attr_auto_brightness); -	if (egpios != NULL)-		iounmap( (void *)egpios ); 	funcs->udc_detect = NULL; 	return 0; }Index: kernel26/arch/arm/mach-pxa/hx4700/hx4700_pcmcia.c===================================================================--- kernel26.orig/arch/arm/mach-pxa/hx4700/hx4700_pcmcia.c	2007-11-12 22:49:56.000000000 +0100+++ kernel26/arch/arm/mach-pxa/hx4700/hx4700_pcmcia.c	2007-11-12 22:53:47.000000000 +0100@@ -22,12 +22,12 @@  #include <asm/mach-types.h> #include <asm/hardware.h>+#include <asm/gpio.h> #include <asm/irq.h>  #include <asm/arch/pxa-regs.h> #include <asm/arch/hx4700-gpio.h> #include <asm/arch/hx4700-asic.h>-#include <asm/arch/hx4700-core.h> #include <asm/hardware/ipaq-asic3.h> #include <linux/mfd/asic3_base.h> @@ -111,11 +111,11 @@ 	skt->irq = HX4700_IRQ( CF_RNB );  	if (power_en) {-		hx4700_egpio_enable( EGPIO4_CF_3V3_ON );+		gpio_set_value(EGPIO4_CF_3V3_ON, 1); 		set_irq_type( irq, IRQT_RISING ); 	} 	else {-		hx4700_egpio_disable( EGPIO4_CF_3V3_ON );+		gpio_set_value(EGPIO4_CF_3V3_ON, 0); 		set_irq_type( irq, IRQT_FALLING ); 	} @@ -195,12 +195,12 @@ 			ASIC3_EXTCF_CF0_BUF_EN     | 0                          | 			ASIC3_EXTCF_CF0_PWAIT_EN   | 0 		);-		hx4700_egpio_disable( EGPIO4_CF_3V3_ON );+		gpio_set_value(EGPIO4_CF_3V3_ON, 0); 		hx4700_cf_reset(1);	/* Ensure the slot is reset when powered off */ 		power_en = 0; 	} 	else if (state->Vcc == 33 || state->Vcc == 50) {-		hx4700_egpio_enable( EGPIO4_CF_3V3_ON );+		gpio_set_value(EGPIO4_CF_3V3_ON, 0); 		mdelay(1); 		/* Turn on CF stuff without messing with SD bit 14.  */ 		asic3_set_extcf_select(&hx4700_asic3.dev,Index: kernel26/include/asm-arm/arch-pxa/hx4700-core.h===================================================================--- kernel26.orig/include/asm-arm/arch-pxa/hx4700-core.h	2007-11-12 22:49:56.000000000 +0100+++ kernel26/include/asm-arm/arch-pxa/hx4700-core.h	2007-11-12 22:53:47.000000000 +0100@@ -9,19 +9,6 @@ #define _HX4700_CORE_H #include <linux/leds.h> -#define EGPIO0_VCC_3V3_EN		(1<<0)	/* WLAN support chip power */-#define EGPIO1_WL_VREG_EN		(1<<1)	/* WLAN Power */-#define EGPIO2_VCC_2V1_WL_EN		(1<<2)	/* unused */-#define EGPIO3_SS_PWR_ON		(1<<3)	/* smart slot power on */-#define EGPIO4_CF_3V3_ON		(1<<4)	/* CF 3.3V enable */-#define EGPIO5_BT_3V3_ON		(1<<5)	/* Bluetooth 3.3V enable */-#define EGPIO6_WL1V8_EN			(1<<6)	/* WLAN 1.8V enable */-#define EGPIO7_VCC_3V3_WL_EN		(1<<7)	/* WLAN 3.3V enable */-#define EGPIO8_USB_3V3_ON		(1<<8)	/* unused */--void hx4700_egpio_enable( u_int16_t bits );-void hx4700_egpio_disable( u_int16_t bits );- struct hx4700_core_funcs {     int (*udc_detect)( void ); };Index: kernel26/include/asm-arm/arch-pxa/hx4700-gpio.h===================================================================--- kernel26.orig/include/asm-arm/arch-pxa/hx4700-gpio.h	2007-11-12 22:49:56.000000000 +0100+++ kernel26/include/asm-arm/arch-pxa/hx4700-gpio.h	2007-11-12 23:05:33.000000000 +0100@@ -9,6 +9,7 @@ #ifndef _HX4700_GPIO_H_ #define _HX4700_GPIO_H_ +#include <asm/arch/hx4700.h> #include <asm/arch/pxa-regs.h>  #define GET_HX4700_GPIO(gpio) \@@ -195,4 +196,18 @@ #define GPIO_NR_HX4700_I2C_SCL_MD		(117 | GPIO_ALT_FN_1_OUT) #define GPIO_NR_HX4700_I2C_SDA_MD		(118 | GPIO_ALT_FN_1_OUT) +/*+ * EGPIOs+ */++#define EGPIO0_VCC_3V3_EN		(HX4700_EGPIO_BASE + 0)	/* WLAN support chip power */+#define EGPIO1_WL_VREG_EN		(HX4700_EGPIO_BASE + 1)	/* WLAN Power */+#define EGPIO2_VCC_2V1_WL_EN		(HX4700_EGPIO_BASE + 2)	/* unused */+#define EGPIO3_SS_PWR_ON		(HX4700_EGPIO_BASE + 3)	/* smart slot power on */+#define EGPIO4_CF_3V3_ON		(HX4700_EGPIO_BASE + 4)	/* CF 3.3V enable */+#define EGPIO5_BT_3V3_ON		(HX4700_EGPIO_BASE + 5)	/* Bluetooth 3.3V enable */+#define EGPIO6_WL1V8_EN			(HX4700_EGPIO_BASE + 6)	/* WLAN 1.8V enable */+#define EGPIO7_VCC_3V3_WL_EN		(HX4700_EGPIO_BASE + 7)	/* WLAN 3.3V enable */+#define EGPIO8_USB_3V3_ON		(HX4700_EGPIO_BASE + 8)	/* unused */+ #endif /* _HX4700_GPIO_H */Index: kernel26/include/asm-arm/arch-pxa/hx4700.h===================================================================--- kernel26.orig/include/asm-arm/arch-pxa/hx4700.h	2007-11-12 22:49:56.000000000 +0100+++ kernel26/include/asm-arm/arch-pxa/hx4700.h	2007-11-12 22:53:47.000000000 +0100@@ -15,7 +15,7 @@  #define HX4700_ASIC3_IRQ_BASE IRQ_BOARD_START #define HX4700_ASIC3_GPIO_BASE GPIO_BASE_INCREMENT-+#define HX4700_EGPIO_BASE (2*GPIO_BASE_INCREMENT)  struct hx4700_bt_funcs { 	void (*configure) ( int state );Index: kernel26/arch/arm/mach-pxa/hx4700/hx4700.c===================================================================--- kernel26.orig/arch/arm/mach-pxa/hx4700/hx4700.c	2007-11-12 22:49:55.000000000 +0100+++ kernel26/arch/arm/mach-pxa/hx4700/hx4700.c	2007-11-12 22:53:47.000000000 +0100@@ -34,6 +34,7 @@ #include <linux/gpio_keys.h> #include <linux/dpm.h> #include <linux/rs232_serial.h>+#include <linux/mfd/htc-egpio.h> #include <asm/gpio.h> #include <asm/arch/pxa2xx_udc_gpio.h> @@ -194,6 +195,32 @@ 	.get_txrx  = hx4700_irda_get_txrx, }; +/* EGPIOs */++static struct resource egpio_resources[] = {+	[0] = {+		.start	= PXA_CS5_PHYS,+		.end	= PXA_CS5_PHYS + 0x4,+		.flags	= IORESOURCE_MEM,+	},+};++struct htc_egpio_platform_data egpio_data = {+	.gpio_base   = HX4700_EGPIO_BASE,+	.nrRegs      = 1,+};++struct platform_device hx4700_egpio = {+	.name = "htc-egpio",+	.id   = -1,+	.dev  = {+		.platform_data = &egpio_data,+	},+	.resource      = egpio_resources,+	.num_resources = ARRAY_SIZE(egpio_resources),+};++ /* LEDs */ static struct asic3_led hx4700_leds[] = { 	{@@ -568,6 +595,7 @@ };  static struct platform_device *devices[] __initdata = {+	&hx4700_egpio, 	&ads7846_ssp, 	&ads7846_ts, 	&hx4700_asic3,Index: kernel26/drivers/net/wireless/acx/hx4700_acx.c===================================================================--- kernel26.orig/drivers/net/wireless/acx/hx4700_acx.c	2007-11-12 22:49:55.000000000 +0100+++ kernel26/drivers/net/wireless/acx/hx4700_acx.c	2007-11-12 22:53:47.000000000 +0100@@ -21,6 +21,7 @@ #include <asm/arch/pxa-regs.h> #include <asm/arch/hx4700-gpio.h> #include <asm/arch/hx4700-core.h>+#include <asm/gpio.h> #include <asm/io.h>  #include "acx_hw.h"@@ -34,12 +35,13 @@ { 	SET_HX4700_GPIO( WLAN_RESET_N, 0 ); 	mdelay(5);-	hx4700_egpio_enable( EGPIO0_VCC_3V3_EN );+	gpio_set_value(EGPIO0_VCC_3V3_EN, 1); 	mdelay(100);-	hx4700_egpio_enable( EGPIO7_VCC_3V3_WL_EN );+	gpio_set_value(EGPIO7_VCC_3V3_WL_EN, 1); 	mdelay(150);-	hx4700_egpio_enable( EGPIO1_WL_VREG_EN | EGPIO2_VCC_2V1_WL_EN |-                             EGPIO6_WL1V8_EN );+	gpio_set_value(EGPIO1_WL_VREG_EN, 1);+	gpio_set_value(EGPIO2_VCC_2V1_WL_EN, 1);+	gpio_set_value(EGPIO6_WL1V8_EN, 1); 	mdelay(10); 	SET_HX4700_GPIO( WLAN_RESET_N, 1 ); 	mdelay(50);@@ -50,9 +52,11 @@ static int hx4700_wlan_stop( void ) {-	hx4700_egpio_disable( EGPIO0_VCC_3V3_EN | EGPIO1_WL_VREG_EN |-                              EGPIO7_VCC_3V3_WL_EN | EGPIO2_VCC_2V1_WL_EN |-                              EGPIO6_WL1V8_EN );+	gpio_set_value(EGPIO0_VCC_3V3_EN, 0);+	gpio_set_value(EGPIO1_WL_VREG_EN, 0);+	gpio_set_value(EGPIO7_VCC_3V3_WL_EN, 0);+	gpio_set_value(EGPIO2_VCC_2V1_WL_EN, 0);+	gpio_set_value(EGPIO6_WL1V8_EN, 0); 	SET_HX4700_GPIO( WLAN_RESET_N, 0 ); 	led_trigger_event_shared(hx4700_radio_trig, LED_OFF); 	return 0;Index: kernel26/arch/arm/mach-pxa/hx4700/Kconfig===================================================================--- kernel26.orig/arch/arm/mach-pxa/hx4700/Kconfig	2007-11-12 22:54:05.000000000 +0100+++ kernel26/arch/arm/mach-pxa/hx4700/Kconfig	2007-11-12 22:54:38.000000000 +0100@@ -6,6 +6,7 @@ 	select KEYBOARD_GPIO 	select IWMMXT 	select PXA_SUSPEND_SAVE_EXTRA_REGS+	select HTC_EGPIO 	help 	  This enables support for the HP iPAQ hx4700 handheld.