From 4321e1a12b811c02441240aa6183156791204f3f Mon Sep 17 00:00:00 2001 From: Russell King - ARM Linux Date: Tue, 15 Feb 2011 15:37:30 +0800 Subject: ARM: pxa: clean up set_pxa_fb_info set_pxa_fb_info() has been a long-standing wart in the naming scheme of the pxa_set_xxx_info() functions. This renames the function, and combines set_pxa_fb_parent() with set_pxa_fb_info(). Signed-off-by: Russell King Acked-by: Igor Grinberg Signed-off-by: Eric Miao --- arch/arm/mach-pxa/z2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm/mach-pxa/z2.c') diff --git a/arch/arm/mach-pxa/z2.c b/arch/arm/mach-pxa/z2.c index a323e076129e..084c724c1569 100644 --- a/arch/arm/mach-pxa/z2.c +++ b/arch/arm/mach-pxa/z2.c @@ -272,7 +272,7 @@ static struct pxafb_mach_info z2_lcd_screen = { static void __init z2_lcd_init(void) { - set_pxa_fb_info(&z2_lcd_screen); + pxa_set_fb_info(NULL, &z2_lcd_screen); } #else static inline void z2_lcd_init(void) {} -- cgit v1.2.3-55-g7522 From 2e62344de8e2a7e402fe2a009c3d09bc6fd589e6 Mon Sep 17 00:00:00 2001 From: Vasily Khoruzhick Date: Sun, 13 Mar 2011 17:19:17 +0200 Subject: ARM: PXA: Z2: Use only power button as wake source It's very easy to press some keypad key when Z2 is closed, so to prevent unexpected wakeups, use only 'Power' key to wake Z2 from sleep. Signed-off-by: Vasily Khoruzhick Acked-by: Marek Vasut --- arch/arm/mach-pxa/z2.c | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) (limited to 'arch/arm/mach-pxa/z2.c') diff --git a/arch/arm/mach-pxa/z2.c b/arch/arm/mach-pxa/z2.c index 084c724c1569..db6199c74ebb 100644 --- a/arch/arm/mach-pxa/z2.c +++ b/arch/arm/mach-pxa/z2.c @@ -92,13 +92,13 @@ static unsigned long z2_pin_config[] = { GPIO47_STUART_TXD, /* Keypad */ - GPIO100_KP_MKIN_0 | WAKEUP_ON_LEVEL_HIGH, - GPIO101_KP_MKIN_1 | WAKEUP_ON_LEVEL_HIGH, - GPIO102_KP_MKIN_2 | WAKEUP_ON_LEVEL_HIGH, - GPIO34_KP_MKIN_3 | WAKEUP_ON_LEVEL_HIGH, - GPIO38_KP_MKIN_4 | WAKEUP_ON_LEVEL_HIGH, - GPIO16_KP_MKIN_5 | WAKEUP_ON_LEVEL_HIGH, - GPIO17_KP_MKIN_6 | WAKEUP_ON_LEVEL_HIGH, + GPIO100_KP_MKIN_0, + GPIO101_KP_MKIN_1, + GPIO102_KP_MKIN_2, + GPIO34_KP_MKIN_3, + GPIO38_KP_MKIN_4, + GPIO16_KP_MKIN_5, + GPIO17_KP_MKIN_6, GPIO103_KP_MKOUT_0, GPIO104_KP_MKOUT_1, GPIO105_KP_MKOUT_2, @@ -428,8 +428,22 @@ static inline void z2_mkp_init(void) {} ******************************************************************************/ #if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) static struct gpio_keys_button z2_pxa_buttons[] = { - {KEY_POWER, GPIO1_ZIPITZ2_POWER_BUTTON, 0, "Power Button" }, - {KEY_CLOSE, GPIO98_ZIPITZ2_LID_BUTTON, 0, "Lid Button" }, + { + .code = KEY_POWER, + .gpio = GPIO1_ZIPITZ2_POWER_BUTTON, + .active_low = 0, + .desc = "Power Button", + .wakeup = 1, + .type = EV_KEY, + }, + { + .code = KEY_CLOSE, + .gpio = GPIO98_ZIPITZ2_LID_BUTTON, + .active_low = 0, + .desc = "Lid Button", + .wakeup = 0 + .type = EV_KEY, + }, }; static struct gpio_keys_platform_data z2_pxa_keys_data = { -- cgit v1.2.3-55-g7522 From 233cdbce55b8948b46fcd76ad77c1f33b8c01095 Mon Sep 17 00:00:00 2001 From: Vasily Khoruzhick Date: Sun, 13 Mar 2011 17:19:18 +0200 Subject: ARM: PXA: Z2: Fix battery pdata Fix coefficients to get actual voltage, and make voltage_max/voltage_min looks like values for LiIon battery. Signed-off-by: Vasily Khoruzhick Acked-by: Marek Vasut --- arch/arm/mach-pxa/z2.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'arch/arm/mach-pxa/z2.c') diff --git a/arch/arm/mach-pxa/z2.c b/arch/arm/mach-pxa/z2.c index db6199c74ebb..31db09bb0b5c 100644 --- a/arch/arm/mach-pxa/z2.c +++ b/arch/arm/mach-pxa/z2.c @@ -476,9 +476,9 @@ static struct z2_battery_info batt_chip_info = { .batt_I2C_addr = 0x55, .batt_I2C_reg = 2, .charge_gpio = GPIO0_ZIPITZ2_AC_DETECT, - .min_voltage = 2400000, - .max_voltage = 3700000, - .batt_div = 69, + .min_voltage = 3475000, + .max_voltage = 4190000, + .batt_div = 59, .batt_mult = 1000000, .batt_tech = POWER_SUPPLY_TECHNOLOGY_LION, .batt_name = "Z2", -- cgit v1.2.3-55-g7522 From b8f56a78e3a161f10bfd4e648a3d3828718aaa80 Mon Sep 17 00:00:00 2001 From: Vasily Khoruzhick Date: Sun, 13 Mar 2011 17:19:19 +0200 Subject: ARM: PXA: Z2: Fix libertas init/tear down sequences GPIO15 seems to be not related to WiFi, so don't touch it. Signed-off-by: Vasily Khoruzhick Acked-by: Marek Vasut --- arch/arm/mach-pxa/include/mach/z2.h | 3 +-- arch/arm/mach-pxa/z2.c | 31 ++++++++----------------------- 2 files changed, 9 insertions(+), 25 deletions(-) (limited to 'arch/arm/mach-pxa/z2.c') diff --git a/arch/arm/mach-pxa/include/mach/z2.h b/arch/arm/mach-pxa/include/mach/z2.h index 8835c16bc82f..7b0f71ef3167 100644 --- a/arch/arm/mach-pxa/include/mach/z2.h +++ b/arch/arm/mach-pxa/include/mach/z2.h @@ -25,8 +25,7 @@ #define GPIO98_ZIPITZ2_LID_BUTTON 98 /* Libertas GSPI8686 WiFi */ -#define GPIO14_ZIPITZ2_WIFI_RESET 14 -#define GPIO15_ZIPITZ2_WIFI_POWER 15 +#define GPIO14_ZIPITZ2_WIFI_POWER 14 #define GPIO24_ZIPITZ2_WIFI_CS 24 #define GPIO36_ZIPITZ2_WIFI_IRQ 36 diff --git a/arch/arm/mach-pxa/z2.c b/arch/arm/mach-pxa/z2.c index 31db09bb0b5c..4df1ecb14543 100644 --- a/arch/arm/mach-pxa/z2.c +++ b/arch/arm/mach-pxa/z2.c @@ -139,8 +139,7 @@ static unsigned long z2_pin_config[] = { GPIO1_GPIO, /* Power button */ GPIO37_GPIO, /* Headphone detect */ GPIO98_GPIO, /* Lid switch */ - GPIO14_GPIO, /* WiFi Reset */ - GPIO15_GPIO, /* WiFi Power */ + GPIO14_GPIO, /* WiFi Power */ GPIO24_GPIO, /* WiFi CS */ GPIO36_GPIO, /* WiFi IRQ */ GPIO88_GPIO, /* LCD CS */ @@ -512,26 +511,16 @@ static int z2_lbs_spi_setup(struct spi_device *spi) { int ret = 0; - ret = gpio_request(GPIO15_ZIPITZ2_WIFI_POWER, "WiFi Power"); + ret = gpio_request(GPIO14_ZIPITZ2_WIFI_POWER, "WiFi Power"); if (ret) goto err; - ret = gpio_direction_output(GPIO15_ZIPITZ2_WIFI_POWER, 1); + ret = gpio_direction_output(GPIO14_ZIPITZ2_WIFI_POWER, 1); if (ret) goto err2; - ret = gpio_request(GPIO14_ZIPITZ2_WIFI_RESET, "WiFi Reset"); - if (ret) - goto err2; - - ret = gpio_direction_output(GPIO14_ZIPITZ2_WIFI_RESET, 0); - if (ret) - goto err3; - - /* Reset the card */ + /* Wait until card is powered on */ mdelay(180); - gpio_set_value(GPIO14_ZIPITZ2_WIFI_RESET, 1); - mdelay(20); spi->bits_per_word = 16; spi->mode = SPI_MODE_2, @@ -540,22 +529,18 @@ static int z2_lbs_spi_setup(struct spi_device *spi) return 0; -err3: - gpio_free(GPIO14_ZIPITZ2_WIFI_RESET); err2: - gpio_free(GPIO15_ZIPITZ2_WIFI_POWER); + gpio_free(GPIO14_ZIPITZ2_WIFI_POWER); err: return ret; }; static int z2_lbs_spi_teardown(struct spi_device *spi) { - gpio_set_value(GPIO14_ZIPITZ2_WIFI_RESET, 0); - gpio_set_value(GPIO15_ZIPITZ2_WIFI_POWER, 0); - gpio_free(GPIO14_ZIPITZ2_WIFI_RESET); - gpio_free(GPIO15_ZIPITZ2_WIFI_POWER); - return 0; + gpio_set_value(GPIO14_ZIPITZ2_WIFI_POWER, 0); + gpio_free(GPIO14_ZIPITZ2_WIFI_POWER); + return 0; }; static struct pxa2xx_spi_chip z2_lbs_chip_info = { -- cgit v1.2.3-55-g7522 From 034e17563b90fa20342b78a2faac9cba3a1c4a38 Mon Sep 17 00:00:00 2001 From: Vasily Khoruzhick Date: Sun, 13 Mar 2011 17:19:20 +0200 Subject: ARM: PXA: Z2: Keep kbd backlight disabled by default It eats too much power, and anyway it's not usefull during boot process. Userspace can enable it later. Signed-off-by: Vasily Khoruzhick Acked-by: Marek Vasut --- arch/arm/mach-pxa/z2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/arm/mach-pxa/z2.c') diff --git a/arch/arm/mach-pxa/z2.c b/arch/arm/mach-pxa/z2.c index 4df1ecb14543..9b6ab0778808 100644 --- a/arch/arm/mach-pxa/z2.c +++ b/arch/arm/mach-pxa/z2.c @@ -204,7 +204,7 @@ static struct platform_pwm_backlight_data z2_backlight_data[] = { /* Keypad Backlight */ .pwm_id = 1, .max_brightness = 1023, - .dft_brightness = 512, + .dft_brightness = 0, .pwm_period_ns = 1260320, }, [1] = { -- cgit v1.2.3-55-g7522 From 54d5710058ebe34451f4ab1d73d86cd8214897b7 Mon Sep 17 00:00:00 2001 From: Vasily Khoruzhick Date: Sun, 13 Mar 2011 17:19:21 +0200 Subject: ARM: PXA: Z2: Add default triggers for LEDs So user can see if there's any mmc activity and if device's charging. Signed-off-by: Vasily Khoruzhick Acked-by: Marek Vasut --- arch/arm/mach-pxa/z2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'arch/arm/mach-pxa/z2.c') diff --git a/arch/arm/mach-pxa/z2.c b/arch/arm/mach-pxa/z2.c index 9b6ab0778808..3ab73f3079a0 100644 --- a/arch/arm/mach-pxa/z2.c +++ b/arch/arm/mach-pxa/z2.c @@ -309,12 +309,12 @@ struct gpio_led z2_gpio_leds[] = { .active_low = 1, }, { .name = "z2:green:charged", - .default_trigger = "none", + .default_trigger = "mmc0", .gpio = GPIO85_ZIPITZ2_LED_CHARGED, .active_low = 1, }, { .name = "z2:amber:charging", - .default_trigger = "none", + .default_trigger = "Z2-charging-or-full", .gpio = GPIO83_ZIPITZ2_LED_CHARGING, .active_low = 1, }, -- cgit v1.2.3-55-g7522 From e3b1ceedf7adc4adfc989ee78a30fca7b62480b5 Mon Sep 17 00:00:00 2001 From: Vasily Khoruzhick Date: Sun, 13 Mar 2011 17:19:22 +0200 Subject: ARM: PXA: Z2: Use switch event for lid Otherwise userspace might be confused. Signed-off-by: Vasily Khoruzhick Acked-by: Marek Vasut --- arch/arm/mach-pxa/z2.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'arch/arm/mach-pxa/z2.c') diff --git a/arch/arm/mach-pxa/z2.c b/arch/arm/mach-pxa/z2.c index 3ab73f3079a0..d9322ddad8d8 100644 --- a/arch/arm/mach-pxa/z2.c +++ b/arch/arm/mach-pxa/z2.c @@ -436,12 +436,12 @@ static struct gpio_keys_button z2_pxa_buttons[] = { .type = EV_KEY, }, { - .code = KEY_CLOSE, + .code = SW_LID, .gpio = GPIO98_ZIPITZ2_LID_BUTTON, - .active_low = 0, - .desc = "Lid Button", - .wakeup = 0 - .type = EV_KEY, + .active_low = 1, + .desc = "Lid Switch", + .wakeup = 0, + .type = EV_SW, }, }; -- cgit v1.2.3-55-g7522