summaryrefslogtreecommitdiff
path: root/drivers/input/misc
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2013-09-10 14:53:03 +0400
committerLinus Walleij <linus.walleij@linaro.org>2013-09-27 16:15:14 +0400
commite9c9fc2315ad7a57af1a5124ad911870b60d9bd0 (patch)
treedb8d7fa11a76186b4a978cefe437d7b4bc6d447f /drivers/input/misc
parent8040dd09c2ca7e70daf84f040beb3ced9602fce5 (diff)
downloadlinux-e9c9fc2315ad7a57af1a5124ad911870b60d9bd0.tar.xz
input: misc: ixp4-beeper: switch to use gpiolib
The platform using this beeper has support for gpiolib, so there is no point to use the custom gpio_line* API. A strange ambiguity where a line was first set as input and then driven high was solved by first driving the line high as output and then switch it to input. Cc: Imre Kaloz <kaloz@openwrt.org> Cc: Alexandre Courbot <acourbot@nvidia.com> Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Krzysztof Halasa <khc@pm.waw.pl> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'drivers/input/misc')
-rw-r--r--drivers/input/misc/ixp4xx-beeper.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/input/misc/ixp4xx-beeper.c b/drivers/input/misc/ixp4xx-beeper.c
index f34beb228d36..f14afd09e34d 100644
--- a/drivers/input/misc/ixp4xx-beeper.c
+++ b/drivers/input/misc/ixp4xx-beeper.c
@@ -20,6 +20,7 @@
#include <linux/delay.h>
#include <linux/platform_device.h>
#include <linux/interrupt.h>
+#include <linux/gpio.h>
#include <mach/hardware.h>
MODULE_AUTHOR("Alessandro Zummo <a.zummo@towertech.it>");
@@ -35,15 +36,12 @@ static void ixp4xx_spkr_control(unsigned int pin, unsigned int count)
spin_lock_irqsave(&beep_lock, flags);
- if (count) {
- gpio_line_config(pin, IXP4XX_GPIO_OUT);
- gpio_line_set(pin, IXP4XX_GPIO_LOW);
-
+ if (count) {
+ gpio_direction_output(pin, 0);
*IXP4XX_OSRT2 = (count & ~IXP4XX_OST_RELOAD_MASK) | IXP4XX_OST_ENABLE;
} else {
- gpio_line_config(pin, IXP4XX_GPIO_IN);
- gpio_line_set(pin, IXP4XX_GPIO_HIGH);
-
+ gpio_direction_output(pin, 1);
+ gpio_direction_input(pin);
*IXP4XX_OSRT2 = 0;
}