GTA04 - enable VSIM regulator for GSM

Otherwise aerial doesn't receive enough power.

Signed-off-by: NeilBrown <neilb@suse.de>
gpio-keys: ensure we don't miss key-presses during resume.

If the latency of resume means we don't poll the key status until
after it has been released, we can lose the keypress which woke the
device.

So on each interrupt, record that a press is pending, and in that
case, report both the up and down event.  One might be swallowed by
the input layer if there was no change, but the result will be that
every interrupt will produce at least one event.

Signed-off-by: NeilBrown <neilb@suse.de>
HSO: only disable net on suspend if enabled.
Revert "HSO: allow power-save"

This reverts commit 8446a5252c21648d80c10282fe555f310c861904.

Turns out it is more trouble than it is worth - makes modem unreliable.

Signed-off-by: NeilBrown <neilb@suse.de>
Revert "OMAP:HACK - don't let CORE go to off-mode the first time."

This reverts commit 1e1660118ffd7696b30760b527ab79fa0b3b9c8a.

off mode isn't reliable after all.

Signed-off-by: NeilBrown <neilb@suse.de>
Revert "GTA04 enable off mode"

This reverts commit 14a2f822c6782edb222cef918229cf826e3217f4.

Off mode isn't reliable after all

Signed-off-by: NeilBrown <neilb@suse.de>
twl4030_charger: fix buglet in converting current to reg setting.

As 'cgain' is a bool, it is not appropriate to 'and' with anything.
Just test it.

This has not practical effect as the CGAIN bit is currently never set.

Signed-off-by: NeilBrown <neilb@suse.de>
twl4030_charger:  default for USB2 is 500mA, not 600.

By default we only charge with 100mA.
If 'allow_usb' is set, we now default to 500mA.

If default_usb_current is set, we use that, but at least 500mA if
allow_usb.

Signed-off-by: NeilBrown <neilb@suse.de>
twl4030_charger: allow setting of voltage at which charge restarts.

By default, charging restarts when battery voltage drops to 3.95V
This corresponds to about 75% capacity which is rather low.

Allow it to be set via /sys/module/twl4030_charger/parameters/min_battery_mvolts
and default to 4.113V which should be better than 90% charge.

Signed-off-by: NeilBrown <neilb@suse.de>
twl4030_charger: enable manual enable/disable of usb charging.

'off' or 'auto' to

 /sys/class/power/twl4030_usb/mode

will now enable or disable charging from USB port.  Normally this is
enabled on 'plug' and disabled on 'unplug'.
Unplug will still disable charging.  'plug' will only enable it if
'auto' if selected.

Signed-off-by: NeilBrown <neilb@suse.de>
twl4030_charger: add software controlled linear charging mode.

   adds a sysfs control node to achieve that.
   It can be set to
   auto: normal automatic charging is enabled (default)
   off: charging is off
   on: charing is on (software controlled)
       CC/CV mode is still automatically done,
       but end of charge due to low current not.

Note: If linear charging mode is used there should be some method of
stopping charging automatically. It is not a so time-critical, but
it is the wrong setting for leaving a charger connected for several days
since Lithium batteries should not be kept at 100% for longer periods.
Linear charging does a good job with not so reliable power sources, since
several voltage controlling is then often too intelligent.
It was used with a bike hub dynamo since a year or so. In that case there
are automatically charging stops when the cyclist needs a break.
Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
Signed-off-by: NeilBrown <neilb@suse.de>
twl4030_charger: incorporate linear charging into usb_mode.

usb_mode attribute can now be:
 none - don't change, even when plugged int
 auto - auto charge based on voltage and current
 linear - charge with whatever current is available.

On an unplug even charging is turned off, but writing to
this attribute will try to restart it.

Signed-off-by: NeilBrown <neilb@suse.de>
GTA04 sound: remove white space and other noise.

Signed-off-by: NeilBrown <neilb@suse.de>
GTA04-audio: convert VOICE and HEADSET to use snd_soc_register_card.

Also make driver optional so that it has to be requested by the
board file.

Signed-off-by: NeilBrown <neilb@suse.de>
gta04-voice: tristate McBSP when not in use.

When the 'voice' DSP is not in use we trystate the output
so that the connection through the TWL4030.

Signed-off-by: NeilBrown <neilb@suse.de>
twl4030-codec: don't report EBUSY if no change requested.

"mode" may not be changed when active.
However if a request is received to set the mode to what it currently
is, that is also rejected when active, which is annoying.
So check first and if no change is actually requested, don't report
an error.

Signed-off-by: NeilBrown <neilb@suse.de>
twl4030-voice: allow voice port to be connected externally.

If voice port on twl4030 is not connected to a McBSP (or similar)
then we cannot configre the format the way we normally do for a DAI.

In this case, allow the platform data to specify a format which is
put into effect when the 'voice' mode is selected.

This is needed if the 'voice' port directly connects to a mobile-phone
module.

Signed-off-by: NeilBrown <neilb@suse.de>
twl4030-audio: enable routing between to 'voice' interface.

When 'voice' is some external connection, we power up
the downlink when the downline amplifier is not muted,
and power up the uplink when a new switch "Voice Uplink" is
turned on.

Signed-off-by: NeilBrown <neilb@suse.de>
twl4030_charger: rename 'linear' to 'continuous'.

It seems to make more sense.
'continuous' allows continuous charging - whatever input current
is available is feed to battery and system continuously.

Signed-off-by: NeilBrown <neilb@suse.de>
twl4030-charger: make min_battery_mvolts per-power_supply.

Rather than one "min_battery_mvolts" value, we now have one for the
USB power supply and one for the 'ac' power supply.
This makes the file easier to find:
  /sys/class/power_supply/twl4030_usb/min_battery_mvolts
  /sys/class/power_supply/twl4030_ac/min_battery_mvolts

And allows different settings for the two.

When check which charge path is currently active and set one of the
other as appropriate.  We repeat this check each time the USB is
plugged or unplugged.

Signed-off-by: NeilBrown <neilb@suse.de>