lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1267296977-22626-1-git-send-email-gardner.ben@gmail.com>
Date:	Sat, 27 Feb 2010 12:56:17 -0600
From:	Ben Gardner <gardner.ben@...il.com>
To:	linux-kernel@...r.kernel.org,
	Andres Salomon <dilinger@...labora.co.uk>,
	Mark Brown <broonie@...nsource.wolfsonmicro.com>,
	David Brownell <david-b@...bell.net>
Cc:	Ben Gardner <gardner.ben@...il.com>,
	Andres Salomon <dilinger@...labora.co.uk>,
	Andrew Morton <akpm@...ux-foundation.org>,
	David Brownell <dbrownell@...rs.sourceforge.net>,
	Jani Nikula <ext-jani.1.nikula@...ia.com>
Subject: [PATCH v2] cs5535-gpio: change input/output enable to match gpiolib expectations

The intent of the gpiolib set_direction_xxx functions is as follows:
output: enable both input and output
input: disable output, enable input

Change the cs5535 driver to do that.

Signed-off-by: Ben Gardner <gardner.ben@...il.com>
CC: Andres Salomon <dilinger@...labora.co.uk>
CC: Andrew Morton <akpm@...ux-foundation.org>
CC: David Brownell <dbrownell@...rs.sourceforge.net>
CC: Jani Nikula <ext-jani.1.nikula@...ia.com>
---
 drivers/gpio/cs5535-gpio.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/gpio/cs5535-gpio.c b/drivers/gpio/cs5535-gpio.c
index 0fdbe94..de064c9 100644
--- a/drivers/gpio/cs5535-gpio.c
+++ b/drivers/gpio/cs5535-gpio.c
@@ -171,6 +171,7 @@ static int chip_direction_input(struct gpio_chip *c, unsigned offset)
 	unsigned long flags;
 
 	spin_lock_irqsave(&chip->lock, flags);
+	__cs5535_gpio_clear(chip, offset, GPIO_OUTPUT_ENABLE);
 	__cs5535_gpio_set(chip, offset, GPIO_INPUT_ENABLE);
 	spin_unlock_irqrestore(&chip->lock, flags);
 
@@ -185,6 +186,7 @@ static int chip_direction_output(struct gpio_chip *c, unsigned offset, int val)
 	spin_lock_irqsave(&chip->lock, flags);
 
 	__cs5535_gpio_set(chip, offset, GPIO_OUTPUT_ENABLE);
+	__cs5535_gpio_set(chip, offset, GPIO_INPUT_ENABLE);
 	if (val)
 		__cs5535_gpio_set(chip, offset, GPIO_OUTPUT_VAL);
 	else
-- 
1.7.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ