diff options
author | Carlos Eduardo Aguiar <carlos.aguiar@indt.org.br> | 2007-11-30 00:52:53 -0500 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2008-02-08 13:38:01 -0500 |
commit | 087c50302fbd608118e7c0f27a95dc552ad2f53b (patch) | |
tree | 1394a3bed4a977baab3cad9378f1497698435fc6 /arch/arm/mach-omap1/board-sx1.c | |
parent | 138ab9f8321f67c71984ca43222efa71b0a0a0a9 (diff) |
ARM: OMAP1: Use MMC multislot structures for Siemens SX1 board
Use MMC multislot structures for Siemens SX1 board
Signed-off-by: Carlos Eduardo Aguiar <carlos.aguiar@indt.org.br>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap1/board-sx1.c')
-rw-r--r-- | arch/arm/mach-omap1/board-sx1.c | 39 |
1 files changed, 14 insertions, 25 deletions
diff --git a/arch/arm/mach-omap1/board-sx1.c b/arch/arm/mach-omap1/board-sx1.c index 2743d639aa05..be3ecd8c890e 100644 --- a/arch/arm/mach-omap1/board-sx1.c +++ b/arch/arm/mach-omap1/board-sx1.c | |||
@@ -44,7 +44,7 @@ | |||
44 | #include <asm/arch/keypad.h> | 44 | #include <asm/arch/keypad.h> |
45 | 45 | ||
46 | /* Write to I2C device */ | 46 | /* Write to I2C device */ |
47 | int i2c_write_byte(u8 devaddr, u8 regoffset, u8 value) | 47 | int sx1_i2c_write_byte(u8 devaddr, u8 regoffset, u8 value) |
48 | { | 48 | { |
49 | struct i2c_adapter *adap; | 49 | struct i2c_adapter *adap; |
50 | int err; | 50 | int err; |
@@ -67,7 +67,7 @@ int i2c_write_byte(u8 devaddr, u8 regoffset, u8 value) | |||
67 | } | 67 | } |
68 | 68 | ||
69 | /* Read from I2C device */ | 69 | /* Read from I2C device */ |
70 | int i2c_read_byte(u8 devaddr, u8 regoffset, u8 * value) | 70 | int sx1_i2c_read_byte(u8 devaddr, u8 regoffset, u8 *value) |
71 | { | 71 | { |
72 | struct i2c_adapter *adap; | 72 | struct i2c_adapter *adap; |
73 | int err; | 73 | int err; |
@@ -101,66 +101,55 @@ int sx1_setkeylight(u8 keylight) | |||
101 | { | 101 | { |
102 | if (keylight > SOFIA_MAX_LIGHT_VAL) | 102 | if (keylight > SOFIA_MAX_LIGHT_VAL) |
103 | keylight = SOFIA_MAX_LIGHT_VAL; | 103 | keylight = SOFIA_MAX_LIGHT_VAL; |
104 | return i2c_write_byte(SOFIA_I2C_ADDR, SOFIA_KEYLIGHT_REG, keylight); | 104 | return sx1_i2c_write_byte(SOFIA_I2C_ADDR, SOFIA_KEYLIGHT_REG, keylight); |
105 | } | 105 | } |
106 | /* get current keylight intensity */ | 106 | /* get current keylight intensity */ |
107 | int sx1_getkeylight(u8 * keylight) | 107 | int sx1_getkeylight(u8 * keylight) |
108 | { | 108 | { |
109 | return i2c_read_byte(SOFIA_I2C_ADDR, SOFIA_KEYLIGHT_REG, keylight); | 109 | return sx1_i2c_read_byte(SOFIA_I2C_ADDR, SOFIA_KEYLIGHT_REG, keylight); |
110 | } | 110 | } |
111 | /* set LCD backlight intensity */ | 111 | /* set LCD backlight intensity */ |
112 | int sx1_setbacklight(u8 backlight) | 112 | int sx1_setbacklight(u8 backlight) |
113 | { | 113 | { |
114 | if (backlight > SOFIA_MAX_LIGHT_VAL) | 114 | if (backlight > SOFIA_MAX_LIGHT_VAL) |
115 | backlight = SOFIA_MAX_LIGHT_VAL; | 115 | backlight = SOFIA_MAX_LIGHT_VAL; |
116 | return i2c_write_byte(SOFIA_I2C_ADDR, SOFIA_BACKLIGHT_REG, backlight); | 116 | return sx1_i2c_write_byte(SOFIA_I2C_ADDR, SOFIA_BACKLIGHT_REG, |
117 | backlight); | ||
117 | } | 118 | } |
118 | /* get current LCD backlight intensity */ | 119 | /* get current LCD backlight intensity */ |
119 | int sx1_getbacklight (u8 * backlight) | 120 | int sx1_getbacklight (u8 * backlight) |
120 | { | 121 | { |
121 | return i2c_read_byte(SOFIA_I2C_ADDR, SOFIA_BACKLIGHT_REG, backlight); | 122 | return sx1_i2c_read_byte(SOFIA_I2C_ADDR, SOFIA_BACKLIGHT_REG, |
123 | backlight); | ||
122 | } | 124 | } |
123 | /* set LCD backlight power on/off */ | 125 | /* set LCD backlight power on/off */ |
124 | int sx1_setmmipower(u8 onoff) | 126 | int sx1_setmmipower(u8 onoff) |
125 | { | 127 | { |
126 | int err; | 128 | int err; |
127 | u8 dat = 0; | 129 | u8 dat = 0; |
128 | err = i2c_read_byte(SOFIA_I2C_ADDR, SOFIA_POWER1_REG, &dat); | 130 | err = sx1_i2c_read_byte(SOFIA_I2C_ADDR, SOFIA_POWER1_REG, &dat); |
129 | if (err < 0) | 131 | if (err < 0) |
130 | return err; | 132 | return err; |
131 | if (onoff) | 133 | if (onoff) |
132 | dat |= SOFIA_MMILIGHT_POWER; | 134 | dat |= SOFIA_MMILIGHT_POWER; |
133 | else | 135 | else |
134 | dat &= ~SOFIA_MMILIGHT_POWER; | 136 | dat &= ~SOFIA_MMILIGHT_POWER; |
135 | return i2c_write_byte(SOFIA_I2C_ADDR, SOFIA_POWER1_REG, dat); | 137 | return sx1_i2c_write_byte(SOFIA_I2C_ADDR, SOFIA_POWER1_REG, dat); |
136 | } | ||
137 | /* set MMC power on/off */ | ||
138 | int sx1_setmmcpower(u8 onoff) | ||
139 | { | ||
140 | int err; | ||
141 | u8 dat = 0; | ||
142 | err = i2c_read_byte(SOFIA_I2C_ADDR, SOFIA_POWER1_REG, &dat); | ||
143 | if (err < 0) | ||
144 | return err; | ||
145 | if (onoff) | ||
146 | dat |= SOFIA_MMC_POWER; | ||
147 | else | ||
148 | dat &= ~SOFIA_MMC_POWER; | ||
149 | return i2c_write_byte(SOFIA_I2C_ADDR, SOFIA_POWER1_REG, dat); | ||
150 | } | 138 | } |
139 | |||
151 | /* set USB power on/off */ | 140 | /* set USB power on/off */ |
152 | int sx1_setusbpower(u8 onoff) | 141 | int sx1_setusbpower(u8 onoff) |
153 | { | 142 | { |
154 | int err; | 143 | int err; |
155 | u8 dat = 0; | 144 | u8 dat = 0; |
156 | err = i2c_read_byte(SOFIA_I2C_ADDR, SOFIA_POWER1_REG, &dat); | 145 | err = sx1_i2c_read_byte(SOFIA_I2C_ADDR, SOFIA_POWER1_REG, &dat); |
157 | if (err < 0) | 146 | if (err < 0) |
158 | return err; | 147 | return err; |
159 | if (onoff) | 148 | if (onoff) |
160 | dat |= SOFIA_USB_POWER; | 149 | dat |= SOFIA_USB_POWER; |
161 | else | 150 | else |
162 | dat &= ~SOFIA_USB_POWER; | 151 | dat &= ~SOFIA_USB_POWER; |
163 | return i2c_write_byte(SOFIA_I2C_ADDR, SOFIA_POWER1_REG, dat); | 152 | return sx1_i2c_write_byte(SOFIA_I2C_ADDR, SOFIA_POWER1_REG, dat); |
164 | } | 153 | } |
165 | 154 | ||
166 | EXPORT_SYMBOL(sx1_setkeylight); | 155 | EXPORT_SYMBOL(sx1_setkeylight); |
@@ -168,7 +157,6 @@ EXPORT_SYMBOL(sx1_getkeylight); | |||
168 | EXPORT_SYMBOL(sx1_setbacklight); | 157 | EXPORT_SYMBOL(sx1_setbacklight); |
169 | EXPORT_SYMBOL(sx1_getbacklight); | 158 | EXPORT_SYMBOL(sx1_getbacklight); |
170 | EXPORT_SYMBOL(sx1_setmmipower); | 159 | EXPORT_SYMBOL(sx1_setmmipower); |
171 | EXPORT_SYMBOL(sx1_setmmcpower); | ||
172 | EXPORT_SYMBOL(sx1_setusbpower); | 160 | EXPORT_SYMBOL(sx1_setusbpower); |
173 | 161 | ||
174 | /*----------- Keypad -------------------------*/ | 162 | /*----------- Keypad -------------------------*/ |
@@ -454,6 +442,7 @@ static void __init omap_sx1_init(void) | |||
454 | omap_board_config = sx1_config; | 442 | omap_board_config = sx1_config; |
455 | omap_board_config_size = ARRAY_SIZE(sx1_config); | 443 | omap_board_config_size = ARRAY_SIZE(sx1_config); |
456 | omap_serial_init(); | 444 | omap_serial_init(); |
445 | sx1_mmc_init(); | ||
457 | 446 | ||
458 | /* turn on USB power */ | 447 | /* turn on USB power */ |
459 | /* sx1_setusbpower(1); cant do it here because i2c is not ready */ | 448 | /* sx1_setusbpower(1); cant do it here because i2c is not ready */ |