Skip to contentSkip to conversation

OMAP:GPIO: Make GPIO an early init device

RFC PATCH In review Varadarajan, Charulatha 4 participants 15 messages Feb 12, 2010 – Mar 17, 2010 1 message not in the archive

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

cover OMAP:GPIO: Make GPIO an early init device

From: Charulatha V <[email protected]>

This patch series splits OMAP GPIO into OMAP1 and OMAP2 components. Then coverts OMAP2 OMAP3 and OMAP4 GPIO module to use device registration model and makes GPIO an early init device. This is in preparation for the omap_device conversion of the GPIO portions.

This patch series requires early driver register support patch sent by Thara Gopinath (http://patchwork.kernel.org/patch/77926/).
These patches are generated on top of pm branch. These patches are boot tested on SDP 3430 and compile tested for OMAP 2420 and 2430.

Charulatha V (4):
OMAP2: Fix compile errors
OMAP GPIO: split omap1 and omap2+
OMAP: Convert GPIO into a early driver
OMAP GPIO: Convert all printk's to pr_* in gpio

 arch/arm/mach-omap1/Makefile                  |    2 +-
 arch/arm/mach-omap1/gpio.c                    | 1255 ++++++++++++
 arch/arm/mach-omap2/Makefile                  |    2 +-
 arch/arm/mach-omap2/board-2430sdp.c           |    3 +-
 arch/arm/mach-omap2/board-3430sdp.c           |    3 +-
 arch/arm/mach-omap2/board-3630sdp.c           |    3 +-
 arch/arm/mach-omap2/board-4430sdp.c           |    3 +-
 arch/arm/mach-omap2/board-am3517evm.c         |    4 +-
 arch/arm/mach-omap2/board-apollon.c           |    3 +-
 arch/arm/mach-omap2/board-ldp.c               |    3 +-
 arch/arm/mach-omap2/board-omap3beagle.c       |    3 +-
 arch/arm/mach-omap2/board-omap3evm.c          |    3 +-
 arch/arm/mach-omap2/board-omap3pandora.c      |    3 +-
 arch/arm/mach-omap2/board-omap3touchbook.c    |    3 +-
 arch/arm/mach-omap2/board-overo.c             |    3 +-
 arch/arm/mach-omap2/board-rx51.c              |    3 +-
 arch/arm/mach-omap2/board-zoom2.c             |    3 +-
 arch/arm/mach-omap2/board-zoom3.c             |    3 +-
 arch/arm/mach-omap2/gpio.c                    | 2254 ++++++++++++++++++++++
 arch/arm/mach-omap2/io.c                      |    2 +
 arch/arm/mach-omap2/serial.c                  |    1 +
 arch/arm/plat-omap/Makefile                   |    2 +-
 arch/arm/plat-omap/gpio.c                     | 2521 -------------------------
 arch/arm/plat-omap/i2c.c                      |    2 +
 arch/arm/plat-omap/include/plat/gpio.h        |  145 ++
 25 files changed, 3671 insertions(+), 2555 deletions(-)
 create mode 100644 arch/arm/mach-omap1/gpio.c
 create mode 100644 arch/arm/mach-omap2/gpio.c
 delete mode 100644 arch/arm/plat-omap/gpio.c
#1 lore raw

RFC PATCH 1/4 OMAP2: Fix compile errors

From: Rajendra Nayak <[email protected]>

There are few compile errors for OMAP2 which are fixed by this patch

---
 arch/arm/mach-omap2/board-2430sdp.c |    2 +-
 arch/arm/mach-omap2/serial.c        |    1 +
 arch/arm/plat-omap/i2c.c            |    2 ++
 3 files changed, 4 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/board-2430sdp.c +1 -1
index d6f55ef..3f45d4b 100644
@@ -146,7 +146,7 @@ static void __init omap_2430sdp_init_irq(void)
 {
 	omap_board_config = sdp2430_config;
 	omap_board_config_size = ARRAY_SIZE(sdp2430_config);
-	omap2_init_common_hw(NULL, NULL);
+	omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL);
 	omap_init_irq();
 	omap_gpio_init();
 }
arch/arm/mach-omap2/serial.c +1 -0
index e7b874f..a686948 100644
@@ -570,6 +570,7 @@ DEVICE_ATTR(sleep_timeout, 0644, sleep_timeout_show, sleep_timeout_store);
 #define DEV_CREATE_FILE(dev, attr) WARN_ON(device_create_file(dev, attr))
 #else
 static inline void omap_uart_idle_init(struct omap_uart_state *uart) {}
+static void omap_uart_block_sleep(struct omap_uart_state *uart) {}
 #define DEV_CREATE_FILE(dev, attr)
 #endif /* CONFIG_PM */
 
arch/arm/plat-omap/i2c.c +2 -0
index fcb515d..6a617ca 100644
@@ -99,6 +99,8 @@ static void omap_i2c_set_wfc_mpu_wkup_lat(struct device *dev, int val)
 {
 	omap_pm_set_max_mpu_wakeup_lat(dev, val);
 }
+#else
+static void omap_i2c_set_wfc_mpu_wkup_lat(struct device *dev, int val) {}
 #endif
 
 static void __init omap_set_i2c_constraint_func(
Signature · 1 line
1.6.3.3

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw

RFC PATCH 3/4 OMAP:Convert GPIO into a early driver

From: Charulatha V <[email protected]>

This patch converts GPIO module into a platform driver by making each GPIO Bank a device. This is done by providing clock, interrupt and base address details through platform data.

This patch also initializes GPIO driver as a earlydriver. This is so that GPIO devices are initialized very early on during bootup.

In board files, omap_init_irq is moved before omap2_init_common_hw so that omap_init_irq is completed before early drivers uses irqs.

The device structures introduced in this patch would be later removed when GPIO driver gets adapted to HWmod framework

---
 arch/arm/mach-omap2/board-2430sdp.c        |    3 +-
 arch/arm/mach-omap2/board-3430sdp.c        |    3 +-
 arch/arm/mach-omap2/board-3630sdp.c        |    3 +-
 arch/arm/mach-omap2/board-4430sdp.c        |    3 +-
 arch/arm/mach-omap2/board-am3517evm.c      |    4 +-
 arch/arm/mach-omap2/board-apollon.c        |    3 +-
 arch/arm/mach-omap2/board-ldp.c            |    3 +-
 arch/arm/mach-omap2/board-omap3beagle.c    |    3 +-
 arch/arm/mach-omap2/board-omap3evm.c       |    3 +-
 arch/arm/mach-omap2/board-omap3pandora.c   |    3 +-
 arch/arm/mach-omap2/board-omap3touchbook.c |    3 +-
 arch/arm/mach-omap2/board-overo.c          |    3 +-
 arch/arm/mach-omap2/board-rx51.c           |    3 +-
 arch/arm/mach-omap2/board-zoom2.c          |    3 +-
 arch/arm/mach-omap2/board-zoom3.c          |    3 +-
 arch/arm/mach-omap2/gpio.c                 | 1230 +++++++++++++++++++++-------
 arch/arm/mach-omap2/io.c                   |    2 +
 arch/arm/plat-omap/include/plat/gpio.h     |  130 +++-
 18 files changed, 1085 insertions(+), 323 deletions(-)
arch/arm/mach-omap2/board-2430sdp.c +1 -2
index 3f45d4b..ad05cde 100644
@@ -146,9 +146,8 @@ static void __init omap_2430sdp_init_irq(void)
 {
 	omap_board_config = sdp2430_config;
 	omap_board_config_size = ARRAY_SIZE(sdp2430_config);
-	omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL);
 	omap_init_irq();
-	omap_gpio_init();
+	omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL);
 }
 
 static struct twl4030_gpio_platform_data sdp2430_gpio_data = {
arch/arm/mach-omap2/board-3430sdp.c +1 -2
index b4ffcff..820b34c 100644
@@ -344,10 +344,9 @@ static void __init omap_3430sdp_init_irq(void)
 	omap_board_config_size = ARRAY_SIZE(sdp3430_config);
 	omap3_pm_init_cpuidle(omap3_cpuidle_params_table);
 	omap3_pm_init_vc(&omap3_setuptime_table);
+	omap_init_irq();
 	omap2_init_common_hw(hyb18m512160af6_sdrc_params, NULL, omap3_mpu_rate_table,
 			     omap3_dsp_rate_table, omap3_l3_rate_table);
-	omap_init_irq();
-	omap_gpio_init();
 }
 
 static int sdp3430_batt_table[] = {
arch/arm/mach-omap2/board-3630sdp.c +1 -2
index 0b6dd04..fdc2762 100755
@@ -79,11 +79,10 @@ static void __init omap_sdp_init_irq(void)
 {
 	omap_board_config = sdp_config;
 	omap_board_config_size = ARRAY_SIZE(sdp_config);
+	omap_init_irq();
 	omap2_init_common_hw(h8mbx00u0mer0em_sdrc_params,
 			     h8mbx00u0mer0em_sdrc_params,
                              NULL, NULL, NULL);
-	omap_init_irq();
-	omap_gpio_init();
 }
 
 #ifdef CONFIG_OMAP_MUX
arch/arm/mach-omap2/board-4430sdp.c +1 -2
index cc4c00d..ace6be7 100644
@@ -69,12 +69,11 @@ static void __init omap_4430sdp_init_irq(void)
 {
 	omap_board_config = sdp4430_config;
 	omap_board_config_size = ARRAY_SIZE(sdp4430_config);
+	gic_init_irq();
 	omap2_init_common_hw(NULL, NULL);
 #ifdef CONFIG_OMAP_32K_TIMER
 	omap2_gp_clockevent_set_gptimer(1);
 #endif
-	gic_init_irq();
-	omap_gpio_init();
 }
 
 
arch/arm/mach-omap2/board-am3517evm.c +1 -3
index 3966846..be8e750 100644
@@ -45,10 +45,8 @@ static void __init am3517_evm_init_irq(void)
 {
 	omap_board_config = am3517_evm_config;
 	omap_board_config_size = ARRAY_SIZE(am3517_evm_config);
-
-	omap2_init_common_hw(NULL, NULL);
 	omap_init_irq();
-	omap_gpio_init();
+	omap2_init_common_hw(NULL, NULL);
 }
 
 static struct ehci_hcd_omap_platform_data ehci_pdata __initdata = {
arch/arm/mach-omap2/board-apollon.c +1 -2
index d8934fe..75027d7 100644
@@ -277,9 +277,8 @@ static void __init omap_apollon_init_irq(void)
 {
 	omap_board_config = apollon_config;
 	omap_board_config_size = ARRAY_SIZE(apollon_config);
-	omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL);
 	omap_init_irq();
-	omap_gpio_init();
+	omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL);
 	apollon_init_smc91x();
 }
 
arch/arm/mach-omap2/board-ldp.c +1 -2
index 5dadf33..157f058 100644
@@ -290,9 +290,8 @@ static void __init omap_ldp_init_irq(void)
 {
 	omap_board_config = ldp_config;
 	omap_board_config_size = ARRAY_SIZE(ldp_config);
-	omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL);
 	omap_init_irq();
-	omap_gpio_init();
+	omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL);
 	ldp_init_smsc911x();
 }
 
arch/arm/mach-omap2/board-omap3beagle.c +1 -2
index dd5c1ff..681895b 100644
@@ -361,14 +361,13 @@ static void __init omap3_beagle_init_irq(void)
 {
 	omap_board_config = omap3_beagle_config;
 	omap_board_config_size = ARRAY_SIZE(omap3_beagle_config);
+	omap_init_irq();
 	omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
 			     mt46h32m32lf6_sdrc_params, omap3_mpu_rate_table,
 			     omap3_dsp_rate_table, omap3_l3_rate_table);
-	omap_init_irq();
 #ifdef CONFIG_OMAP_32K_TIMER
 	omap2_gp_clockevent_set_gptimer(12);
 #endif
-	omap_gpio_init();
 }
 
 static struct platform_device *omap3_beagle_devices[] __initdata = {
arch/arm/mach-omap2/board-omap3evm.c +1 -2
index 56ca602..9a3b468 100644
@@ -404,10 +404,9 @@ static void __init omap3_evm_init_irq(void)
 {
 	omap_board_config = omap3_evm_config;
 	omap_board_config_size = ARRAY_SIZE(omap3_evm_config);
+	omap_init_irq();
 	omap2_init_common_hw(mt46h32m32lf6_sdrc_params, NULL, omap3_mpu_rate_table,
 	                     omap3_dsp_rate_table, omap3_l3_rate_table);
-	omap_init_irq();
-	omap_gpio_init();
 }
 
 static struct platform_device *omap3_evm_devices[] __initdata = {
arch/arm/mach-omap2/board-omap3pandora.c +1 -2
index dbd92af..13849b8 100644
@@ -480,11 +480,10 @@ static struct spi_board_info omap3pandora_spi_board_info[] __initdata = {
 
 static void __init omap3pandora_init_irq(void)
 {
+	omap_init_irq();
 	omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
 			     mt46h32m32lf6_sdrc_params,
 			     NULL, NULL, NULL);
-	omap_init_irq();
-	omap_gpio_init();
 }
 
 static struct platform_device *omap3pandora_devices[] __initdata = {
arch/arm/mach-omap2/board-omap3touchbook.c +1 -2
index 8252ba4..c60cea3 100644
@@ -439,13 +439,12 @@ static void __init omap3_touchbook_init_irq(void)
 	omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
 	omap_board_config = omap3_touchbook_config;
 	omap_board_config_size = ARRAY_SIZE(omap3_touchbook_config);
+	omap_init_irq();
 	omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
 			     mt46h32m32lf6_sdrc_params);
-	omap_init_irq();
 #ifdef CONFIG_OMAP_32K_TIMER
 	omap2_gp_clockevent_set_gptimer(12);
 #endif
-	omap_gpio_init();
 }
 
 static struct platform_device *omap3_touchbook_devices[] __initdata = {
arch/arm/mach-omap2/board-overo.c +1 -2
index 667fd38..688ad20 100644
@@ -384,10 +384,9 @@ static void __init overo_init_irq(void)
 {
 	omap_board_config = overo_config;
 	omap_board_config_size = ARRAY_SIZE(overo_config);
+	omap_init_irq();
 	omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
 			     mt46h32m32lf6_sdrc_params, NULL, NULL, NULL);
-	omap_init_irq();
-	omap_gpio_init();
 }
 
 static struct platform_device *overo_devices[] __initdata = {
arch/arm/mach-omap2/board-rx51.c +1 -2
index 78d4305..b52e31e 100644
@@ -106,12 +106,11 @@ static void __init rx51_init_irq(void)
 	omap_board_config_size = ARRAY_SIZE(rx51_config);
 	omap3_pm_init_cpuidle(rx51_cpuidle_params);
 	sdrc_params = rx51_get_sdram_timings();
+	omap_init_irq();
 	omap2_init_common_hw(sdrc_params, sdrc_params,
 			     omap3_mpu_rate_table,
 			     omap3_dsp_rate_table,
 			     omap3_l3_rate_table);
-	omap_init_irq();
-	omap_gpio_init();
 }
 
 extern void __init rx51_peripherals_init(void);
arch/arm/mach-omap2/board-zoom2.c +1 -2
index a2cdfdd..a62d8c5 100644
@@ -29,11 +29,10 @@
 
 static void __init omap_zoom2_init_irq(void)
 {
+	omap_init_irq();
 	omap2_init_common_hw(mt46h32m32lf6_sdrc_params,
 				 mt46h32m32lf6_sdrc_params, omap3_mpu_rate_table,
 				 omap3_dsp_rate_table, omap3_l3_rate_table);
-	omap_init_irq();
-	omap_gpio_init();
 }
 
 /* REVISIT: These audio entries can be removed once MFD code is merged */
arch/arm/mach-omap2/board-zoom3.c +1 -2
index 687305b..0997da8 100644
@@ -38,11 +38,10 @@ static void __init omap_zoom_init_irq(void)
 {
 	omap_board_config = zoom_config;
 	omap_board_config_size = ARRAY_SIZE(zoom_config);
+	omap_init_irq();
 	omap2_init_common_hw(h8mbx00u0mer0em_sdrc_params,
 			     h8mbx00u0mer0em_sdrc_params,
 			     NULL, NULL, NULL);
-	omap_init_irq();
-	omap_gpio_init();
 }
 
 #ifdef CONFIG_OMAP_MUX
arch/arm/mach-omap2/gpio.c +945 -285

1,322 lines not on this page · raw message

arch/arm/mach-omap2/io.c +2 -0
index c93b42a..854660e 100644
@@ -34,6 +34,7 @@
 #include <plat/gpmc.h>
 #include <plat/serial.h>
 #include <plat/vram.h>
+#include <plat/gpio.h>
 
 #include "clock2xxx.h"
 #include "clock34xx.h"
@@ -360,4 +361,5 @@ void __init omap2_init_common_hw(struct omap_sdrc_params *sdrc_cs0,
 	_omap2_init_reprogram_sdrc();
 #endif
 	gpmc_init();
+	omap_gpio_early_init();
 }
arch/arm/plat-omap/include/plat/gpio.h +123 -7

172 lines not on this page · raw message

Signature · 1 line
1.6.3.3
#4 lore raw

RFC PATCH 4/4 OMAP:GPIO: Convert all printk's to pr_* in gpio

From: Charulatha V <[email protected]>

GPIO driver still uses printk's instead of using pr_* This patch fixes all such instances.

---
 arch/arm/mach-omap2/gpio.c |   26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)
arch/arm/mach-omap2/gpio.c +13 -13
index 65b8edb..f28900f 100644
@@ -824,7 +824,7 @@ static inline int gpio_valid(int gpio)
 static int check_gpio(int gpio)
 {
 	if (unlikely(gpio_valid(gpio) < 0)) {
-		printk(KERN_ERR "omap-gpio: invalid GPIO %d\n", gpio);
+		pr_err("omap-gpio: invalid GPIO %d\n", gpio);
 		dump_stack();
 		return -1;
 	}
@@ -937,7 +937,7 @@ void omap_set_gpio_debounce(int gpio, int enable)
 	}
 
 	if (!(bank->mod_usage & l)) {
-		printk(KERN_ERR "GPIO %d not requested\n", gpio);
+		pr_err("GPIO %d not requested\n", gpio);
 		return;
 	}
 
@@ -974,7 +974,7 @@ void omap_set_gpio_debounce_time(int gpio, int enc_time)
 	reg = bank->base;
 
 	if (!bank->mod_usage) {
-		printk(KERN_ERR "GPIO not requested\n");
+		pr_err("GPIO not requested\n");
 		return;
 	}
 
@@ -1209,7 +1209,7 @@ static int _set_gpio_wakeup(struct gpio_bank *bank, int gpio, int enable)
 	unsigned long uninitialized_var(flags);
 
 	if (bank->non_wakeup_gpios & (1 << gpio)) {
-		printk(KERN_ERR "Unable to modify wakeup on "
+		pr_err("Unable to modify wakeup on "
 				"non-wakeup GPIO%d\n",
 				(bank - gpio_bank) * 32 + gpio);
 		return -EINVAL;
@@ -1535,7 +1535,7 @@ static int __init omap3_gpio_pads_init(void)
 		GFP_KERNEL);
 
 	if (gpio_pads == NULL) {
-		printk(KERN_ERR "FATAL: Failed to allocate gpio_pads\n");
+		pr_err("FATAL: Failed to allocate gpio_pads\n");
 		return -ENOMEM;
 	}
 
@@ -2002,7 +2002,7 @@ static int __devinit omap_gpio_probe(struct platform_device *pdev)
 	int id, i;
 
 	if (!pdev || !pdata) {
-		printk(KERN_ERR "GPIO device initialize without"
+		pr_err("GPIO device initialize without"
 					"platform data\n");
 		return -EINVAL;
 	}
@@ -2018,7 +2018,7 @@ static int __devinit omap_gpio_probe(struct platform_device *pdev)
 
 	id = pdev->id;
 	if (id > gpio_bank_count) {
-		printk(KERN_ERR "Invalid GPIO device id (%d)\n", id);
+		pr_err("Invalid GPIO device id (%d)\n", id);
 		return -EINVAL;
 	}
 
@@ -2031,14 +2031,14 @@ static int __devinit omap_gpio_probe(struct platform_device *pdev)
 
 	bank->ick = clk_get(NULL, pdata->ick_name);
 	if (IS_ERR(bank->ick))
-		printk(KERN_ERR "Could not get %s\n", pdata->ick_name);
+		pr_err("Could not get %s\n", pdata->ick_name);
 	else
 		clk_enable(bank->ick);
 
 	if (cpu_is_omap24xx()) {
 		bank->fck = clk_get(NULL, pdata->fck_name);
 		if (IS_ERR(bank->fck))
-			printk(KERN_ERR "Could not get %s\n", pdata->fck_name);
+			pr_err("Could not get %s\n", pdata->fck_name);
 		else
 			clk_enable(bank->fck);
 	}
@@ -2048,19 +2048,19 @@ static int __devinit omap_gpio_probe(struct platform_device *pdev)
 	/* Static mapping, never released */
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (unlikely(!res)) {
-		printk(KERN_ERR "GPIO Bank %i Invalid mem resource\n", id);
+		pr_err("GPIO Bank %i Invalid mem resource\n", id);
 		return -ENODEV;
 	}
 
 	bank->base = ioremap(res->start, resource_size(res));
 	if (!bank->base) {
-		printk(KERN_ERR "Could not ioremap gpio bank%i\n", id);
+		pr_err("Could not ioremap gpio bank%i\n", id);
 		return -ENOMEM;
 	}
 
 	res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
 	if (unlikely(!res)) {
-		printk(KERN_ERR "GPIO Bank %i Invalid irq resource\n", id);
+		pr_err("GPIO Bank %i Invalid irq resource\n", id);
 		return -ENODEV;
 	}
 
@@ -2126,7 +2126,7 @@ static int __devinit omap_gpio_probe(struct platform_device *pdev)
 	if (cpu_is_omap34xx() || cpu_is_omap44xx()) {
 		bank->dbck = clk_get(NULL, pdata->dbck_name);
 		if (IS_ERR(bank->dbck))
-			printk(KERN_ERR "Could not get %s\n", pdata->dbck_name);
+			pr_err("Could not get %s\n", pdata->dbck_name);
 	}
 
 	/* Enable autoidle for the OCP interface */
Signature · 1 line
1.6.3.3
#5 lore raw

Re: [PATCH 1/4 RFC]OMAP2: Fix compile errors

In reply to Varadarajan, Charulatha
Quoted 17 lines · Charulatha

From: Rajendra Nayak <[email protected]>

There are few compile errors for OMAP2 which are fixed by this patch

---
 arch/arm/mach-omap2/board-2430sdp.c |    2 +-
 arch/arm/mach-omap2/serial.c        |    1 +
 arch/arm/plat-omap/i2c.c            |    2 ++
 3 files changed, 4 insertions(+), 1 deletions(-)
arch/arm/mach-omap2/board-2430sdp.c +0 -0
index d6f55ef..3f45d4b 100644

arch/arm/mach-omap2/board-2430sdp.c static void __init omap_2430sdp_init_irq(void) · line 149

Quoted 5 lines
arch/arm/mach-omap2/board-2430sdp.c +1 -1
@@ -146,7 +146,7 @@ static void __init omap_2430sdp_init_irq(void)
 {
 	omap_board_config = sdp2430_config;
 	omap_board_config_size = ARRAY_SIZE(sdp2430_config);
-	omap2_init_common_hw(NULL, NULL);
+	omap2_init_common_hw(NULL, NULL, NULL, NULL, NULL);

This change is only needed in the PM branch. Please base this series on mainline.

With our new OPP layer, the changes to init_common_hw() will be dropped so this change will no longer be necessary.

Kevin

Quoted 35 lines
arch/arm/mach-omap2/board-2430sdp.c +0 -0
 	omap_init_irq();
 	omap_gpio_init();
 }
arch/arm/mach-omap2/serial.c +1 -0
index e7b874f..a686948 100644
@@ -570,6 +570,7 @@ DEVICE_ATTR(sleep_timeout, 0644, sleep_timeout_show, sleep_timeout_store);
 #define DEV_CREATE_FILE(dev, attr) WARN_ON(device_create_file(dev, attr))
 #else
 static inline void omap_uart_idle_init(struct omap_uart_state *uart) {}
+static void omap_uart_block_sleep(struct omap_uart_state *uart) {}
 #define DEV_CREATE_FILE(dev, attr)
 #endif /* CONFIG_PM */
 
arch/arm/plat-omap/i2c.c +2 -0
index fcb515d..6a617ca 100644
@@ -99,6 +99,8 @@ static void omap_i2c_set_wfc_mpu_wkup_lat(struct device *dev, int val)
 {
 	omap_pm_set_max_mpu_wakeup_lat(dev, val);
 }
+#else
+static void omap_i2c_set_wfc_mpu_wkup_lat(struct device *dev, int val) {}
 #endif
 
 static void __init omap_set_i2c_constraint_func(
Signature · 6 lines
1.6.3.3

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#6 lore raw

compilation error on hwmods branch

In "origin/pm-wip/hwmods" branch, using "omap_3430sdp_defconfig" or "omap3_defconfig", results in the following error. Anyone working on this?

drivers/usb/musb/omap2430.c:261: error: expected identifier or '(' before 'do' drivers/usb/musb/omap2430.c:261: error: expected identifier or '(' before 'while' drivers/usb/musb/omap2430.c:268: error: expected identifier or '(' before 'do' drivers/usb/musb/omap2430.c:268: error: expected identifier or '(' before 'while' make[2]: *** [drivers/usb/musb/omap2430.o] Error 1
make[1]: *** [drivers/usb/musb] Error 2
make: *** [drivers] Error 2

Last commit:
-----------
commit 799e299e05ca47664c8534dede56fc0a070ae30c

Author: Kevin Hilman <[email protected]>
Date:   Thu Jan 7 16:19:53 2010 -0800

OMAP: UART: omap_device converions, remove implicit 8520 assumptions

Major rework of OMAP UART init for omap_device conversion as well as use with either 8250 driver or new omap-serial driver.

Signifcant contributions and testing from Govindraj R <[email protected]>.

In preparation for a new omap-serial driver, remove 8250 assumptions and dependencies from the serial core.

Convert UART core and PM support to use omap_device layer. Also add support for both console on 8250 or omap-serial driver.

omap_device conversion:
- Convert clock API calls to omap_device calls
- Remove all static platform_data setup and configuration. This is all done by the omap_device build phase.

Known issues:
- broken on OMAP4 until OMAP4 UART hwmods are available

maintainer
#7 lore raw

Re: compilation error on hwmods branch

Quoted 10 lines · Varadarajan, Charulatha

In "origin/pm-wip/hwmods" branch, using "omap_3430sdp_defconfig" or "omap3_defconfig", results in the following error. Anyone working on this?

drivers/usb/musb/omap2430.c:261: error: expected identifier or '(' before 'do' drivers/usb/musb/omap2430.c:261: error: expected identifier or '(' before 'while' drivers/usb/musb/omap2430.c:268: error: expected identifier or '(' before 'do' drivers/usb/musb/omap2430.c:268: error: expected identifier or '(' before 'while' make[2]: *** [drivers/usb/musb/omap2430.o] Error 1
make[1]: *** [drivers/usb/musb] Error 2
make: *** [drivers] Error 2

A fix for that has been already queued via linux-usb. Also in omap-testing and master branches.

Tony

#8 lore raw

Re: compilation error on hwmods branch

Quoted 12 lines · Tony Lindgren
Quoted 10 lines · Varadarajan, Charulatha

In "origin/pm-wip/hwmods" branch, using "omap_3430sdp_defconfig" or "omap3_defconfig", results in the following error. Anyone working on this?

drivers/usb/musb/omap2430.c:261: error: expected identifier or '(' before 'do' drivers/usb/musb/omap2430.c:261: error: expected identifier or '(' before 'while' drivers/usb/musb/omap2430.c:268: error: expected identifier or '(' before 'do' drivers/usb/musb/omap2430.c:268: error: expected identifier or '(' before 'while' make[2]: *** [drivers/usb/musb/omap2430.o] Error 1
make[1]: *** [drivers/usb/musb] Error 2
make: *** [drivers] Error 2

Quoted 2 lines

A fix for that has been already queued via linux-usb. Also in omap-testing and master branches.

Hi Charu,

pm-wip/hwmods branch is currently based at v2.6.34-rc1 for ease of merging with other development trees.

If you want to test with this, please merge it into l-o master or the PM branch which both include fixes for various problems as Tony mentioned.

Kevin

#9 lore raw
In reply to Varadarajan, Charulatha

Hello Charulatha,

Quoted 4 lines · Charulatha

Charulatha V (4):
OMAP2: Fix compile errors
OMAP GPIO: split omap1 and omap2+
OMAP: Convert GPIO into a early driver

The above patch appears to be missing. Could you please re-send?

Quoted 1 line

OMAP GPIO: Convert all printk's to pr_* in gpio

- Paul

maintainer
#11 lore raw
Quoted 11 lines · Paul Walmsley
Quoted 5 lines · Paul Walmsley
Quoted 1 line · Charulatha

OMAP: Convert GPIO into a early driver

The above patch appears to be missing. Could you please re-send?

This patch was too big for the mailing list, so it's been posted here:

http://www.pwsan.com/omap/patches/gpio/0002-OMAP-GPIO-split-omap1-and-omap2.patch

What, make two almost identical copies of the shared code? No way! Instead, please keep the common code under plat-omap:

arch/arm/plat-omap/gpio.c

Then implement the processor specific functions:

arch/arm/mach-omap1/gpio.c
arch/arm/mach-omap2/gpio.c
arch/arm/mach-omap2/gpio24xx.c
arch/arm/mach-omap2/gpio44xx.c

Then have a subsys_initcall in processor specific implementation that sets the function pointers in the common code.

Regards,

Tony

#12 lore raw
Quoted 7 lines

-----Original Message-----
From: Tony Lindgren [mailto:[email protected]]
Sent: Monday, February 15, 2010 11:19 PM
To: Paul Walmsley
Cc: Varadarajan, Charulatha; [email protected]
Subject: Re: [PATCH 0/4 RFC]OMAP:GPIO: Make GPIO an early init device

Quoted 10 lines
Quoted 9 lines · Paul Walmsley
Quoted 5 lines · Paul Walmsley
Quoted 1 line · Charulatha

OMAP: Convert GPIO into a early driver

The above patch appears to be missing. Could you please re-send?

This patch was too big for the mailing list, so it's been posted here:

Thanks Paul.

Quoted 11 lines
Quoted 2 lines

http://www.pwsan.com/omap/patches/gpio/0002-OMAP-GPIO-split-omap1-and-

omap2.patch

What, make two almost identical copies of the shared code? No way! Instead, please keep the common code under plat-omap:

arch/arm/plat-omap/gpio.c

Then implement the processor specific functions:

Quoted 8 lines

arch/arm/mach-omap1/gpio.c
arch/arm/mach-omap2/gpio.c
arch/arm/mach-omap2/gpio24xx.c
arch/arm/mach-omap2/gpio44xx.c

Then have a subsys_initcall in processor specific implementation that sets the function pointers in the common code.

Tony,

The current gpio.c has functions with code similar as mentioned below:

{
	#ifdef CONFIG_ARCH_OMAP1
		Get the reg offset for OMAP1
	#endif
	#ifdef CONFIG_ARCH_OMAP15XX
		Get the reg offset for OMAP15XX
	#endif
	#ifdef CONFIG_ARCH_OMAP16XX
		Get the reg offset for OMAP16XX
	#endif
	#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
		Get the reg offset for this OMAP
	#endif
	#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
		Get the reg offset for OMAP2&3
	#endif
	#if defined(CONFIG_ARCH_OMAP4)
		Get the reg offset for OMAP4
	#endif

	Read/write the register 
}

If function pointers are used in common code (plat-omap/gpio.c), the API's in this file would essentially do nothing but invoke these pointers. IMHO this is simply adding one unnecessary level of indirection. Please correct me if I am missing out something.

Quoted 3 lines

Regards,

Tony

maintainer
#13 lore raw
Quoted 66 lines · Varadarajan, Charulatha
Quoted 7 lines

-----Original Message-----
From: Tony Lindgren [mailto:[email protected]]
Sent: Monday, February 15, 2010 11:19 PM
To: Paul Walmsley
Cc: Varadarajan, Charulatha; [email protected]
Subject: Re: [PATCH 0/4 RFC]OMAP:GPIO: Make GPIO an early init device

Quoted 10 lines
Quoted 9 lines · Paul Walmsley
Quoted 5 lines · Paul Walmsley
Quoted 1 line · Charulatha

OMAP: Convert GPIO into a early driver

The above patch appears to be missing. Could you please re-send?

This patch was too big for the mailing list, so it's been posted here:

Thanks Paul.

Quoted 11 lines
Quoted 2 lines

http://www.pwsan.com/omap/patches/gpio/0002-OMAP-GPIO-split-omap1-and-

omap2.patch

What, make two almost identical copies of the shared code? No way! Instead, please keep the common code under plat-omap:

arch/arm/plat-omap/gpio.c

Then implement the processor specific functions:

Quoted 8 lines

arch/arm/mach-omap1/gpio.c
arch/arm/mach-omap2/gpio.c
arch/arm/mach-omap2/gpio24xx.c
arch/arm/mach-omap2/gpio44xx.c

Then have a subsys_initcall in processor specific implementation that sets the function pointers in the common code.

Tony,

The current gpio.c has functions with code similar as mentioned below:

{
	#ifdef CONFIG_ARCH_OMAP1
		Get the reg offset for OMAP1
	#endif
	#ifdef CONFIG_ARCH_OMAP15XX
		Get the reg offset for OMAP15XX
	#endif
	#ifdef CONFIG_ARCH_OMAP16XX
		Get the reg offset for OMAP16XX
	#endif
	#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
		Get the reg offset for this OMAP
	#endif
	#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
		Get the reg offset for OMAP2&3
	#endif
	#if defined(CONFIG_ARCH_OMAP4)
		Get the reg offset for OMAP4
	#endif

	Read/write the register 
}
Quoted 2 lines

If function pointers are used in common code (plat-omap/gpio.c), the API's in this file would essentially do nothing but invoke these pointers. IMHO this is simply adding one unnecessary level of indirection. Please correct me if I am missing out something.

For those you can just set the various reg offsets once during __init based on the omap type and then the function stays the same.

For example, in arch/arm/mach-omap2/gpio44xx.c you could have something like the following (completely untested):

static const struct gpio_reg omap4_gpio_reg[] = {
	...
};
static const struct gpio_bank omap4_gpio_bank[] = {
	...
};

static int omap_gpio_suspend(struct sys_device *dev, pm_message_t mesg)

{
	...
}

static int omap_gpio_resume(struct sys_device *dev)

{
	...
}
const struct omap_gpio omap4_gpio = {
	.regs		= omap4_gpio_reg,
	.banks		= omap4_gpio_bank,
	.suspend	= omap4_gpio_suspend,
	.resume		= omap4_gpio_resume,
	...
};

...

static int __init omap_gpio_init(void)

{
	if (!cpu_is_omap44xx())
		return -ENODEV;

	return omap_gpio_init(omap4_gpio);
}

arch_initcall(omap44xx_gpio_init);

For some of them, you want to be able to implement the whole function depending on the omap type that you boot.

We're already doing it like this in most places, the gpio.c code just needs to be updated for that.

Regards,

Tony

#14 lore raw

Tony,

Quoted 92 lines
Quoted 45 lines
Quoted 11 lines
Quoted 2 lines

http://www.pwsan.com/omap/patches/gpio/0002-OMAP-GPIO-split-omap1-and-

omap2.patch

What, make two almost identical copies of the shared code? No way! Instead, please keep the common code under plat-omap:

arch/arm/plat-omap/gpio.c

Then implement the processor specific functions:

Quoted 8 lines

arch/arm/mach-omap1/gpio.c
arch/arm/mach-omap2/gpio.c
arch/arm/mach-omap2/gpio24xx.c
arch/arm/mach-omap2/gpio44xx.c

Then have a subsys_initcall in processor specific implementation that sets the function pointers in the common code.

Tony,

The current gpio.c has functions with code similar as mentioned below:

{
	#ifdef CONFIG_ARCH_OMAP1
		Get the reg offset for OMAP1
	#endif
	#ifdef CONFIG_ARCH_OMAP15XX
		Get the reg offset for OMAP15XX
	#endif
	#ifdef CONFIG_ARCH_OMAP16XX
		Get the reg offset for OMAP16XX
	#endif
	#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
		Get the reg offset for this OMAP
	#endif
	#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
		Get the reg offset for OMAP2&3
	#endif
	#if defined(CONFIG_ARCH_OMAP4)
		Get the reg offset for OMAP4
	#endif

	Read/write the register
}
Quoted 1 line

If function pointers are used in common code (plat-omap/gpio.c), the API's in

this file would essentially do nothing but invoke these pointers. IMHO this is simply adding one unnecessary level of indirection.

Quoted 1 line

Please correct me if I am missing out something.

For those you can just set the various reg offsets once during __init based on the omap type and then the function stays the same.

For example, in arch/arm/mach-omap2/gpio44xx.c you could have something like the following (completely untested):

static const struct gpio_reg omap4_gpio_reg[] = {
	...
};
static const struct gpio_bank omap4_gpio_bank[] = {
	...
};

static int omap_gpio_suspend(struct sys_device *dev, pm_message_t mesg)

{
	...
}

static int omap_gpio_resume(struct sys_device *dev)

{
	...
}
const struct omap_gpio omap4_gpio = {
	.regs		= omap4_gpio_reg,
	.banks		= omap4_gpio_bank,
	.suspend	= omap4_gpio_suspend,
	.resume		= omap4_gpio_resume,
	...
};

...

static int __init omap_gpio_init(void)

{
	if (!cpu_is_omap44xx())
		return -ENODEV;

	return omap_gpio_init(omap4_gpio);
}
Quoted 7 lines

arch_initcall(omap44xx_gpio_init);

For some of them, you want to be able to implement the whole function depending on the omap type that you boot.

We're already doing it like this in most places, the gpio.c code just needs to be updated for that.

Thanks. Can you please specify some example code & location in the current code base, so that I can align exactly before sending my next version of patches?

Quoted 4 lines

Regards,

Tony

maintainer
#15 lore raw
Quoted 99 lines · Varadarajan, Charulatha

Tony,

Quoted 97 lines
Quoted 45 lines
Quoted 11 lines
Quoted 2 lines

http://www.pwsan.com/omap/patches/gpio/0002-OMAP-GPIO-split-omap1-and-

omap2.patch

What, make two almost identical copies of the shared code? No way! Instead, please keep the common code under plat-omap:

arch/arm/plat-omap/gpio.c

Then implement the processor specific functions:

Quoted 8 lines

arch/arm/mach-omap1/gpio.c
arch/arm/mach-omap2/gpio.c
arch/arm/mach-omap2/gpio24xx.c
arch/arm/mach-omap2/gpio44xx.c

Then have a subsys_initcall in processor specific implementation that sets the function pointers in the common code.

Tony,

The current gpio.c has functions with code similar as mentioned below:

{
	#ifdef CONFIG_ARCH_OMAP1
		Get the reg offset for OMAP1
	#endif
	#ifdef CONFIG_ARCH_OMAP15XX
		Get the reg offset for OMAP15XX
	#endif
	#ifdef CONFIG_ARCH_OMAP16XX
		Get the reg offset for OMAP16XX
	#endif
	#if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850)
		Get the reg offset for this OMAP
	#endif
	#if defined(CONFIG_ARCH_OMAP2) || defined(CONFIG_ARCH_OMAP3)
		Get the reg offset for OMAP2&3
	#endif
	#if defined(CONFIG_ARCH_OMAP4)
		Get the reg offset for OMAP4
	#endif

	Read/write the register
}
Quoted 1 line

If function pointers are used in common code (plat-omap/gpio.c), the API's in

this file would essentially do nothing but invoke these pointers. IMHO this is simply adding one unnecessary level of indirection.

Quoted 1 line

Please correct me if I am missing out something.

For those you can just set the various reg offsets once during __init based on the omap type and then the function stays the same.

For example, in arch/arm/mach-omap2/gpio44xx.c you could have something like the following (completely untested):

static const struct gpio_reg omap4_gpio_reg[] = {
	...
};
static const struct gpio_bank omap4_gpio_bank[] = {
	...
};

static int omap_gpio_suspend(struct sys_device *dev, pm_message_t mesg)

{
	...
}

static int omap_gpio_resume(struct sys_device *dev)

{
	...
}
const struct omap_gpio omap4_gpio = {
	.regs		= omap4_gpio_reg,
	.banks		= omap4_gpio_bank,
	.suspend	= omap4_gpio_suspend,
	.resume		= omap4_gpio_resume,
	...
};

...

static int __init omap_gpio_init(void)

{
	if (!cpu_is_omap44xx())
		return -ENODEV;

	return omap_gpio_init(omap4_gpio);
}

arch_initcall(omap44xx_gpio_init);

For some of them, you want to be able to implement the whole function depending on the omap type that you boot.

Quoted 6 lines
Quoted 2 lines

We're already doing it like this in most places, the gpio.c code just needs to be updated for that.

Thanks. Can you please specify some example code & location in the current code base, so that I can align exactly before sending my next version of patches?

See mach-omap2/clock.c for example for struct clk_functions.

Please do the changes in a set where each change patch can be easily reviewed and tested. Maybe something like the following patches:

1. Add support for passing platform_data to omap_gpio_init()
2. Add support for implementing SoC specific omap_gpio_AAA()
3. Add support for implementing SoC specific omap_gpio_BBB()
4. Add support for implementing SoC specific omap_gpio_CCC()
...

Regards,

Tony