aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/spitz_pm.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-pxa/spitz_pm.c')
-rw-r--r--arch/arm/mach-pxa/spitz_pm.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/arch/arm/mach-pxa/spitz_pm.c b/arch/arm/mach-pxa/spitz_pm.c
index fc5a70c40358..4209ddf6da61 100644
--- a/arch/arm/mach-pxa/spitz_pm.c
+++ b/arch/arm/mach-pxa/spitz_pm.c
@@ -24,9 +24,10 @@
24 24
25#include <mach/sharpsl.h> 25#include <mach/sharpsl.h>
26#include <mach/spitz.h> 26#include <mach/spitz.h>
27#include <mach/pxa2xx-regs.h> 27#include <mach/pxa27x.h>
28#include <mach/pxa2xx-gpio.h> 28
29#include "sharpsl.h" 29#include "sharpsl.h"
30#include "generic.h"
30 31
31#define SHARPSL_CHARGE_ON_VOLT 0x99 /* 2.9V */ 32#define SHARPSL_CHARGE_ON_VOLT 0x99 /* 2.9V */
32#define SHARPSL_CHARGE_ON_TEMP 0xe0 /* 2.9V */ 33#define SHARPSL_CHARGE_ON_TEMP 0xe0 /* 2.9V */
@@ -37,10 +38,17 @@
37 38
38static int spitz_last_ac_status; 39static int spitz_last_ac_status;
39 40
41static struct gpio spitz_charger_gpios[] = {
42 { SPITZ_GPIO_KEY_INT, GPIOF_IN, "Keyboard Interrupt" },
43 { SPITZ_GPIO_SYNC, GPIOF_IN, "Sync" },
44 { SPITZ_GPIO_ADC_TEMP_ON, GPIOF_OUT_INIT_LOW, "ADC Temp On" },
45 { SPITZ_GPIO_JK_B, GPIOF_OUT_INIT_LOW, "JK B" },
46 { SPITZ_GPIO_CHRG_ON, GPIOF_OUT_INIT_LOW, "Charger On" },
47};
48
40static void spitz_charger_init(void) 49static void spitz_charger_init(void)
41{ 50{
42 pxa_gpio_mode(SPITZ_GPIO_KEY_INT | GPIO_IN); 51 gpio_request_array(ARRAY_AND_SIZE(spitz_charger_gpios));
43 pxa_gpio_mode(SPITZ_GPIO_SYNC | GPIO_IN);
44} 52}
45 53
46static void spitz_measure_temp(int on) 54static void spitz_measure_temp(int on)
@@ -76,6 +84,11 @@ static void spitz_discharge1(int on)
76 gpio_set_value(SPITZ_GPIO_LED_GREEN, on); 84 gpio_set_value(SPITZ_GPIO_LED_GREEN, on);
77} 85}
78 86
87static unsigned long gpio18_config[] = {
88 GPIO18_RDY,
89 GPIO18_GPIO,
90};
91
79static void spitz_presuspend(void) 92static void spitz_presuspend(void)
80{ 93{
81 spitz_last_ac_status = sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN); 94 spitz_last_ac_status = sharpsl_pm.machinfo->read_devdata(SHARPSL_STATUS_ACIN);
@@ -97,7 +110,9 @@ static void spitz_presuspend(void)
97 PGSR3 &= ~SPITZ_GPIO_G3_STROBE_BIT; 110 PGSR3 &= ~SPITZ_GPIO_G3_STROBE_BIT;
98 PGSR2 |= GPIO_bit(SPITZ_GPIO_KEY_STROBE0); 111 PGSR2 |= GPIO_bit(SPITZ_GPIO_KEY_STROBE0);
99 112
100 pxa_gpio_mode(GPIO18_RDY|GPIO_OUT | GPIO_DFLT_HIGH); 113 pxa2xx_mfp_config(&gpio18_config[0], 1);
114 gpio_request_one(18, GPIOF_OUT_INIT_HIGH, "Unknown");
115 gpio_free(18);
101 116
102 PRER = GPIO_bit(SPITZ_GPIO_KEY_INT); 117 PRER = GPIO_bit(SPITZ_GPIO_KEY_INT);
103 PFER = GPIO_bit(SPITZ_GPIO_KEY_INT) | GPIO_bit(SPITZ_GPIO_RESET); 118 PFER = GPIO_bit(SPITZ_GPIO_KEY_INT) | GPIO_bit(SPITZ_GPIO_RESET);
@@ -114,8 +129,7 @@ static void spitz_presuspend(void)
114 129
115static void spitz_postsuspend(void) 130static void spitz_postsuspend(void)
116{ 131{
117 pxa_gpio_mode(GPIO18_RDY_MD); 132 pxa2xx_mfp_config(&gpio18_config[1], 1);
118 pxa_gpio_mode(10 | GPIO_IN);
119} 133}
120 134
121static int spitz_should_wakeup(unsigned int resume_on_alarm) 135static int spitz_should_wakeup(unsigned int resume_on_alarm)