summaryrefslogtreecommitdiffstats
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.tar.bz2
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,
unsigned drive_strength, bool use_alt)
{
/* SSP_{CMD,SCK} */
- imx233_set_pin_drive_strength(2, 0, drive_strength);
- imx233_set_pin_drive_strength(2, 6, drive_strength);
- imx233_pinctrl_acquire_pin(2, 0, "ssp1 cmd");
- imx233_pinctrl_acquire_pin(2, 6, "ssp1 sck");
- imx233_set_pin_function(2, 0, PINCTRL_FUNCTION_MAIN);
- imx233_set_pin_function(2, 6, PINCTRL_FUNCTION_MAIN);
- imx233_enable_pin_pullup(2, 0, enable_pullups);
+ imx233_pinctrl_set_drive(2, 0, drive_strength);
+ imx233_pinctrl_set_drive(2, 6, drive_strength);
+ imx233_pinctrl_acquire(2, 0, "ssp1 cmd");
+ imx233_pinctrl_acquire(2, 6, "ssp1 sck");
+ imx233_pinctrl_set_function(2, 0, PINCTRL_FUNCTION_MAIN);
+ imx233_pinctrl_set_function(2, 6, PINCTRL_FUNCTION_MAIN);
+ imx233_pinctrl_enable_pullup(2, 0, enable_pullups);
/* SSP_DATA{0-3} */
for(unsigned i = 0; i < MIN(bus_width, 4); i++)
{
- imx233_pinctrl_acquire_pin(2, 2 + i, "ssp1 data");
- imx233_set_pin_drive_strength(2, 2 + i, drive_strength);
- imx233_set_pin_function(2, 2 + i, PINCTRL_FUNCTION_MAIN);
- imx233_enable_pin_pullup(2, 2 + i, enable_pullups);
+ imx233_pinctrl_acquire(2, 2 + i, "ssp1 data");
+ imx233_pinctrl_set_drive(2, 2 + i, drive_strength);
+ imx233_pinctrl_set_function(2, 2 + i, PINCTRL_FUNCTION_MAIN);
+ imx233_pinctrl_enable_pullup(2, 2 + i, enable_pullups);
}
/* SSP_DATA{4-7} */
@@ -189,17 +189,17 @@ void imx233_ssp_setup_ssp1_sd_mmc_pins(bool enable_pullups, unsigned bus_width,
{
if(use_alt)
{
- imx233_pinctrl_acquire_pin(0, 22 + i, "ssp1 data");
- imx233_set_pin_drive_strength(0, 22 + i, drive_strength);
- imx233_set_pin_function(0, 22 + i, PINCTRL_FUNCTION_ALT2);
- imx233_enable_pin_pullup(0, 22 + i, enable_pullups);
+ imx233_pinctrl_acquire(0, 22 + i, "ssp1 data");
+ imx233_pinctrl_set_drive(0, 22 + i, drive_strength);
+ imx233_pinctrl_set_function(0, 22 + i, PINCTRL_FUNCTION_ALT2);
+ imx233_pinctrl_enable_pullup(0, 22 + i, enable_pullups);
}
else
{
- imx233_pinctrl_acquire_pin(0, 4 + i, "ssp1 data");
- imx233_set_pin_drive_strength(0, 4 + i, drive_strength);
- imx233_set_pin_function(0, 4 + i, PINCTRL_FUNCTION_ALT2);
- imx233_enable_pin_pullup(0, 4 + i, enable_pullups);
+ imx233_pinctrl_acquire(0, 4 + i, "ssp1 data");
+ imx233_pinctrl_set_drive(0, 4 + i, drive_strength);
+ imx233_pinctrl_set_function(0, 4 + i, PINCTRL_FUNCTION_ALT2);
+ imx233_pinctrl_enable_pullup(0, 4 + i, enable_pullups);
}
}
}
@@ -208,22 +208,22 @@ void imx233_ssp_setup_ssp2_sd_mmc_pins(bool enable_pullups, unsigned bus_width,
unsigned drive_strength)
{
/* SSP_{CMD,SCK} */
- imx233_pinctrl_acquire_pin(0, 20, "ssp2 cmd");
- imx233_pinctrl_acquire_pin(0, 24, "ssp2 sck");
- imx233_set_pin_drive_strength(0, 20, drive_strength);
- imx233_set_pin_drive_strength(0, 24, drive_strength);
- imx233_set_pin_function(0, 20, PINCTRL_FUNCTION_ALT2);
- imx233_set_pin_function(0, 24, PINCTRL_FUNCTION_ALT2);
- imx233_enable_pin_pullup(0, 20, enable_pullups);
+ imx233_pinctrl_acquire(0, 20, "ssp2 cmd");
+ imx233_pinctrl_acquire(0, 24, "ssp2 sck");
+ imx233_pinctrl_set_drive(0, 20, drive_strength);
+ imx233_pinctrl_set_drive(0, 24, drive_strength);
+ imx233_pinctrl_set_function(0, 20, PINCTRL_FUNCTION_ALT2);
+ imx233_pinctrl_set_function(0, 24, PINCTRL_FUNCTION_ALT2);
+ imx233_pinctrl_enable_pullup(0, 20, enable_pullups);
/* SSP_DATA{0-7}*/
for(unsigned i = 0; i < bus_width; i++)
{
- imx233_pinctrl_acquire_pin(0, i, "ssp2 data");
- imx233_set_pin_drive_strength(0, i, drive_strength);
- imx233_set_pin_function(0, i, PINCTRL_FUNCTION_ALT2);
- imx233_enable_pin_pullup(0, i, enable_pullups);
- imx233_enable_gpio_output(0, i, false);
- imx233_set_gpio_output(0, i, false);
+ imx233_pinctrl_acquire(0, i, "ssp2 data");
+ imx233_pinctrl_set_drive(0, i, drive_strength);
+ imx233_pinctrl_set_function(0, i, PINCTRL_FUNCTION_ALT2);
+ imx233_pinctrl_enable_pullup(0, i, enable_pullups);
+ imx233_pinctrl_enable_gpio(0, i, false);
+ imx233_pinctrl_set_gpio(0, i, false);
}
}
@@ -376,13 +376,13 @@ void imx233_ssp_sdmmc_setup_detect(int ssp, bool enable, ssp_detect_cb_t fn,
ssp_detect_invert[ssp - 1] = invert;
if(enable)
{
- imx233_pinctrl_acquire_pin(bank, pin, ssp == 1 ? "ssp1 detect" : "ssp2 detect");
- imx233_set_pin_function(bank, pin, PINCTRL_FUNCTION_GPIO);
- imx233_enable_gpio_output(bank, pin, false);
+ imx233_pinctrl_acquire(bank, pin, ssp == 1 ? "ssp1 detect" : "ssp2 detect");
+ imx233_pinctrl_set_function(bank, pin, PINCTRL_FUNCTION_GPIO);
+ imx233_pinctrl_enable_gpio(bank, pin, false);
}
if(first_time && imx233_ssp_sdmmc_detect(ssp))
detect_irq(bank, pin);
- imx233_setup_pin_irq(bank, pin, enable, true, !imx233_ssp_sdmmc_detect_raw(ssp), detect_irq);
+ imx233_pinctrl_setup_irq(bank, pin, enable, true, !imx233_ssp_sdmmc_detect_raw(ssp), detect_irq);
}
bool imx233_ssp_sdmmc_is_detect_inverted(int ssp)