* git://git.infradead.org/battery-2.6:
power_supply: Add driver for the PMU on WM831x PMICs
ds2760_battery: Fix integer overflow for time_to_empty_now
wm97xx_battery: Convert to dev_pm_ops
wm97xx_battery: Use irq to detect charger state
wm97xx_battery: Use platform_data
wm97xx-core: Pass platform_data to battery
ds2760_battery: implement set_charged() feature
power_supply: get_by_name and set_charged functionality
power_supply: EXPORT_SYMBOL cleanups
ds2760_battery: add current_accum module parameter
ds2760_battery: handle full_active_uAh == 0 case correctly
ds2760_battery: add rated_capacity module parameter
ds2760_battery: export more features
ds2760_battery: delay power supply registration
wm8350_power: Implement charge type property
power_supply: Add a charge_type property, and use it for olpc driver
olpc_battery: Add an 'error' sysfs device that displays raw errors
Revert "power: remove POWER_SUPPLY_PROP_CAPACITY_LEVEL"
This makes it consistent with other buses (platform, i2c, vio, ...). I'm
not sure why we use the prefixes, but there must be a reason.
This was easy enough to do it, and I did it.
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Jean Delvare <khali@linux-fr.org>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Dmitry Torokhov <dtor@mail.ru>
Cc: Samuel Ortiz <sameo@openedhand.com>
Cc: "John W. Linville" <linville@tuxdriver.com>
Acked-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
The MELPAS MCS-5000 is the touchscreen controller. The overview of this
controller can see at the following website:
http://www.melfas.com/product/product01.asp?k_r=eng_
This driver is tested on s3c6410 NCP board and supports only the i2c
interface.
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
The AD7889 is a new part but 100% software compatible with the AD7879, so
add it to the id_table and help text.
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Touchscreen driver for the PCAP2 multi function device used in
Motorola EZX smartphones.
Signed-off-by: Daniel Ribeiro <drwyrm@gmail.com>
Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org>
Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Acked-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (52 commits)
Input: bcm5974 - silence uninitialized variables warnings
Input: wistron_btns - add keymap for AOpen 1557
Input: psmouse - use boolean type
Input: i8042 - use platform_driver_probe
Input: i8042 - use boolean type where it makes sense
Input: i8042 - try disabling and re-enabling AUX port at close
Input: pxa27x_keypad - allow modifying keymap from userspace
Input: sunkbd - fix formatting
Input: i8042 - bypass AUX IRQ delivery test on laptops
Input: wacom_w8001 - simplify querying logic
Input: atkbd - allow setting force-release bitmap via sysfs
Input: w90p910_keypad - move a dereference below a NULL test
Input: add twl4030_keypad driver
Input: matrix-keypad - add function to build device keymap
Input: tosakbd - fix cleaning up KEY_STROBEs after error
Input: joydev - validate axis/button maps before clobbering current ones
Input: xpad - add USB ID for the drumkit controller from Rock Band
Input: w90p910_keypad - rename driver name to match platform
Input: add new driver for Sentelic Finger Sensing Pad
Input: psmouse - allow defining read-only attributes
...
There is no need for locking when we send query and start commands
to the touchscreen since there is no concurrency.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Add the cpu.c and dev.c and modify w90p910 platform
to apply to use the common API(provided by cpu.c and dev.c)
at the same time, I renamed all w90x900 to nuc900 in every
c file of w90x900 platform and touchscreen's driver name.
Signed-off-by: Wan ZongShun <mcuos.com@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Sometimes, when using the touchscreen, it stops working till next restart
and the following message is printed:
ucb1400: unexpected IE_STATUS = 0x0
The following patch retriggers the touchscreen interrupt unconditionally.
This prevents hanging of the touchscreen in case of bogus interrupt
occurence.
Signed-off-by: Pavel Revak <palo@bielyvlk.sk>
Acked-by: Marek Vasut <marek.vasut@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This patch enables ADC filtering on UCB1400 codec by default. The
benefit from this change is mostly on some Colibri boards where
the ADCSYNC pin of the UCB1400 codec isn't connected causing the
touchscreen to jitter very badly. This change has no visible
effect on boards where the ADCSYNC pin is connected.
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Tested-by: Palo Revak <palo@bielyvlk.sk>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This adds a struct eeti_ts_platform_data which currently holds only one
value to specify the interrupt polarity.
The driver has a fallback if no platform data is passed in via the
i2c_board_info, so no regression is caused.
Signed-off-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Check the result when sending the power down command to the controller.
Signed-off-by: Richard Röjfors <richard.rojfors.ext@mocean-labs.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
In cases when get_pendown_state callback is not available have
the driver to fallback on pressure calculation to determine if
the pen is up.
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This patch adds support for the e2i touchscreen controller used in the
Mimo 740 (and probably in other e2i touchscreen products). Tested on
Mimo 740.
Signed-off-by: Florian Echtler <floe@butterbrot.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Don't read coordinates during probe of the driver, just power down
the controller and wait for interrupts.
Signed-off-by: Richard Röjfors<richard.rojfors.ext@mocean-labs.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Make init_platform_hw and exit_platform_hw callbacks optional since
they are not needed on all platforms.
Signed-off-by: Richard Röjfors <richard.rojfors.ext@mocean-labs.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Properly shut off interrupts/delayed work by free-ing IRQ first
and then ensuring that enable/disable is balanced. Also add
__devinit/__devexit markings, restore poll delay/period scheduling
logic, make sure we call exit_platform_hw() method when probe
fails.
Tested-by: Richard Röjfors <richard.rojfors.ext@mocean-labs.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Since it's not allowed to do synchronous I2C in the HR timer callback
context we have to switch to using the global workqueue. The work is
scheduled every 1ms when polling rather than 5 us.
Signed-off-by: Richard Röjfors <richard.rojfors.ext@mocean-labs.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This patch allows tweaking the behaviour of GPIO_STATUS register
shift quirk that's in wm97xx-core. The problem with GPIO_STATUS
register being shifted by one doesn't appear on all hardware it
seems and causes problems with accelerated touchscreen drivers on
Palm hardware. Therefore an accelerated touchscreen driver can select
if the shift is/isn't happening on the hardware.
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This patch refactors the Mainstone accelerated touch code a little and
adds support for interrupt driven touchscreen on Palm LifeDrive, TX and
Tungsten T5.
Signed-off-by: Marek Vasut <marek.vasut@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Now that clk API is available on ARM we can use it in the driver.
Signed-off-by: Wan ZongShun <mcuos.com@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
The driver for UCB1400 touchscreen controllers contains a function named
ucb1400_ts_pen_down(), but it returns 0 if the pen is down and 1 if it's up.
This causes confusion, especially since it's used as a boolean truth value
later in the code. This patch renames it.
Signed-off-by: Hans J. Koch <hjk@linutronix.de>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Add support for the JASTEC/DigiTech DTR-02U USB touch screen
controllers.
Signed-off-by: Jim Persson <jim-linux@nurd.se>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Use the function resource_size, which reduces the chance of
introducing off-by-one errors in calculating the resource size.
The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)
// <smpl>
@@
struct resource *res;
@@
- (res->end - res->start) + 1
+ resource_size(res)
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Some SoCs support only pin change interrupts on GPIO pins used as irq
lines.
The ads7846 core is not affected from the additional irqs on the rising
edge because the code accounts touch bounce anyway by kicking in a timer
and disabling the irq after the first request and reenabling the irq after
a timeout when there is no longer pen down detected.
Signed-off-by: Michael Roth <mroth@nessie.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
The touchscreen works in two modes, wait trigger mode and auto-semi
mode. The device starts in wait trigger mode and waits until pressure
is detected, then device sets WT_INT bit and raises an interrupt.
The driver should put the device into auto-semi mode and prepare for
reading first X and then Y coordinates. When coordinate data is ready
the driver sets ADC_INT bit and raises interrupt again.
[dtor@mail.ru: various cleanups]
Signed-off-by: Wan ZongShun <mcuos.com@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
platform_data != driver_data
driver data is actually the "correct" place of the struct however it is
not placed there due to the need of the ac97 struct. This is broken since
d9105c2b01 aka "[ARM] 5184/1: Split ucb1400_ts into core and touchscreen"
Signed-off-by: Manuel Traut <manut@linutronix.de>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This patch adds a driver for EETI's I2C connected touchscreens.
Signed-off-by: Daniel Mack <daniel@caiaq.de>
Tested-by: Sven Neumann <s.neumann@raumfeld.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
The platform codes must provide get_pendown_state() for the driver
to work properly.
Signed-off-by: Kwangwoo Lee <kwangwoo.lee@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Now that hrtimers are always running in hard irq context we can't
unconditionally enable interrupts at the end of the timer function.
Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Kwangwoo Lee <kwangwoo.lee@gmail.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
In the near future, the driver core is going to not allow direct access
to the driver_data pointer in struct device. Instead, the functions
dev_get_drvdata() and dev_set_drvdata() should be used. These functions
have been around since the beginning, so are backwards compatible with
all older kernel versions.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This patch adds an accelerated driver for Atmel AVR32 AT32AP700X
microprocessors. It uses interrupts on the channel B in the AC97
controller. Thus, offloading the work queue in the wm97xx-ts driver.
The driver has been tested with Atmel AVR32 AT32AP7000 and Wolfson
WM9712 codec.
The driver can also be easily modified to support Atmel AT91 devices, as
AT91 and AVR32 share the same AC97C module.
[Fixed leak of atmel_wm97xx when probe fails. -- broonie]
[dtor@mail.ru: do not report ABS_PRESSURE events when not measuring pressure]
Signed-off-by: Hans-Christian Egtvedt <hans-christian.egtvedt@atmel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
disable_irq() waits for all running handlers to complete before
returning. As such, if it's used to disable an interrupt from
that interrupt's handler it will deadlock. This replaces the
dangerous instances with the _nosync() variant which doesn't have
this problem.
Signed-off-by: Ben Nizette <bn@niasdigital.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
disable_irq() waits for all running handlers to complete before
returning. As such, if it's used to disable an interrupt from
that interrupt's handler it will deadlock. This replaces the
dangerous instances with the _nosync() variant which doesn't have
this problem.
Signed-off-by: Ben Nizette <bn@niasdigital.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
The use of disable_irq inside the handler for the interrupt being
disabled has always been dangerous. disable_irq should wait for that
handler to complete before returning -> deadlock.
For some reason this wasn't actually the case until 3aa551c9b was merged
but since this time, the ads7846 driver has deadlocked the system on
first interrupt.
Convert the driver to use the handler-safe _nosync variant.
Signed-off-by: Ben Nizette <bn@niasdigital.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
The loop body was never executed, because the condition is
always false. Convert to for with more obvious condition.
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This patch removes depreciated IRQF_SAMPLE_RANDOM flags from
ad7877 and ad7879 touchscreen drivers.
Signed-off-by: Michael Hennerich <michael.hennerich@analog.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
PEN_{UP/DOWN} events are expected to be available soon after stopping
TSI auto measurement, but this is found not always be true. Work around
this by adding delay and simulating such an event (according to pen down
status bit).
Signed-off-by: Bin Yang <bin.yang@marvell.com>
Signed-off-by: Eric Miao <eric.miao@marvell.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Bin did a lot of work on this driver, without his help, this driver
will not be possible.
Signed-off-by: Bin Yang <bin.yang@marvell.com>
Signed-off-by: Eric Miao <eric.miao@marvell.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>