Commit Graph

173162 Commits (fdb8ebb729bbb640e64028a4f579a02ebc405727)

Author SHA1 Message Date
Dmitry Artamonow c463eb62ac ARM: 5823/1: SA1100: h3100/h3600: add support for gpio-keys
Add support for "Power" and "Action" (joystick center) buttons -
the only buttons on iPaq h3100/h3600 connected to GPIOs
(other buttons are controlled by microcontroller)
Also remove setting PWER for wakeup on Power button press -
gpio-keys driver will handle it.

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:57 +00:00
Dmitry Artamonow 4aa9755580 ARM: 5822/1: SA1100: h3100/h3600: clean up #includes
After a code reorganization and following split, there's some #includes
now unused. Clean them up and sort remaining alphabetticaly where possible.

Compile tested.

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:57 +00:00
Dmitry Artamonow 6e23fcb3bd ARM: 5821/1: SA1100: h3100/h3600: revise copyright boilerplates
Correct boilerplates after files split. Also shorten them a bit - use
standart GPL wording (as per http://lkml.org/lkml/2007/5/1/220) and
drop changelog, which only entry about h3800 support and abstracted
EGPIOs is just confusing now, as both of these features are gone.

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:56 +00:00
Dmitry Artamonow 86e5e38c46 ARM: 5820/1: SA1100: h3100/h3600: split h3600.c
Split common h3600.c into three separate files: h3100.c, h3600.c and
h3xxx.c (the latter contains common code for h3100/h3600)
Copyright boilerplates and #includes are copied intact and will be
cleaned up later.

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:56 +00:00
Dmitry Artamonow 8715b29db2 ARM: 5819/1: SA1100: h3100/h3600: merge h3600.h and h3600_gpio.h into h3xxx.h
Combine both headers into one, rename to h3xxx.h and change all
users accordingly.

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:56 +00:00
Dmitry Artamonow 4c88a5c20f ARM: 5818/1: SA1100: h3100/h3600: drop old GPIO definitions
As all existing code was converted to gpiolib, drop no more
used pre-gpiolib (bit-shifted) GPIO definintions.
Supply new gpiolib-friendly definitions for GPIOs which
don't have them yet.

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:56 +00:00
Dmitry Artamonow 51834901fa ARM: 5817/1: SA1100: h3100/h3600: configure all unused gpios as inputs
After conversion to gpiolib there's still some GPIOs left, that get
configured in *_mach_init() as outputs (using direct operations
on GPCR/GPDR registers), but otherwise unused. These GPIOs are mainly
sound related and should be configured by corresponding driver once
it is written.

Drop this initialisation and configure all GPIOs as input.

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:55 +00:00
Dmitry Artamonow ca912b17c0 ARM: 5816/1: SA1100: h3600: remove IRQ_GPIO_* definitions
As all the remaining users of these definitions
(in pcmcia/sa1100_h3600 driver) were converted to gpio_to_irq(),
they can be safely removed.

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:55 +00:00
Dmitry Artamonow 766f0378a7 ARM: 5815/1: SA1100: h3100/h3600: remove now unused assign_h3600_egpio handlers
As all users of assign_h3600_egpio now converted to gpiolib, we
can safely remove all assign_h3600_egpio handling code and
definitions.

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:55 +00:00
Dmitry Artamonow 22f9740552 ARM: 5814/1: SA1100: h3100/h3600: convert all users of assign_h3600_egpio to gpiolib
Use of gpio_request/gpio_free in some callbacks may look ugly, but
corresponding drivers (sa1100_serial and sa1100_fb) don't provide (yet)
init/exit hooks and registering these gpios in *_mach_init is also
not possible, because htc-gpio driver starts a bit later...

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:55 +00:00
Dmitry Artamonow 2eec62d7db ARM: 5813/1: SA1100: h3100/h3600: add htc-egpio driver
It will be used for future conversion of assign_h3600_egpio calls to
gpiolib.

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:55 +00:00
Dmitry Artamonow cf5a87d80a ARM: 5812/1: SA1100: h3100/h3600: separate machine-specific LCD helpers
h3100 and h3600 have different sets of LCD-controlling gpios,
which mapped to the same "abstracted" EGPIO.
As we plan to get rid of those abstracted egpios completely, we
need to separate these helper functions.

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:54 +00:00
Dmitry Artamonow 2a83709199 ARM: 5811/2: pcmcia: convert sa1100_h3600 driver to gpiolib
Convert all operations with GPLR/GPCR/GPSR to gpiolibs calls.
Also change all IRQ_GPIO* to gpio_to_irq(*GPIO*)

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:36 +00:00
Dmitry Artamonow d0e6041efd ARM: 5799/1: SA1100: h3600: stop setting direction for LCD pins
sa1100_fb driver handles this

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:26 +00:00
Dmitry Artamonow 382c14a52d ARM: 5798/1: SA1100: h3600: remove unused cruft from h3600.h
PM_SUSPEND, PM_RESUME and machine_is_h3xxx() are not used anywhere in
kernel (checked with git grep), so it's safe to remove them.

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:25 +00:00
Dmitry Artamonow 2a151a0f12 ARM: 5796/1: SA1100: h3600: remove IRDA bits from serial PM callback
IRDA is handled by separate sa1100-ir driver and has
nothing to do with sa1100_serial

Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:25 +00:00
Dmitry Artamonow 1e23221e98 ARM: 5797/1: SA1100: h3100/h3600: remove dead links from Kconfig help text
Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:25 +00:00
Dmitry Artamonow e55b20e81d ARM: 5795/1: SA1100: h3100/h3600: mark *_mach_init functions as __init
Signed-off-by: Dmitry Artamonow <mad_soft@inbox.ru>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:25 +00:00
Russell King 0fb85a5aa0 ARM: iPAQ: no need to set PWER_RTC
The rtc-sa1100 driver takes care of this.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:25 +00:00
Russell King 6e21ee6aa7 ARM: iPAQ: move serial port support functions
No point calling sa1100_register_uart_fns early - these aren't
used until late in the boot sequence.  Also convert to gpiolib
support.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:24 +00:00
Russell King 9c196f0f8d ARM: iPAQ: convert H3100 IrDA to use generic gpio support
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:24 +00:00
Russell King 0831e3e4cf ARM: iPAQ: provide a way to setup platform-controlled GPIOs
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:24 +00:00
Russell King a5d176a191 ARM: iPAQ: separate IrDA machine specifics
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:24 +00:00
Russell King 898e810ead ARM: h3600: provide each iPAQ machine type with own init function
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:24 +00:00
Russell King 7a5b4e16c8 ARM: sa11x0: convert set_xxx_data() to register_xxx()
Only register devices if we have platform data for those which require
platform data.

Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2009-12-06 16:52:23 +00:00
Jean Delvare 6471b68982 i2c-stub: Documentation update
There is nothing sensors-specific to i2c-stub.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-12-06 17:06:30 +01:00
Jean Delvare 38f41f282f i2c-stub: Allow user to disable some commands
Add a module parameter to override the functionality bitfield. This
lets the user disable some commands. This can be used to force a chip
driver to take different code paths.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-12-06 17:06:29 +01:00
Jean Delvare 4710317891 i2c-stub: Implement I2C block support
This is required to test some drivers, for example at24.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-12-06 17:06:28 +01:00
Jean Delvare 69b0089a67 i2c: Refactor for_each callbacks
Functions i2c_do_add_adapter() and __attach_adapter() do essentially
the same thing, differing only in how the parameters are passed. Same
for i2c_do_add_adapter() and __detach_adapter(). Introduce wrappers to
normalize the parameters, so that we do not have to duplicate the
code.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: David Brownell <dbrownell@users.sourceforge.net>
2009-12-06 17:06:27 +01:00
Jean Delvare 7e2193a8f9 i2c-i801: Retry on lost arbitration
The Intel 82801 is sometimes used on systems with a BMC connected. The
BMC can access the SMBus, resulting in lost arbitration for the 82801.
We should let i2c-core retry transactions for us in this case.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-12-06 17:06:27 +01:00
Vincent Sanders 9669f54194 i2c: Remove big kernel lock from i2cdev_open
The BKL is held over a kmalloc so cannot protect anything beyond that.
The two calls before the kmalloc have their own locking.
Improve device open function by removing the now unnecessary ret variable

Signed-off-by: Vincent Sanders <vince@simtec.co.uk>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-12-06 17:06:26 +01:00
Jean Delvare c2e90e9b68 ics932s401: Clean up detect function
As kind is now hard-coded to -1, there is room for code clean-ups.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Acked-by: "Darrick J. Wong" <djwong@us.ibm.com>
2009-12-06 17:06:26 +01:00
Jean Delvare ccfbbd082a i2c: Simplify i2c_detect_address
The kind parameter of i2c_detect_address() always has value -1, so we
can get rid of it.

Next step is to update all i2c detect callback functions to get rid of
this now useless parameter.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-12-06 17:06:25 +01:00
Jean Delvare c7b25a9e96 i2c: Drop probe, ignore and force module parameters
The legacy probe and force module parameters are obsolete now, the
same can be achieved using the new_device sysfs interface, which is
both more flexible and cheaper (it is implemented by i2c-core rather
than replicated in every driver module.)

The legacy ignore module parameters can be dropped as well. Ignoring
can be done by instantiating a "dummy" device at the problematic
address.

This is the first step of a huge cleanup to i2c-core's i2c_detect
function, i2c.h's I2C_CLIENT_INSMOD* macros, and all drivers that made
use of them.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-12-06 17:06:24 +01:00
Jean Delvare abe38388e5 i2c: Add missing __devinit markers to old i2c adapter drivers
These _setup functions are called from _probe so they can be marked
__devinit.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-12-06 17:06:23 +01:00
Jean Delvare da44bdeb95 i2c: Bus drivers don't have to support I2C_M_REV_DIR_ADDR
I2C bus drivers don't have to support I2C_M_REV_DIR_ADDR. It is a
deviation from the I2C specification, which only makes sense to
implement when really needed.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Ben Dooks <ben-linux@fluff.org>
2009-12-06 17:06:22 +01:00
Mika Kuoppala 194684e596 i2c: Prevent priority inversion on top of bus lock
Low priority thread holding the i2c bus mutex could block higher
priority threads to access the bus resulting in unacceptable
latencies. Change the mutex type to rt_mutex preventing priority
inversion.

Tested-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mika Kuoppala <mika.kuoppala@nokia.com>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-12-06 17:06:22 +01:00
Jean Delvare a0c11cdd6a i2c-voodoo3: Delete
Superseded by tdfxfb. I2C/DDC support used to live in a separate
driver but this caused driver conflicts.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Krzysztof Helt <krzysztof.h1@wp.pl>
2009-12-06 17:06:21 +01:00
Jean Delvare bc6286e50b i2c-powermac: Drop temporary name buffer
We no longer need to write the adapter name to a temporary buffer.
We can write it directly to the i2c_adapter's name field. This is
more efficient.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Tested-by: Michel Daenzer <michel@daenzer.net>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2009-12-06 17:06:20 +01:00
Jean Delvare 6dfa5ca3c9 i2c-powermac: Include the i2c_adapter in struct pmac_i2c_bus
Include the i2c_adapter in struct pmac_i2c_bus. This avoids memory
fragmentation and allows for several code cleanups.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Tested-by: Michel Daenzer <michel@daenzer.net>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2009-12-06 17:06:19 +01:00
Jean Delvare d7d838a6eb i2c-powermac: Log errors
Log errors when they happen, otherwise we have no idea what went
wrong.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Tested-by: Michel Daenzer <michel@daenzer.net>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
2009-12-06 17:06:18 +01:00
Jean Delvare 02864d58ce i2c-powermac: Refactor i2c_powermac_smbus_xfer
I wanted to add some error logging to the i2c-powermac driver, but
found that it was very difficult due to the way the
i2c_powermac_smbus_xfer function is organized. Refactor the code in
this function so that each low-level function is only called once.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Tested-by: Michel Daenzer <michel@daenzer.net>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
2009-12-06 17:06:17 +01:00
Jean Delvare 6f7e549f87 i2c-powermac: Reject unsupported I2C transactions
The i2c-powermac driver doesn't support arbitrary multi-message I2C
transactions, only SMBus ones. Make it clear by returning an error if
a multi-message I2C transaction is attempted. This is better than only
processing the first message, because most callers won't recover from
the short transaction. Anyone wishing to issue multi-message
transactions should use the SMBus API instead of the raw I2C API.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Tested-by: Michel Daenzer <michel@daenzer.net>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
2009-12-06 17:06:17 +01:00
Wolfram Sang dddc66ffa0 i2c/chips: Move ds1682 to drivers/misc
As i2c/chips is deprecated, move ds1682 to a more apropriate location.
Build tested.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
Signed-off-by: Jean Delvare <khali@linux-fr.org>
2009-12-06 17:06:16 +01:00
Rafael J. Wysocki 7a1a8eb58a PM: Add flag for devices capable of generating run-time wake-up events
Apparently, there are devices that can wake up the system from sleep
states and yet are incapable of generating wake-up events at run
time.  Thus, introduce a flag indicating if given device is capable
of generating run-time wake-up events.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2009-12-06 16:17:57 +01:00
Rafael J. Wysocki 965c4ac061 PM / Runtime: Remove unnecessary braces in __pm_runtime_set_status()
Some braces in __pm_runtime_set_status() are not necessary, so
remove them.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2009-12-06 16:17:57 +01:00
Rafael J. Wysocki e1b1903eee PM / Runtime: Make documentation of runtime_idle() agree with the code
Currently the ->runtime_idle() callback is documented as having no
return value, but in fact it returns int.  Although its return value
is ignored at the PM core level, it may be used by bus type routines
executing the drivers' ->runtime_idle() callbacks.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Reported-by: Alan Stern <stern@rowland.harvard.edu>
2009-12-06 16:17:57 +01:00
Rafael J. Wysocki 0ddf0ed1d4 PM / Runtime: Ensure timer_expires is nonzero in pm_schedule_suspend()
The runtime PM core code assumes that dev->power.timer_expires is
nonzero when the timer is scheduled, but it may become zero
incidentally in pm_schedule_suspend().  Prevent this from happening
by bumping dev->power.timer_expires up to 1 if it's 0 before calling
mod_timer().

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Reported-by: Alan Stern <stern@rowland.harvard.edu>
2009-12-06 16:17:56 +01:00
Alan Stern 63c9480170 PM / Runtime: Use deferred_resume flag in pm_request_resume
This patch (as1307) adds a small optimization to
__pm_request_resume().  If the device is currently being suspended,
there's no need to queue a work routine to resume it.  Setting the
deferred_resume flag will suffice.  (There's also a minor improvement
to the function's code layout: An unnecessary "else" is removed.)

Also, the patch clarifies the usage of the deferred_resume flag.  It
is meaningful only while a suspend is in progress, so it should be
cleared just before a suspend starts, not just after one ends.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2009-12-06 16:17:56 +01:00
Alan Stern 7b199ca202 PM / Runtime: Export the PM runtime workqueue
This patch (as1306) exports the PM runtime workqueue for use by
loadable modules.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
2009-12-06 16:17:56 +01:00