power_supply/MFD: twl4030_charger: Allow charger to control the regulator that feeds it.

The charger needs usb3v1 to be running, so add a new consumer to
keep it running.

This allows the charger to draw current even when the USB driver has
powered down.

Acked-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: NeilBrown <neilb@suse.de>
twl4030-usb: Don't power down phy when it is in-use by charger.

The USB phy is used both for data transfer and to charge the battery.
If the charger it active it will hold a reference to
usb3v1.  In that case we don't want to power-down the phy.

This allows charging to continue while the device is suspended.

Signed-off-by: NeilBrown <neilb@suse.de>
twl4030_charger: set usb max current

It provides a sysfs file here:
/sys/bus/platform/devices/twl4030_bci/max_current
/sys/class/power_supply/twl4030_usb/device/max_current
(symlinked stuff)

Into this sysfs file the maximum usb current in uA can be written or read.
The setting stays the same until the next reconnection.
Then the current is set to 600000uA if the kernel parameter
allow_usb is set, or to the value of the newly added parameter
default_usb_current, which expects the default current in uA.
(default 100000uA)

Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
Signed-off-by: NeilBrown <neilb@suse.de>
twl4030_usb: export status of id pin via sysfs

A file in sysfs is created:
/sys/bus/platform/devices/twl4030_usb/id
it shows 440k, 200k, 102k, floating or GND.

If none of the corresponding bits are set, unknown is shown.

Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
Signed-off-by: NeilBrown <neilb@suse.de>
ARM OMAP2: Shouldn't define this function as it is already defined in .h file

Signed-off-by: NeilBrown <neilb@suse.de>
ARM: silence bad warning about try_to_freeze.

There is something wrong with restarting syscalls in ARM, or something.
Anyway, try_to_freeze sometimes gets called with interrupts disabled,
which is bad.  Don't know how to fix, so just silence for now.

Signed-off-by: NeilBrown <neilb@suse.de>
Change 'fixed' regulator to pulse GPIO low instead of holding it.

In GTA04, use used a 'fixed' regulator to reset the wifi when it is
not in use.  The GPIO drives the reset line.
But as that line resets bluetooth as well it cannot hold it low.

So hack the 'fixed' regulator to pulse the line low at 'on' and 'off'
instead of holding it low.

I should probably make this configurable and try to get it upstream.

Signed-off-by: NeilBrown <neilb@suse.de>
GTA04: Initialize serial ports separately.

This  prepares for a future patch which adds some per-port config

Also explicitly initial the GPIOs - just for consistency.

Signed-off-by: NeilBrown <neilb@suse.de>
GTA04 - make 3G wakeup a shared interrupt.

This allows receiving the interrupt through 'poll' on
  /sys/class/gpio/gpio176/value
after setting .../edge to 'rising'

Signed-off-by: NeilBrown <neilb@suse.de>
GTA04: refresh defconfig files for 3.3.1

Signed-off-by: NeilBrown <neilb@suse.de>
GTA04: add twl4030 'vibra' input device.

This create a /dev/input/eventXX device which supports a 'rumble'
force-feedback effect.

Signed-off-by: NeilBrown <neilb@suse.de>
GTA04: rename defconfig files.

1/ the 'default' should be no debugging
2/ the kernel should work on gta04a4 as well as gta04a3

So:
 renamed:    arch/arm/configs/gta04a3_defconfig -> arch/arm/configs/gta04_debug_defconfig
 renamed:    arch/arm/configs/gta04a3_nodebug_defconfig -> arch/arm/configs/gta04_defconfig
GTA04 - remove unnecessary CONFIG options and tidy up.

Kernel is quite a bit smaller now...

Signed-off-by: NeilBrown <neilb@suse.de>
GTA04: Add 'GTA04' directory for useful stuff.

Currently:
  README: explaining other files and how to compile
  udev-rules/: config files to ensure stable device names.

Signed-off-by: NeilBrown <neilb@suse.de>
GTA04: Add demo script for running the vibrator

Signed-off-by: NeilBrown <neilb@suse.de>
Improve vibra.py demo script

Add a 'multi_vibe' which rumbles several times in quick succession.
Can the interface a bit.

Signed-off-by: NeilBrown <neilb@suse.de>
made VAUX2 always_on since switching it off is against the specs of the chips!

Signed-off-by: NeilBrown <neilb@suse.de>
GTA04 board-file updates  for 3.4-rc

- GPIO_TO_IRQ changes
- mmc init changes

Signed-off-by: NeilBrown <neilb@suse.de>
GTA04: defconfig updates for 3.4-rc

Signed-off-by: NeilBrown <neilb@suse.de>
gta04: add more consumer for vdvi power supply.

This appear to be needed or display driver doesn't work.

Copied from board-omap3pandora.c

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