Adrian Hunter
e2bf08d643
omap_hsmmc: set a large data timeout for commands with busy signal
...
Commands like SWITCH (CMD6) send a response and then signal busy while the
operation is completed. These commands are expected to always succeed
(otherwise the response would have indicated an error).
Set an arbitrarily large data timeout value (100ms) for these commands to
ensure that premature timeouts do not occur.
Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com >
Acked-by: Matt Fleming <matt@console-pimps.org >
Cc: Ian Molton <ian@mnementh.co.uk >
Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com >
Cc: Jarkko Lavinen <jarkko.lavinen@nokia.com >
Cc: Denis Karpov <ext-denis.2.karpov@nokia.com >
Cc: Pierre Ossman <pierre@ossman.eu >
Cc: Philip Langdale <philipl@overt.org >
Cc: "Madhusudhan" <madhu.cr@ti.com >
Cc: <linux-mmc@vger.kernel.org >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:36 -07:00
Adrian Hunter
2bec08937e
omap_hsmmc: ensure all clock enables and disables are paired
...
[madhu.cr@ti.com: fix for the db clock failure message]
Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
Acked-by: Matt Fleming <matt@console-pimps.org>
Cc: Ian Molton <ian@mnementh.co.uk>
Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com>
Cc: Jarkko Lavinen <jarkko.lavinen@nokia.com>
Cc: Denis Karpov <ext-denis.2.karpov@nokia.com>
Cc: Pierre Ossman <pierre@ossman.eu>
Cc: Philip Langdale <philipl@overt.org>
Cc: "Madhusudhan" <madhu.cr@ti.com>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: Madhusudhan Chikkature <madhu.cr@ti.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-23 07:39:36 -07:00
Adrian Hunter
b62f622812
omap_hsmmc: protect the card when the cover is open
...
Depending on the manufacturer, there is a small possibility that removing
a card while it is being written to, can render the card permanently
unusable. To prevent that, the card is made inaccessible when the cover
is open.
Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com >
Acked-by: Matt Fleming <matt@console-pimps.org >
Cc: Ian Molton <ian@mnementh.co.uk >
Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com >
Cc: Jarkko Lavinen <jarkko.lavinen@nokia.com >
Cc: Denis Karpov <ext-denis.2.karpov@nokia.com >
Cc: Pierre Ossman <pierre@ossman.eu >
Cc: Philip Langdale <philipl@overt.org >
Cc: "Madhusudhan" <madhu.cr@ti.com >
Cc: <linux-mmc@vger.kernel.org >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:36 -07:00
Denis Karpov
70a3341a71
omap_hsmmc: code refactoring
...
Functions', structures', variables' names are changed to start with
omap_hsmmc_ prefix.
Signed-off-by: Denis Karpov <ext-denis.2.karpov@nokia.com >
Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com >
Acked-by: Matt Fleming <matt@console-pimps.org >
Cc: Ian Molton <ian@mnementh.co.uk >
Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com >
Cc: Jarkko Lavinen <jarkko.lavinen@nokia.com >
Cc: Denis Karpov <ext-denis.2.karpov@nokia.com >
Cc: Pierre Ossman <pierre@ossman.eu >
Cc: Philip Langdale <philipl@overt.org >
Cc: "Madhusudhan" <madhu.cr@ti.com >
Cc: <linux-mmc@vger.kernel.org >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:35 -07:00
Adrian Hunter
4dffd7a251
omap_hsmmc: prevent races with irq handler
...
If an unexpected interrupt occurs while preparing the next request, an
oops can occur.
For example, a new request is setting up DMA for data transfer so
host->data is not NULL. An unexpected transfer complete (TC) interrupt
comes along and the interrupt handler sets host->data to NULL. Oops!
Prevent that by adding a spinlock.
Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com >
Acked-by: Matt Fleming <matt@console-pimps.org >
Cc: Ian Molton <ian@mnementh.co.uk >
Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com >
Cc: Jarkko Lavinen <jarkko.lavinen@nokia.com >
Cc: Denis Karpov <ext-denis.2.karpov@nokia.com >
Cc: Pierre Ossman <pierre@ossman.eu >
Cc: Philip Langdale <philipl@overt.org >
Cc: "Madhusudhan" <madhu.cr@ti.com >
Cc: <linux-mmc@vger.kernel.org >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:35 -07:00
Adrian Hunter
23050103c2
omap_hsmmc: cater for weird CMD6 behaviour
...
Sometimes the controller unexpectedly produces a TC (transfer complete)
interrupt before the CC (command complete) interrupt for command 6
(SWITCH). This is a problem because the CC interrupt can get mixed up
with the next request. Add a hack for CMD6.
Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com >
Acked-by: Matt Fleming <matt@console-pimps.org >
Cc: Ian Molton <ian@mnementh.co.uk >
Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com >
Cc: Jarkko Lavinen <jarkko.lavinen@nokia.com >
Cc: Denis Karpov <ext-denis.2.karpov@nokia.com >
Cc: Pierre Ossman <pierre@ossman.eu >
Cc: Philip Langdale <philipl@overt.org >
Cc: "Madhusudhan" <madhu.cr@ti.com >
Cc: <linux-mmc@vger.kernel.org >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:35 -07:00
Adrian Hunter
c653a6d4d1
omap_hsmmc: clear interrupt status after init sequence
...
Clear the interrupt status after sending the initialization sequence, as
specified in the TRM.
Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com >
Acked-by: Matt Fleming <matt@console-pimps.org >
Cc: Ian Molton <ian@mnementh.co.uk >
Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com >
Cc: Jarkko Lavinen <jarkko.lavinen@nokia.com >
Cc: Denis Karpov <ext-denis.2.karpov@nokia.com >
Cc: Pierre Ossman <pierre@ossman.eu >
Cc: Philip Langdale <philipl@overt.org >
Cc: "Madhusudhan" <madhu.cr@ti.com >
Cc: <linux-mmc@vger.kernel.org >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:35 -07:00
Denis Karpov
191d1f1de1
omap_hsmmc: cleanup macro usage
...
Use macro mmc_slot() in omap_hsmmc.
Signed-off-by: Denis Karpov <ext-denis.2.karpov@nokia.com >
Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com >
Acked-by: Matt Fleming <matt@console-pimps.org >
Cc: Ian Molton <ian@mnementh.co.uk >
Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com >
Cc: Jarkko Lavinen <jarkko.lavinen@nokia.com >
Cc: Denis Karpov <ext-denis.2.karpov@nokia.com >
Cc: Pierre Ossman <pierre@ossman.eu >
Cc: Philip Langdale <philipl@overt.org >
Cc: "Madhusudhan" <madhu.cr@ti.com >
Cc: <linux-mmc@vger.kernel.org >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:35 -07:00
Jarkko Lavinen
0a40e64786
omap_hsmmc: fix NULL pointer dereference
...
Do not call 'mmc_omap_xfer_done()' if the request is already done.
Signed-off-by: Jarkko Lavinen <jarkko.lavinen@nokia.com >
Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com >
Acked-by: Matt Fleming <matt@console-pimps.org >
Cc: Ian Molton <ian@mnementh.co.uk >
Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com >
Cc: Jarkko Lavinen <jarkko.lavinen@nokia.com >
Cc: Denis Karpov <ext-denis.2.karpov@nokia.com >
Cc: Pierre Ossman <pierre@ossman.eu >
Cc: Philip Langdale <philipl@overt.org >
Cc: "Madhusudhan" <madhu.cr@ti.com >
Cc: <linux-mmc@vger.kernel.org >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:35 -07:00
Jarkko Lavinen
13189e78ca
omap_hsmmc: add mmc card sleep and awake support
...
After 1 second of inactivity, put card and/or regulator to sleep. After 8
seconds of inactivity, turn off the power.
Signed-off-by: Jarkko Lavinen <jarkko.lavinen@nokia.com >
Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com >
Acked-by: Matt Fleming <matt@console-pimps.org >
Cc: Ian Molton <ian@mnementh.co.uk >
Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com >
Cc: Jarkko Lavinen <jarkko.lavinen@nokia.com >
Cc: Denis Karpov <ext-denis.2.karpov@nokia.com >
Cc: Pierre Ossman <pierre@ossman.eu >
Cc: Philip Langdale <philipl@overt.org >
Cc: "Madhusudhan" <madhu.cr@ti.com >
Cc: <linux-mmc@vger.kernel.org >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:35 -07:00
Adrian Hunter
623821f71b
omap_hsmmc: put MMC regulator to sleep
...
When a card is not in use, the voltage regulator can be put to sleep.
This is an alternative to powering the card off, when powering off is not
safe because the card might be replaced without the driver being aware of
it.
That situation happens if:
- the card is removable i.e. not eMMC
- and there is no card detect
- and there is a cover switch but the cover is open
Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com >
Acked-by: Matt Fleming <matt@console-pimps.org >
Cc: Ian Molton <ian@mnementh.co.uk >
Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com >
Cc: Jarkko Lavinen <jarkko.lavinen@nokia.com >
Cc: Denis Karpov <ext-denis.2.karpov@nokia.com >
Cc: Pierre Ossman <pierre@ossman.eu >
Cc: Philip Langdale <philipl@overt.org >
Cc: "Madhusudhan" <madhu.cr@ti.com >
Cc: <linux-mmc@vger.kernel.org >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:35 -07:00
Denis Karpov
dd498effcf
omap_hsmmc: support for deeper power saving states
...
Support for multi-level dynamic power saving states in omap_hsmmc
(ENABLED->DISABLED->OFF). In the "deepest" state (OFF) we switch off the
voltage regulators.
Signed-off-by: Denis Karpov <ext-denis.2.karpov@nokia.com >
Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com >
Acked-by: Matt Fleming <matt@console-pimps.org >
Cc: Ian Molton <ian@mnementh.co.uk >
Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com >
Cc: Jarkko Lavinen <jarkko.lavinen@nokia.com >
Cc: Denis Karpov <ext-denis.2.karpov@nokia.com >
Cc: Pierre Ossman <pierre@ossman.eu >
Cc: Philip Langdale <philipl@overt.org >
Cc: "Madhusudhan" <madhu.cr@ti.com >
Cc: <linux-mmc@vger.kernel.org >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:35 -07:00
Adrian Hunter
23d99bb923
omap_hsmmc: make use of new MMC_CAP_NONREMOVABLE host capability
...
Let the board specify that a card is nonremovable e.g. eMMC
Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com >
Acked-by: Matt Fleming <matt@console-pimps.org >
Cc: Ian Molton <ian@mnementh.co.uk >
Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com >
Cc: Jarkko Lavinen <jarkko.lavinen@nokia.com >
Cc: Denis Karpov <ext-denis.2.karpov@nokia.com >
Cc: Pierre Ossman <pierre@ossman.eu >
Cc: Philip Langdale <philipl@overt.org >
Cc: "Madhusudhan" <madhu.cr@ti.com >
Cc: <linux-mmc@vger.kernel.org >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:35 -07:00
Jarkko Lavinen
a3f406f861
omap_hsmmc: fix scatter-gather list sanity checking
...
Do not use host->dma_len when it is uninitialzed. Finish the request with
an error if the mmc_omap_prepare_data() fails.
Signed-off-by: Jarkko Lavinen <jarkko.lavinen@nokia.com >
Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com >
Acked-by: Matt Fleming <matt@console-pimps.org >
Cc: Ian Molton <ian@mnementh.co.uk >
Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com >
Cc: Jarkko Lavinen <jarkko.lavinen@nokia.com >
Cc: Denis Karpov <ext-denis.2.karpov@nokia.com >
Cc: Pierre Ossman <pierre@ossman.eu >
Cc: Philip Langdale <philipl@overt.org >
Cc: "Madhusudhan" <madhu.cr@ti.com >
Cc: <linux-mmc@vger.kernel.org >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:34 -07:00
Adrian Hunter
a6b2240da2
omap_hsmmc: ensure workqueues are empty before suspend
...
Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com >
Acked-by: Matt Fleming <matt@console-pimps.org >
Cc: Ian Molton <ian@mnementh.co.uk >
Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com >
Cc: Jarkko Lavinen <jarkko.lavinen@nokia.com >
Cc: Denis Karpov <ext-denis.2.karpov@nokia.com >
Cc: Pierre Ossman <pierre@ossman.eu >
Cc: Philip Langdale <philipl@overt.org >
Cc: "Madhusudhan" <madhu.cr@ti.com >
Cc: <linux-mmc@vger.kernel.org >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:34 -07:00
Denis Karpov
abb28e731a
omap_hsmmc: set open drain bit correctly
...
The code could set the bit to 1 but not reset it to 0.
Signed-off-by: Denis Karpov <ext-denis.2.karpov@nokia.com >
Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com >
Acked-by: Matt Fleming <matt@console-pimps.org >
Cc: Ian Molton <ian@mnementh.co.uk >
Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com >
Cc: Jarkko Lavinen <jarkko.lavinen@nokia.com >
Cc: Denis Karpov <ext-denis.2.karpov@nokia.com >
Cc: Pierre Ossman <pierre@ossman.eu >
Cc: Philip Langdale <philipl@overt.org >
Cc: "Madhusudhan" <madhu.cr@ti.com >
Cc: <linux-mmc@vger.kernel.org >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:34 -07:00
Denis Karpov
11dd62a741
omap_hsmmc: context save/restore support
...
Keep the context over PM dynamic OFF states.
Signed-off-by: Denis Karpov <ext-denis.2.karpov@nokia.com >
Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com >
Acked-by: Matt Fleming <matt@console-pimps.org >
Cc: Ian Molton <ian@mnementh.co.uk >
Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com >
Cc: Jarkko Lavinen <jarkko.lavinen@nokia.com >
Cc: Denis Karpov <ext-denis.2.karpov@nokia.com >
Cc: Pierre Ossman <pierre@ossman.eu >
Cc: Philip Langdale <philipl@overt.org >
Cc: "Madhusudhan" <madhu.cr@ti.com >
Cc: <linux-mmc@vger.kernel.org >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:34 -07:00
Adrian Hunter
a3621465b4
omap_hsmmc: keep track of power mode
...
This patch is preparation for adding context save and restore support.
Keep track of the current power mode so that the context restore function
can avoid restoring the context for a card if the power has been switched
off. If the power is off, the card must be reinitialized anyway which
will re-establish the context.
Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com >
Acked-by: Matt Fleming <matt@console-pimps.org >
Cc: Ian Molton <ian@mnementh.co.uk >
Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com >
Cc: Jarkko Lavinen <jarkko.lavinen@nokia.com >
Cc: Denis Karpov <ext-denis.2.karpov@nokia.com >
Cc: Pierre Ossman <pierre@ossman.eu >
Cc: Philip Langdale <philipl@overt.org >
Cc: "Madhusudhan" <madhu.cr@ti.com >
Cc: <linux-mmc@vger.kernel.org >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:34 -07:00
Adrian Hunter
5e2ea6173d
omap_hsmmc: make use of new enable/disable interface
...
For the moment enable / disable just turns the fclk on and off.
Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com >
Acked-by: Matt Fleming <matt@console-pimps.org >
Cc: Ian Molton <ian@mnementh.co.uk >
Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com >
Cc: Jarkko Lavinen <jarkko.lavinen@nokia.com >
Cc: Denis Karpov <ext-denis.2.karpov@nokia.com >
Cc: Pierre Ossman <pierre@ossman.eu >
Cc: Philip Langdale <philipl@overt.org >
Cc: "Madhusudhan" <madhu.cr@ti.com >
Cc: <linux-mmc@vger.kernel.org >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:34 -07:00
Denis Karpov
d900f7128c
omap_hsmmc: add debugfs entry (host registers)
...
Adds <debugfs_root>/kernel/debug/mmc<N>/regs entry, contents show
registers' state and some driver internal state variables.
Signed-off-by: Denis Karpov <ext-denis.2.karpov@nokia.com >
Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com >
Acked-by: Matt Fleming <matt@console-pimps.org >
Cc: Ian Molton <ian@mnementh.co.uk >
Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com >
Cc: Jarkko Lavinen <jarkko.lavinen@nokia.com >
Cc: Denis Karpov <ext-denis.2.karpov@nokia.com >
Cc: Pierre Ossman <pierre@ossman.eu >
Cc: Philip Langdale <philipl@overt.org >
Cc: "Madhusudhan" <madhu.cr@ti.com >
Cc: <linux-mmc@vger.kernel.org >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:34 -07:00
Adrian Hunter
ef0b27d4cc
mmc: check status after MMC SWITCH command
...
According to the standard, the SWITCH command should be followed by a
SEND_STATUS command to check for errors.
Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com >
Acked-by: Matt Fleming <matt@console-pimps.org >
Cc: Ian Molton <ian@mnementh.co.uk >
Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com >
Cc: Jarkko Lavinen <jarkko.lavinen@nokia.com >
Cc: Denis Karpov <ext-denis.2.karpov@nokia.com >
Cc: Pierre Ossman <pierre@ossman.eu >
Cc: Philip Langdale <philipl@overt.org >
Cc: "Madhusudhan" <madhu.cr@ti.com >
Cc: <linux-mmc@vger.kernel.org >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:34 -07:00
Denis Karpov
53509f0fe2
mmc: power off once at removal
...
Fix MMC host stop sequence: power off once.
Signed-off-by: Denis Karpov <ext-denis.2.karpov@nokia.com >
Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com >
Acked-by: Matt Fleming <matt@console-pimps.org >
Cc: Ian Molton <ian@mnementh.co.uk >
Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com >
Cc: Jarkko Lavinen <jarkko.lavinen@nokia.com >
Cc: Denis Karpov <ext-denis.2.karpov@nokia.com >
Cc: Pierre Ossman <pierre@ossman.eu >
Cc: Philip Langdale <philipl@overt.org >
Cc: "Madhusudhan" <madhu.cr@ti.com >
Cc: <linux-mmc@vger.kernel.org >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:34 -07:00
Jarkko Lavinen
b1ebe38456
mmc: add mmc card sleep and awake support
...
Add support for the new MMC command SLEEP_AWAKE.
Signed-off-by: Jarkko Lavinen <jarkko.lavinen@nokia.com >
Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com >
Acked-by: Matt Fleming <matt@console-pimps.org >
Cc: Ian Molton <ian@mnementh.co.uk >
Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com >
Cc: Jarkko Lavinen <jarkko.lavinen@nokia.com >
Cc: Denis Karpov <ext-denis.2.karpov@nokia.com >
Cc: Pierre Ossman <pierre@ossman.eu >
Cc: Philip Langdale <philipl@overt.org >
Cc: "Madhusudhan" <madhu.cr@ti.com >
Cc: <linux-mmc@vger.kernel.org >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:33 -07:00
Adrian Hunter
eae1aeeed8
mmc: add ability to save power by powering off cards
...
Power can be saved by powering off cards that are not in use. This is
similar to suspend / resume except it is under the control of the driver,
and does not require any power management support. It can only be used
when the driver can monitor whether the card is removed, otherwise it is
unsafe. This is possible because, unlike suspend, the driver still
receives card detect and / or cover switch interrupts.
Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com >
Acked-by: Matt Fleming <matt@console-pimps.org >
Cc: Ian Molton <ian@mnementh.co.uk >
Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com >
Cc: Jarkko Lavinen <jarkko.lavinen@nokia.com >
Cc: Denis Karpov <ext-denis.2.karpov@nokia.com >
Cc: Pierre Ossman <pierre@ossman.eu >
Cc: Philip Langdale <philipl@overt.org >
Cc: "Madhusudhan" <madhu.cr@ti.com >
Cc: <linux-mmc@vger.kernel.org >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:33 -07:00
Adrian Hunter
9feae24696
mmc: add MMC_CAP_NONREMOVABLE host capability
...
eMMC's are not removable, so unsafe resume is OK always.
To permit this a new host capability MMC_CAP_NONREMOVABLE has been added
and suspend / resume updated accordingly.
Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com >
Acked-by: Matt Fleming <matt@console-pimps.org >
Cc: Ian Molton <ian@mnementh.co.uk >
Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com >
Cc: Jarkko Lavinen <jarkko.lavinen@nokia.com >
Cc: Denis Karpov <ext-denis.2.karpov@nokia.com >
Cc: Pierre Ossman <pierre@ossman.eu >
Cc: Philip Langdale <philipl@overt.org >
Cc: "Madhusudhan" <madhu.cr@ti.com >
Cc: <linux-mmc@vger.kernel.org >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:33 -07:00
Adrian Hunter
319a3f1429
mmc: allow host claim / release nesting
...
This change allows the MMC host to be claimed in situations where the host
may or may not have already been claimed. Also 'mmc_try_claim_host()' is
now exported.
Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com >
Acked-by: Matt Fleming <matt@console-pimps.org >
Cc: Ian Molton <ian@mnementh.co.uk >
Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com >
Cc: Jarkko Lavinen <jarkko.lavinen@nokia.com >
Cc: Denis Karpov <ext-denis.2.karpov@nokia.com >
Cc: Pierre Ossman <pierre@ossman.eu >
Cc: Philip Langdale <philipl@overt.org >
Cc: "Madhusudhan" <madhu.cr@ti.com >
Cc: <linux-mmc@vger.kernel.org >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:33 -07:00
Adrian Hunter
8ea926b22e
mmc: add 'enable' and 'disable' methods to mmc host
...
MMC hosts that support power saving can use the 'enable' and 'disable'
methods to exit and enter power saving states. An explanation of their
use is provided in the comments added to include/linux/mmc/host.h.
Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com >
Acked-by: Matt Fleming <matt@console-pimps.org >
Cc: Ian Molton <ian@mnementh.co.uk >
Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com >
Cc: Jarkko Lavinen <jarkko.lavinen@nokia.com >
Cc: Denis Karpov <ext-denis.2.karpov@nokia.com >
Cc: Pierre Ossman <pierre@ossman.eu >
Cc: Philip Langdale <philipl@overt.org >
Cc: "Madhusudhan" <madhu.cr@ti.com >
Cc: <linux-mmc@vger.kernel.org >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:33 -07:00
Ohad Ben-Cohen
27cce39f55
sdio: do not ignore MMC_VDD_165_195
...
This is needed for 1.8V embedded SDIO devices and supporting host controllers
(e.g. TI 127x and ZOOM2 boards)
Signed-off-by: Ohad Ben-Cohen <ohad@bencohen.org >
Acked-by: Matt Fleming <matt@console-pimps.org >
Cc: Ian Molton <ian@mnementh.co.uk >
Cc: Pierre Ossman <pierre@ossman.eu >
Cc: Ian Molton <ian@mnementh.co.uk >
Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com >
Cc: Philip Langdale <philipl@overt.org >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:33 -07:00
Uwe Kleine-König
f400cd8c84
mmc: register mmci-omap-hs using platform_driver_probe
...
omap_mmc_probe lives in .init.text, so using platform_driver_register to
register it is wrong because binding a device after the init memory is
discarded (e.g. via sysfs) results in an oops.
As requested by David Brownell platform_driver_probe is used instead of
moving the probe function to .devinit.text as proposed initially. This
saves some memory, but devices registered after the driver is probed are
not bound (probably there are none) and binding via sysfs isn't possible.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de >
Cc: Jean Pihet <jpihet@mvista.com >
Cc: Tony Lindgren <tony@atomide.com >
Cc: Pierre Ossman <drzeus@drzeus.cx >
Cc: Andy Lowe <alowe@mvista.com >
Cc: Adrian Hunter <ext-adrian.hunter@nokia.com >
Cc: Andrew Morton <akpm@linux-foundation.org >
Acked-by: David Brownell <dbrownell@users.sourceforge.net >
Cc: Madhusudhan Chikkature<madhu.cr@ti.com >
Cc: Greg Kroah-Hartman <gregkh@suse.de >
Cc: Matt Fleming <matt@console-pimps.org >
Cc: Ian Molton <ian@mnementh.co.uk >
Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com >
Cc: Philip Langdale <philipl@overt.org >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:33 -07:00
Joe Perches
b5a74d6058
msm_sdcc.c: move overly indented code to separate function
...
Signed-off-by: Joe Perches <joe@perches.com >
Cc: Pavel Machek <pavel@ucw.cz >
Cc: Brian Swetland <swetland@google.com >
Cc: Pierre Ossman <drzeus-list@drzeus.cx >
Cc: San Mehat <san@android.com >
Cc: Matt Fleming <matt@console-pimps.org >
Cc: Ian Molton <ian@mnementh.co.uk >
Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com >
Cc: Philip Langdale <philipl@overt.org >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:33 -07:00
Joe Perches
75d145283b
msm_sdcc.c: stylistic cleaning
...
Make it a bit more like typical kernel style.
Signed-off-by: Joe Perches <joe@perches.com >
Cc: Pavel Machek <pavel@ucw.cz >
Cc: Brian Swetland <swetland@google.com >
Cc: Pierre Ossman <drzeus-list@drzeus.cx >
Cc: San Mehat <san@android.com >
Cc: Matt Fleming <matt@console-pimps.org >
Cc: Ian Molton <ian@mnementh.co.uk >
Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com >
Cc: Philip Langdale <philipl@overt.org >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:33 -07:00
Joe Perches
0a7ff7c757
msm_sdcc.c: convert printk(KERN_<level> to pr_<level>(
...
Signed-off-by: Joe Perches <joe@perches.com >
Cc: Pavel Machek <pavel@ucw.cz >
Cc: Brian Swetland <swetland@google.com >
Cc: Pierre Ossman <drzeus-list@drzeus.cx >
Cc: San Mehat <san@android.com >
Cc: Matt Fleming <matt@console-pimps.org >
Cc: Ian Molton <ian@mnementh.co.uk >
Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com >
Cc: Philip Langdale <philipl@overt.org >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:33 -07:00
San Mehat
9d2bd7383c
mmc: msm_sdccc: driver for HTC Dream
...
MMC Driver for HTC Dream. I picked the code up from Google git trees,
removed stuff not strictly necessary, and did a few cleanups. It still
works :-).
Signed-off-by: Pavel Machek <pavel@ucw.cz >
Cc: Brian Swetland <swetland@google.com >
Cc: Pierre Ossman <drzeus-list@drzeus.cx >
Cc: Joe Perches <joe@perches.com >
Cc: Matt Fleming <matt@console-pimps.org >
Cc: Ian Molton <ian@mnementh.co.uk >
Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com >
Cc: Philip Langdale <philipl@overt.org >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:32 -07:00
Anand Gadiyar
ccdfe3a66a
OMAP: HSMMC: do not enable buffer ready interrupt if using DMA
...
This considerably reduces the number of interrupts during a transfer
and ought to result in some power saving.
Signed-off-by: Anand Gadiyar <gadiyar@ti.com >
Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com >
Acked-by: Kishore Kadiyala <kishore.kadiyala@ti.com >
Cc: Pierre Ossman <drzeus@drzeus.cx >
Cc: Matt Fleming <matt@console-pimps.org >
Cc: Ian Molton <ian@mnementh.co.uk >
Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com >
Cc: Philip Langdale <philipl@overt.org >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:32 -07:00
Balaji Rao
500f35648e
mmc: in mmc_power_up(), use previously selected ocr if available
...
When mmc_power_up is called during unsafe resume, host->ocr should be used
instead of host->ocr_avail.
Signed-off-by: Balaji Rao <balajirrao@openmoko.org >
Cc: Andy Green <andy@openmoko.com >
Cc: Pierre Ossman <drzeus-mmc@drzeus.cx >
Cc: Ian Molton <ian@mnementh.co.uk >
Cc: "Roberto A. Foglietta" <roberto.foglietta@gmail.com >
Cc: Philip Langdale <philipl@overt.org >
Acked-by: Matt Fleming <matt@console-pimps.org >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:32 -07:00
Jaswinder Singh Rajput
54447c3e8f
vlynq: includecheck fix: drivers/vlynq/vlynq.c
...
Fix the following 'make includecheck' warning:
drivers/vlynq/vlynq.c: linux/device.h is included more than once.
Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com >
Signed-off-by: Florian Fainelli <florian@openwrt.org >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:30 -07:00
Jan Beulich
8c87df457c
BUILD_BUG_ON(): fix it and a couple of bogus uses of it
...
gcc permitting variable length arrays makes the current construct used for
BUILD_BUG_ON() useless, as that doesn't produce any diagnostic if the
controlling expression isn't really constant. Instead, this patch makes
it so that a bit field gets used here. Consequently, those uses where the
condition isn't really constant now also need fixing.
Note that in the gfp.h, kmemcheck.h, and virtio_config.h cases
MAYBE_BUILD_BUG_ON() really just serves documentation purposes - even if
the expression is compile time constant (__builtin_constant_p() yields
true), the array is still deemed of variable length by gcc, and hence the
whole expression doesn't have the intended effect.
[akpm@linux-foundation.org: make arch/sparc/include/asm/vio.h compile]
[akpm@linux-foundation.org: more nonsensical assertions in tpm.c..]
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Rajiv Andrade <srajiv@linux.vnet.ibm.com>
Cc: Mimi Zohar <zohar@us.ibm.com>
Cc: James Morris <jmorris@namei.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-23 07:39:29 -07:00
Scott James Remnant
02b51df1b0
proc connector: add event for process becoming session leader
...
The act of a process becoming a session leader is a useful signal to a
supervising init daemon such as Upstart.
While a daemon will normally do this as part of the process of becoming a
daemon, it is rare for its children to do so. When the children do, it is
nearly always a sign that the child should be considered detached from the
parent and not supervised along with it.
The poster-child example is OpenSSH; the per-login children call setsid()
so that they may control the pty connected to them. If the primary daemon
dies or is restarted, we do not want to consider the per-login children
and want to respawn the primary daemon without killing the children.
This patch adds a new PROC_SID_EVENT and associated structure to the
proc_event event_data union, it arranges for this to be emitted when the
special PIDTYPE_SID pid is set.
[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Scott James Remnant <scott@ubuntu.com>
Acked-by: Matt Helsley <matthltc@us.ibm.com>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Cc: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Acked-by: "David S. Miller" <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-23 07:39:29 -07:00
James Morris
88e9d34c72
seq_file: constify seq_operations
...
Make all seq_operations structs const, to help mitigate against
revectoring user-triggerable function pointers.
This is derived from the grsecurity patch, although generated from scratch
because it's simpler than extracting the changes from there.
Signed-off-by: James Morris <jmorris@namei.org >
Acked-by: Serge Hallyn <serue@us.ibm.com >
Acked-by: Casey Schaufler <casey@schaufler-ca.com >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:29 -07:00
Roel Kluin
912e837aef
dme1737: Keep index within pwm_config[]
...
The static code scanner "Parfait" reported this because pwm_config is
only 3 bytes - pwm_config[3] is out of range.
Since this code path is never called with ix == 3 (the device has no PWM4
output) this doesn't change anything in practice. But to encourage
testing with Parfait, lets make the warning go away...
Signed-off-by: Roel Kluin <roel.kluin@gmail.com >
Acked-by: Jean Delvare <khali@linux-fr.org >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:28 -07:00
Michael Buesch
e898893399
dac960: fix undefined behavior on empty string
...
Fix undefined behavior due to a buffer underrun if an empty string is
written to the proc file.
Signed-off-by: Michael Buesch <mb@bu3sch.de >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:28 -07:00
M. Mohan Kumar
f58f2fa928
kprobes: use do_IRQ() in lkdtm
...
Current lkdtm code puts a probe on __do_IRQ for some of the kdump test
cases. Since __do_IRQ is deprecated, change lkdtm code to use do_IRQ
function.
Signed-off-by: M. Mohan Kumar <mohan@in.ibm.com >
Cc: Ankita Garg <ankita@in.ibm.com >
Cc: Ingo Molnar <mingo@elte.hu >
Cc: Ananth N Mavinakayanahalli <ananth@in.ibm.com >
Cc: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com >
Cc: "David S. Miller" <davem@davemloft.net >
Cc: Masami Hiramatsu <mhiramat@redhat.com >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org >
2009-09-23 07:39:27 -07:00
Greg Kroah-Hartman
3ae9da1c99
USB: skeleton: fix coding style issues.
...
This fixes up the majority of the coding style issues in the
usb-skeleton driver.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de >
2009-09-23 06:46:40 -07:00
Oliver Neukum
8cd0166434
USB: O_NONBLOCK in read path of skeleton
...
Non blocking IO is supported in the read path of usb-skeleton.
This is done by just not blocking. As support for handling signals
without stopping IO is already there, it can be used for O_NONBLOCK, too.
Signed-off-by: Oliver Neukum <oliver@neukum.org >
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de >
2009-09-23 06:46:40 -07:00
Oliver Neukum
7981998673
USB: make usb-skeleton honor O_NONBLOCK in write path
...
usb:usb-skeleton: honor O_NONBLOCK in write path
nonblocking writes are allowed by using down_trylock if necessary
to reserve an URB
Signed-off-by: Oliver Neukum <oliver@neukum.org >
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de >
2009-09-23 06:46:40 -07:00
Oliver Neukum
e7389cc9a7
USB: skel_read really sucks royally
...
The read code path of the skeleton driver really sucks
- skel_read works only for devices which always send data
- the timeout comes out of thin air
- it blocks signals for the duration of the timeout
- it disallows nonblocking IO by design
This patch fixes it by using a real urb, a completion and interruptible waits.
Signed-off-by: Oliver Neukum <oliver@neukum.org >
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de >
2009-09-23 06:46:40 -07:00
Sarah Sharp
b356b7c769
USB: Add hub descriptor update hook for xHCI
...
Add a hook for updating xHCI internal structures after khubd fetches the
hub descriptor and sets up the hub's TT information. The xHCI driver must
update the internal structures before devices under the hub can be
enumerated.
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de >
2009-09-23 06:46:40 -07:00
Sarah Sharp
ac1c1b7f16
USB: xhci: Support USB hubs.
...
For a USB hub to work under an xHCI host controller, the xHC's internal
scheduler must be made aware of the hub's characteristics. Add an xHCI
hook that the USB core will call after it fetches the hub descriptor.
This hook will add hub information to the slot context for that device,
including whether it has multiple TTs or a single TT, the number of ports
on the hub, and TT think time.
Setting up the slot context for the device is different for 0.95 and 0.96
xHCI host controllers.
Some of the slot context reserved fields in the 0.95 specification were
changed into hub fields in the 0.96 specification. Don't set the TT think
time or number of ports for a hub if we're dealing with a 0.95-compliant
xHCI host controller.
The 0.95 xHCI specification says that to modify the hub flag, we need to
issue an evaluate context command. The 0.96 specification says that flag
can be set with a configure endpoint command. Issue the correct command
based on the version reported by the hardware.
This patch does not add support for multi-TT hubs. Multi-TT hubs expose
a single TT on alt setting 0, and multi-TT on alt setting 1. The xHCI
driver can't handle setting alternate interfaces yet.
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de >
2009-09-23 06:46:40 -07:00
Sarah Sharp
07b6de1028
USB: xhci: Set multi-TT field for LS/FS devices under hubs.
...
When setting up a slot context for an address device command, set the
multi-TT field if this is a low or full speed device under a HS hub with
multiple transaction translators.
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de >
2009-09-23 06:46:40 -07:00
Sarah Sharp
4a0cd9670f
USB: xhci: Set route string for all devices.
...
The xHCI driver needs to set the route string in the slot context of all
devices, not just SuperSpeed devices. The route string concept was added
in the USB 3.0 specification, section 10.1.3.2. Each hub in the topology
is expected to have no more than 15 ports in order for the route string of
a device to be unique. SuperSpeed hubs are restricted to only having 15
ports, but FS/LS/HS hubs are not. The xHCI specification says that if the
port number the device is under is greater than 15, that portion of the
route string shall be set to 15.
Signed-off-by: Sarah Sharp <sarah.a.sharp@linux.intel.com >
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de >
2009-09-23 06:46:40 -07:00