]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/arm/mach-pxa/sharpsl_pm.c
Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm
[linux-2.6-omap-h63xx.git] / arch / arm / mach-pxa / sharpsl_pm.c
index 15c2f1a8623ba8b547dea59b9dcc6ab97e18adef..f0845c1b001c8a94fca44dbb93df2edf621ecbd8 100644 (file)
@@ -116,20 +116,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)