aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/sharpsl_pm.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-10-23 19:06:49 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-10-23 19:06:49 -0400
commit0d876c6a96e2cabf8632e8066b617d9c2dec9518 (patch)
tree2be0d37f97a367192f309f61de8bb8dec0a4e55f /arch/arm/mach-pxa/sharpsl_pm.c
parent900bca34940ca1db8dd04a2e9b240ffac32da6f6 (diff)
parent6ffab0efc17f70f44810ae50fc40f934c8173f35 (diff)
Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm: [ARM] pxa: corgi backlight driver should not select ssp drivers [ARM] 5321/1: Kirkwood: fix typo in Makefile [ARM] 5320/1: fix assembly constraints in implementation of do_div() [ARM] 5318/1: Swap the PRRR and NMRR values in proc-v7.S [ARM] 5316/1: AT91: oops (regression) fix on gpio irq [ARM] msm: vreg interface to msm7k pmic [ARM] msm: dma: various basic dma improvements and bugfixes [ARM] msm: clock: provide clk_*() api support for [ARM] msm: clean up iomap and devices [ARM] msm: add proc_comm support, necessary for clock and power control [ARM] msm: rename ARCH_MSM7X00A to ARCH_MSM [ARM] pxa/spitz: fix unbalance parenthesis in header file spitz.h [ARM] pxa: update {corgi,spitz}_defconfig to favor SPI-based drivers [ARM] pxa: fix the corgi_ssp.c dependency issue in {corgi,spitz}_defconfig Revert "[ARM] pxa/corgi: remove now unused corgi_ssp.c and corgi_lcd.c"
Diffstat (limited to 'arch/arm/mach-pxa/sharpsl_pm.c')
-rw-r--r--arch/arm/mach-pxa/sharpsl_pm.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/arch/arm/mach-pxa/sharpsl_pm.c b/arch/arm/mach-pxa/sharpsl_pm.c
index 15c2f1a8623b..f0845c1b001c 100644
--- a/arch/arm/mach-pxa/sharpsl_pm.c
+++ b/arch/arm/mach-pxa/sharpsl_pm.c
@@ -116,20 +116,33 @@ struct battery_thresh spitz_battery_levels_noac[] = {
116 { 0, 0}, 116 { 0, 0},
117}; 117};
118 118
119/* MAX1111 Commands */
120#define MAXCTRL_PD0 1u << 0
121#define MAXCTRL_PD1 1u << 1
122#define MAXCTRL_SGL 1u << 2
123#define MAXCTRL_UNI 1u << 3
124#define MAXCTRL_SEL_SH 4
125#define MAXCTRL_STR 1u << 7
126
119/* 127/*
120 * Read MAX1111 ADC 128 * Read MAX1111 ADC
121 */ 129 */
122extern int max1111_read_channel(int);
123
124int sharpsl_pm_pxa_read_max1111(int channel) 130int sharpsl_pm_pxa_read_max1111(int channel)
125{ 131{
126 if (machine_is_tosa()) // Ugly, better move this function into another module 132 if (machine_is_tosa()) // Ugly, better move this function into another module
127 return 0; 133 return 0;
128 134
135#ifdef CONFIG_CORGI_SSP_DEPRECATED
136 return corgi_ssp_max1111_get((channel << MAXCTRL_SEL_SH) | MAXCTRL_PD0 | MAXCTRL_PD1
137 | MAXCTRL_SGL | MAXCTRL_UNI | MAXCTRL_STR);
138#else
139 extern int max1111_read_channel(int);
140
129 /* max1111 accepts channels from 0-3, however, 141 /* max1111 accepts channels from 0-3, however,
130 * it is encoded from 0-7 here in the code. 142 * it is encoded from 0-7 here in the code.
131 */ 143 */
132 return max1111_read_channel(channel >> 1); 144 return max1111_read_channel(channel >> 1);
145#endif
133} 146}
134 147
135void sharpsl_pm_pxa_init(void) 148void sharpsl_pm_pxa_init(void)