Skip to contentSkip to conversation

pxa: Sane naming of gpios for palm platform

PATCH New Marek Vasut 1 participant 5 messages Jul 13, 2010

Subsystems (5)
lore
Share & tools
lore
#0 lore raw

PATCH 1/5 pxa: Sane naming of gpios for palm platform

---
 arch/arm/mach-pxa/include/mach/palmld.h  |   58 ++++++++++++++--------------
 arch/arm/mach-pxa/include/mach/palmt5.h  |   30 +++++++-------
 arch/arm/mach-pxa/include/mach/palmtx.h  |   44 +++++++++++-----------
 arch/arm/mach-pxa/include/mach/palmz72.h |   28 +++++++-------
 arch/arm/mach-pxa/palmld.c               |   60 +++++++++++++++---------------
 arch/arm/mach-pxa/palmt5.c               |   52 +++++++++++++-------------
 arch/arm/mach-pxa/palmtx.c               |   52 +++++++++++++-------------
 arch/arm/mach-pxa/palmz72.c              |   60 +++++++++++++++---------------
 drivers/ata/pata_palmld.c                |   22 +++++-----
 drivers/pcmcia/pxa2xx_palmld.c           |   32 ++++++++--------
 drivers/pcmcia/pxa2xx_palmtx.c           |   42 ++++++++++----------
 11 files changed, 240 insertions(+), 240 deletions(-)
 create mode 100644 arch/arm/mach-pxa/palm27x.c
 create mode 100644 configs/config-colibri
 create mode 100644 configs/config-income
 create mode 100644 configs/config-littleton
 create mode 100644 configs/config-vpac270
 create mode 100644 configs/config-vpac270-minimal
 create mode 100644 configs/config-zaurus
 create mode 100644 configs/config-zipitz2
arch/arm/mach-pxa/include/mach/palmld.h +29 -29
index ae536e8..8f9034d 100644
@@ -16,55 +16,55 @@
 /** HERE ARE GPIOs **/
 
 /* GPIOs */
-#define GPIO_NR_PALMLD_GPIO_RESET	1
-#define GPIO_NR_PALMLD_POWER_DETECT	4
-#define GPIO_NR_PALMLD_HOTSYNC_BUTTON_N	10
-#define GPIO_NR_PALMLD_POWER_SWITCH	12
-#define GPIO_NR_PALMLD_EARPHONE_DETECT 	13
-#define GPIO_NR_PALMLD_LOCK_SWITCH	15
+#define GPIO1_PALMLD_GPIO_RESET		1
+#define GPIO4_PALMLD_POWER_DETECT	4
+#define GPIO10_PALMLD_HOTSYNC_BUTTON_N	10
+#define GPIO12_PALMLD_POWER_SWITCH	12
+#define GPIO13_PALMLD_EARPHONE_DETECT	13
+#define GPIO15_PALMLD_LOCK_SWITCH	15
 
 /* SD/MMC */
-#define GPIO_NR_PALMLD_SD_DETECT_N	14
-#define GPIO_NR_PALMLD_SD_POWER		114
-#define GPIO_NR_PALMLD_SD_READONLY	116
+#define GPIO14_PALMLD_SD_DETECT_N	14
+#define GPIO114_PALMLD_SD_POWER		114
+#define GPIO116_PALMLD_SD_READONLY	116
 
 /* TOUCHSCREEN */
-#define GPIO_NR_PALMLD_WM9712_IRQ	27
+#define GPIO27_PALMLD_WM9712_IRQ	27
 
 /* IRDA */
-#define GPIO_NR_PALMLD_IR_DISABLE	108
+#define GPIO108_PALMLD_IR_DISABLE	108
 
 /* LCD/BACKLIGHT */
-#define GPIO_NR_PALMLD_BL_POWER		19
-#define GPIO_NR_PALMLD_LCD_POWER	96
+#define GPIO19_PALMLD_BL_POWER		19
+#define GPIO96_PALMLD_LCD_POWER		96
 
 /* LCD BORDER */
-#define GPIO_NR_PALMLD_BORDER_SWITCH	21
-#define GPIO_NR_PALMLD_BORDER_SELECT	22
+#define GPIO21_PALMLD_BORDER_SWITCH	21
+#define GPIO22_PALMLD_BORDER_SELECT	22
 
 /* BLUETOOTH */
-#define GPIO_NR_PALMLD_BT_POWER		17
-#define GPIO_NR_PALMLD_BT_RESET		83
+#define GPIO17_PALMLD_BT_POWER		17
+#define GPIO83_PALMLD_BT_RESET		83
 
 /* PCMCIA (WiFi) */
-#define GPIO_NR_PALMLD_PCMCIA_READY	38
-#define GPIO_NR_PALMLD_PCMCIA_POWER	36
-#define GPIO_NR_PALMLD_PCMCIA_RESET	81
+#define GPIO38_PALMLD_PCMCIA_READY	38
+#define GPIO36_PALMLD_PCMCIA_POWER	36
+#define GPIO81_PALMLD_PCMCIA_RESET	81
 
 /* LEDs */
-#define GPIO_NR_PALMLD_LED_GREEN	52
-#define GPIO_NR_PALMLD_LED_AMBER	94
+#define GPIO52_PALMLD_LED_GREEN		52
+#define GPIO94_PALMLD_LED_AMBER		94
 
 /* IDE */
-#define GPIO_NR_PALMLD_IDE_RESET	98
-#define GPIO_NR_PALMLD_IDE_PWEN		115
+#define GPIO98_PALMLD_IDE_RESET		98
+#define GPIO115_PALMLD_IDE_PWEN		115
 
 /* USB */
-#define GPIO_NR_PALMLD_USB_DETECT_N	3
-#define GPIO_NR_PALMLD_USB_READY	86
-#define GPIO_NR_PALMLD_USB_RESET	88
-#define GPIO_NR_PALMLD_USB_INT		106
-#define GPIO_NR_PALMLD_USB_POWER	118
+#define GPIO3_PALMLD_USB_DETECT_N	3
+#define GPIO86_PALMLD_USB_READY		86
+#define GPIO88_PALMLD_USB_RESET		88
+#define GPIO106_PALMLD_USB_INT		106
+#define GPIO118_PALMLD_USB_POWER	118
 /* 20, 53 and 86 are usb related too */
 
 /* INTERRUPTS */
arch/arm/mach-pxa/include/mach/palmt5.h +15 -15
index 6baf746..d70bb62 100644
@@ -18,34 +18,34 @@
 /** HERE ARE GPIOs **/
 
 /* GPIOs */
-#define GPIO_NR_PALMT5_GPIO_RESET		1
+#define GPIO1_PALMT5_GPIO_RESET			1
 
-#define GPIO_NR_PALMT5_POWER_DETECT		90
-#define GPIO_NR_PALMT5_HOTSYNC_BUTTON_N		10
-#define GPIO_NR_PALMT5_EARPHONE_DETECT		107
+#define GPIO90_PALMT5_POWER_DETECT		90
+#define GPIO10_PALMT5_HOTSYNC_BUTTON_N		10
+#define GPIO107_PALMT5_EARPHONE_DETECT		107
 
 /* SD/MMC */
-#define GPIO_NR_PALMT5_SD_DETECT_N		14
-#define GPIO_NR_PALMT5_SD_POWER			114
-#define GPIO_NR_PALMT5_SD_READONLY		115
+#define GPIO14_PALMT5_SD_DETECT_N		14
+#define GPIO114_PALMT5_SD_POWER			114
+#define GPIO115_PALMT5_SD_READONLY		115
 
 /* TOUCHSCREEN */
-#define GPIO_NR_PALMT5_WM9712_IRQ		27
+#define GPIO27_PALMT5_WM9712_IRQ		27
 
 /* IRDA - disable GPIO connected to SD pin of tranceiver (TFBS4710?) ? */
-#define GPIO_NR_PALMT5_IR_DISABLE		40
+#define GPIO40_PALMT5_IR_DISABLE		40
 
 /* USB */
-#define GPIO_NR_PALMT5_USB_DETECT_N		15
-#define GPIO_NR_PALMT5_USB_PULLUP		93
+#define GPIO15_PALMT5_USB_DETECT_N		15
+#define GPIO93_PALMT5_USB_PULLUP		93
 
 /* LCD/BACKLIGHT */
-#define GPIO_NR_PALMT5_BL_POWER			84
-#define GPIO_NR_PALMT5_LCD_POWER		96
+#define GPIO84_PALMT5_BL_POWER			84
+#define GPIO96_PALMT5_LCD_POWER			96
 
 /* BLUETOOTH */
-#define GPIO_NR_PALMT5_BT_POWER			17
-#define GPIO_NR_PALMT5_BT_RESET			83
+#define GPIO17_PALMT5_BT_POWER			17
+#define GPIO83_PALMT5_BT_RESET			83
 
 /* INTERRUPTS */
 #define IRQ_GPIO_PALMT5_SD_DETECT_N	IRQ_GPIO(GPIO_NR_PALMT5_SD_DETECT_N)
arch/arm/mach-pxa/include/mach/palmtx.h +22 -22

69 lines not on this page · raw message

arch/arm/mach-pxa/include/mach/palmz72.h +14 -14
index 2bbcf70..83dced5 100644
@@ -15,34 +15,34 @@
 #define _INCLUDE_PALMZ72_H_
 
 /* Power and control */
-#define GPIO_NR_PALMZ72_GPIO_RESET		1
-#define GPIO_NR_PALMZ72_POWER_DETECT		0
+#define GPIO1_PALMZ72_GPIO_RESET		1
+#define GPIO0_PALMZ72_POWER_DETECT		0
 
 /* SD/MMC */
-#define GPIO_NR_PALMZ72_SD_DETECT_N		14
-#define GPIO_NR_PALMZ72_SD_POWER_N		98
-#define GPIO_NR_PALMZ72_SD_RO			115
+#define GPIO14_PALMZ72_SD_DETECT_N		14
+#define GPIO98_PALMZ72_SD_POWER_N		98
+#define GPIO115_PALMZ72_SD_RO			115
 
 /* Touchscreen */
-#define GPIO_NR_PALMZ72_WM9712_IRQ		27
+#define GPIO27_PALMZ72_WM9712_IRQ		27
 
 /* IRDA -  disable GPIO connected to SD pin of tranceiver (TFBS4710?) ? */
-#define GPIO_NR_PALMZ72_IR_DISABLE		49
+#define GPIO49_PALMZ72_IR_DISABLE		49
 
 /* USB */
-#define GPIO_NR_PALMZ72_USB_DETECT_N		15
-#define GPIO_NR_PALMZ72_USB_PULLUP		95
+#define GPIO15_PALMZ72_USB_DETECT_N		15
+#define GPIO95_PALMZ72_USB_PULLUP		95
 
 /* LCD/Backlight */
-#define GPIO_NR_PALMZ72_BL_POWER		20
-#define GPIO_NR_PALMZ72_LCD_POWER		96
+#define GPIO20_PALMZ72_BL_POWER			20
+#define GPIO96_PALMZ72_LCD_POWER		96
 
 /* LED */
-#define GPIO_NR_PALMZ72_LED_GREEN		88
+#define GPIO88_PALMZ72_LED_GREEN		88
 
 /* Bluetooth */
-#define GPIO_NR_PALMZ72_BT_POWER		17
-#define GPIO_NR_PALMZ72_BT_RESET		83
+#define GPIO17_PALMZ72_BT_POWER			17
+#define GPIO83_PALMZ72_BT_RESET			83
 
 /** Initial values **/
 
arch/arm/mach-pxa/palm27x.c new file +0 -0
new file mode 100644
index 0000000..e69de29
arch/arm/mach-pxa/palmld.c +30 -30

156 lines not on this page · raw message

arch/arm/mach-pxa/palmt5.c +26 -26

141 lines not on this page · raw message

arch/arm/mach-pxa/palmtx.c +26 -26

142 lines not on this page · raw message

arch/arm/mach-pxa/palmz72.c +30 -30

152 lines not on this page · raw message

configs/config-colibri new file +0 -0
new file mode 100644
index 0000000..e69de29
configs/config-income new file +0 -0
new file mode 100644
index 0000000..e69de29
configs/config-littleton new file +0 -0
new file mode 100644
index 0000000..e69de29
configs/config-vpac270 new file +0 -0
new file mode 100644
index 0000000..e69de29
configs/config-vpac270-minimal new file +0 -0
new file mode 100644
index 0000000..e69de29
configs/config-zaurus new file +0 -0
new file mode 100644
index 0000000..e69de29
configs/config-zipitz2 new file +0 -0
new file mode 100644
index 0000000..e69de29
drivers/ata/pata_palmld.c +11 -11
index 11fb4cc..7ca74d6 100644
@@ -61,24 +61,24 @@ static __devinit int palmld_pata_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	/* request and activate power GPIO, IRQ GPIO */
-	ret = gpio_request(GPIO_NR_PALMLD_IDE_PWEN, "HDD PWR");
+	ret = gpio_request(GPIO115_PALMLD_IDE_PWEN, "HDD PWR");
 	if (ret)
 		goto err1;
-	ret = gpio_direction_output(GPIO_NR_PALMLD_IDE_PWEN, 1);
+	ret = gpio_direction_output(GPIO115_PALMLD_IDE_PWEN, 1);
 	if (ret)
 		goto err2;
 
-	ret = gpio_request(GPIO_NR_PALMLD_IDE_RESET, "HDD RST");
+	ret = gpio_request(GPIO98_PALMLD_IDE_RESET, "HDD RST");
 	if (ret)
 		goto err2;
-	ret = gpio_direction_output(GPIO_NR_PALMLD_IDE_RESET, 0);
+	ret = gpio_direction_output(GPIO98_PALMLD_IDE_RESET, 0);
 	if (ret)
 		goto err3;
 
 	/* reset the drive */
-	gpio_set_value(GPIO_NR_PALMLD_IDE_RESET, 0);
+	gpio_set_value(GPIO98_PALMLD_IDE_RESET, 0);
 	msleep(30);
-	gpio_set_value(GPIO_NR_PALMLD_IDE_RESET, 1);
+	gpio_set_value(GPIO98_PALMLD_IDE_RESET, 1);
 	msleep(30);
 
 	/* setup the ata port */
@@ -100,9 +100,9 @@ static __devinit int palmld_pata_probe(struct platform_device *pdev)
 					&palmld_sht);
 
 err3:
-	gpio_free(GPIO_NR_PALMLD_IDE_RESET);
+	gpio_free(GPIO98_PALMLD_IDE_RESET);
 err2:
-	gpio_free(GPIO_NR_PALMLD_IDE_PWEN);
+	gpio_free(GPIO115_PALMLD_IDE_PWEN);
 err1:
 	return ret;
 }
@@ -114,10 +114,10 @@ static __devexit int palmld_pata_remove(struct platform_device *dev)
 	ata_host_detach(host);
 
 	/* power down the HDD */
-	gpio_set_value(GPIO_NR_PALMLD_IDE_PWEN, 0);
+	gpio_set_value(GPIO115_PALMLD_IDE_PWEN, 0);
 
-	gpio_free(GPIO_NR_PALMLD_IDE_RESET);
-	gpio_free(GPIO_NR_PALMLD_IDE_PWEN);
+	gpio_free(GPIO98_PALMLD_IDE_RESET);
+	gpio_free(GPIO115_PALMLD_IDE_PWEN);
 
 	return 0;
 }
drivers/pcmcia/pxa2xx_palmld.c +16 -16
index 6fb6f7f..4317657 100644
@@ -24,52 +24,52 @@ static int palmld_pcmcia_hw_init(struct soc_pcmcia_socket *skt)
 {
 	int ret;
 
-	ret = gpio_request(GPIO_NR_PALMLD_PCMCIA_POWER, "PCMCIA PWR");
+	ret = gpio_request(GPIO36_PALMLD_PCMCIA_POWER, "PCMCIA PWR");
 	if (ret)
 		goto err1;
-	ret = gpio_direction_output(GPIO_NR_PALMLD_PCMCIA_POWER, 0);
+	ret = gpio_direction_output(GPIO36_PALMLD_PCMCIA_POWER, 0);
 	if (ret)
 		goto err2;
 
-	ret = gpio_request(GPIO_NR_PALMLD_PCMCIA_RESET, "PCMCIA RST");
+	ret = gpio_request(GPIO81_PALMLD_PCMCIA_RESET, "PCMCIA RST");
 	if (ret)
 		goto err2;
-	ret = gpio_direction_output(GPIO_NR_PALMLD_PCMCIA_RESET, 1);
+	ret = gpio_direction_output(GPIO81_PALMLD_PCMCIA_RESET, 1);
 	if (ret)
 		goto err3;
 
-	ret = gpio_request(GPIO_NR_PALMLD_PCMCIA_READY, "PCMCIA RDY");
+	ret = gpio_request(GPIO38_PALMLD_PCMCIA_READY, "PCMCIA RDY");
 	if (ret)
 		goto err3;
-	ret = gpio_direction_input(GPIO_NR_PALMLD_PCMCIA_READY);
+	ret = gpio_direction_input(GPIO38_PALMLD_PCMCIA_READY);
 	if (ret)
 		goto err4;
 
-	skt->socket.pci_irq = IRQ_GPIO(GPIO_NR_PALMLD_PCMCIA_READY);
+	skt->socket.pci_irq = IRQ_GPIO(GPIO38_PALMLD_PCMCIA_READY);
 	return 0;
 
 err4:
-	gpio_free(GPIO_NR_PALMLD_PCMCIA_READY);
+	gpio_free(GPIO38_PALMLD_PCMCIA_READY);
 err3:
-	gpio_free(GPIO_NR_PALMLD_PCMCIA_RESET);
+	gpio_free(GPIO81_PALMLD_PCMCIA_RESET);
 err2:
-	gpio_free(GPIO_NR_PALMLD_PCMCIA_POWER);
+	gpio_free(GPIO36_PALMLD_PCMCIA_POWER);
 err1:
 	return ret;
 }
 
 static void palmld_pcmcia_hw_shutdown(struct soc_pcmcia_socket *skt)
 {
-	gpio_free(GPIO_NR_PALMLD_PCMCIA_READY);
-	gpio_free(GPIO_NR_PALMLD_PCMCIA_RESET);
-	gpio_free(GPIO_NR_PALMLD_PCMCIA_POWER);
+	gpio_free(GPIO38_PALMLD_PCMCIA_READY);
+	gpio_free(GPIO81_PALMLD_PCMCIA_RESET);
+	gpio_free(GPIO36_PALMLD_PCMCIA_POWER);
 }
 
 static void palmld_pcmcia_socket_state(struct soc_pcmcia_socket *skt,
 					struct pcmcia_state *state)
 {
 	state->detect = 1; /* always inserted */
-	state->ready  = !!gpio_get_value(GPIO_NR_PALMLD_PCMCIA_READY);
+	state->ready  = !!gpio_get_value(GPIO38_PALMLD_PCMCIA_READY);
 	state->bvd1   = 1;
 	state->bvd2   = 1;
 	state->wrprot = 0;
@@ -80,8 +80,8 @@ static void palmld_pcmcia_socket_state(struct soc_pcmcia_socket *skt,
 static int palmld_pcmcia_configure_socket(struct soc_pcmcia_socket *skt,
 					const socket_state_t *state)
 {
-	gpio_set_value(GPIO_NR_PALMLD_PCMCIA_POWER, 1);
-	gpio_set_value(GPIO_NR_PALMLD_PCMCIA_RESET,
+	gpio_set_value(GPIO36_PALMLD_PCMCIA_POWER, 1);
+	gpio_set_value(GPIO81_PALMLD_PCMCIA_RESET,
 			!!(state->flags & SS_RESET));
 
 	return 0;
drivers/pcmcia/pxa2xx_palmtx.c +21 -21

92 lines not on this page · raw message

Signature · 1 line
1.7.1
#1 lore raw

PATCH v2 2/5 pxa: Introduce Palm27x

This contains common code for Palm LD, TX, T5, Z72

---
 arch/arm/mach-pxa/Kconfig                |    3 +
 arch/arm/mach-pxa/Makefile               |    1 +
 arch/arm/mach-pxa/include/mach/palm27x.h |   48 +++
 arch/arm/mach-pxa/palm27x.c              |  475 ++++++++++++++++++++++++++++++
 4 files changed, 527 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-pxa/include/mach/palm27x.h
arch/arm/mach-pxa/Kconfig +3 -0
index 2ff0b32..f3eaade 100644
@@ -347,6 +347,9 @@ config ARCH_PXA_PALM
 	bool "PXA based Palm PDAs"
 	select HAVE_PWM
 
+config MACH_PALM27X
+	bool
+
 config MACH_PALMTE2
 	bool "Palm Tungsten|E2"
 	default y
arch/arm/mach-pxa/Makefile +1 -0
index 3f72218..20c80e8 100644
@@ -75,6 +75,7 @@ obj-$(CONFIG_PXA_EZX)           += ezx.o
 obj-$(CONFIG_MACH_MP900C)	+= mp900.o
 obj-$(CONFIG_MACH_PALMTE2)	+= palmte2.o
 obj-$(CONFIG_MACH_PALMTC)	+= palmtc.o
+obj-$(CONFIG_MACH_PALM27X)	+= palm27x.o
 obj-$(CONFIG_MACH_PALMT5)	+= palmt5.o
 obj-$(CONFIG_MACH_PALMTX)	+= palmtx.o
 obj-$(CONFIG_MACH_PALMZ72)	+= palmz72.o
arch/arm/mach-pxa/include/mach/palm27x.h new file +48 -0

48 lines not on this page · raw message

arch/arm/mach-pxa/palm27x.c +475 -0

475 lines not on this page · raw message

Signature · 1 line
1.7.1
#2 lore raw

PATCH v2 3/5 pxa: Flip Palm LD, TX, T5, Z72 to Palm27x

In reply to Marek Vasut
---
 arch/arm/mach-pxa/Kconfig    |    4 +
 arch/arm/mach-pxa/palmld.c   |  258 +++----------------------------------
 arch/arm/mach-pxa/palmt5.c   |  275 +++------------------------------------
 arch/arm/mach-pxa/palmtreo.c |  292 +++++-------------------------------------
 arch/arm/mach-pxa/palmtx.c   |  270 +++------------------------------------
 arch/arm/mach-pxa/palmz72.c  |  261 ++-----------------------------------
 6 files changed, 109 insertions(+), 1251 deletions(-)
arch/arm/mach-pxa/Kconfig +4 -0
index f3eaade..cdefc45 100644
@@ -374,6 +374,7 @@ config MACH_PALMT5
 	depends on ARCH_PXA_PALM
 	select PXA27x
 	select IWMMXT
+	select MACH_PALM27X
 	help
 	  Say Y here if you intend to run this kernel on a Palm Tungsten|T5
 	  handheld computer.
@@ -384,6 +385,7 @@ config MACH_PALMTX
 	depends on ARCH_PXA_PALM
 	select PXA27x
 	select IWMMXT
+	select MACH_PALM27X
 	help
 	  Say Y here if you intend to run this kernel on a Palm T|X
 	  handheld computer.
@@ -394,6 +396,7 @@ config MACH_PALMZ72
 	depends on ARCH_PXA_PALM
 	select PXA27x
 	select IWMMXT
+	select MACH_PALM27X
 	help
 	  Say Y here if you intend to run this kernel on Palm Zire 72
 	  handheld computer.
@@ -404,6 +407,7 @@ config MACH_PALMLD
 	depends on ARCH_PXA_PALM
 	select PXA27x
 	select IWMMXT
+	select MACH_PALM27X
 	help
 	  Say Y here if you intend to run this kernel on a Palm LifeDrive
 	  handheld computer.
arch/arm/mach-pxa/palmld.c +18 -240

305 lines not on this page · raw message

arch/arm/mach-pxa/palmt5.c +19 -256

301 lines not on this page · raw message

arch/arm/mach-pxa/palmtreo.c +35 -257

346 lines not on this page · raw message

arch/arm/mach-pxa/palmtx.c +19 -251

311 lines not on this page · raw message

arch/arm/mach-pxa/palmz72.c +14 -247

297 lines not on this page · raw message

Signature · 1 line
1.7.1
#3 lore raw

PATCH 4/5 pxa: Add core pmic support for Palm27x

In reply to Marek Vasut
---
 arch/arm/mach-pxa/palm27x.c |   57 +++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 57 insertions(+), 0 deletions(-)
arch/arm/mach-pxa/palm27x.c +57 -0
index ff5ee8c..a1009ec 100644
@@ -21,6 +21,7 @@
 #include <linux/wm97xx.h>
 #include <linux/power_supply.h>
 #include <linux/usb/gpio_vbus.h>
+#include <linux/regulator/max1586.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -35,6 +36,8 @@
 #include <mach/palmasoc.h>
 #include <mach/palm27x.h>
 
+#include <plat/i2c.h>
+
 #include "generic.h"
 #include "devices.h"
 
@@ -458,6 +461,59 @@ static void __init palm27x_power_init(int ac, int usb)
 static inline void palm27x_power_init(int ac, int usb) {}
 #endif
 
+/******************************************************************************
+ * Core power regulator
+ ******************************************************************************/
+#if defined(CONFIG_REGULATOR_MAX1586) || \
+    defined(CONFIG_REGULATOR_MAX1586_MODULE)
+static struct regulator_consumer_supply palm27x_max1587a_consumers[] = {
+	{
+		.supply	= "vcc_core",
+	}
+};
+
+static struct regulator_init_data palm27x_max1587a_v3_info = {
+	.constraints = {
+		.name		= "vcc_core range",
+		.min_uV		= 900000,
+		.max_uV		= 1705000,
+		.always_on	= 1,
+		.valid_ops_mask	= REGULATOR_CHANGE_VOLTAGE,
+	},
+	.consumer_supplies	= palm27x_max1587a_consumers,
+	.num_consumer_supplies	= ARRAY_SIZE(palm27x_max1587a_consumers),
+};
+
+static struct max1586_subdev_data palm27x_max1587a_subdevs[] = {
+	{
+		.name		= "vcc_core",
+		.id		= MAX1586_V3,
+		.platform_data	= &palm27x_max1587a_v3_info,
+	}
+};
+
+static struct max1586_platform_data palm27x_max1587a_info = {
+	.subdevs     = palm27x_max1587a_subdevs,
+	.num_subdevs = ARRAY_SIZE(palm27x_max1587a_subdevs),
+	.v3_gain     = MAX1586_GAIN_R24_3k32, /* 730..1550 mV */
+};
+
+static struct i2c_board_info __initdata palm27x_pi2c_board_info[] = {
+	{
+		I2C_BOARD_INFO("max1586", 0x14),
+		.platform_data	= &palm27x_max1587a_info,
+	},
+};
+
+static void __init palm27x_pmic_init(void)
+{
+	i2c_register_board_info(1, ARRAY_AND_SIZE(palm27x_pi2c_board_info));
+	pxa27x_set_i2c_power_info(NULL);
+}
+#else
+static inline void palm27x_pmic_init(void) {}
+#endif
+
 void __init palm27x_common_init(struct palm27x_handheld *palm)
 {
 	pxa_set_ffuart_info(NULL);
@@ -472,4 +528,5 @@ void __init palm27x_common_init(struct palm27x_handheld *palm)
 	palm27x_ac97_init(palm->batt_minv, palm->batt_maxv, palm->jack_gpio);
 	palm27x_pwm_init(palm->bl_bl, palm->bl_lcd);
 	palm27x_power_init(palm->power_ac, palm->power_usb);
+	palm27x_pmic_init();
 }
Signature · 1 line
1.7.1
#4 lore raw

PATCH 5/5 pxa: Modularize remnants of code in Palms

In reply to Marek Vasut
---
 arch/arm/mach-pxa/palmld.c   |   63 +++++++++++++++----
 arch/arm/mach-pxa/palmt5.c   |   22 ++++++-
 arch/arm/mach-pxa/palmtreo.c |  141 ++++++++++++++++++++----------------------
 arch/arm/mach-pxa/palmtx.c   |   49 ++++++++++++---
 arch/arm/mach-pxa/palmz72.c  |   22 ++++++-
 5 files changed, 196 insertions(+), 101 deletions(-)
arch/arm/mach-pxa/palmld.c +51 -12
index 263ab6a..569a666 100644
@@ -128,6 +128,7 @@ static unsigned long palmld_pin_config[] __initdata = {
 /******************************************************************************
  * NOR Flash
  ******************************************************************************/
+#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
 static struct mtd_partition palmld_partitions[] = {
 	{
 		.name		= "Flash",
@@ -161,9 +162,18 @@ static struct platform_device palmld_flash = {
 	},
 };
 
+static void __init palmld_nor_init(void)
+{
+	platform_device_register(&palmld_flash);
+}
+#else
+static inline void palmld_nor_init(void) {}
+#endif
+
 /******************************************************************************
  * GPIO keyboard
  ******************************************************************************/
+#if defined(CONFIG_KEYBOARD_PXA27x) || defined(CONFIG_KEYBOARD_PXA27x_MODULE)
 static unsigned int palmld_matrix_keys[] = {
 	KEY(0, 1, KEY_F2),
 	KEY(0, 2, KEY_UP),
@@ -190,9 +200,18 @@ static struct pxa27x_keypad_platform_data palmld_keypad_platform_data = {
 	.debounce_interval	= 30,
 };
 
+static void __init palmld_kpc_init(void)
+{
+	pxa_set_keypad_info(&palmld_keypad_platform_data);
+}
+#else
+static inline void palmld_kpc_init(void) {}
+#endif
+
 /******************************************************************************
  * GPIO keys
  ******************************************************************************/
+#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
 static struct gpio_keys_button palmld_pxa_buttons[] = {
 	{KEY_F8, GPIO10_PALMLD_HOTSYNC_BUTTON_N, 1, "HotSync Button" },
 	{KEY_F9, GPIO15_PALMLD_LOCK_SWITCH, 0, "Lock Switch" },
@@ -212,9 +231,18 @@ static struct platform_device palmld_pxa_keys = {
 	},
 };
 
+static void __init palmld_keys_init(void)
+{
+	platform_device_register(&palmld_pxa_keys);
+}
+#else
+static inline void palmld_keys_init(void) {}
+#endif
+
 /******************************************************************************
  * LEDs
  ******************************************************************************/
+#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
 struct gpio_led gpio_leds[] = {
 {
 	.name			= "palmld:green:led",
@@ -240,26 +268,34 @@ static struct platform_device palmld_leds = {
 	}
 };
 
+static void __init palmld_leds_init(void)
+{
+	platform_device_register(&palmld_leds);
+}
+#else
+static inline void palmld_leds_init(void) {}
+#endif
+
 /******************************************************************************
  * HDD
  ******************************************************************************/
-static struct platform_device palmld_hdd = {
+#if defined(CONFIG_PATA_PALMLD) || defined(CONFIG_PATA_PALMLD_MODULE)
+static struct platform_device palmld_ide_device = {
 	.name	= "pata_palmld",
 	.id	= -1,
 };
 
+static void __init palmld_ide_init(void)
+{
+	platform_device_register(&palmld_ide_device);
+}
+#else
+static inline void palmld_ide_init(void) {}
+#endif
+
 /******************************************************************************
  * Machine init
  ******************************************************************************/
-static struct platform_device *devices[] __initdata = {
-#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
-	&palmld_pxa_keys,
-#endif
-	&palmld_leds,
-	&palmld_hdd,
-	&palmld_flash,
-};
-
 static struct map_desc palmld_io_desc[] __initdata = {
 {
 	.virtual	= PALMLD_IDE_VIRT,
@@ -301,8 +337,11 @@ static void __init palmld_init(void)
 {
 	pxa2xx_mfp_config(ARRAY_AND_SIZE(palmld_pin_config));
 	palm27x_common_init(&palmld);
-	pxa_set_keypad_info(&palmld_keypad_platform_data);
-	platform_add_devices(devices, ARRAY_SIZE(devices));
+	palmld_kpc_init();
+	palmld_keys_init();
+	palmld_nor_init();
+	palmld_leds_init();
+	palmld_ide_init();
 }
 
 MACHINE_START(PALMLD, "Palm LifeDrive")
arch/arm/mach-pxa/palmt5.c +20 -2
index 6687868..6fc285b 100644
@@ -106,6 +106,7 @@ static unsigned long palmt5_pin_config[] __initdata = {
 /******************************************************************************
  * GPIO keyboard
  ******************************************************************************/
+#if defined(CONFIG_KEYBOARD_PXA27x) || defined(CONFIG_KEYBOARD_PXA27x_MODULE)
 static unsigned int palmt5_matrix_keys[] = {
 	KEY(0, 0, KEY_POWER),
 	KEY(0, 1, KEY_F1),
@@ -131,9 +132,18 @@ static struct pxa27x_keypad_platform_data palmt5_keypad_platform_data = {
 	.debounce_interval	= 30,
 };
 
+static void __init palmt5_kpc_init(void)
+{
+	pxa_set_keypad_info(&palmt5_keypad_platform_data);
+}
+#else
+static inline void palmt5_kpc_init(void) {}
+#endif
+
 /******************************************************************************
  * GPIO keys
  ******************************************************************************/
+#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
 static struct gpio_keys_button palmt5_pxa_buttons[] = {
 	{KEY_F8, GPIO10_PALMT5_HOTSYNC_BUTTON_N, 1, "HotSync Button" },
 };
@@ -151,6 +161,14 @@ static struct platform_device palmt5_pxa_keys = {
 	},
 };
 
+static void __init palmt5_keys_init(void)
+{
+	platform_device_register(&palmt5_pxa_keys);
+}
+#else
+static inline void palmt5_keys_init(void) {}
+#endif
+
 /******************************************************************************
  * Machine init
  ******************************************************************************/
@@ -176,8 +194,8 @@ static void __init palmt5_init(void)
 {
 	pxa2xx_mfp_config(ARRAY_AND_SIZE(palmt5_pin_config));
 	palm27x_common_init(&palmt5);
-	pxa_set_keypad_info(&palmt5_keypad_platform_data);
-	platform_device_register(&palmt5_pxa_keys);
+	palmt5_kpc_init();
+	palmt5_keys_init();
 }
 
 MACHINE_START(PALMT5, "Palm Tungsten|T5")
arch/arm/mach-pxa/palmtreo.c +66 -75

216 lines not on this page · raw message

arch/arm/mach-pxa/palmtx.c +39 -10

98 lines not on this page · raw message

arch/arm/mach-pxa/palmz72.c +20 -2
index ecf486c..13ff682 100644
@@ -112,6 +112,7 @@ static unsigned long palmz72_pin_config[] __initdata = {
 /******************************************************************************
  * GPIO keyboard
  ******************************************************************************/
+#if defined(CONFIG_KEYBOARD_PXA27x) || defined(CONFIG_KEYBOARD_PXA27x_MODULE)
 static unsigned int palmz72_matrix_keys[] = {
 	KEY(0, 0, KEY_POWER),
 	KEY(0, 1, KEY_F1),
@@ -137,9 +138,18 @@ static struct pxa27x_keypad_platform_data palmz72_keypad_platform_data = {
 	.debounce_interval	= 30,
 };
 
+static void __init palmz72_kpc_init(void)
+{
+	pxa_set_keypad_info(&palmz72_keypad_platform_data);
+}
+#else
+static inline void palmz72_kpc_init(void) {}
+#endif
+
 /******************************************************************************
  * LEDs
  ******************************************************************************/
+#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
 static struct gpio_led gpio_leds[] = {
 	{
 		.name			= "palmz72:green:led",
@@ -161,6 +171,14 @@ static struct platform_device palmz72_leds = {
 	}
 };
 
+static void __init palmz72_leds_init(void)
+{
+	platform_device_register(&palmz72_leds);
+}
+#else
+static inline void palmz72_leds_init(void) {}
+#endif
+
 #ifdef CONFIG_PM
 
 /* We have some black magic here
@@ -255,8 +273,8 @@ static void __init palmz72_init(void)
 {
 	pxa2xx_mfp_config(ARRAY_AND_SIZE(palmz72_pin_config));
 	palm27x_common_init(&palmz72);
-	pxa_set_keypad_info(&palmz72_keypad_platform_data);
-	platform_device_register(&palmz72_leds);
+	palmz72_kpc_init();
+	palmz72_leds_init();
 }
 
 MACHINE_START(PALMZ72, "Palm Zire72")
Signature · 1 line
1.7.1