login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2010
»
July
»
4
Re: [PATCH] gpiolib: Implement set_debounce for WM831x GPIOs
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
[view in full thread]
From: Samuel Ortiz
Subject:
Re: [PATCH] gpiolib: Implement set_debounce for WM831x GPIOs
Date: Sunday, July 4, 2010 - 3:07 pm
On Sat, Jul 03, 2010 at 03:40:56PM +0200, Mark Brown wrote:
quoted text
> The debounce times are approximate, they can be selected using the two > input functions.
Thanks Mark, patch applied. Cheers, Samuel.
quoted text
> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> > --- > drivers/gpio/wm831x-gpio.c | 32 ++++++++++++++++++++++++++++++++ > 1 files changed, 32 insertions(+), 0 deletions(-) > > diff --git a/drivers/gpio/wm831x-gpio.c b/drivers/gpio/wm831x-gpio.c > index 1fa449a..309644c 100644 > --- a/drivers/gpio/wm831x-gpio.c > +++ b/drivers/gpio/wm831x-gpio.c > @@ -108,6 +108,37 @@ static int wm831x_gpio_to_irq(struct gpio_chip *chip, unsigned offset) > return wm831x->irq_base + WM831X_IRQ_GPIO_1 + offset; > } > > +static int wm831x_gpio_set_debounce(struct gpio_chip *chip, unsigned offset, > + unsigned debounce) > +{ > + struct wm831x_gpio *wm831x_gpio = to_wm831x_gpio(chip); > + struct wm831x *wm831x = wm831x_gpio->wm831x; > + int reg = WM831X_GPIO1_CONTROL + offset; > + int ret, fn; > + > + ret = wm831x_reg_read(wm831x, reg); > + if (ret < 0) > + return ret; > + > + switch (ret & WM831X_GPN_FN_MASK) { > + case 0: > + case 1: > + break; > + default: > + /* Not in GPIO mode */ > + return -EBUSY; > + } > + > + if (debounce >= 32 && debounce <= 64) > + fn = 0; > + else if (debounce >= 4000 && debounce <= 8000) > + fn = 1; > + else > + return -EINVAL; > + > + return wm831x_set_bits(wm831x, reg, WM831X_GPN_FN_MASK, fn); > +} > + > #ifdef CONFIG_DEBUG_FS > static void wm831x_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip) > { > @@ -208,6 +239,7 @@ static struct gpio_chip template_chip = { > .direction_output = wm831x_gpio_direction_out, > .set = wm831x_gpio_set, > .to_irq = wm831x_gpio_to_irq, > + .set_debounce = wm831x_gpio_set_debounce, > .dbg_show = wm831x_gpio_dbg_show, > .can_sleep = 1, > }; > -- > 1.7.1 >
-- Intel Open Source Technology Centre
http://oss.intel.com/
--
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
Messages in current thread:
[PATCH] gpiolib: Implement set_debounce for WM831x GPIOs
, Mark Brown
, (Sat Jul 3, 6:40 am)
Re: [PATCH] gpiolib: Implement set_debounce for WM831x GPIOs
, Samuel Ortiz
, (Sun Jul 4, 3:07 pm)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Mathieu Desnoyers
[PATCH 01/10] local_t : architecture independant extension
Ingo Molnar
Re: 2.6.20-rc6-mm3
monstr
[PATCH 46/56] microblaze_v2: headers files entry.h current.h mman.h registers.h se...
alan
Re: Versioning file system
Jan Engelhardt
Re: Linux Security *Module* Framework (Was: LSM conversion to static interface)
git
:
Andy Parkins
git-fetch fails with error code 128
Johannes Sixt
Re: [PATCH v2 04/13] Teach rebase interactive the mark command
Yakov Lerner
Re: Autoconf/Automake
Miklos Vajna
Re: [IRC/patches] Failed octopus merge does not clean up
Johannes Sixt
Re: [msysGit] [PATCH 01/12] Fake reencoding success under NO_ICONV instead of retu...
linux-netdev
:
jamal
[net-next-2.6 PATCH 1/7] xfrm: introduce basic mark infrastructure
jamal
[net-next-2.6 PATCH 0/7] xfrm by MARK
Timo Teräs
ip xfrm policy semantics
Jeff Garzik
Re: [PATCH 1/5] sky2: phy setup changes
Ken-ichirou MATSUZAWA
Re: [PATCH] don't touch bridge sysfs in container.
git-commits-head
:
Linux Kernel Mailing List
No need to do lock_super() for exclusion in generic_shutdown_super()
Linux Kernel Mailing List
x86, msr: Export the register-setting MSR functions via /dev/*/msr
Linux Kernel Mailing List
MIPS: SMTC: Fix lockup in smtc_distribute_timer
Linux Kernel Mailing List
V4L/DVB (13840): smsusb: Add ISDB-T firmware for Hauppauge WinTV-Nova-T-MiniStick
Linux Kernel Mailing List
Input: gpio-keys - add support for disabling gpios through sysfs
openbsd-misc
:
Marco Peereboom
Re: Defending OpenBSD Performance
elitdostlar
Seks partneri arayan bayanlar bu adreste - 8878xs706x6438
Damon Schultz
Routing iTunes sharing across subnets using OpenBSD
Ashraf Cotu
Je sur comptable a la banque BCB je vais virée $6.million a la etranger
Chris Black
Re: carp, 2 router
Colocation donated by:
Syndicate