Skip to content

Commit

Permalink
mxc: iomuxv1: Do not use gpio_request when setting the pin as GPIO
Browse files Browse the repository at this point in the history
When setting the IOMUX of multiple pins via mxc_gpio_setup_multiple_pins, gpio_request
is called and this prevents subsequent calls of gpio_request done by drivers to succeed.

Remove gpio_request call from mxc_gpio_setup_multiple_pins function.

As gpio_request is removed from mxc_gpio_setup_multiple_pins, there is no need to have
mxc_gpio_release_multiple_pins anymore, so remove this function.

Tested on a mx27_3ds board and after applying this patch it is possible to define all the
IOMUX setup in a static array

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
  • Loading branch information
Fabio Estevam authored and Sascha Hauer committed Jul 7, 2011
1 parent b2a08e3 commit 581f84e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 33 deletions.
1 change: 0 additions & 1 deletion arch/arm/plat-mxc/include/mach/iomux-v1.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@
extern int mxc_gpio_mode(int gpio_mode);
extern int mxc_gpio_setup_multiple_pins(const int *pin_list, unsigned count,
const char *label);
extern void mxc_gpio_release_multiple_pins(const int *pin_list, int count);

extern int __init imx_iomuxv1_init(void __iomem *base, int numports);

Expand Down
32 changes: 0 additions & 32 deletions arch/arm/plat-mxc/iomux-v1.c
Original file line number Diff line number Diff line change
Expand Up @@ -172,45 +172,13 @@ static int imx_iomuxv1_setup_multiple(const int *list, unsigned count)
int mxc_gpio_setup_multiple_pins(const int *pin_list, unsigned count,
const char *label)
{
size_t i;
int ret;

for (i = 0; i < count; ++i) {
unsigned gpio = pin_list[i] & (GPIO_PIN_MASK | GPIO_PORT_MASK);

ret = gpio_request(gpio, label);
if (ret)
goto err_gpio_request;
}

ret = imx_iomuxv1_setup_multiple(pin_list, count);
if (ret)
goto err_setup;

return 0;

err_setup:
BUG_ON(i != count);

err_gpio_request:
mxc_gpio_release_multiple_pins(pin_list, i);

return ret;
}
EXPORT_SYMBOL(mxc_gpio_setup_multiple_pins);

void mxc_gpio_release_multiple_pins(const int *pin_list, int count)
{
size_t i;

for (i = 0; i < count; ++i) {
unsigned gpio = pin_list[i] & (GPIO_PIN_MASK | GPIO_PORT_MASK);

gpio_free(gpio);
}
}
EXPORT_SYMBOL(mxc_gpio_release_multiple_pins);

int __init imx_iomuxv1_init(void __iomem *base, int numports)
{
imx_iomuxv1_baseaddr = base;
Expand Down

0 comments on commit 581f84e

Please sign in to comment.