Merge branch 'linux-next' of git://git.infradead.org/ubifs-2.6
[pandora-kernel.git] / arch / arm / mach-pxa / sharpsl_pm.c
index 15c2f1a..16b4ec6 100644 (file)
@@ -25,7 +25,6 @@
 #include <mach/hardware.h>
 #include <asm/mach-types.h>
 #include <mach/pm.h>
-#include <mach/pxa-regs.h>
 #include <mach/pxa2xx-gpio.h>
 #include <mach/sharpsl.h>
 #include "sharpsl.h"
@@ -116,20 +115,33 @@ struct battery_thresh  spitz_battery_levels_noac[] = {
        {   0,   0},
 };
 
+/* MAX1111 Commands */
+#define MAXCTRL_PD0      1u << 0
+#define MAXCTRL_PD1      1u << 1
+#define MAXCTRL_SGL      1u << 2
+#define MAXCTRL_UNI      1u << 3
+#define MAXCTRL_SEL_SH   4
+#define MAXCTRL_STR      1u << 7
+
 /*
  * Read MAX1111 ADC
  */
-extern int max1111_read_channel(int);
-
 int sharpsl_pm_pxa_read_max1111(int channel)
 {
        if (machine_is_tosa()) // Ugly, better move this function into another module
            return 0;
 
+#ifdef CONFIG_CORGI_SSP_DEPRECATED
+       return corgi_ssp_max1111_get((channel << MAXCTRL_SEL_SH) | MAXCTRL_PD0 | MAXCTRL_PD1
+                       | MAXCTRL_SGL | MAXCTRL_UNI | MAXCTRL_STR);
+#else
+       extern int max1111_read_channel(int);
+
        /* max1111 accepts channels from 0-3, however,
         * it is encoded from 0-7 here in the code.
         */
        return max1111_read_channel(channel >> 1);
+#endif
 }
 
 void sharpsl_pm_pxa_init(void)