From 999f6338780fa0577b6581941c697c868d1ec2d3 Mon Sep 17 00:00:00 2001 From: Robert Jarzmik Date: Mon, 17 Nov 2008 20:29:03 +0100 Subject: [ARM] pxa/MioA701: fix memory corruption. In the resume bootstrap, the early disable address is wrong. Fix it to RAM address 0xa020b000 instead of 0xa0200000, and make it consistent with RESUME_ENABLE_ADDR in mioa701.c. Signed-off-by: Robert Jarzmik Acked-by: Russell King Signed-off-by: Eric Miao --- arch/arm/mach-pxa/mioa701_bootresume.S | 1 + 1 file changed, 1 insertion(+) (limited to 'arch') diff --git a/arch/arm/mach-pxa/mioa701_bootresume.S b/arch/arm/mach-pxa/mioa701_bootresume.S index a647693d985..324d25a48c8 100644 --- a/arch/arm/mach-pxa/mioa701_bootresume.S +++ b/arch/arm/mach-pxa/mioa701_bootresume.S @@ -24,6 +24,7 @@ ENTRY(mioa701_jumpaddr) 1: mov r0, #0xa0000000 @ Don't suppose memory access works orr r0, r0, #0x00200000 @ even if it's supposed to + orr r0, r0, #0x0000b000 mov r1, #0 str r1, [r0] @ Early disable resume for next boot ldr r0, mioa701_jumpaddr @ (Murphy's Law) -- cgit v1.2.3 From 844c6f6a36984c5fe1bcc2d68a88f2ed212d1eef Mon Sep 17 00:00:00 2001 From: Robert Jarzmik Date: Mon, 17 Nov 2008 20:29:04 +0100 Subject: [ARM] pxa/MioA701: bluetooth resume fix The G3IPL expects the value at RAM address 0xa020b020 to be exactly 1 to setup the bluetooth GPIOs properly. The actual code got a value from gpio_get_value() which was not 1, but a "not equal to 0" integer. Signed-off-by: Robert Jarzmik Acked-by: Russell King Signed-off-by: Eric Miao --- arch/arm/mach-pxa/mioa701.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch') diff --git a/arch/arm/mach-pxa/mioa701.c b/arch/arm/mach-pxa/mioa701.c index 0842c531ee4..782903fe9c6 100644 --- a/arch/arm/mach-pxa/mioa701.c +++ b/arch/arm/mach-pxa/mioa701.c @@ -565,7 +565,7 @@ static int mioa701_sys_suspend(struct sys_device *sysdev, pm_message_t state) u32 *mem_resume_unknown = phys_to_virt(RESUME_UNKNOWN_ADDR); /* Devices prepare suspend */ - is_bt_on = gpio_get_value(GPIO83_BT_ON); + is_bt_on = !!gpio_get_value(GPIO83_BT_ON); pxa2xx_mfp_set_lpm(GPIO83_BT_ON, is_bt_on ? MFP_LPM_DRIVE_HIGH : MFP_LPM_DRIVE_LOW); -- cgit v1.2.3 From 147dcf5489fb86c4bfe400520186f9f11b304783 Mon Sep 17 00:00:00 2001 From: Amit Kucheria Date: Tue, 25 Nov 2008 15:11:12 -0800 Subject: ARM: OMAP: Typo fix for clock_allow_idle The second clk_deny_idle instance should be clk_allow_idle instead. Signed-off-by: Amit Kucheria Signed-off-by: Tony Lindgren --- arch/arm/plat-omap/include/mach/pm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch') diff --git a/arch/arm/plat-omap/include/mach/pm.h b/arch/arm/plat-omap/include/mach/pm.h index 768eb6e7abc..2a9c27ad4c3 100644 --- a/arch/arm/plat-omap/include/mach/pm.h +++ b/arch/arm/plat-omap/include/mach/pm.h @@ -128,7 +128,7 @@ void clk_deny_idle(struct clk *clk); * clk_allow_idle - Counters previous clk_deny_idle * @clk: clock signal handle */ -void clk_deny_idle(struct clk *clk); +void clk_allow_idle(struct clk *clk); extern void omap_pm_idle(void); extern void omap_pm_suspend(void); -- cgit v1.2.3 From 72e9622c2a2eb73d82c716504cc93d22cd3cfd8e Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Tue, 25 Nov 2008 18:57:08 +0100 Subject: [ARM] pxa/pcm990: use negative number for an invalid GPIO in camera data 0 is a valid GPIO number, use a negative number to specify, that this camera doesn't have a GPIO for bus-width switching. Signed-off-by: Guennadi Liakhovetski Signed-off-by: Eric Miao --- arch/arm/mach-pxa/pcm990-baseboard.c | 1 + 1 file changed, 1 insertion(+) (limited to 'arch') diff --git a/arch/arm/mach-pxa/pcm990-baseboard.c b/arch/arm/mach-pxa/pcm990-baseboard.c index f601425f1b1..b36cec5c9ee 100644 --- a/arch/arm/mach-pxa/pcm990-baseboard.c +++ b/arch/arm/mach-pxa/pcm990-baseboard.c @@ -385,6 +385,7 @@ static struct soc_camera_link iclink[] = { .gpio = NR_BUILTIN_GPIO + 1, }, { .bus_id = 0, /* Must match with the camera ID above */ + .gpio = -ENXIO, } }; -- cgit v1.2.3 From 2fd36a5d6e830269a37f0f6ccfd34ee0517ebc7d Mon Sep 17 00:00:00 2001 From: Eric Miao Date: Wed, 26 Nov 2008 12:51:42 +0800 Subject: [ARM] pxa/corgi: update default config to exclude tosa from being built Signed-off-by: Eric Miao --- arch/arm/configs/corgi_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch') diff --git a/arch/arm/configs/corgi_defconfig b/arch/arm/configs/corgi_defconfig index f3af0b593eb..98765438048 100644 --- a/arch/arm/configs/corgi_defconfig +++ b/arch/arm/configs/corgi_defconfig @@ -179,7 +179,7 @@ CONFIG_MACH_HUSKY=y # CONFIG_MACH_AKITA is not set # CONFIG_MACH_SPITZ is not set # CONFIG_MACH_BORZOI is not set -CONFIG_MACH_TOSA=y +# CONFIG_MACH_TOSA is not set # CONFIG_ARCH_VIPER is not set # CONFIG_ARCH_PXA_ESERIES is not set # CONFIG_TRIZEPS_PXA is not set -- cgit v1.2.3 From 723fdb781abfe78d8ba7d911abbb581722348aa7 Mon Sep 17 00:00:00 2001 From: Tero Kristo Date: Wed, 26 Nov 2008 14:35:16 -0800 Subject: ARM: OMAP: Fixes for suspend / resume GPIO wake-up handling Use the correct wake-up enable register, and make it work with 34xx also. Signed-off-by: Tero Kristo Signed-off-by: Kevin Hilman Signed-off-by: Tony Lindgren --- arch/arm/plat-omap/gpio.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'arch') diff --git a/arch/arm/plat-omap/gpio.c b/arch/arm/plat-omap/gpio.c index 8679fbca6bb..424049d83fb 100644 --- a/arch/arm/plat-omap/gpio.c +++ b/arch/arm/plat-omap/gpio.c @@ -101,6 +101,7 @@ #define OMAP24XX_GPIO_IRQSTATUS2 0x0028 #define OMAP24XX_GPIO_IRQENABLE2 0x002c #define OMAP24XX_GPIO_IRQENABLE1 0x001c +#define OMAP24XX_GPIO_WAKE_EN 0x0020 #define OMAP24XX_GPIO_CTRL 0x0030 #define OMAP24XX_GPIO_OE 0x0034 #define OMAP24XX_GPIO_DATAIN 0x0038 @@ -1551,7 +1552,7 @@ static int omap_gpio_suspend(struct sys_device *dev, pm_message_t mesg) #endif #if defined(CONFIG_ARCH_OMAP24XX) || defined(CONFIG_ARCH_OMAP34XX) case METHOD_GPIO_24XX: - wake_status = bank->base + OMAP24XX_GPIO_SETWKUENA; + wake_status = bank->base + OMAP24XX_GPIO_WAKE_EN; wake_clear = bank->base + OMAP24XX_GPIO_CLEARWKUENA; wake_set = bank->base + OMAP24XX_GPIO_SETWKUENA; break; @@ -1574,7 +1575,7 @@ static int omap_gpio_resume(struct sys_device *dev) { int i; - if (!cpu_is_omap24xx() && !cpu_is_omap16xx()) + if (!cpu_class_is_omap2() && !cpu_is_omap16xx()) return 0; for (i = 0; i < gpio_bank_count; i++) { -- cgit v1.2.3 From a730b327ca70f0e4d933202e3979e96613c3585f Mon Sep 17 00:00:00 2001 From: Marek Vasut Date: Thu, 20 Nov 2008 17:34:57 +0100 Subject: [ARM] pxa/palmtx: misc fixes to use generic GPIO API Signed-off-by: Marek Vasut Signed-off-by: Eric Miao --- arch/arm/mach-pxa/palmtx.c | 150 +++++++++++++++++++++++++++++++++++---------- 1 file changed, 118 insertions(+), 32 deletions(-) (limited to 'arch') diff --git a/arch/arm/mach-pxa/palmtx.c b/arch/arm/mach-pxa/palmtx.c index 4447711c9fc..a9d94f5dbec 100644 --- a/arch/arm/mach-pxa/palmtx.c +++ b/arch/arm/mach-pxa/palmtx.c @@ -56,6 +56,9 @@ static unsigned long palmtx_pin_config[] __initdata = { GPIO110_MMC_DAT_2, GPIO111_MMC_DAT_3, GPIO112_MMC_CMD, + GPIO14_GPIO, /* SD detect */ + GPIO114_GPIO, /* SD power */ + GPIO115_GPIO, /* SD r/o switch */ /* AC97 */ GPIO28_AC97_BITCLK, @@ -64,6 +67,7 @@ static unsigned long palmtx_pin_config[] __initdata = { GPIO31_AC97_SYNC, /* IrDA */ + GPIO40_GPIO, /* ir disable */ GPIO46_FICP_RXD, GPIO47_FICP_TXD, @@ -71,7 +75,8 @@ static unsigned long palmtx_pin_config[] __initdata = { GPIO16_PWM0_OUT, /* USB */ - GPIO13_GPIO, + GPIO13_GPIO, /* usb detect */ + GPIO95_GPIO, /* usb power */ /* PCMCIA */ GPIO48_nPOE, @@ -84,6 +89,45 @@ static unsigned long palmtx_pin_config[] __initdata = { GPIO55_nPREG, GPIO56_nPWAIT, GPIO57_nIOIS16, + GPIO94_GPIO, /* wifi power 1 */ + GPIO108_GPIO, /* wifi power 2 */ + GPIO116_GPIO, /* wifi ready */ + + /* MATRIX KEYPAD */ + GPIO100_KP_MKIN_0, + GPIO101_KP_MKIN_1, + GPIO102_KP_MKIN_2, + GPIO97_KP_MKIN_3, + GPIO103_KP_MKOUT_0, + GPIO104_KP_MKOUT_1, + GPIO105_KP_MKOUT_2, + + /* LCD */ + GPIO58_LCD_LDD_0, + GPIO59_LCD_LDD_1, + GPIO60_LCD_LDD_2, + GPIO61_LCD_LDD_3, + GPIO62_LCD_LDD_4, + GPIO63_LCD_LDD_5, + GPIO64_LCD_LDD_6, + GPIO65_LCD_LDD_7, + GPIO66_LCD_LDD_8, + GPIO67_LCD_LDD_9, + GPIO68_LCD_LDD_10, + GPIO69_LCD_LDD_11, + GPIO70_LCD_LDD_12, + GPIO71_LCD_LDD_13, + GPIO72_LCD_LDD_14, + GPIO73_LCD_LDD_15, + GPIO74_LCD_FCLK, + GPIO75_LCD_LCLK, + GPIO76_LCD_PCLK, + GPIO77_LCD_BIAS, + + /* MISC. */ + GPIO10_GPIO, /* hotsync button */ + GPIO12_GPIO, /* power detect */ + GPIO107_GPIO, /* earphone detect */ }; /****************************************************************************** @@ -95,32 +139,49 @@ static int palmtx_mci_init(struct device *dev, irq_handler_t palmtx_detect_int, int err = 0; /* Setup an interrupt for detecting card insert/remove events */ - err = request_irq(IRQ_GPIO_PALMTX_SD_DETECT_N, palmtx_detect_int, - IRQF_DISABLED | IRQF_SAMPLE_RANDOM | + err = gpio_request(GPIO_NR_PALMTX_SD_DETECT_N, "SD IRQ"); + if (err) + goto err; + err = gpio_direction_input(GPIO_NR_PALMTX_SD_DETECT_N); + if (err) + goto err2; + err = request_irq(gpio_to_irq(GPIO_NR_PALMTX_SD_DETECT_N), + palmtx_detect_int, IRQF_DISABLED | IRQF_SAMPLE_RANDOM | IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING, "SD/MMC card detect", data); if (err) { printk(KERN_ERR "%s: cannot request SD/MMC card detect IRQ\n", __func__); - return err; + goto err2; } err = gpio_request(GPIO_NR_PALMTX_SD_POWER, "SD_POWER"); if (err) - goto pwr_err; + goto err3; + err = gpio_direction_output(GPIO_NR_PALMTX_SD_POWER, 0); + if (err) + goto err4; err = gpio_request(GPIO_NR_PALMTX_SD_READONLY, "SD_READONLY"); if (err) - goto ro_err; + goto err4; + err = gpio_direction_input(GPIO_NR_PALMTX_SD_READONLY); + if (err) + goto err5; printk(KERN_DEBUG "%s: irq registered\n", __func__); return 0; -ro_err: +err5: + gpio_free(GPIO_NR_PALMTX_SD_READONLY); +err4: gpio_free(GPIO_NR_PALMTX_SD_POWER); -pwr_err: - free_irq(IRQ_GPIO_PALMTX_SD_DETECT_N, data); +err3: + free_irq(gpio_to_irq(GPIO_NR_PALMTX_SD_DETECT_N), data); +err2: + gpio_free(GPIO_NR_PALMTX_SD_DETECT_N); +err: return err; } @@ -128,7 +189,8 @@ static void palmtx_mci_exit(struct device *dev, void *data) { gpio_free(GPIO_NR_PALMTX_SD_READONLY); gpio_free(GPIO_NR_PALMTX_SD_POWER); - free_irq(IRQ_GPIO_PALMTX_SD_DETECT_N, data); + free_irq(gpio_to_irq(GPIO_NR_PALMTX_SD_DETECT_N), data); + gpio_free(GPIO_NR_PALMTX_SD_DETECT_N); } static void palmtx_mci_power(struct device *dev, unsigned int vdd) @@ -167,7 +229,6 @@ static unsigned int palmtx_matrix_keys[] = { KEY(3, 0, KEY_RIGHT), KEY(3, 2, KEY_LEFT), - }; static struct pxa27x_keypad_platform_data palmtx_keypad_platform_data = { @@ -209,11 +270,19 @@ static int palmtx_backlight_init(struct device *dev) ret = gpio_request(GPIO_NR_PALMTX_BL_POWER, "BL POWER"); if (ret) goto err; + ret = gpio_direction_output(GPIO_NR_PALMTX_BL_POWER, 0); + if (ret) + goto err2; ret = gpio_request(GPIO_NR_PALMTX_LCD_POWER, "LCD POWER"); if (ret) goto err2; + ret = gpio_direction_output(GPIO_NR_PALMTX_LCD_POWER, 0); + if (ret) + goto err3; return 0; +err3: + gpio_free(GPIO_NR_PALMTX_LCD_POWER); err2: gpio_free(GPIO_NR_PALMTX_BL_POWER); err: @@ -254,6 +323,24 @@ static struct platform_device palmtx_backlight = { /****************************************************************************** * IrDA ******************************************************************************/ +static int palmtx_irda_startup(struct device *dev) +{ + int err; + err = gpio_request(GPIO_NR_PALMTX_IR_DISABLE, "IR DISABLE"); + if (err) + goto err; + err = gpio_direction_output(GPIO_NR_PALMTX_IR_DISABLE, 1); + if (err) + gpio_free(GPIO_NR_PALMTX_IR_DISABLE); +err: + return err; +} + +static void palmtx_irda_shutdown(struct device *dev) +{ + gpio_free(GPIO_NR_PALMTX_IR_DISABLE); +} + static void palmtx_irda_transceiver_mode(struct device *dev, int mode) { gpio_set_value(GPIO_NR_PALMTX_IR_DISABLE, mode & IR_OFF); @@ -261,6 +348,8 @@ static void palmtx_irda_transceiver_mode(struct device *dev, int mode) } static struct pxaficp_platform_data palmtx_ficp_platform_data = { + .startup = palmtx_irda_startup, + .shutdown = palmtx_irda_shutdown, .transceiver_cap = IR_SIRMODE | IR_FIRMODE | IR_OFF, .transceiver_mode = palmtx_irda_transceiver_mode, }; @@ -268,17 +357,11 @@ static struct pxaficp_platform_data palmtx_ficp_platform_data = { /****************************************************************************** * UDC ******************************************************************************/ -static void palmtx_udc_command(int cmd) -{ - gpio_set_value(GPIO_NR_PALMTX_USB_POWER, !cmd); - udelay(50); - gpio_set_value(GPIO_NR_PALMTX_USB_PULLUP, !cmd); -} - static struct pxa2xx_udc_mach_info palmtx_udc_info __initdata = { .gpio_vbus = GPIO_NR_PALMTX_USB_DETECT_N, .gpio_vbus_inverted = 1, - .udc_command = palmtx_udc_command, + .gpio_pullup = GPIO_NR_PALMTX_USB_POWER, + .gpio_pullup_inverted = 0, }; /****************************************************************************** @@ -290,17 +373,16 @@ static int power_supply_init(struct device *dev) ret = gpio_request(GPIO_NR_PALMTX_POWER_DETECT, "CABLE_STATE_AC"); if (ret) - goto err_cs_ac; - - ret = gpio_request(GPIO_NR_PALMTX_USB_DETECT_N, "CABLE_STATE_USB"); + goto err1; + ret = gpio_direction_input(GPIO_NR_PALMTX_POWER_DETECT); if (ret) - goto err_cs_usb; + goto err2; return 0; -err_cs_usb: +err2: gpio_free(GPIO_NR_PALMTX_POWER_DETECT); -err_cs_ac: +err1: return ret; } @@ -309,14 +391,8 @@ static int palmtx_is_ac_online(void) return gpio_get_value(GPIO_NR_PALMTX_POWER_DETECT); } -static int palmtx_is_usb_online(void) -{ - return !gpio_get_value(GPIO_NR_PALMTX_USB_DETECT_N); -} - static void power_supply_exit(struct device *dev) { - gpio_free(GPIO_NR_PALMTX_USB_DETECT_N); gpio_free(GPIO_NR_PALMTX_POWER_DETECT); } @@ -327,7 +403,6 @@ static char *palmtx_supplicants[] = { static struct pda_power_pdata power_supply_info = { .init = power_supply_init, .is_ac_online = palmtx_is_ac_online, - .is_usb_online = palmtx_is_usb_online, .exit = power_supply_exit, .supplied_to = palmtx_supplicants, .num_supplicants = ARRAY_SIZE(palmtx_supplicants), @@ -410,12 +485,23 @@ static void __init palmtx_map_io(void) iotable_init(palmtx_io_desc, ARRAY_SIZE(palmtx_io_desc)); } +/* setup udc GPIOs initial state */ +static void __init palmtx_udc_init(void) +{ + if (!gpio_request(GPIO_NR_PALMTX_USB_POWER, "UDC Vbus")) { + gpio_direction_output(GPIO_NR_PALMTX_USB_POWER, 1); + gpio_free(GPIO_NR_PALMTX_USB_POWER); + } +} + + static void __init palmtx_init(void) { pxa2xx_mfp_config(ARRAY_AND_SIZE(palmtx_pin_config)); set_pxa_fb_info(&palmtx_lcd_screen); pxa_set_mci_info(&palmtx_mci_platform_data); + palmtx_udc_init(); pxa_set_udc_info(&palmtx_udc_info); pxa_set_ac97_info(NULL); pxa_set_ficp_info(&palmtx_ficp_platform_data); -- cgit v1.2.3