Browse Source

Merge tag 'pxa-for-3.19' of https://github.com/rjarzmik/linux into next/soc

Pull "arm: pxa: pxa for v3.19" from Robert Jarzmik:

This is a very quiet release, featuring a small cleanup, a tosa change
on its charger driver, and support for pxa device-tree based pxa27x
boards.

The device-tree part will only be fully activated once clocks support
is fully operation in the common clock framework.

* tag 'pxa-for-3.19' of https://github.com/rjarzmik/linux:
  arm: pxa: add pxa27x device-tree support
  arm: pxa: remove unnecessary includes from pxa-dt
  arm: pxa: move init functions into generic.h
  arm: pxa: add device-tree irq init for pxa27x
  ARM: pxa: tosa: switch to gpio-charger
  arm: mach-pxa: Convert pr_warning to pr_warn

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Arnd Bergmann 10 years ago
parent
commit
c830343a88

+ 11 - 0
arch/arm/mach-pxa/Kconfig

@@ -4,6 +4,17 @@ menu "Intel PXA2xx/PXA3xx Implementations"
 
 
 comment "Intel/Marvell Dev Platforms (sorted by hardware release time)"
 comment "Intel/Marvell Dev Platforms (sorted by hardware release time)"
 
 
+config MACH_PXA27X_DT
+	bool "Support PXA27x platforms from device tree"
+	select CPU_PXA27x
+	select POWER_SUPPLY
+	select PXA27x
+	select USE_OF
+	help
+	  Include support for Marvell PXA27x based platforms using
+	  the device tree. Needn't select any other machine while
+	  MACH_PXA27X_DT is enabled.
+
 config MACH_PXA3XX_DT
 config MACH_PXA3XX_DT
 	bool "Support PXA3xx platforms from device tree"
 	bool "Support PXA3xx platforms from device tree"
 	select CPU_PXA300
 	select CPU_PXA300

+ 1 - 0
arch/arm/mach-pxa/Makefile

@@ -21,6 +21,7 @@ obj-$(CONFIG_CPU_PXA930)	+= pxa930.o
 
 
 # Device Tree support
 # Device Tree support
 obj-$(CONFIG_MACH_PXA3XX_DT)	+= pxa-dt.o
 obj-$(CONFIG_MACH_PXA3XX_DT)	+= pxa-dt.o
+obj-$(CONFIG_MACH_PXA27X_DT)	+= pxa-dt.o
 
 
 # Intel/Marvell Dev Platforms
 # Intel/Marvell Dev Platforms
 obj-$(CONFIG_ARCH_LUBBOCK)	+= lubbock.o
 obj-$(CONFIG_ARCH_LUBBOCK)	+= lubbock.o

+ 2 - 2
arch/arm/mach-pxa/em-x270.c

@@ -378,7 +378,7 @@ static void __init em_x270_init_nand(void)
 
 
 	err = gpio_request(GPIO11_NAND_CS, "NAND CS");
 	err = gpio_request(GPIO11_NAND_CS, "NAND CS");
 	if (err) {
 	if (err) {
-		pr_warning("EM-X270: failed to request NAND CS gpio\n");
+		pr_warn("EM-X270: failed to request NAND CS gpio\n");
 		return;
 		return;
 	}
 	}
 
 
@@ -386,7 +386,7 @@ static void __init em_x270_init_nand(void)
 
 
 	err = gpio_request(nand_rb, "NAND R/B");
 	err = gpio_request(nand_rb, "NAND R/B");
 	if (err) {
 	if (err) {
-		pr_warning("EM-X270: failed to request NAND R/B gpio\n");
+		pr_warn("EM-X270: failed to request NAND R/B gpio\n");
 		gpio_free(GPIO11_NAND_CS);
 		gpio_free(GPIO11_NAND_CS);
 		return;
 		return;
 	}
 	}

+ 42 - 23
arch/arm/mach-pxa/generic.h

@@ -13,11 +13,11 @@
 
 
 struct irq_data;
 struct irq_data;
 
 
-extern void pxa_timer_init(void);
-
-extern void __init pxa_map_io(void);
-
 extern unsigned int get_clk_frequency_khz(int info);
 extern unsigned int get_clk_frequency_khz(int info);
+extern void __init pxa_dt_irq_init(int (*fn)(struct irq_data *,
+					     unsigned int));
+extern void __init pxa_map_io(void);
+extern void pxa_timer_init(void);
 
 
 #define SET_BANK(__nr,__start,__size) \
 #define SET_BANK(__nr,__start,__size) \
 	mi->bank[__nr].start = (__start), \
 	mi->bank[__nr].start = (__start), \
@@ -25,6 +25,43 @@ extern unsigned int get_clk_frequency_khz(int info);
 
 
 #define ARRAY_AND_SIZE(x)	(x), ARRAY_SIZE(x)
 #define ARRAY_AND_SIZE(x)	(x), ARRAY_SIZE(x)
 
 
+#define pxa25x_handle_irq icip_handle_irq
+extern void __init pxa25x_init_irq(void);
+extern void __init pxa25x_map_io(void);
+extern void __init pxa26x_init_irq(void);
+
+#define pxa27x_handle_irq ichp_handle_irq
+extern void __init pxa27x_dt_init_irq(void);
+extern unsigned	pxa27x_get_clk_frequency_khz(int);
+extern void __init pxa27x_init_irq(void);
+extern void __init pxa27x_map_io(void);
+
+#define pxa3xx_handle_irq ichp_handle_irq
+extern void __init pxa3xx_dt_init_irq(void);
+extern void __init pxa3xx_init_irq(void);
+extern void __init pxa3xx_map_io(void);
+
+extern struct syscore_ops pxa_irq_syscore_ops;
+extern struct syscore_ops pxa2xx_mfp_syscore_ops;
+extern struct syscore_ops pxa3xx_mfp_syscore_ops;
+
+void __init pxa_set_ffuart_info(void *info);
+void __init pxa_set_btuart_info(void *info);
+void __init pxa_set_stuart_info(void *info);
+void __init pxa_set_hwuart_info(void *info);
+
+void pxa_restart(enum reboot_mode, const char *);
+
+#if defined(CONFIG_PXA25x) || defined(CONFIG_PXA27x)
+extern void pxa2xx_clear_reset_status(unsigned int);
+#else
+static inline void pxa2xx_clear_reset_status(unsigned int mask) {}
+#endif
+
+/*
+ * Once fully converted to the clock framework, all these functions should be
+ * removed, and replaced with a clk_get(NULL, "core").
+ */
 #ifdef CONFIG_PXA25x
 #ifdef CONFIG_PXA25x
 extern unsigned pxa25x_get_clk_frequency_khz(int);
 extern unsigned pxa25x_get_clk_frequency_khz(int);
 #else
 #else
@@ -32,30 +69,12 @@ extern unsigned pxa25x_get_clk_frequency_khz(int);
 #endif
 #endif
 
 
 #ifdef CONFIG_PXA27x
 #ifdef CONFIG_PXA27x
-extern unsigned pxa27x_get_clk_frequency_khz(int);
 #else
 #else
 #define pxa27x_get_clk_frequency_khz(x)		(0)
 #define pxa27x_get_clk_frequency_khz(x)		(0)
 #endif
 #endif
 
 
-#if defined(CONFIG_PXA25x) || defined(CONFIG_PXA27x)
-extern void pxa2xx_clear_reset_status(unsigned int);
-#else
-static inline void pxa2xx_clear_reset_status(unsigned int mask) {}
-#endif
-
 #ifdef CONFIG_PXA3xx
 #ifdef CONFIG_PXA3xx
-extern unsigned pxa3xx_get_clk_frequency_khz(int);
+extern unsigned	pxa3xx_get_clk_frequency_khz(int);
 #else
 #else
 #define pxa3xx_get_clk_frequency_khz(x)		(0)
 #define pxa3xx_get_clk_frequency_khz(x)		(0)
 #endif
 #endif
-
-extern struct syscore_ops pxa_irq_syscore_ops;
-extern struct syscore_ops pxa2xx_mfp_syscore_ops;
-extern struct syscore_ops pxa3xx_mfp_syscore_ops;
-
-void __init pxa_set_ffuart_info(void *info);
-void __init pxa_set_btuart_info(void *info);
-void __init pxa_set_stuart_info(void *info);
-void __init pxa_set_hwuart_info(void *info);
-
-void pxa_restart(enum reboot_mode, const char *);

+ 1 - 2
arch/arm/mach-pxa/gumstix.c

@@ -140,8 +140,7 @@ static void gumstix_setup_bt_clock(void)
 	int timeout = 500;
 	int timeout = 500;
 
 
 	if (!(OSCC & OSCC_OOK))
 	if (!(OSCC & OSCC_OOK))
-		pr_warning("32kHz clock was not on. Bootloader may need to "
-				"be updated\n");
+		pr_warn("32kHz clock was not on. Bootloader may need to be updated\n");
 	else
 	else
 		return;
 		return;
 
 

+ 0 - 8
arch/arm/mach-pxa/include/mach/pxa25x.h

@@ -6,12 +6,4 @@
 #include <mach/mfp-pxa25x.h>
 #include <mach/mfp-pxa25x.h>
 #include <mach/irqs.h>
 #include <mach/irqs.h>
 
 
-extern void __init pxa25x_map_io(void);
-extern void __init pxa25x_init_irq(void);
-#ifdef CONFIG_CPU_PXA26x
-extern void __init pxa26x_init_irq(void);
-#endif
-
-#define pxa25x_handle_irq	icip_handle_irq
-
 #endif /* __MACH_PXA25x_H */
 #endif /* __MACH_PXA25x_H */

+ 0 - 4
arch/arm/mach-pxa/include/mach/pxa27x.h

@@ -19,11 +19,7 @@
 #define ARB_CORE_PARK		(1<<24)	   /* Be parked with core when idle */
 #define ARB_CORE_PARK		(1<<24)	   /* Be parked with core when idle */
 #define ARB_LOCK_FLAG		(1<<23)	   /* Only Locking masters gain access to the bus */
 #define ARB_LOCK_FLAG		(1<<23)	   /* Only Locking masters gain access to the bus */
 
 
-extern void __init pxa27x_map_io(void);
-extern void __init pxa27x_init_irq(void);
 extern int __init pxa27x_set_pwrmode(unsigned int mode);
 extern int __init pxa27x_set_pwrmode(unsigned int mode);
 extern void pxa27x_cpu_pm_enter(suspend_state_t state);
 extern void pxa27x_cpu_pm_enter(suspend_state_t state);
 
 
-#define pxa27x_handle_irq	ichp_handle_irq
-
 #endif /* __MACH_PXA27x_H */
 #endif /* __MACH_PXA27x_H */

+ 0 - 5
arch/arm/mach-pxa/include/mach/pxa3xx.h

@@ -5,9 +5,4 @@
 #include <mach/pxa3xx-regs.h>
 #include <mach/pxa3xx-regs.h>
 #include <mach/irqs.h>
 #include <mach/irqs.h>
 
 
-extern void __init pxa3xx_map_io(void);
-extern void __init pxa3xx_init_irq(void);
-
-#define pxa3xx_handle_irq	ichp_handle_irq
-
 #endif /* __MACH_PXA3XX_H */
 #endif /* __MACH_PXA3XX_H */

+ 5 - 7
arch/arm/mach-pxa/mfp-pxa2xx.c

@@ -93,8 +93,8 @@ static int __mfp_config_gpio(unsigned gpio, unsigned long c)
 		break;
 		break;
 	default:
 	default:
 		/* warning and fall through, treat as MFP_LPM_DEFAULT */
 		/* warning and fall through, treat as MFP_LPM_DEFAULT */
-		pr_warning("%s: GPIO%d: unsupported low power mode\n",
-				__func__, gpio);
+		pr_warn("%s: GPIO%d: unsupported low power mode\n",
+			__func__, gpio);
 		break;
 		break;
 	}
 	}
 
 
@@ -107,14 +107,12 @@ static int __mfp_config_gpio(unsigned gpio, unsigned long c)
 	 * configurations of those pins not able to wakeup
 	 * configurations of those pins not able to wakeup
 	 */
 	 */
 	if ((c & MFP_LPM_CAN_WAKEUP) && !gpio_desc[gpio].can_wakeup) {
 	if ((c & MFP_LPM_CAN_WAKEUP) && !gpio_desc[gpio].can_wakeup) {
-		pr_warning("%s: GPIO%d unable to wakeup\n",
-				__func__, gpio);
+		pr_warn("%s: GPIO%d unable to wakeup\n", __func__, gpio);
 		return -EINVAL;
 		return -EINVAL;
 	}
 	}
 
 
 	if ((c & MFP_LPM_CAN_WAKEUP) && is_out) {
 	if ((c & MFP_LPM_CAN_WAKEUP) && is_out) {
-		pr_warning("%s: output GPIO%d unable to wakeup\n",
-				__func__, gpio);
+		pr_warn("%s: output GPIO%d unable to wakeup\n", __func__, gpio);
 		return -EINVAL;
 		return -EINVAL;
 	}
 	}
 
 
@@ -126,7 +124,7 @@ static inline int __mfp_validate(int mfp)
 	int gpio = mfp_to_gpio(mfp);
 	int gpio = mfp_to_gpio(mfp);
 
 
 	if ((mfp > MFP_PIN_GPIO127) || !gpio_desc[gpio].valid) {
 	if ((mfp > MFP_PIN_GPIO127) || !gpio_desc[gpio].valid) {
-		pr_warning("%s: GPIO%d is invalid pin\n", __func__, gpio);
+		pr_warn("%s: GPIO%d is invalid pin\n", __func__, gpio);
 		return -1;
 		return -1;
 	}
 	}
 
 

+ 1 - 1
arch/arm/mach-pxa/poodle.c

@@ -446,7 +446,7 @@ static void __init poodle_init(void)
 
 
 	ret = platform_add_devices(devices, ARRAY_SIZE(devices));
 	ret = platform_add_devices(devices, ARRAY_SIZE(devices));
 	if (ret)
 	if (ret)
-		pr_warning("poodle: Unable to register LoCoMo device\n");
+		pr_warn("poodle: Unable to register LoCoMo device\n");
 
 
 	pxa_set_fb_info(&poodle_locomo_device.dev, &poodle_fb_info);
 	pxa_set_fb_info(&poodle_locomo_device.dev, &poodle_fb_info);
 	pxa_set_udc_info(&udc_info);
 	pxa_set_udc_info(&udc_info);

+ 15 - 3
arch/arm/mach-pxa/pxa-dt.c

@@ -15,13 +15,10 @@
 #include <asm/mach/arch.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/time.h>
 #include <asm/mach/time.h>
 #include <mach/irqs.h>
 #include <mach/irqs.h>
-#include <mach/pxa3xx.h>
 
 
 #include "generic.h"
 #include "generic.h"
 
 
 #ifdef CONFIG_PXA3xx
 #ifdef CONFIG_PXA3xx
-extern void __init pxa3xx_dt_init_irq(void);
-
 static const struct of_dev_auxdata pxa3xx_auxdata_lookup[] __initconst = {
 static const struct of_dev_auxdata pxa3xx_auxdata_lookup[] __initconst = {
 	OF_DEV_AUXDATA("mrvl,pxa-uart",		0x40100000, "pxa2xx-uart.0", NULL),
 	OF_DEV_AUXDATA("mrvl,pxa-uart",		0x40100000, "pxa2xx-uart.0", NULL),
 	OF_DEV_AUXDATA("mrvl,pxa-uart",		0x40200000, "pxa2xx-uart.1", NULL),
 	OF_DEV_AUXDATA("mrvl,pxa-uart",		0x40200000, "pxa2xx-uart.1", NULL),
@@ -61,3 +58,18 @@ DT_MACHINE_START(PXA_DT, "Marvell PXA3xx (Device Tree Support)")
 	.dt_compat	= pxa3xx_dt_board_compat,
 	.dt_compat	= pxa3xx_dt_board_compat,
 MACHINE_END
 MACHINE_END
 #endif
 #endif
+
+#ifdef CONFIG_PXA27x
+static const char * const pxa27x_dt_board_compat[] __initconst = {
+	"marvell,pxa270",
+	NULL,
+};
+
+DT_MACHINE_START(PXA27X_DT, "Marvell PXA2xx (Device Tree Support)")
+	.map_io		= pxa27x_map_io,
+	.init_irq	= pxa27x_dt_init_irq,
+	.handle_irq	= pxa27x_handle_irq,
+	.restart	= pxa_restart,
+	.dt_compat	= pxa27x_dt_board_compat,
+MACHINE_END
+#endif

+ 6 - 0
arch/arm/mach-pxa/pxa27x.c

@@ -398,6 +398,12 @@ void __init pxa27x_init_irq(void)
 	pxa_init_irq(34, pxa27x_set_wake);
 	pxa_init_irq(34, pxa27x_set_wake);
 }
 }
 
 
+void __init pxa27x_dt_init_irq(void)
+{
+	if (IS_ENABLED(CONFIG_OF))
+		pxa_dt_irq_init(pxa27x_set_wake);
+}
+
 static struct map_desc pxa27x_io_desc[] __initdata = {
 static struct map_desc pxa27x_io_desc[] __initdata = {
 	{	/* Mem Ctl */
 	{	/* Mem Ctl */
 		.virtual	= (unsigned long)SMEMC_VIRT,
 		.virtual	= (unsigned long)SMEMC_VIRT,

+ 3 - 3
arch/arm/mach-pxa/pxa3xx-ulpi.c

@@ -74,7 +74,7 @@ static int pxa310_ulpi_poll(void)
 		cpu_relax();
 		cpu_relax();
 	}
 	}
 
 
-	pr_warning("%s: ULPI access timed out!\n", __func__);
+	pr_warn("%s: ULPI access timed out!\n", __func__);
 
 
 	return -ETIMEDOUT;
 	return -ETIMEDOUT;
 }
 }
@@ -84,7 +84,7 @@ static int pxa310_ulpi_read(struct usb_phy *otg, u32 reg)
 	int err;
 	int err;
 
 
 	if (pxa310_ulpi_get_phymode() != SYNCH) {
 	if (pxa310_ulpi_get_phymode() != SYNCH) {
-		pr_warning("%s: PHY is not in SYNCH mode!\n", __func__);
+		pr_warn("%s: PHY is not in SYNCH mode!\n", __func__);
 		return -EBUSY;
 		return -EBUSY;
 	}
 	}
 
 
@@ -101,7 +101,7 @@ static int pxa310_ulpi_read(struct usb_phy *otg, u32 reg)
 static int pxa310_ulpi_write(struct usb_phy *otg, u32 val, u32 reg)
 static int pxa310_ulpi_write(struct usb_phy *otg, u32 val, u32 reg)
 {
 {
 	if (pxa310_ulpi_get_phymode() != SYNCH) {
 	if (pxa310_ulpi_get_phymode() != SYNCH) {
-		pr_warning("%s: PHY is not in SYNCH mode!\n", __func__);
+		pr_warn("%s: PHY is not in SYNCH mode!\n", __func__);
 		return -EBUSY;
 		return -EBUSY;
 	}
 	}
 
 

+ 13 - 13
arch/arm/mach-pxa/raumfeld.c

@@ -521,7 +521,7 @@ static void __init raumfeld_w1_init(void)
 				"W1 external pullup enable");
 				"W1 external pullup enable");
 
 
 	if (ret < 0)
 	if (ret < 0)
-		pr_warning("Unable to request GPIO_W1_PULLUP_ENABLE\n");
+		pr_warn("Unable to request GPIO_W1_PULLUP_ENABLE\n");
 	else
 	else
 		gpio_direction_output(GPIO_W1_PULLUP_ENABLE, 0);
 		gpio_direction_output(GPIO_W1_PULLUP_ENABLE, 0);
 
 
@@ -600,7 +600,7 @@ static void __init raumfeld_lcd_init(void)
 
 
 	ret = gpio_request(GPIO_TFT_VA_EN, "display VA enable");
 	ret = gpio_request(GPIO_TFT_VA_EN, "display VA enable");
 	if (ret < 0)
 	if (ret < 0)
-		pr_warning("Unable to request GPIO_TFT_VA_EN\n");
+		pr_warn("Unable to request GPIO_TFT_VA_EN\n");
 	else
 	else
 		gpio_direction_output(GPIO_TFT_VA_EN, 1);
 		gpio_direction_output(GPIO_TFT_VA_EN, 1);
 
 
@@ -608,7 +608,7 @@ static void __init raumfeld_lcd_init(void)
 
 
 	ret = gpio_request(GPIO_DISPLAY_ENABLE, "display enable");
 	ret = gpio_request(GPIO_DISPLAY_ENABLE, "display enable");
 	if (ret < 0)
 	if (ret < 0)
-		pr_warning("Unable to request GPIO_DISPLAY_ENABLE\n");
+		pr_warn("Unable to request GPIO_DISPLAY_ENABLE\n");
 	else
 	else
 		gpio_direction_output(GPIO_DISPLAY_ENABLE, 1);
 		gpio_direction_output(GPIO_DISPLAY_ENABLE, 1);
 
 
@@ -814,17 +814,17 @@ static void __init raumfeld_power_init(void)
 	/* Set PEN2 high to enable maximum charge current */
 	/* Set PEN2 high to enable maximum charge current */
 	ret = gpio_request(GPIO_CHRG_PEN2, "CHRG_PEN2");
 	ret = gpio_request(GPIO_CHRG_PEN2, "CHRG_PEN2");
 	if (ret < 0)
 	if (ret < 0)
-		pr_warning("Unable to request GPIO_CHRG_PEN2\n");
+		pr_warn("Unable to request GPIO_CHRG_PEN2\n");
 	else
 	else
 		gpio_direction_output(GPIO_CHRG_PEN2, 1);
 		gpio_direction_output(GPIO_CHRG_PEN2, 1);
 
 
 	ret = gpio_request(GPIO_CHARGE_DC_OK, "CABLE_DC_OK");
 	ret = gpio_request(GPIO_CHARGE_DC_OK, "CABLE_DC_OK");
 	if (ret < 0)
 	if (ret < 0)
-		pr_warning("Unable to request GPIO_CHARGE_DC_OK\n");
+		pr_warn("Unable to request GPIO_CHARGE_DC_OK\n");
 
 
 	ret = gpio_request(GPIO_CHARGE_USB_SUSP, "CHARGE_USB_SUSP");
 	ret = gpio_request(GPIO_CHARGE_USB_SUSP, "CHARGE_USB_SUSP");
 	if (ret < 0)
 	if (ret < 0)
-		pr_warning("Unable to request GPIO_CHARGE_USB_SUSP\n");
+		pr_warn("Unable to request GPIO_CHARGE_USB_SUSP\n");
 	else
 	else
 		gpio_direction_output(GPIO_CHARGE_USB_SUSP, 0);
 		gpio_direction_output(GPIO_CHARGE_USB_SUSP, 0);
 
 
@@ -976,19 +976,19 @@ static void __init raumfeld_audio_init(void)
 
 
 	ret = gpio_request(GPIO_CODEC_RESET, "cs4270 reset");
 	ret = gpio_request(GPIO_CODEC_RESET, "cs4270 reset");
 	if (ret < 0)
 	if (ret < 0)
-		pr_warning("unable to request GPIO_CODEC_RESET\n");
+		pr_warn("unable to request GPIO_CODEC_RESET\n");
 	else
 	else
 		gpio_direction_output(GPIO_CODEC_RESET, 1);
 		gpio_direction_output(GPIO_CODEC_RESET, 1);
 
 
 	ret = gpio_request(GPIO_SPDIF_RESET, "ak4104 s/pdif reset");
 	ret = gpio_request(GPIO_SPDIF_RESET, "ak4104 s/pdif reset");
 	if (ret < 0)
 	if (ret < 0)
-		pr_warning("unable to request GPIO_SPDIF_RESET\n");
+		pr_warn("unable to request GPIO_SPDIF_RESET\n");
 	else
 	else
 		gpio_direction_output(GPIO_SPDIF_RESET, 1);
 		gpio_direction_output(GPIO_SPDIF_RESET, 1);
 
 
 	ret = gpio_request(GPIO_MCLK_RESET, "MCLK reset");
 	ret = gpio_request(GPIO_MCLK_RESET, "MCLK reset");
 	if (ret < 0)
 	if (ret < 0)
-		pr_warning("unable to request GPIO_MCLK_RESET\n");
+		pr_warn("unable to request GPIO_MCLK_RESET\n");
 	else
 	else
 		gpio_direction_output(GPIO_MCLK_RESET, 1);
 		gpio_direction_output(GPIO_MCLK_RESET, 1);
 
 
@@ -1019,20 +1019,20 @@ static void __init raumfeld_common_init(void)
 
 
 	ret = gpio_request(GPIO_W2W_RESET, "Wi2Wi reset");
 	ret = gpio_request(GPIO_W2W_RESET, "Wi2Wi reset");
 	if (ret < 0)
 	if (ret < 0)
-		pr_warning("Unable to request GPIO_W2W_RESET\n");
+		pr_warn("Unable to request GPIO_W2W_RESET\n");
 	else
 	else
 		gpio_direction_output(GPIO_W2W_RESET, 0);
 		gpio_direction_output(GPIO_W2W_RESET, 0);
 
 
 	ret = gpio_request(GPIO_W2W_PDN, "Wi2Wi powerup");
 	ret = gpio_request(GPIO_W2W_PDN, "Wi2Wi powerup");
 	if (ret < 0)
 	if (ret < 0)
-		pr_warning("Unable to request GPIO_W2W_PDN\n");
+		pr_warn("Unable to request GPIO_W2W_PDN\n");
 	else
 	else
 		gpio_direction_output(GPIO_W2W_PDN, 0);
 		gpio_direction_output(GPIO_W2W_PDN, 0);
 
 
 	/* this can be used to switch off the device */
 	/* this can be used to switch off the device */
 	ret = gpio_request(GPIO_SHUTDOWN_SUPPLY, "supply shutdown");
 	ret = gpio_request(GPIO_SHUTDOWN_SUPPLY, "supply shutdown");
 	if (ret < 0)
 	if (ret < 0)
-		pr_warning("Unable to request GPIO_SHUTDOWN_SUPPLY\n");
+		pr_warn("Unable to request GPIO_SHUTDOWN_SUPPLY\n");
 	else
 	else
 		gpio_direction_output(GPIO_SHUTDOWN_SUPPLY, 0);
 		gpio_direction_output(GPIO_SHUTDOWN_SUPPLY, 0);
 
 
@@ -1051,7 +1051,7 @@ static void __init raumfeld_controller_init(void)
 
 
 	ret = gpio_request(GPIO_SHUTDOWN_BATT, "battery shutdown");
 	ret = gpio_request(GPIO_SHUTDOWN_BATT, "battery shutdown");
 	if (ret < 0)
 	if (ret < 0)
-		pr_warning("Unable to request GPIO_SHUTDOWN_BATT\n");
+		pr_warn("Unable to request GPIO_SHUTDOWN_BATT\n");
 	else
 	else
 		gpio_direction_output(GPIO_SHUTDOWN_BATT, 0);
 		gpio_direction_output(GPIO_SHUTDOWN_BATT, 0);
 
 

+ 7 - 34
arch/arm/mach-pxa/tosa.c

@@ -30,7 +30,7 @@
 #include <linux/gpio_keys.h>
 #include <linux/gpio_keys.h>
 #include <linux/input.h>
 #include <linux/input.h>
 #include <linux/gpio.h>
 #include <linux/gpio.h>
-#include <linux/pda_power.h>
+#include <linux/power/gpio-charger.h>
 #include <linux/spi/spi.h>
 #include <linux/spi/spi.h>
 #include <linux/spi/pxa2xx_spi.h>
 #include <linux/spi/pxa2xx_spi.h>
 #include <linux/input/matrix_keypad.h>
 #include <linux/input/matrix_keypad.h>
@@ -361,44 +361,17 @@ static struct pxaficp_platform_data tosa_ficp_platform_data = {
 /*
 /*
  * Tosa AC IN
  * Tosa AC IN
  */
  */
-static int tosa_power_init(struct device *dev)
-{
-	int ret = gpio_request(TOSA_GPIO_AC_IN, "ac in");
-	if (ret)
-		goto err_gpio_req;
-
-	ret = gpio_direction_input(TOSA_GPIO_AC_IN);
-	if (ret)
-		goto err_gpio_in;
-
-	return 0;
-
-err_gpio_in:
-	gpio_free(TOSA_GPIO_AC_IN);
-err_gpio_req:
-	return ret;
-}
-
-static void tosa_power_exit(struct device *dev)
-{
-	gpio_free(TOSA_GPIO_AC_IN);
-}
-
-static int tosa_power_ac_online(void)
-{
-	return gpio_get_value(TOSA_GPIO_AC_IN) == 0;
-}
-
 static char *tosa_ac_supplied_to[] = {
 static char *tosa_ac_supplied_to[] = {
 	"main-battery",
 	"main-battery",
 	"backup-battery",
 	"backup-battery",
 	"jacket-battery",
 	"jacket-battery",
 };
 };
 
 
-static struct pda_power_pdata tosa_power_data = {
-	.init			= tosa_power_init,
-	.is_ac_online		= tosa_power_ac_online,
-	.exit			= tosa_power_exit,
+static struct gpio_charger_platform_data tosa_power_data = {
+	.name			= "charger",
+	.type			= POWER_SUPPLY_TYPE_MAINS,
+	.gpio			= TOSA_GPIO_AC_IN,
+	.gpio_active_low	= 1,
 	.supplied_to		= tosa_ac_supplied_to,
 	.supplied_to		= tosa_ac_supplied_to,
 	.num_supplicants	= ARRAY_SIZE(tosa_ac_supplied_to),
 	.num_supplicants	= ARRAY_SIZE(tosa_ac_supplied_to),
 };
 };
@@ -415,7 +388,7 @@ static struct resource tosa_power_resource[] = {
 };
 };
 
 
 static struct platform_device tosa_power_device = {
 static struct platform_device tosa_power_device = {
-	.name			= "pda-power",
+	.name			= "gpio-charger",
 	.id			= -1,
 	.id			= -1,
 	.dev.platform_data	= &tosa_power_data,
 	.dev.platform_data	= &tosa_power_data,
 	.resource		= tosa_power_resource,
 	.resource		= tosa_power_resource,