summaryrefslogtreecommitdiffstats
path: root/firmware/target/arm/imx233
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
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')
-rw-r--r--firmware/target/arm/imx233/creative-zenxfi2/button-zenxfi2.c14
-rw-r--r--firmware/target/arm/imx233/creative-zenxfi2/lcd-zenxfi2.c58
-rw-r--r--firmware/target/arm/imx233/creative-zenxfi3/audio-zenxfi3.c18
-rw-r--r--firmware/target/arm/imx233/creative-zenxfi3/button-zenxfi3.c32
-rw-r--r--firmware/target/arm/imx233/creative-zenxfi3/lcd-zenxfi3.c46
-rw-r--r--firmware/target/arm/imx233/debug-imx233.c4
-rw-r--r--firmware/target/arm/imx233/i2c-imx233.c8
-rw-r--r--firmware/target/arm/imx233/pinctrl-imx233.c18
-rw-r--r--firmware/target/arm/imx233/pinctrl-imx233.h40
-rw-r--r--firmware/target/arm/imx233/power-imx233.c8
-rw-r--r--firmware/target/arm/imx233/pwm-imx233.c6
-rw-r--r--firmware/target/arm/imx233/sansa-fuzeplus/backlight-fuzeplus.c14
-rw-r--r--firmware/target/arm/imx233/sansa-fuzeplus/button-fuzeplus.c34
-rw-r--r--firmware/target/arm/imx233/sansa-fuzeplus/fmradio-i2c-fuzeplus.c34
-rw-r--r--firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c136
-rw-r--r--firmware/target/arm/imx233/sansa-fuzeplus/power-fuzeplus.c10
-rw-r--r--firmware/target/arm/imx233/sdmmc-imx233.c10
-rw-r--r--firmware/target/arm/imx233/ssp-imx233.c72
18 files changed, 281 insertions, 281 deletions
diff --git a/firmware/target/arm/imx233/creative-zenxfi2/button-zenxfi2.c b/firmware/target/arm/imx233/creative-zenxfi2/button-zenxfi2.c
index 0685963166..b990becf26 100644
--- a/firmware/target/arm/imx233/creative-zenxfi2/button-zenxfi2.c
+++ b/firmware/target/arm/imx233/creative-zenxfi2/button-zenxfi2.c
@@ -71,13 +71,13 @@ void button_init_device(void)
imx233_touchscreen_enable(true);
/* power button */
- imx233_pinctrl_acquire_pin(0, 11, "power");
- imx233_set_pin_function(0, 11, PINCTRL_FUNCTION_GPIO);
- imx233_enable_gpio_output(0, 11, false);
+ imx233_pinctrl_acquire(0, 11, "power");
+ imx233_pinctrl_set_function(0, 11, PINCTRL_FUNCTION_GPIO);
+ imx233_pinctrl_enable_gpio(0, 11, false);
/* select button */
- imx233_pinctrl_acquire_pin(0, 14, "select");
- imx233_set_pin_function(0, 14, PINCTRL_FUNCTION_GPIO);
- imx233_enable_gpio_output(0, 14, false);
+ imx233_pinctrl_acquire(0, 14, "select");
+ imx233_pinctrl_set_function(0, 14, PINCTRL_FUNCTION_GPIO);
+ imx233_pinctrl_enable_gpio(0, 14, false);
}
static int touch_to_pixels(int *val_x, int *val_y)
@@ -119,7 +119,7 @@ int button_read_device(int *data)
int res = 0;
/* B0P11: #power
* B0P14: #select */
- uint32_t mask = imx233_get_gpio_input_mask(0, 0x4800);
+ uint32_t mask = imx233_pinctrl_get_gpio_mask(0, 0x4800);
if(!(mask & 0x800))
res |= BUTTON_POWER;
if(!(mask & 0x4000))
diff --git a/firmware/target/arm/imx233/creative-zenxfi2/lcd-zenxfi2.c b/firmware/target/arm/imx233/creative-zenxfi2/lcd-zenxfi2.c
index 4f5033e3d3..0a16c995c1 100644
--- a/firmware/target/arm/imx233/creative-zenxfi2/lcd-zenxfi2.c
+++ b/firmware/target/arm/imx233/creative-zenxfi2/lcd-zenxfi2.c
@@ -45,42 +45,42 @@ static void setup_parameters(void)
static void setup_lcd_pins(bool use_lcdif)
{
- imx233_pinctrl_acquire_pin(1, 18, "lcd reset");
- imx233_pinctrl_acquire_pin(1, 19, "lcd rs");
- imx233_pinctrl_acquire_pin(1, 20, "lcd wr");
- imx233_pinctrl_acquire_pin(1, 21, "lcd cs");
- imx233_pinctrl_acquire_pin(1, 22, "lcd dotclk");
- imx233_pinctrl_acquire_pin(1, 23, "lcd enable");
- imx233_pinctrl_acquire_pin(1, 24, "lcd hsync");
- imx233_pinctrl_acquire_pin(1, 25, "lcd vsync");
- imx233_pinctrl_acquire_pin_mask(1, 0x3ffff, "lcd data");
+ imx233_pinctrl_acquire(1, 18, "lcd reset");
+ imx233_pinctrl_acquire(1, 19, "lcd rs");
+ imx233_pinctrl_acquire(1, 20, "lcd wr");
+ imx233_pinctrl_acquire(1, 21, "lcd cs");
+ imx233_pinctrl_acquire(1, 22, "lcd dotclk");
+ imx233_pinctrl_acquire(1, 23, "lcd enable");
+ imx233_pinctrl_acquire(1, 24, "lcd hsync");
+ imx233_pinctrl_acquire(1, 25, "lcd vsync");
+ imx233_pinctrl_acquire_mask(1, 0x3ffff, "lcd data");
if(use_lcdif)
{
- imx233_set_pin_function(1, 25, PINCTRL_FUNCTION_MAIN); /* lcd_vsync */
- imx233_set_pin_function(1, 21, PINCTRL_FUNCTION_MAIN); /* lcd_cs */
- imx233_set_pin_function(1, 22, PINCTRL_FUNCTION_MAIN); /* lcd_dotclk */
- imx233_set_pin_function(1, 23, PINCTRL_FUNCTION_MAIN); /* lcd_enable */
- imx233_set_pin_function(1, 24, PINCTRL_FUNCTION_MAIN); /* lcd_hsync */
- imx233_set_pin_function(1, 18, PINCTRL_FUNCTION_MAIN); /* lcd_reset */
- imx233_set_pin_function(1, 19, PINCTRL_FUNCTION_MAIN); /* lcd_rs */
- imx233_set_pin_function(1, 16, PINCTRL_FUNCTION_MAIN); /* lcd_d16 */
- imx233_set_pin_function(1, 17, PINCTRL_FUNCTION_MAIN); /* lcd_d17 */
- imx233_set_pin_function(1, 20, PINCTRL_FUNCTION_MAIN); /* lcd_wr */
+ imx233_pinctrl_set_function(1, 25, PINCTRL_FUNCTION_MAIN); /* lcd_vsync */
+ imx233_pinctrl_set_function(1, 21, PINCTRL_FUNCTION_MAIN); /* lcd_cs */
+ imx233_pinctrl_set_function(1, 22, PINCTRL_FUNCTION_MAIN); /* lcd_dotclk */
+ imx233_pinctrl_set_function(1, 23, PINCTRL_FUNCTION_MAIN); /* lcd_enable */
+ imx233_pinctrl_set_function(1, 24, PINCTRL_FUNCTION_MAIN); /* lcd_hsync */
+ imx233_pinctrl_set_function(1, 18, PINCTRL_FUNCTION_MAIN); /* lcd_reset */
+ imx233_pinctrl_set_function(1, 19, PINCTRL_FUNCTION_MAIN); /* lcd_rs */
+ imx233_pinctrl_set_function(1, 16, PINCTRL_FUNCTION_MAIN); /* lcd_d16 */
+ imx233_pinctrl_set_function(1, 17, PINCTRL_FUNCTION_MAIN); /* lcd_d17 */
+ imx233_pinctrl_set_function(1, 20, PINCTRL_FUNCTION_MAIN); /* lcd_wr */
HW_PINCTRL_MUXSELn_CLR(2) = 0xffffffff; /* lcd_d{0-15} */
}
else
{
HW_PINCTRL_MUXSELn_SET(2) = 0xffffffff; /* lcd_d{0-15} */
- imx233_enable_gpio_output_mask(1, 0x3ffffff, false); /* lcd_{d{0-17},reset,rs,wr,cs,dotclk,enable,hsync,vsync} */
- imx233_set_pin_function(1, 16, PINCTRL_FUNCTION_GPIO); /* lcd_d16 */
- imx233_set_pin_function(1, 17, PINCTRL_FUNCTION_GPIO); /* lcd_d17 */
- imx233_set_pin_function(1, 19, PINCTRL_FUNCTION_GPIO); /* lcd_rs */
- imx233_set_pin_function(1, 20, PINCTRL_FUNCTION_GPIO); /* lcd_wr */
- imx233_set_pin_function(1, 21, PINCTRL_FUNCTION_GPIO); /* lcd_cs */
- imx233_set_pin_function(1, 22, PINCTRL_FUNCTION_GPIO); /* lcd_dotclk */
- imx233_set_pin_function(1, 23, PINCTRL_FUNCTION_GPIO); /* lcd_enable */
- imx233_set_pin_function(1, 24, PINCTRL_FUNCTION_GPIO); /* lcd_hsync */
- imx233_set_pin_function(1, 25, PINCTRL_FUNCTION_GPIO); /* lcd_vsync */
+ imx233_pinctrl_enable_gpio_mask(1, 0x3ffffff, false); /* lcd_{d{0-17},reset,rs,wr,cs,dotclk,enable,hsync,vsync} */
+ imx233_pinctrl_set_function(1, 16, PINCTRL_FUNCTION_GPIO); /* lcd_d16 */
+ imx233_pinctrl_set_function(1, 17, PINCTRL_FUNCTION_GPIO); /* lcd_d17 */
+ imx233_pinctrl_set_function(1, 19, PINCTRL_FUNCTION_GPIO); /* lcd_rs */
+ imx233_pinctrl_set_function(1, 20, PINCTRL_FUNCTION_GPIO); /* lcd_wr */
+ imx233_pinctrl_set_function(1, 21, PINCTRL_FUNCTION_GPIO); /* lcd_cs */
+ imx233_pinctrl_set_function(1, 22, PINCTRL_FUNCTION_GPIO); /* lcd_dotclk */
+ imx233_pinctrl_set_function(1, 23, PINCTRL_FUNCTION_GPIO); /* lcd_enable */
+ imx233_pinctrl_set_function(1, 24, PINCTRL_FUNCTION_GPIO); /* lcd_hsync */
+ imx233_pinctrl_set_function(1, 25, PINCTRL_FUNCTION_GPIO); /* lcd_vsync */
}
}
diff --git a/firmware/target/arm/imx233/creative-zenxfi3/audio-zenxfi3.c b/firmware/target/arm/imx233/creative-zenxfi3/audio-zenxfi3.c
index 9394c88f2c..3ea757aedb 100644
--- a/firmware/target/arm/imx233/creative-zenxfi3/audio-zenxfi3.c
+++ b/firmware/target/arm/imx233/creative-zenxfi3/audio-zenxfi3.c
@@ -34,15 +34,15 @@ static bool initialized = false;
static void init(void)
{
/* HP gate */
- imx233_pinctrl_acquire_pin(1, 30, "hp gate");
- imx233_set_pin_function(1, 30, PINCTRL_FUNCTION_GPIO);
- imx233_enable_gpio_output(1, 30, true);
- imx233_set_gpio_output(1, 30, false);
+ imx233_pinctrl_acquire(1, 30, "hp gate");
+ imx233_pinctrl_set_function(1, 30, PINCTRL_FUNCTION_GPIO);
+ imx233_pinctrl_enable_gpio(1, 30, true);
+ imx233_pinctrl_set_gpio(1, 30, false);
/* SPKR gate */
- imx233_pinctrl_acquire_pin(1, 22, "spkr gate");
- imx233_set_pin_function(1, 22, PINCTRL_FUNCTION_GPIO);
- imx233_enable_gpio_output(1, 22, true);
- imx233_set_gpio_output(1, 22, false);
+ imx233_pinctrl_acquire(1, 22, "spkr gate");
+ imx233_pinctrl_set_function(1, 22, PINCTRL_FUNCTION_GPIO);
+ imx233_pinctrl_enable_gpio(1, 22, true);
+ imx233_pinctrl_set_gpio(1, 22, false);
initialized = true;
}
@@ -52,7 +52,7 @@ static void select_audio_path(void)
if(!initialized)
init();
/* route audio to HP */
- imx233_set_gpio_output(1, 30, true);
+ imx233_pinctrl_set_gpio(1, 30, true);
if(input_source == AUDIO_SRC_PLAYBACK)
imx233_audioout_select_hp_input(false);
diff --git a/firmware/target/arm/imx233/creative-zenxfi3/button-zenxfi3.c b/firmware/target/arm/imx233/creative-zenxfi3/button-zenxfi3.c
index 70355bc24c..7f981b5d68 100644
--- a/firmware/target/arm/imx233/creative-zenxfi3/button-zenxfi3.c
+++ b/firmware/target/arm/imx233/creative-zenxfi3/button-zenxfi3.c
@@ -107,7 +107,7 @@ static void mpr121_thread(void)
if(status & 0x80) touchpad_btns |= BUTTON_PLAY;
}
/* enable interrupt */
- imx233_setup_pin_irq(0, 18, true, true, false, &mpr121_irq_cb);
+ imx233_pinctrl_setup_irq(0, 18, true, true, false, &mpr121_irq_cb);
}
}
@@ -122,28 +122,28 @@ void button_init_device(void)
create_thread(mpr121_thread, mpr121_stack, sizeof(mpr121_stack), 0,
mpr121_thread_name IF_PRIO(, PRIORITY_USER_INTERFACE) IF_COP(, CPU));
/* enable interrupt */
- imx233_pinctrl_acquire_pin(0, 18, "mpr121 int");
- imx233_set_pin_function(0, 18, PINCTRL_FUNCTION_GPIO);
- imx233_enable_gpio_output(0, 18, false);
- imx233_setup_pin_irq(0, 18, true, true, false, &mpr121_irq_cb);
+ imx233_pinctrl_acquire(0, 18, "mpr121 int");
+ imx233_pinctrl_set_function(0, 18, PINCTRL_FUNCTION_GPIO);
+ imx233_pinctrl_enable_gpio(0, 18, false);
+ imx233_pinctrl_setup_irq(0, 18, true, true, false, &mpr121_irq_cb);
/* hold button */
- imx233_pinctrl_acquire_pin(0, 4, "hold");
- imx233_set_pin_function(0, 4, PINCTRL_FUNCTION_GPIO);
- imx233_enable_gpio_output(0, 4, false);
+ imx233_pinctrl_acquire(0, 4, "hold");
+ imx233_pinctrl_set_function(0, 4, PINCTRL_FUNCTION_GPIO);
+ imx233_pinctrl_enable_gpio(0, 4, false);
/* volume down button */
- imx233_pinctrl_acquire_pin(2, 7, "volume down");
- imx233_set_pin_function(2, 7, PINCTRL_FUNCTION_GPIO);
- imx233_enable_gpio_output(2, 7, false);
+ imx233_pinctrl_acquire(2, 7, "volume down");
+ imx233_pinctrl_set_function(2, 7, PINCTRL_FUNCTION_GPIO);
+ imx233_pinctrl_enable_gpio(2, 7, false);
/* volume up button */
- imx233_pinctrl_acquire_pin(2, 8, "volume up");
- imx233_set_pin_function(2, 8, PINCTRL_FUNCTION_GPIO);
- imx233_enable_gpio_output(2, 8, false);
+ imx233_pinctrl_acquire(2, 8, "volume up");
+ imx233_pinctrl_set_function(2, 8, PINCTRL_FUNCTION_GPIO);
+ imx233_pinctrl_enable_gpio(2, 8, false);
}
bool button_hold(void)
{
/* B0P04: #hold */
- return !imx233_get_gpio_input_mask(0, 0x10);
+ return !imx233_pinctrl_get_gpio_mask(0, 0x10);
}
int button_read_device(void)
@@ -171,7 +171,7 @@ int button_read_device(void)
/* B2P07: #volume-
* B2P08: #volume+
* PSWITCH: power */
- uint32_t mask = imx233_get_gpio_input_mask(2, 0x180);
+ uint32_t mask = imx233_pinctrl_get_gpio_mask(2, 0x180);
if(!(mask & 0x80))
res |= BUTTON_VOL_DOWN;
if(!(mask & 0x100))
diff --git a/firmware/target/arm/imx233/creative-zenxfi3/lcd-zenxfi3.c b/firmware/target/arm/imx233/creative-zenxfi3/lcd-zenxfi3.c
index bc669d1a60..253f37eef6 100644
--- a/firmware/target/arm/imx233/creative-zenxfi3/lcd-zenxfi3.c
+++ b/firmware/target/arm/imx233/creative-zenxfi3/lcd-zenxfi3.c
@@ -48,36 +48,36 @@ static void setup_lcd_pins(bool use_lcdif)
/* WARNING
* the B1P22 pins is used to gate the speaker! Do NOT drive
* them as lcd_dotclk and lcd_hsync or it will break audio */
- imx233_pinctrl_acquire_pin(1, 18, "lcd reset");
- imx233_pinctrl_acquire_pin(1, 19, "lcd rs");
- imx233_pinctrl_acquire_pin(1, 20, "lcd wr");
- imx233_pinctrl_acquire_pin(1, 21, "lcd cs");
- imx233_pinctrl_acquire_pin(1, 23, "lcd enable");
- imx233_pinctrl_acquire_pin(1, 25, "lcd vsync");
- imx233_pinctrl_acquire_pin_mask(1, 0x3ffff, "lcd data");
+ imx233_pinctrl_acquire(1, 18, "lcd reset");
+ imx233_pinctrl_acquire(1, 19, "lcd rs");
+ imx233_pinctrl_acquire(1, 20, "lcd wr");
+ imx233_pinctrl_acquire(1, 21, "lcd cs");
+ imx233_pinctrl_acquire(1, 23, "lcd enable");
+ imx233_pinctrl_acquire(1, 25, "lcd vsync");
+ imx233_pinctrl_acquire_mask(1, 0x3ffff, "lcd data");
if(use_lcdif)
{
- imx233_set_pin_function(1, 25, PINCTRL_FUNCTION_MAIN); /* lcd_vsync */
- imx233_set_pin_function(1, 21, PINCTRL_FUNCTION_MAIN); /* lcd_cs */
- imx233_set_pin_function(1, 23, PINCTRL_FUNCTION_MAIN); /* lcd_enable */
- imx233_set_pin_function(1, 18, PINCTRL_FUNCTION_MAIN); /* lcd_reset */
- imx233_set_pin_function(1, 19, PINCTRL_FUNCTION_MAIN); /* lcd_rs */
- imx233_set_pin_function(1, 16, PINCTRL_FUNCTION_MAIN); /* lcd_d16 */
- imx233_set_pin_function(1, 17, PINCTRL_FUNCTION_MAIN); /* lcd_d17 */
- imx233_set_pin_function(1, 20, PINCTRL_FUNCTION_MAIN); /* lcd_wr */
+ imx233_pinctrl_set_function(1, 25, PINCTRL_FUNCTION_MAIN); /* lcd_vsync */
+ imx233_pinctrl_set_function(1, 21, PINCTRL_FUNCTION_MAIN); /* lcd_cs */
+ imx233_pinctrl_set_function(1, 23, PINCTRL_FUNCTION_MAIN); /* lcd_enable */
+ imx233_pinctrl_set_function(1, 18, PINCTRL_FUNCTION_MAIN); /* lcd_reset */
+ imx233_pinctrl_set_function(1, 19, PINCTRL_FUNCTION_MAIN); /* lcd_rs */
+ imx233_pinctrl_set_function(1, 16, PINCTRL_FUNCTION_MAIN); /* lcd_d16 */
+ imx233_pinctrl_set_function(1, 17, PINCTRL_FUNCTION_MAIN); /* lcd_d17 */
+ imx233_pinctrl_set_function(1, 20, PINCTRL_FUNCTION_MAIN); /* lcd_wr */
HW_PINCTRL_MUXSELn_CLR(2) = 0xffffffff; /* lcd_d{0-15} */
}
else
{
HW_PINCTRL_MUXSELn_SET(2) = 0xffffffff; /* lcd_d{0-15} */
- imx233_enable_gpio_output_mask(1, 0x2bfffff, false); /* lcd_{d{0-17},reset,rs,wr,cs,enable,vsync} */
- imx233_set_pin_function(1, 16, PINCTRL_FUNCTION_GPIO); /* lcd_d16 */
- imx233_set_pin_function(1, 17, PINCTRL_FUNCTION_GPIO); /* lcd_d17 */
- imx233_set_pin_function(1, 19, PINCTRL_FUNCTION_GPIO); /* lcd_rs */
- imx233_set_pin_function(1, 20, PINCTRL_FUNCTION_GPIO); /* lcd_wr */
- imx233_set_pin_function(1, 21, PINCTRL_FUNCTION_GPIO); /* lcd_cs */
- imx233_set_pin_function(1, 23, PINCTRL_FUNCTION_GPIO); /* lcd_enable */
- imx233_set_pin_function(1, 25, PINCTRL_FUNCTION_GPIO); /* lcd_vsync */
+ imx233_pinctrl_enable_gpio_mask(1, 0x2bfffff, false); /* lcd_{d{0-17},reset,rs,wr,cs,enable,vsync} */
+ imx233_pinctrl_set_function(1, 16, PINCTRL_FUNCTION_GPIO); /* lcd_d16 */
+ imx233_pinctrl_set_function(1, 17, PINCTRL_FUNCTION_GPIO); /* lcd_d17 */
+ imx233_pinctrl_set_function(1, 19, PINCTRL_FUNCTION_GPIO); /* lcd_rs */
+ imx233_pinctrl_set_function(1, 20, PINCTRL_FUNCTION_GPIO); /* lcd_wr */
+ imx233_pinctrl_set_function(1, 21, PINCTRL_FUNCTION_GPIO); /* lcd_cs */
+ imx233_pinctrl_set_function(1, 23, PINCTRL_FUNCTION_GPIO); /* lcd_enable */
+ imx233_pinctrl_set_function(1, 25, PINCTRL_FUNCTION_GPIO); /* lcd_vsync */
}
}
diff --git a/firmware/target/arm/imx233/debug-imx233.c b/firmware/target/arm/imx233/debug-imx233.c
index 10f951c2e1..ff3313a59e 100644
--- a/firmware/target/arm/imx233/debug-imx233.c
+++ b/firmware/target/arm/imx233/debug-imx233.c
@@ -527,7 +527,7 @@ bool dbg_hw_info_pinctrl(void)
lcd_clear_display();
for(int i = 0; i < 4; i++)
- lcd_putsf(0, i, "DIN%d = 0x%08x", i, imx233_get_gpio_input_mask(i, 0xffffffff));
+ lcd_putsf(0, i, "DIN%d = 0x%08x", i, imx233_pinctrl_get_gpio_mask(i, 0xffffffff));
#ifdef IMX233_PINCTRL_DEBUG
unsigned cur_line = 6;
unsigned last_line = lcd_getheight() / font_get(lcd_getfont())->height;
@@ -536,7 +536,7 @@ bool dbg_hw_info_pinctrl(void)
for(int bank = 0; bank < 4; bank++)
for(int pin = 0; pin < 32; pin++)
{
- const char *owner = imx233_pinctrl_get_pin_use(bank, pin);
+ const char *owner = imx233_pinctrl_blame(bank, pin);
if(owner == NULL)
continue;
if(cur_idx++ >= top_user && cur_line < last_line)
diff --git a/firmware/target/arm/imx233/i2c-imx233.c b/firmware/target/arm/imx233/i2c-imx233.c
index 054ce09a28..d087c94793 100644
--- a/firmware/target/arm/imx233/i2c-imx233.c
+++ b/firmware/target/arm/imx233/i2c-imx233.c
@@ -84,10 +84,10 @@ void imx233_i2c_init(void)
{
BF_SET(I2C_CTRL0, SFTRST);
/* setup pins (must be done when shutdown) */
- imx233_pinctrl_acquire_pin(0, 30, "i2c");
- imx233_pinctrl_acquire_pin(0, 31, "i2c");
- imx233_set_pin_function(0, 30, PINCTRL_FUNCTION_MAIN);
- imx233_set_pin_function(0, 31, PINCTRL_FUNCTION_MAIN);
+ imx233_pinctrl_acquire(0, 30, "i2c");
+ imx233_pinctrl_acquire(0, 31, "i2c");
+ imx233_pinctrl_set_function(0, 30, PINCTRL_FUNCTION_MAIN);
+ imx233_pinctrl_set_function(0, 31, PINCTRL_FUNCTION_MAIN);
/* clear softreset */
imx233_reset_block(&HW_I2C_CTRL0);
/* Errata:
diff --git a/firmware/target/arm/imx233/pinctrl-imx233.c b/firmware/target/arm/imx233/pinctrl-imx233.c
index 3d8a6cfe54..5dc25031b1 100644
--- a/firmware/target/arm/imx233/pinctrl-imx233.c
+++ b/firmware/target/arm/imx233/pinctrl-imx233.c
@@ -28,35 +28,35 @@
// 4 banks of 32 pins
static const char *pin_use[4][32];
-void imx233_pinctrl_acquire_pin(unsigned bank, unsigned pin, const char *name)
+void imx233_pinctrl_acquire(unsigned bank, unsigned pin, const char *name)
{
if(pin_use[bank][pin] != NULL && pin_use[bank][pin] != name)
panicf("acquire B%dP%02d for %s, was %s!", bank, pin, name, pin_use[bank][pin]);
pin_use[bank][pin] = name;
}
-void imx233_pinctrl_acquire_pin_mask(unsigned bank, uint32_t mask, const char *name)
+void imx233_pinctrl_acquire_mask(unsigned bank, uint32_t mask, const char *name)
{
for(unsigned pin = 0; pin < 32; pin++)
if(mask & (1 << pin))
- imx233_pinctrl_acquire_pin(bank, pin, name);
+ imx233_pinctrl_acquire(bank, pin, name);
}
-void imx233_pinctrl_release_pin(unsigned bank, unsigned pin, const char *name)
+void imx233_pinctrl_release(unsigned bank, unsigned pin, const char *name)
{
if(pin_use[bank][pin] != NULL && pin_use[bank][pin] != name)
panicf("release B%dP%02d for %s: was %s!", bank, pin, name, pin_use[bank][pin]);
pin_use[bank][pin] = NULL;
}
-void imx233_pinctrl_release_pin_mask(unsigned bank, uint32_t mask, const char *name)
+void imx233_pinctrl_release_mask(unsigned bank, uint32_t mask, const char *name)
{
for(unsigned pin = 0; pin < 32; pin++)
if(mask & (1 << pin))
- imx233_pinctrl_release_pin(bank, pin, name);
+ imx233_pinctrl_release(bank, pin, name);
}
-const char *imx233_pinctrl_get_pin_use(unsigned bank, unsigned pin)
+const char *imx233_pinctrl_blame(unsigned bank, unsigned pin)
{
return pin_use[bank][pin];
}
@@ -71,7 +71,7 @@ static void INT_GPIO(int bank)
if(fire & (1 << pin))
{
pin_irq_cb_t cb = pin_cb[bank][pin];
- imx233_setup_pin_irq(bank, pin, false, false, false, NULL);
+ imx233_pinctrl_setup_irq(bank, pin, false, false, false, NULL);
if(cb)
cb(bank, pin);
}
@@ -92,7 +92,7 @@ void INT_GPIO2(void)
INT_GPIO(2);
}
-void imx233_setup_pin_irq(int bank, int pin, bool enable_int,
+void imx233_pinctrl_setup_irq(int bank, int pin, bool enable_int,
bool level, bool polarity, pin_irq_cb_t cb)
{
HW_PINCTRL_PIN2IRQn_CLR(bank) = 1 << pin;
diff --git a/firmware/target/arm/imx233/pinctrl-imx233.h b/firmware/target/arm/imx233/pinctrl-imx233.h
index 82ed47d57e..c731490e38 100644
--- a/firmware/target/arm/imx233/pinctrl-imx233.h
+++ b/firmware/target/arm/imx233/pinctrl-imx233.h
@@ -41,17 +41,17 @@
#define PINCTRL_DRIVE_16mA 3 /* not available on all pins */
#ifdef IMX233_PINCTRL_DEBUG
-void imx233_pinctrl_acquire_pin(unsigned bank, unsigned pin, const char *name);
-void imx233_pinctrl_acquire_pin_mask(unsigned bank, uint32_t mask, const char *name);
-void imx233_pinctrl_release_pin(unsigned bank, unsigned pin, const char *name);
-void imx233_pinctrl_release_pin_mask(unsigned bank, uint32_t mask, const char *name);
-const char *imx233_pinctrl_get_pin_use(unsigned bank, unsigned pin);
+void imx233_pinctrl_acquire(unsigned bank, unsigned pin, const char *name);
+void imx233_pinctrl_acquire_mask(unsigned bank, uint32_t mask, const char *name);
+void imx233_pinctrl_release(unsigned bank, unsigned pin, const char *name);
+void imx233_pinctrl_release_mask(unsigned bank, uint32_t mask, const char *name);
+const char *imx233_pinctrl_blame(unsigned bank, unsigned pin);
#else
-#define imx233_pinctrl_acquire_pin(...)
-#define imx233_pinctrl_acquire_pin_mask(...)
-#define imx233_pinctrl_release_pin(...)
-#define imx233_pinctrl_release_pin_mask(...)
-#define imx233_pinctrl_get_pin_use(...) NULL
+#define imx233_pinctrl_acquire(...)
+#define imx233_pinctrl_acquire_mask(...)
+#define imx233_pinctrl_release(...)
+#define imx233_pinctrl_release_mask(...)
+#define imx233_pinctrl_blame(...) NULL
#endif
typedef void (*pin_irq_cb_t)(int bank, int pin);
@@ -61,13 +61,13 @@ static inline void imx233_pinctrl_init(void)
HW_PINCTRL_CTRL_CLR = BM_OR2(PINCTRL_CTRL, CLKGATE, SFTRST);
}
-static inline void imx233_set_pin_drive_strength(unsigned bank, unsigned pin, unsigned strength)
+static inline void imx233_pinctrl_set_drive(unsigned bank, unsigned pin, unsigned strength)
{
HW_PINCTRL_DRIVEn_CLR(4 * bank + pin / 8) = 3 << (4 * (pin % 8));
HW_PINCTRL_DRIVEn_SET(4 * bank + pin / 8) = strength << (4 * (pin % 8));
}
-static inline void imx233_enable_gpio_output(unsigned bank, unsigned pin, bool enable)
+static inline void imx233_pinctrl_enable_gpio(unsigned bank, unsigned pin, bool enable)
{
if(enable)
HW_PINCTRL_DOEn_SET(bank) = 1 << pin;
@@ -75,7 +75,7 @@ static inline void imx233_enable_gpio_output(unsigned bank, unsigned pin, bool e
HW_PINCTRL_DOEn_CLR(bank) = 1 << pin;
}
-static inline void imx233_enable_gpio_output_mask(unsigned bank, uint32_t pin_mask, bool enable)
+static inline void imx233_pinctrl_enable_gpio_mask(unsigned bank, uint32_t pin_mask, bool enable)
{
if(enable)
HW_PINCTRL_DOEn_SET(bank) = pin_mask;
@@ -83,7 +83,7 @@ static inline void imx233_enable_gpio_output_mask(unsigned bank, uint32_t pin_ma
HW_PINCTRL_DOEn_CLR(bank) = pin_mask;
}
-static inline void imx233_set_gpio_output(unsigned bank, unsigned pin, bool value)
+static inline void imx233_pinctrl_set_gpio(unsigned bank, unsigned pin, bool value)
{
if(value)
HW_PINCTRL_DOUTn_SET(bank) = 1 << pin;
@@ -91,7 +91,7 @@ static inline void imx233_set_gpio_output(unsigned bank, unsigned pin, bool valu
HW_PINCTRL_DOUTn_CLR(bank) = 1 << pin;
}
-static inline void imx233_set_gpio_output_mask(unsigned bank, uint32_t pin_mask, bool value)
+static inline void imx233_pinctrl_set_gpio_mask(unsigned bank, uint32_t pin_mask, bool value)
{
if(value)
HW_PINCTRL_DOUTn_SET(bank) = pin_mask;
@@ -99,18 +99,18 @@ static inline void imx233_set_gpio_output_mask(unsigned bank, uint32_t pin_mask,
HW_PINCTRL_DOUTn_CLR(bank) = pin_mask;
}
-static inline uint32_t imx233_get_gpio_input_mask(unsigned bank, uint32_t pin_mask)
+static inline uint32_t imx233_pinctrl_get_gpio_mask(unsigned bank, uint32_t pin_mask)
{
return HW_PINCTRL_DINn(bank) & pin_mask;
}
-static inline void imx233_set_pin_function(unsigned bank, unsigned pin, unsigned function)
+static inline void imx233_pinctrl_set_function(unsigned bank, unsigned pin, unsigned function)
{
HW_PINCTRL_MUXSELn_CLR(2 * bank + pin / 16) = 3 << (2 * (pin % 16));
HW_PINCTRL_MUXSELn_SET(2 * bank + pin / 16) = function << (2 * (pin % 16));
}
-static inline void imx233_enable_pin_pullup(unsigned bank, unsigned pin, bool enable)
+static inline void imx233_pinctrl_enable_pullup(unsigned bank, unsigned pin, bool enable)
{
if(enable)
HW_PINCTRL_PULLn_SET(bank) = 1 << pin;
@@ -118,7 +118,7 @@ static inline void imx233_enable_pin_pullup(unsigned bank, unsigned pin, bool en
HW_PINCTRL_PULLn_CLR(bank) = 1 << pin;
}
-static inline void imx233_enable_pin_pullup_mask(unsigned bank, uint32_t pin_msk, bool enable)
+static inline void imx233_pinctrl_enable_pullup_mask(unsigned bank, uint32_t pin_msk, bool enable)
{
if(enable)
HW_PINCTRL_PULLn_SET(bank) = pin_msk;
@@ -128,7 +128,7 @@ static inline void imx233_enable_pin_pullup_mask(unsigned bank, uint32_t pin_msk
/** On irq, the pin irq interrupt is disable and then cb is called;
* the setup_pin_irq function needs to be called again to enable it again */
-void imx233_setup_pin_irq(int bank, int pin, bool enable_int,
+void imx233_pinctrl_setup_irq(int bank, int pin, bool enable_int,
bool level, bool polarity, pin_irq_cb_t cb);
#endif /* __PINCTRL_IMX233_H__ */
diff --git a/firmware/target/arm/imx233/power-imx233.c b/firmware/target/arm/imx233/power-imx233.c
index 9c00178f1a..7829fd79ce 100644
--- a/firmware/target/arm/imx233/power-imx233.c
+++ b/firmware/target/arm/imx233/power-imx233.c
@@ -120,10 +120,10 @@ void power_off(void)
sleep(HZ / 2);
#ifdef SANSA_FUZEPLUS
/* This pin seems to be important to shutdown the hardware properly */
- imx233_pinctrl_acquire_pin(0, 9, "power off");
- imx233_set_pin_function(0, 9, PINCTRL_FUNCTION_GPIO);
- imx233_enable_gpio_output(0, 9, true);
- imx233_set_gpio_output(0, 9, true);
+ imx233_pinctrl_acquire(0, 9, "power off");
+ imx233_pinctrl_set_function(0, 9, PINCTRL_FUNCTION_GPIO);
+ imx233_pinctrl_enable_gpio(0, 9, true);
+ imx233_pinctrl_set_gpio(0, 9, true);
#endif
/* power down */
HW_POWER_RESET = BM_OR2(POWER_RESET, UNLOCK, PWD);
diff --git a/firmware/target/arm/imx233/pwm-imx233.c b/firmware/target/arm/imx233/pwm-imx233.c
index c0417c55d0..86460e0140 100644
--- a/firmware/target/arm/imx233/pwm-imx233.c
+++ b/firmware/target/arm/imx233/pwm-imx233.c
@@ -49,11 +49,11 @@ void imx233_pwm_setup_channel(int channel, int period, int cdiv, int active,
if(enable)
imx233_pwm_enable_channel(channel, false);
/* setup pin */
- imx233_pinctrl_acquire_pin(IMX233_PWM_PIN_BANK(channel),
+ imx233_pinctrl_acquire(IMX233_PWM_PIN_BANK(channel),
IMX233_PWM_PIN(channel), "pwm");
- imx233_set_pin_function(IMX233_PWM_PIN_BANK(channel), IMX233_PWM_PIN(channel),
+ imx233_pinctrl_set_function(IMX233_PWM_PIN_BANK(channel), IMX233_PWM_PIN(channel),
PINCTRL_FUNCTION_MAIN);
- imx233_set_pin_drive_strength(IMX233_PWM_PIN_BANK(channel), IMX233_PWM_PIN(channel),
+ imx233_pinctrl_set_drive(IMX233_PWM_PIN_BANK(channel), IMX233_PWM_PIN(channel),
PINCTRL_DRIVE_4mA);
/* watch the order ! active THEN period */
HW_PWM_ACTIVEn(channel) = BF_OR2(PWM_ACTIVEn, ACTIVE(active), INACTIVE(inactive));
diff --git a/firmware/target/arm/imx233/sansa-fuzeplus/backlight-fuzeplus.c b/firmware/target/arm/imx233/sansa-fuzeplus/backlight-fuzeplus.c
index 7f181a9672..efe9268989 100644
--- a/firmware/target/arm/imx233/sansa-fuzeplus/backlight-fuzeplus.c
+++ b/firmware/target/arm/imx233/sansa-fuzeplus/backlight-fuzeplus.c
@@ -30,21 +30,21 @@ void _backlight_set_brightness(int brightness)
{
if(brightness != 0)
brightness = 32 - (brightness * 32) / 100;
- imx233_set_gpio_output(1, 28, false);
+ imx233_pinctrl_set_gpio(1, 28, false);
udelay(600);
while(brightness-- > 0)
{
- imx233_set_gpio_output(1, 28, false);
- imx233_set_gpio_output(1, 28, true);
+ imx233_pinctrl_set_gpio(1, 28, false);
+ imx233_pinctrl_set_gpio(1, 28, true);
}
}
bool _backlight_init(void)
{
- imx233_pinctrl_acquire_pin(1, 28, "backlight");
- imx233_set_pin_function(1, 28, PINCTRL_FUNCTION_GPIO);
- imx233_set_pin_drive_strength(1, 28, PINCTRL_DRIVE_8mA);
- imx233_enable_gpio_output(1, 28, true);
+ imx233_pinctrl_acquire(1, 28, "backlight");
+ imx233_pinctrl_set_function(1, 28, PINCTRL_FUNCTION_GPIO);
+ imx233_pinctrl_set_drive(1, 28, PINCTRL_DRIVE_8mA);
+ imx233_pinctrl_enable_gpio(1, 28, true);
_backlight_set_brightness(DEFAULT_BRIGHTNESS_SETTING);
return true;
}
diff --git a/firmware/target/arm/imx233/sansa-fuzeplus/button-fuzeplus.c b/firmware/target/arm/imx233/sansa-fuzeplus/button-fuzeplus.c
index 703e87fc42..6373038d2e 100644
--- a/firmware/target/arm/imx233/sansa-fuzeplus/button-fuzeplus.c
+++ b/firmware/target/arm/imx233/sansa-fuzeplus/button-fuzeplus.c
@@ -79,7 +79,7 @@ bool button_debug_screen(void)
lcd_putsf(0, 1, "RMI: id=%s p=%x s=%x", product_id, func_presence, sensor_prop);
lcd_putsf(0, 2, "xmax=%d ymax=%d res=%d", x_max, y_max, sensor_resol);
lcd_putsf(0, 3, "attn=%d ctl=%x int=%x",
- imx233_get_gpio_input_mask(0, 0x08000000) ? 0 : 1,
+ imx233_pinctrl_get_gpio_mask(0, 0x08000000) ? 0 : 1,
rmi_read_single(RMI_DEVICE_CONTROL),
rmi_read_single(RMI_INTERRUPT_REQUEST));
lcd_putsf(0, 4, "sensi: %d min_dist: %d", (int)sensitivity.value, min_dist);
@@ -271,7 +271,7 @@ static void rmi_thread(void)
touchpad_btns = 0;
/* enable interrupt */
- imx233_setup_pin_irq(0, 27, true, true, false, &rmi_attn_cb);
+ imx233_pinctrl_setup_irq(0, 27, true, true, false, &rmi_attn_cb);
}
}
@@ -302,10 +302,10 @@ void button_init_device(void)
*/
/* touchpad power */
- imx233_pinctrl_acquire_pin(0, 26, "touchpad power");
- imx233_set_pin_function(0, 26, PINCTRL_FUNCTION_GPIO);
- imx233_enable_gpio_output(0, 26, false);
- imx233_set_pin_drive_strength(0, 26, PINCTRL_DRIVE_8mA);
+ imx233_pinctrl_acquire(0, 26, "touchpad power");
+ imx233_pinctrl_set_function(0, 26, PINCTRL_FUNCTION_GPIO);
+ imx233_pinctrl_enable_gpio(0, 26, false);
+ imx233_pinctrl_set_drive(0, 26, PINCTRL_DRIVE_8mA);
rmi_init(0x40);
@@ -325,14 +325,14 @@ void button_init_device(void)
create_thread(rmi_thread, rmi_stack, sizeof(rmi_stack), 0,
rmi_thread_name IF_PRIO(, PRIORITY_USER_INTERFACE) IF_COP(, CPU));
/* enable interrupt */
- imx233_pinctrl_acquire_pin(0, 27, "touchpad int");
- imx233_set_pin_function(0, 27, PINCTRL_FUNCTION_GPIO);
- imx233_enable_gpio_output(0, 27, false);
- imx233_setup_pin_irq(0, 27, true, true, false, &rmi_attn_cb);
+ imx233_pinctrl_acquire(0, 27, "touchpad int");
+ imx233_pinctrl_set_function(0, 27, PINCTRL_FUNCTION_GPIO);
+ imx233_pinctrl_enable_gpio(0, 27, false);
+ imx233_pinctrl_setup_irq(0, 27, true, true, false, &rmi_attn_cb);
/* Volume down */
- imx233_pinctrl_acquire_pin(1, 30, "volume down");
- imx233_set_pin_function(1, 30, PINCTRL_FUNCTION_GPIO);
- imx233_enable_gpio_output(1, 30, false);
+ imx233_pinctrl_acquire(1, 30, "volume down");
+ imx233_pinctrl_set_function(1, 30, PINCTRL_FUNCTION_GPIO);
+ imx233_pinctrl_enable_gpio(1, 30, false);
}
#else
@@ -340,9 +340,9 @@ void button_init_device(void)
void button_init_device(void)
{
/* Volume down */
- imx233_pinctrl_acquire_pin(1, 30, "volume down");
- imx233_set_pin_function(1, 30, PINCTRL_FUNCTION_GPIO);
- imx233_enable_gpio_output(1, 30, false);
+ imx233_pinctrl_acquire(1, 30, "volume down");
+ imx233_pinctrl_set_function(1, 30, PINCTRL_FUNCTION_GPIO);
+ imx233_pinctrl_enable_gpio(1, 30, false);
}
int touchpad_read_device(void)
@@ -355,7 +355,7 @@ int touchpad_read_device(void)
int button_read_device(void)
{
int res = 0;
- if(!imx233_get_gpio_input_mask(1, 0x40000000))
+ if(!imx233_pinctrl_get_gpio_mask(1, 0x40000000))
res |= BUTTON_VOL_DOWN;
/* The imx233 uses the voltage on the PSWITCH pin to detect power up/down
* events as well as recovery mode. Since the power button is the power button
diff --git a/firmware/target/arm/imx233/sansa-fuzeplus/fmradio-i2c-fuzeplus.c b/firmware/target/arm/imx233/sansa-fuzeplus/fmradio-i2c-fuzeplus.c
index 7988c4cb28..80c9d9149a 100644
--- a/firmware/target/arm/imx233/sansa-fuzeplus/fmradio-i2c-fuzeplus.c
+++ b/firmware/target/arm/imx233/sansa-fuzeplus/fmradio-i2c-fuzeplus.c
@@ -38,32 +38,32 @@ static int fmradio_i2c_bus = -1;
static void i2c_scl_dir(bool out)
{
- imx233_enable_gpio_output(1, 22, out);
+ imx233_pinctrl_enable_gpio(1, 22, out);
}
static void i2c_sda_dir(bool out)
{
- imx233_enable_gpio_output(1, 24, out);
+ imx233_pinctrl_enable_gpio(1, 24, out);
}
static void i2c_scl_out(bool high)
{
- imx233_set_gpio_output(1, 22, high);
+ imx233_pinctrl_set_gpio(1, 22, high);
}
static void i2c_sda_out(bool high)
{
- imx233_set_gpio_output(1, 24, high);
+ imx233_pinctrl_set_gpio(1, 24, high);
}
static bool i2c_scl_in(void)
{
- return imx233_get_gpio_input_mask(1, 1 << 22);
+ return imx233_pinctrl_get_gpio_mask(1, 1 << 22);
}
static bool i2c_sda_in(void)
{
- return imx233_get_gpio_input_mask(1, 1 << 24);
+ return imx233_pinctrl_get_gpio_mask(1, 1 << 24);
}
static void i2c_delay(int d)
@@ -90,10 +90,10 @@ struct i2c_interface fmradio_i2c =
void fmradio_i2c_init(void)
{
- imx233_pinctrl_acquire_pin(1, 24, "fmradio i2c");
- imx233_pinctrl_acquire_pin(1, 22, "fmradio i2c");
- imx233_set_pin_function(1, 24, PINCTRL_FUNCTION_GPIO);
- imx233_set_pin_function(1, 22, PINCTRL_FUNCTION_GPIO);
+ imx233_pinctrl_acquire(1, 24, "fmradio i2c");
+ imx233_pinctrl_acquire(1, 22, "fmradio i2c");
+ imx233_pinctrl_set_function(1, 24, PINCTRL_FUNCTION_GPIO);
+ imx233_pinctrl_set_function(1, 22, PINCTRL_FUNCTION_GPIO);
fmradio_i2c_bus = i2c_add_node(&fmradio_i2c);
}
@@ -132,7 +132,7 @@ static void NORETURN_ATTR rds_thread(void)
if(si4700_rds_read_raw(rds_data) && rds_process(rds_data))
si4700_rds_set_event();
/* renable callback */
- imx233_setup_pin_irq(2, 27, true, true, false, &stc_rds_callback);
+ imx233_pinctrl_setup_irq(2, 27, true, true, false, &stc_rds_callback);
}
}
@@ -141,16 +141,16 @@ void si4700_rds_powerup(bool on)
{
if(on)
{
- imx233_pinctrl_acquire_pin(2, 27, "tuner stc/rds");
- imx233_set_pin_function(2, 27, PINCTRL_FUNCTION_GPIO);
- imx233_enable_gpio_output(2, 27, false);
+ imx233_pinctrl_acquire(2, 27, "tuner stc/rds");
+ imx233_pinctrl_set_function(2, 27, PINCTRL_FUNCTION_GPIO);
+ imx233_pinctrl_enable_gpio(2, 27, false);
/* pin is set to 0 when an RDS packet has arrived */
- imx233_setup_pin_irq(2, 27, true, true, false, &stc_rds_callback);
+ imx233_pinctrl_setup_irq(2, 27, true, true, false, &stc_rds_callback);
}
else
{
- imx233_setup_pin_irq(2, 27, false, false, false, NULL);
- imx233_pinctrl_release_pin(2, 27, "tuner stc/rds");
+ imx233_pinctrl_setup_irq(2, 27, false, false, false, NULL);
+ imx233_pinctrl_release(2, 27, "tuner stc/rds");
}
}
diff --git a/firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c b/firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c
index bd584d1822..1ca159786a 100644
--- a/firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c
+++ b/firmware/target/arm/imx233/sansa-fuzeplus/lcd-fuzeplus.c
@@ -67,36 +67,36 @@ static void setup_lcd_pins(bool use_lcdif)
/* WARNING
* the B1P22 and B1P24 pins are used by the tuner i2c! Do NOT drive
* them as lcd_dotclk and lcd_hsync or it will break the tuner! */
- imx233_pinctrl_acquire_pin(1, 18, "lcd reset");
- imx233_pinctrl_acquire_pin(1, 19, "lcd rs");
- imx233_pinctrl_acquire_pin(1, 20, "lcd wr");
- imx233_pinctrl_acquire_pin(1, 21, "lcd cs");
- imx233_pinctrl_acquire_pin(1, 23, "lcd enable");
- imx233_pinctrl_acquire_pin(1, 25, "lcd vsync");
- imx233_pinctrl_acquire_pin_mask(1, 0x3ffff, "lcd data");
+ imx233_pinctrl_acquire(1, 18, "lcd reset");
+ imx233_pinctrl_acquire(1, 19, "lcd rs");
+ imx233_pinctrl_acquire(1, 20, "lcd wr");
+ imx233_pinctrl_acquire(1, 21, "lcd cs");
+ imx233_pinctrl_acquire(1, 23, "lcd enable");
+ imx233_pinctrl_acquire(1, 25, "lcd vsync");
+ imx233_pinctrl_acquire_mask(1, 0x3ffff, "lcd data");
if(use_lcdif)
{
- imx233_set_pin_function(1, 25, PINCTRL_FUNCTION_GPIO); /* lcd_vsync */
- imx233_set_pin_function(1, 21, PINCTRL_FUNCTION_MAIN); /* lcd_cs */
- imx233_set_pin_function(1, 23, PINCTRL_FUNCTION_GPIO); /* lcd_enable */
- imx233_set_pin_function(1, 18, PINCTRL_FUNCTION_MAIN); /* lcd_reset */
- imx233_set_pin_function(1, 19, PINCTRL_FUNCTION_MAIN); /* lcd_rs */
- imx233_set_pin_function(1, 16, PINCTRL_FUNCTION_MAIN); /* lcd_d16 */
- imx233_set_pin_function(1, 17, PINCTRL_FUNCTION_MAIN); /* lcd_d17 */
- imx233_set_pin_function(1, 20, PINCTRL_FUNCTION_MAIN); /* lcd_wr */
+ imx233_pinctrl_set_function(1, 25, PINCTRL_FUNCTION_GPIO); /* lcd_vsync */
+ imx233_pinctrl_set_function(1, 21, PINCTRL_FUNCTION_MAIN); /* lcd_cs */
+ imx233_pinctrl_set_function(1, 23, PINCTRL_FUNCTION_GPIO); /* lcd_enable */
+ imx233_pinctrl_set_function(1, 18, PINCTRL_FUNCTION_MAIN); /* lcd_reset */
+ imx233_pinctrl_set_function(1, 19, PINCTRL_FUNCTION_MAIN); /* lcd_rs */
+ imx233_pinctrl_set_function(1, 16, PINCTRL_FUNCTION_MAIN); /* lcd_d16 */
+ imx233_pinctrl_set_function(1, 17, PINCTRL_FUNCTION_MAIN); /* lcd_d17 */
+ imx233_pinctrl_set_function(1, 20, PINCTRL_FUNCTION_MAIN); /* lcd_wr */
HW_PINCTRL_MUXSELn_CLR(2) = 0xffffffff; /* lcd_d{0-15} */
}
else
{
HW_PINCTRL_MUXSELn_SET(2) = 0xffffffff; /* lcd_d{0-15} */
HW_PINCTRL_DOEn_CLR(1) = 0x2bfffff;
- imx233_set_pin_function(1, 16, PINCTRL_FUNCTION_GPIO); /* lcd_d16 */
- imx233_set_pin_function(1, 17, PINCTRL_FUNCTION_GPIO); /* lcd_d17 */
- imx233_set_pin_function(1, 19, PINCTRL_FUNCTION_GPIO); /* lcd_rs */
- imx233_set_pin_function(1, 20, PINCTRL_FUNCTION_GPIO); /* lcd_wr */
- imx233_set_pin_function(1, 21, PINCTRL_FUNCTION_GPIO); /* lcd_cs */
- imx233_set_pin_function(1, 23, PINCTRL_FUNCTION_GPIO); /* lcd_enable */
- imx233_set_pin_function(1, 25, PINCTRL_FUNCTION_GPIO); /* lcd_vsync */
+ imx233_pinctrl_set_function(1, 16, PINCTRL_FUNCTION_GPIO); /* lcd_d16 */
+ imx233_pinctrl_set_function(1, 17, PINCTRL_FUNCTION_GPIO); /* lcd_d17 */
+ imx233_pinctrl_set_function(1, 19, PINCTRL_FUNCTION_GPIO); /* lcd_rs */
+ imx233_pinctrl_set_function(1, 20, PINCTRL_FUNCTION_GPIO); /* lcd_wr */
+ imx233_pinctrl_set_function(1, 21, PINCTRL_FUNCTION_GPIO); /* lcd_cs */
+ imx233_pinctrl_set_function(1, 23, PINCTRL_FUNCTION_GPIO); /* lcd_enable */
+ imx233_pinctrl_set_function(1, 25, PINCTRL_FUNCTION_GPIO); /* lcd_vsync */
}
}
@@ -104,41 +104,41 @@ static void setup_lcd_pins_i80(bool i80)
{
if(i80)
{
- imx233_set_pin_drive_strength(1, 19, PINCTRL_DRIVE_12mA); /* lcd_rs */
- imx233_set_pin_drive_strength(1, 20, PINCTRL_DRIVE_12mA); /* lcd_wr */
- imx233_set_pin_drive_strength(1, 21, PINCTRL_DRIVE_12mA); /* lcd_cs */
- imx233_set_pin_drive_strength(1, 23, PINCTRL_DRIVE_12mA); /* lcd_enable */
- imx233_set_pin_function(1, 19, PINCTRL_FUNCTION_GPIO); /* lcd_rs */
- imx233_set_pin_function(1, 20, PINCTRL_FUNCTION_GPIO); /* lcd_wr */
- imx233_set_pin_function(1, 21, PINCTRL_FUNCTION_GPIO); /* lcd_cs */
- imx233_set_pin_function(1, 23, PINCTRL_FUNCTION_GPIO); /* lcd_enable */
+ imx233_pinctrl_set_drive(1, 19, PINCTRL_DRIVE_12mA); /* lcd_rs */
+ imx233_pinctrl_set_drive(1, 20, PINCTRL_DRIVE_12mA); /* lcd_wr */
+ imx233_pinctrl_set_drive(1, 21, PINCTRL_DRIVE_12mA); /* lcd_cs */
+ imx233_pinctrl_set_drive(1, 23, PINCTRL_DRIVE_12mA); /* lcd_enable */
+ imx233_pinctrl_set_function(1, 19, PINCTRL_FUNCTION_GPIO); /* lcd_rs */
+ imx233_pinctrl_set_function(1, 20, PINCTRL_FUNCTION_GPIO); /* lcd_wr */
+ imx233_pinctrl_set_function(1, 21, PINCTRL_FUNCTION_GPIO); /* lcd_cs */
+ imx233_pinctrl_set_function(1, 23, PINCTRL_FUNCTION_GPIO); /* lcd_enable */
/* lcd_{rs,wr,cs,enable} */
- imx233_enable_gpio_output_mask(1, (1 << 19) | (1 << 20) | (1 << 21) | (1 << 23), true);
- imx233_set_gpio_output_mask(1, (1 << 19) | (1 << 20) | (1 << 21) | (1 << 23), true);
+ imx233_pinctrl_enable_gpio_mask(1, (1 << 19) | (1 << 20) | (1 << 21) | (1 << 23), true);
+ imx233_pinctrl_set_gpio_mask(1, (1 << 19) | (1 << 20) | (1 << 21) | (1 << 23), true);
- imx233_enable_gpio_output_mask(1, 0x3ffff, false); /* lcd_d{0-17} */
+ imx233_pinctrl_enable_gpio_mask(1, 0x3ffff, false); /* lcd_d{0-17} */
HW_PINCTRL_MUXSELn_SET(2) = 0xffffffff; /* lcd_d{0-15} as GPIO */
- imx233_set_pin_function(1, 16, PINCTRL_FUNCTION_GPIO); /* lcd_d16 */
- imx233_set_pin_function(1, 17, PINCTRL_FUNCTION_GPIO); /* lcd_d17 */
- imx233_set_pin_function(1, 18, PINCTRL_FUNCTION_GPIO); /* lcd_reset */
- imx233_set_pin_function(1, 19, PINCTRL_FUNCTION_GPIO); /* lcd_rs */
+ imx233_pinctrl_set_function(1, 16, PINCTRL_FUNCTION_GPIO); /* lcd_d16 */
+ imx233_pinctrl_set_function(1, 17, PINCTRL_FUNCTION_GPIO); /* lcd_d17 */
+ imx233_pinctrl_set_function(1, 18, PINCTRL_FUNCTION_GPIO); /* lcd_reset */
+ imx233_pinctrl_set_function(1, 19, PINCTRL_FUNCTION_GPIO); /* lcd_rs */
}
else
{
- imx233_set_gpio_output_mask(1, (1 << 19) | (1 << 20) | (1 << 21) | (1 << 23), true);
- imx233_set_pin_drive_strength(1, 19, PINCTRL_DRIVE_4mA); /* lcd_rs */
- imx233_set_pin_drive_strength(1, 20, PINCTRL_DRIVE_4mA); /* lcd_wr */
- imx233_set_pin_drive_strength(1, 21, PINCTRL_DRIVE_4mA); /* lcd_cs */
- imx233_set_pin_drive_strength(1, 23, PINCTRL_DRIVE_4mA); /* lcd_enable */
- imx233_set_pin_function(1, 19, PINCTRL_FUNCTION_MAIN); /* lcd_rs */
- imx233_set_pin_function(1, 20, PINCTRL_FUNCTION_MAIN); /* lcd_wr */
- imx233_set_pin_function(1, 21, PINCTRL_FUNCTION_MAIN); /* lcd_cs */
- imx233_enable_gpio_output_mask(1, 0x3ffff, false); /* lcd_d{0-17} */
+ imx233_pinctrl_set_gpio_mask(1, (1 << 19) | (1 << 20) | (1 << 21) | (1 << 23), true);
+ imx233_pinctrl_set_drive(1, 19, PINCTRL_DRIVE_4mA); /* lcd_rs */
+ imx233_pinctrl_set_drive(1, 20, PINCTRL_DRIVE_4mA); /* lcd_wr */
+ imx233_pinctrl_set_drive(1, 21, PINCTRL_DRIVE_4mA); /* lcd_cs */
+ imx233_pinctrl_set_drive(1, 23, PINCTRL_DRIVE_4mA); /* lcd_enable */
+ imx233_pinctrl_set_function(1, 19, PINCTRL_FUNCTION_MAIN); /* lcd_rs */
+ imx233_pinctrl_set_function(1, 20, PINCTRL_FUNCTION_MAIN); /* lcd_wr */
+ imx233_pinctrl_set_function(1, 21, PINCTRL_FUNCTION_MAIN); /* lcd_cs */
+ imx233_pinctrl_enable_gpio_mask(1, 0x3ffff, false); /* lcd_d{0-17} */
HW_PINCTRL_MUXSELn_CLR(2) = 0xffffffff; /* lcd_d{0-15} as lcd_d{0-15} */
- imx233_set_pin_function(1, 16, PINCTRL_FUNCTION_MAIN); /* lcd_d16 */
- imx233_set_pin_function(1, 17, PINCTRL_FUNCTION_MAIN); /* lcd_d17 */
- imx233_set_pin_function(1, 18, PINCTRL_FUNCTION_MAIN); /* lcd_reset */
- imx233_set_pin_function(1, 19, PINCTRL_FUNCTION_MAIN); /* lcd_rs */
+ imx233_pinctrl_set_function(1, 16, PINCTRL_FUNCTION_MAIN); /* lcd_d16 */
+ imx233_pinctrl_set_function(1, 17, PINCTRL_FUNCTION_MAIN); /* lcd_d17 */
+ imx233_pinctrl_set_function(1, 18, PINCTRL_FUNCTION_MAIN); /* lcd_reset */
+ imx233_pinctrl_set_function(1, 19, PINCTRL_FUNCTION_MAIN); /* lcd_rs */
}
}
@@ -178,37 +178,37 @@ static uint32_t i80_read_register(uint32_t data_out)
{
imx233_lcdif_wait_ready();
/* lcd_enable is mapped to the RD pin of the controller */
- imx233_set_gpio_output(1, 21, true); /* lcd_cs */
- imx233_set_gpio_output(1, 19, true); /* lcd_rs */
- imx233_set_gpio_output(1, 23, true); /* lcd_enable */
- imx233_set_gpio_output(1, 20, true); /* lcd_wr */
- imx233_enable_gpio_output_mask(1, 0x3ffff, true); /* lcd_d{0-17} */
+ imx233_pinctrl_set_gpio(1, 21, true); /* lcd_cs */
+ imx233_pinctrl_set_gpio(1, 19, true); /* lcd_rs */
+ imx233_pinctrl_set_gpio(1, 23, true); /* lcd_enable */
+ imx233_pinctrl_set_gpio(1, 20, true); /* lcd_wr */
+ imx233_pinctrl_enable_gpio_mask(1, 0x3ffff, true); /* lcd_d{0-17} */
udelay(2);
- imx233_set_gpio_output(1, 19, false); /* lcd_rs */
+ imx233_pinctrl_set_gpio(1, 19, false); /* lcd_rs */
udelay(1);
- imx233_set_gpio_output(1, 21, false); /* lcd_cs */
+ imx233_pinctrl_set_gpio(1, 21, false); /* lcd_cs */
udelay(1);
- imx233_set_gpio_output(1, 20, false); /* lcd_wr */
+ imx233_pinctrl_set_gpio(1, 20, false); /* lcd_wr */
udelay(1);
- imx233_set_gpio_output_mask(1, data_out & 0x3ffff, true); /* lcd_d{0-17} */
+ imx233_pinctrl_set_gpio_mask(1, data_out & 0x3ffff, true); /* lcd_d{0-17} */
udelay(1);
- imx233_set_gpio_output(1, 20, true); /* lcd_wr */
+ imx233_pinctrl_set_gpio(1, 20, true); /* lcd_wr */
udelay(3);
- imx233_enable_gpio_output_mask(1, 0x3ffff, false); /* lcd_d{0-17} */
+ imx233_pinctrl_enable_gpio_mask(1, 0x3ffff, false); /* lcd_d{0-17} */
udelay(2);
- imx233_set_gpio_output(1, 23, false); /* lcd_enable */
+ imx233_pinctrl_set_gpio(1, 23, false); /* lcd_enable */
udelay(1);
- imx233_set_gpio_output(1, 19, true); /* lcd_rs */
+ imx233_pinctrl_set_gpio(1, 19, true); /* lcd_rs */
udelay(1);
- imx233_set_gpio_output(1, 23, true); /* lcd_enable */
+ imx233_pinctrl_set_gpio(1, 23, true); /* lcd_enable */
udelay(3);
- imx233_set_gpio_output(1, 23, false); /* lcd_enable */
+ imx233_pinctrl_set_gpio(1, 23, false); /* lcd_enable */
udelay(2);
- uint32_t data_in = imx233_get_gpio_input_mask(1, 0x3ffff); /* lcd_d{0-17} */
+ uint32_t data_in = imx233_pinctrl_get_gpio_mask(1, 0x3ffff); /* lcd_d{0-17} */
udelay(1);
- imx233_set_gpio_output(1, 23, true); /* lcd_enable */
+ imx233_pinctrl_set_gpio(1, 23, true); /* lcd_enable */
udelay(1);
- imx233_set_gpio_output(1, 21, true); /* lcd_cs */
+ imx233_pinctrl_set_gpio(1, 21, true); /* lcd_cs */
udelay(1);
return data_in;
}
diff --git a/firmware/target/arm/imx233/sansa-fuzeplus/power-fuzeplus.c b/firmware/target/arm/imx233/sansa-fuzeplus/power-fuzeplus.c
index 89dbfd3cb7..5d0377f77c 100644
--- a/firmware/target/arm/imx233/sansa-fuzeplus/power-fuzeplus.c
+++ b/firmware/target/arm/imx233/sansa-fuzeplus/power-fuzeplus.c
@@ -33,11 +33,11 @@ bool tuner_power(bool enable)
if(enable != tuner_enable)
{
/* CE is B029 (active high) */
- imx233_pinctrl_acquire_pin(0, 29, "tuner power");
- imx233_set_pin_function(0, 29, PINCTRL_FUNCTION_GPIO);
- imx233_set_pin_drive_strength(0, 29, PINCTRL_DRIVE_4mA);
- imx233_enable_gpio_output(0, 29, enable);
- imx233_set_gpio_output(0, 29, enable);
+ imx233_pinctrl_acquire(0, 29, "tuner power");
+ imx233_pinctrl_set_function(0, 29, PINCTRL_FUNCTION_GPIO);
+ imx233_pinctrl_set_drive(0, 29, PINCTRL_DRIVE_4mA);
+ imx233_pinctrl_enable_gpio(0, 29, enable);
+ imx233_pinctrl_set_gpio(0, 29, enable);
tuner_enable = enable;
/* give time to power up */
udelay(5);
diff --git a/firmware/target/arm/imx233/sdmmc-imx233.c b/firmware/target/arm/imx233/sdmmc-imx233.c
index bff5c98969..ed362a7bc0 100644
--- a/firmware/target/arm/imx233/sdmmc-imx233.c
+++ b/firmware/target/arm/imx233/sdmmc-imx233.c
@@ -200,13 +200,13 @@ static void sdmmc_power(int drive, bool on)
{
int bank = PIN2BANK(SDMMC_CONF(drive).power_pin);
int pin = PIN2PIN(SDMMC_CONF(drive).power_pin);
- imx233_pinctrl_acquire_pin(bank, pin, "sd/mmc power");
- imx233_set_pin_function(bank, pin, PINCTRL_FUNCTION_GPIO);
- imx233_enable_gpio_output(bank, pin, true);
+ imx233_pinctrl_acquire(bank, pin, "sd/mmc power");
+ imx233_pinctrl_set_function(bank, pin, PINCTRL_FUNCTION_GPIO);
+ imx233_pinctrl_enable_gpio(bank, pin, true);
if(SDMMC_FLAGS(drive) & POWER_INVERTED)
- imx233_set_gpio_output(bank, pin, !on);
+ imx233_pinctrl_set_gpio(bank, pin, !on);
else
- imx233_set_gpio_output(bank, pin, on);
+ imx233_pinctrl_set_gpio(bank, pin, on);
}
if(SDMMC_FLAGS(drive) & POWER_DELAY)
sleep(SDMMC_CONF(drive).power_delay);
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)