Skip to contentSkip to conversation

pxa: Introduce Palm27x

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

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

PATCH 1/4 pxa: Introduce Palm27x

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

---
 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
 create mode 100644 arch/arm/mach-pxa/palm27x.c
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 new file +475 -0

475 lines not on this page · raw message

Signature · 1 line
1.7.1
#1 lore raw

PATCH 2/4 pxa: Flip Palm LD, TX, T5, Z72 to Palm27x

---
 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
#2 lore raw

PATCH 3/4 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
#3 lore raw

PATCH 4/4 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 cac66ca..d59db0b 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, GPIO_NR_PALMLD_HOTSYNC_BUTTON_N, 1, "HotSync Button" },
 	{KEY_F9, GPIO_NR_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 593f57c..45daf1b 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, GPIO_NR_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 10b06ad..fe8a6aa 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