summaryrefslogtreecommitdiff
path: root/firmware/target/arm/imx233/ssp-imx233.c
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2013-06-16 19:18:56 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2013-06-17 00:29:24 +0200
commit918a06a12ad633a29634f3249990ba04ce9fb00b (patch)
treeecaa391890d391626a5cf849d08001391926b772 /firmware/target/arm/imx233/ssp-imx233.c
parentabb7d1dcfe204da217a67235811ebb278dc8fbe1 (diff)
downloadrockbox-918a06a12ad633a29634f3249990ba04ce9fb00b.tar.gz
rockbox-918a06a12ad633a29634f3249990ba04ce9fb00b.zip
imx233: normalise pinctrl names
The current pinctrl functions were a mess. Normalise the functions names to make them shorter and clearer. Change-Id: Iac6ff84625ef2b7610268e3a5802dc0088de3167
Diffstat (limited to 'firmware/target/arm/imx233/ssp-imx233.c')
-rw-r--r--firmware/target/arm/imx233/ssp-imx233.c72
1 files changed, 36 insertions, 36 deletions
diff --git a/firmware/target/arm/imx233/ssp-imx233.c b/firmware/target/arm/imx233/ssp-imx233.c
index a6c3028d98..a3f4083aeb 100644
--- a/firmware/target/arm/imx233/ssp-imx233.c
+++ b/firmware/target/arm/imx233/ssp-imx233.c
@@ -168,20 +168,20 @@ void imx233_ssp_setup_ssp1_sd_mmc_pins(bool enable_pullups, unsigned bus_width,
168 unsigned drive_strength, bool use_alt) 168 unsigned drive_strength, bool use_alt)
169{ 169{
170 /* SSP_{CMD,SCK} */ 170 /* SSP_{CMD,SCK} */
171 imx233_set_pin_drive_strength(2, 0, drive_strength); 171 imx233_pinctrl_set_drive(2, 0, drive_strength);
172 imx233_set_pin_drive_strength(2, 6, drive_strength); 172 imx233_pinctrl_set_drive(2, 6, drive_strength);
173 imx233_pinctrl_acquire_pin(2, 0, "ssp1 cmd"); 173 imx233_pinctrl_acquire(2, 0, "ssp1 cmd");
174 imx233_pinctrl_acquire_pin(2, 6, "ssp1 sck"); 174 imx233_pinctrl_acquire(2, 6, "ssp1 sck");
175 imx233_set_pin_function(2, 0, PINCTRL_FUNCTION_MAIN); 175 imx233_pinctrl_set_function(2, 0, PINCTRL_FUNCTION_MAIN);
176 imx233_set_pin_function(2, 6, PINCTRL_FUNCTION_MAIN); 176 imx233_pinctrl_set_function(2, 6, PINCTRL_FUNCTION_MAIN);
177 imx233_enable_pin_pullup(2, 0, enable_pullups); 177 imx233_pinctrl_enable_pullup(2, 0, enable_pullups);
178 /* SSP_DATA{0-3} */ 178 /* SSP_DATA{0-3} */
179 for(unsigned i = 0; i < MIN(bus_width, 4); i++) 179 for(unsigned i = 0; i < MIN(bus_width, 4); i++)
180 { 180 {
181 imx233_pinctrl_acquire_pin(2, 2 + i, "ssp1 data"); 181 imx233_pinctrl_acquire(2, 2 + i, "ssp1 data");
182 imx233_set_pin_drive_strength(2, 2 + i, drive_strength); 182 imx233_pinctrl_set_drive(2, 2 + i, drive_strength);
183 imx233_set_pin_function(2, 2 + i, PINCTRL_FUNCTION_MAIN); 183 imx233_pinctrl_set_function(2, 2 + i, PINCTRL_FUNCTION_MAIN);
184 imx233_enable_pin_pullup(2, 2 + i, enable_pullups); 184 imx233_pinctrl_enable_pullup(2, 2 + i, enable_pullups);
185 } 185 }
186 186
187 /* SSP_DATA{4-7} */ 187 /* SSP_DATA{4-7} */
@@ -189,17 +189,17 @@ void imx233_ssp_setup_ssp1_sd_mmc_pins(bool enable_pullups, unsigned bus_width,
189 { 189 {
190 if(use_alt) 190 if(use_alt)
191 { 191 {
192 imx233_pinctrl_acquire_pin(0, 22 + i, "ssp1 data"); 192 imx233_pinctrl_acquire(0, 22 + i, "ssp1 data");
193 imx233_set_pin_drive_strength(0, 22 + i, drive_strength); 193 imx233_pinctrl_set_drive(0, 22 + i, drive_strength);
194 imx233_set_pin_function(0, 22 + i, PINCTRL_FUNCTION_ALT2); 194 imx233_pinctrl_set_function(0, 22 + i, PINCTRL_FUNCTION_ALT2);
195 imx233_enable_pin_pullup(0, 22 + i, enable_pullups); 195 imx233_pinctrl_enable_pullup(0, 22 + i, enable_pullups);
196 } 196 }
197 else 197 else
198 { 198 {
199 imx233_pinctrl_acquire_pin(0, 4 + i, "ssp1 data"); 199 imx233_pinctrl_acquire(0, 4 + i, "ssp1 data");
200 imx233_set_pin_drive_strength(0, 4 + i, drive_strength); 200 imx233_pinctrl_set_drive(0, 4 + i, drive_strength);
201 imx233_set_pin_function(0, 4 + i, PINCTRL_FUNCTION_ALT2); 201 imx233_pinctrl_set_function(0, 4 + i, PINCTRL_FUNCTION_ALT2);
202 imx233_enable_pin_pullup(0, 4 + i, enable_pullups); 202 imx233_pinctrl_enable_pullup(0, 4 + i, enable_pullups);
203 } 203 }
204 } 204 }
205} 205}
@@ -208,22 +208,22 @@ void imx233_ssp_setup_ssp2_sd_mmc_pins(bool enable_pullups, unsigned bus_width,
208 unsigned drive_strength) 208 unsigned drive_strength)
209{ 209{
210 /* SSP_{CMD,SCK} */ 210 /* SSP_{CMD,SCK} */
211 imx233_pinctrl_acquire_pin(0, 20, "ssp2 cmd"); 211 imx233_pinctrl_acquire(0, 20, "ssp2 cmd");
212 imx233_pinctrl_acquire_pin(0, 24, "ssp2 sck"); 212 imx233_pinctrl_acquire(0, 24, "ssp2 sck");
213 imx233_set_pin_drive_strength(0, 20, drive_strength); 213 imx233_pinctrl_set_drive(0, 20, drive_strength);
214 imx233_set_pin_drive_strength(0, 24, drive_strength); 214 imx233_pinctrl_set_drive(0, 24, drive_strength);
215 imx233_set_pin_function(0, 20, PINCTRL_FUNCTION_ALT2); 215 imx233_pinctrl_set_function(0, 20, PINCTRL_FUNCTION_ALT2);
216 imx233_set_pin_function(0, 24, PINCTRL_FUNCTION_ALT2); 216 imx233_pinctrl_set_function(0, 24, PINCTRL_FUNCTION_ALT2);
217 imx233_enable_pin_pullup(0, 20, enable_pullups); 217 imx233_pinctrl_enable_pullup(0, 20, enable_pullups);
218 /* SSP_DATA{0-7}*/ 218 /* SSP_DATA{0-7}*/
219 for(unsigned i = 0; i < bus_width; i++) 219 for(unsigned i = 0; i < bus_width; i++)
220 { 220 {
221 imx233_pinctrl_acquire_pin(0, i, "ssp2 data"); 221 imx233_pinctrl_acquire(0, i, "ssp2 data");
222 imx233_set_pin_drive_strength(0, i, drive_strength); 222 imx233_pinctrl_set_drive(0, i, drive_strength);
223 imx233_set_pin_function(0, i, PINCTRL_FUNCTION_ALT2); 223 imx233_pinctrl_set_function(0, i, PINCTRL_FUNCTION_ALT2);
224 imx233_enable_pin_pullup(0, i, enable_pullups); 224 imx233_pinctrl_enable_pullup(0, i, enable_pullups);
225 imx233_enable_gpio_output(0, i, false); 225 imx233_pinctrl_enable_gpio(0, i, false);
226 imx233_set_gpio_output(0, i, false); 226 imx233_pinctrl_set_gpio(0, i, false);
227 } 227 }
228} 228}
229 229
@@ -376,13 +376,13 @@ void imx233_ssp_sdmmc_setup_detect(int ssp, bool enable, ssp_detect_cb_t fn,
376 ssp_detect_invert[ssp - 1] = invert; 376 ssp_detect_invert[ssp - 1] = invert;
377 if(enable) 377 if(enable)
378 { 378 {
379 imx233_pinctrl_acquire_pin(bank, pin, ssp == 1 ? "ssp1 detect" : "ssp2 detect"); 379 imx233_pinctrl_acquire(bank, pin, ssp == 1 ? "ssp1 detect" : "ssp2 detect");
380 imx233_set_pin_function(bank, pin, PINCTRL_FUNCTION_GPIO); 380 imx233_pinctrl_set_function(bank, pin, PINCTRL_FUNCTION_GPIO);
381 imx233_enable_gpio_output(bank, pin, false); 381 imx233_pinctrl_enable_gpio(bank, pin, false);
382 } 382 }
383 if(first_time && imx233_ssp_sdmmc_detect(ssp)) 383 if(first_time && imx233_ssp_sdmmc_detect(ssp))
384 detect_irq(bank, pin); 384 detect_irq(bank, pin);
385 imx233_setup_pin_irq(bank, pin, enable, true, !imx233_ssp_sdmmc_detect_raw(ssp), detect_irq); 385 imx233_pinctrl_setup_irq(bank, pin, enable, true, !imx233_ssp_sdmmc_detect_raw(ssp), detect_irq);
386} 386}
387 387
388bool imx233_ssp_sdmmc_is_detect_inverted(int ssp) 388bool imx233_ssp_sdmmc_is_detect_inverted(int ssp)