[ARM] 5566/1: Remove at91_gpiolib_request
Remove at91_gpiolib_request. It returns -EPERM if a request pin is not in GPIO mode, however we want to be able to gpio_request alternative function pins to reserve them, and in some cases we need to be able to use the gpiolib functions on alternative function pins. Signed-off-by: Ryan Mallon <ryan@bluewatersys.com> Acked-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
committed by
Russell King
parent
226ddb9833
commit
7c6425a040
@@ -44,13 +44,11 @@ static int at91_gpiolib_direction_output(struct gpio_chip *chip,
|
|||||||
unsigned offset, int val);
|
unsigned offset, int val);
|
||||||
static int at91_gpiolib_direction_input(struct gpio_chip *chip,
|
static int at91_gpiolib_direction_input(struct gpio_chip *chip,
|
||||||
unsigned offset);
|
unsigned offset);
|
||||||
static int at91_gpiolib_request(struct gpio_chip *chip, unsigned offset);
|
|
||||||
|
|
||||||
#define AT91_GPIO_CHIP(name, base_gpio, nr_gpio) \
|
#define AT91_GPIO_CHIP(name, base_gpio, nr_gpio) \
|
||||||
{ \
|
{ \
|
||||||
.chip = { \
|
.chip = { \
|
||||||
.label = name, \
|
.label = name, \
|
||||||
.request = at91_gpiolib_request, \
|
|
||||||
.direction_input = at91_gpiolib_direction_input, \
|
.direction_input = at91_gpiolib_direction_input, \
|
||||||
.direction_output = at91_gpiolib_direction_output, \
|
.direction_output = at91_gpiolib_direction_output, \
|
||||||
.get = at91_gpiolib_get, \
|
.get = at91_gpiolib_get, \
|
||||||
@@ -588,19 +586,6 @@ static void at91_gpiolib_set(struct gpio_chip *chip, unsigned offset, int val)
|
|||||||
__raw_writel(mask, pio + (val ? PIO_SODR : PIO_CODR));
|
__raw_writel(mask, pio + (val ? PIO_SODR : PIO_CODR));
|
||||||
}
|
}
|
||||||
|
|
||||||
static int at91_gpiolib_request(struct gpio_chip *chip, unsigned offset)
|
|
||||||
{
|
|
||||||
unsigned pin = chip->base + offset;
|
|
||||||
void __iomem *pio = pin_to_controller(pin);
|
|
||||||
unsigned mask = pin_to_mask(pin);
|
|
||||||
|
|
||||||
/* Cannot request GPIOs that are in alternate function mode */
|
|
||||||
if (!(__raw_readl(pio + PIO_PSR) & mask))
|
|
||||||
return -EPERM;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void at91_gpiolib_dbg_show(struct seq_file *s, struct gpio_chip *chip)
|
static void at91_gpiolib_dbg_show(struct seq_file *s, struct gpio_chip *chip)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
Reference in New Issue
Block a user