12 #include <linux/module.h>
13 #include <linux/stat.h>
15 #include <linux/kernel.h>
25 #include <mach/hardware.h>
33 #define SHARPSL_CHARGE_ON_VOLT 0x99
34 #define SHARPSL_CHARGE_ON_TEMP 0xe0
35 #define SHARPSL_CHARGE_ON_ACIN_HIGH 0x9b
36 #define SHARPSL_CHARGE_ON_ACIN_LOW 0x34
37 #define SHARPSL_FATAL_ACIN_VOLT 182
38 #define SHARPSL_FATAL_NOACIN_VOLT 170
40 static int spitz_last_ac_status;
42 static struct gpio spitz_charger_gpios[] = {
51 static void spitz_charger_init(
void)
56 static void spitz_measure_temp(
int on)
61 static void spitz_charge(
int on)
77 static void spitz_discharge(
int on)
84 static void spitz_discharge1(
int on)
91 static void spitz_presuspend(
void)
98 if (machine_is_akita()) {
129 static void spitz_postsuspend(
void)
133 static int spitz_should_wakeup(
unsigned int resume_on_alarm)
138 if (spitz_last_ac_status != acin) {
150 spitz_last_ac_status = acin;
168 static unsigned long spitz_charger_wakeup(
void)
199 .init = spitz_charger_init,
206 .discharge = spitz_discharge,
207 .discharge1 = spitz_discharge1,
208 .charge = spitz_charge,
209 .measure_temp = spitz_measure_temp,
210 .presuspend = spitz_presuspend,
211 .postsuspend = spitz_postsuspend,
213 .charger_wakeup = spitz_charger_wakeup,
214 .should_wakeup = spitz_should_wakeup,
215 #if defined(CONFIG_LCD_CORGI)
227 .status_high_acin = 188,
228 .status_low_acin = 178,
229 .status_high_noac = 185,
230 .status_low_noac = 175,
239 if (!machine_is_spitz() && !machine_is_akita()
240 && !machine_is_borzoi())
256 static void spitzpm_exit(
void)