Commit graph

705 commits

Author SHA1 Message Date
Jonas Aaberg 53ef1f590d ab8500-bm: Flush all work queues before suspending
Flush all workqueues at suspend time to avoid suspending during work.

Signed-off-by: Jonas Aaberg <jonas.aberg@stericsson.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Marcus COOPER <marcus.xm.cooper@stericsson.com>
2013-01-23 14:39:18 +00:00
Martin Bergström ffaa39d9ed ab8500-fg: Go to INIT_RECOVERY when charger removed
When the charger is removed we need to go to INIT_RECOVERY
state instead of directly to RECOVERY state.

Signed-off-by: Martin Bergstrom <martin.bergstrom@stericsson.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Marcus COOPER <marcus.xm.cooper@stericsson.com>
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
Tested-by: Jonas ABERG <jonas.aberg@stericsson.com>
2013-01-23 14:39:17 +00:00
Nicolas Guion b016322293 ab8500-charger: Add support for autopower on AB8505 and AB9540
Accessing autopower register fails on the AB8505 and ab9540 as
the fallback software control register has moved.

Signed-off-by: Marcus Cooper <marcus.xm.cooper@stericsson.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Mattias WALLIN <mattias.wallin@stericsson.com>
Reviewed-by: Nicolas GUION <nicolas.guion@stericsson.com>
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
Tested-by: Jonas ABERG <jonas.aberg@stericsson.com>
2013-01-23 14:39:17 +00:00
Lee Jones c9ade0fca3 abx500-chargalg: Add new sysfs interface to get current charge status
Allow a user to check on AB8500 charging status from debugfs.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
2013-01-23 14:39:16 +00:00
Loic Pallardy e07a56453b pm2301: Update watchdog for pm2xxx support
AB and PMxxx doesn't have same watchdog refresh period. Add watchdog
to refresh period parameters in x500 charger structure, this should
kick watchdog every 30sec. The AC charging should also kick both
pm2xxx and the AB charger watchdog.

Signed-off-by: Rajkumar Kasirajan <rajkumar.kasirajan@stericsson.com>
Signed-off-by: Loic Pallardy <loic.pallardy@stericsson.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Michel JAOUEN <michel.jaouen@stericsson.com>
Reviewed-by: Marcus COOPER <marcus.xm.cooper@stericsson.com>
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
Tested-by: Michel JAOUEN <michel.jaouen@stericsson.com>
Tested-by: Jonas ABERG <jonas.aberg@stericsson.com>
2013-01-23 14:39:15 +00:00
Lee Jones e3455002d0 ab8500-chargalg: Only root should have write permission on sysfs file
Only root should have write permission on sysfs file ab8500_chargalg/chargalg.

Cc: stable@vger.kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2013-01-23 14:39:15 +00:00
Loic Pallardy 8757a08ea2 pm2301: Remove volt_now & curr_now properties
There is no support to measure the main charger voltage and
current using AB9540 gpadc. Therefore this has been removed
from the driver.

Signed-off-by: Rajkumar Kasirajan <rajkumar.kasirajan@stericsson.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Michel JAOUEN <michel.jaouen@stericsson.com>
Reviewed-by: Rabin VINCENT <rabin.vincent@stericsson.com>
Tested-by: Michel JAOUEN <michel.jaouen@stericsson.com>
2013-01-23 14:39:14 +00:00
Olivier Clergeaud 006f82d67c pm2301: Clean-up PM2301 interrupt management
Fix the way interrupts are handled within the PM2301 charging driver.

Signed-off-by: Rajkumar Kasirajan <rajkumar.kasirajan@stericsson.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Olivier CLERGEAUD <olivier.clergeaud@stericsson.com>
Reviewed-by: Marcus COOPER <marcus.xm.cooper@stericsson.com>
Reviewed-by: Michel JAOUEN <michel.jaouen@stericsson.com>
Tested-by: Michel JAOUEN <michel.jaouen@stericsson.com>
2013-01-23 14:39:13 +00:00
Lee Jones 2fa5b0f4a5 pm2301: Move all configuration and emum structs out to a header file
Also shift the file description to a more suitable location.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
2013-01-23 14:39:13 +00:00
Lee Jones d80108fc69 ab8500-chargalg: Update battery health on safety timer exp
When the charging safety timer elapses, the battery health is
shown as "Good". This is misleading and also makes it difficult
to distinguish issues relating to discharging despite the fact
that the charger is still connected.

When in actual fact a safety timer elapse is an indication of a
fault in the battery. Here we make this clearer by reporting
POWER_SUPPLY_HEALTH_UNSPEC_FAILURE instead.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
2013-01-23 11:33:05 +00:00
Lee Jones 3edebfcdb3 ab8500-charger: Kick watchdog
Kicks the watchdog so charging will not stop.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
2013-01-23 11:33:05 +00:00
Michel JAOUEN e6aac611b8 ab8500-btemp: Adaptation to AB8505 and AB9540 platforms
Add AB9540 and AB8505 support to ABx500 BTEMP driver.

Signed-off-by: Rajkumar Kasirajan <rajkumar.kasirajan@stericsson.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Michel JAOUEN <michel.jaouen@stericsson.com>
Reviewed-by: Marcus COOPER <marcus.xm.cooper@stericsson.com>
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
Tested-by: Michel JAOUEN <michel.jaouen@stericsson.com>
Tested-by: Jonas ABERG <jonas.aberg@stericsson.com>
2013-01-23 11:33:04 +00:00
Hakan Berg 75f2a219ff ab8500-fg: Adjust for RF bursts voltage drops
Changed conditions for restarting low battery measurements counter
and adjusted the interval between measurements to avoid RF burst
induced voltage drops, and to shorten time to decide to shut down.

Signed-off-by: Hakan Berg <hakan.berg@stericsson.com>
Signed-off-by: Martin Bergstrom <martin.bergstrom@stericsson.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
Reviewed-by: Marcus COOPER <marcus.xm.cooper@stericsson.com>
2013-01-23 11:33:03 +00:00
Henrik Sölver ff38090aa2 ab8500-charger: AB workaround for invalid charger
AB8500 refuses to start charging when some types of non standard
chargers are connected. This change force the AB to start charging.

Signed-off-by: Henrik Sölver <henrik.solver@stericsson.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Yvan FILLION <yvan.fillion@stericsson.com>
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
Tested-by: Yvan FILLION <yvan.fillion@stericsson.com>
2013-01-23 11:33:03 +00:00
Michel JAOUEN 01ec8c5423 pm2301: Provide u9540 support for the pm2301 charger
AC charger driver for the DB9540 based platforms.

Signed-off-by: Rajkumar Kasirajan <rajkumar.kasirajan@stericsson.com>
Signed-off-by: Loic Pallardy <loic.pallardy@stericsson.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Michel JAOUEN <michel.jaouen@stericsson.com>
Tested-by: Michel JAOUEN <michel.jaouen@stericsson.com>
2013-01-23 11:33:02 +00:00
Andrew Lunn 8fd526fd18 qnap-poweroff: Fix license string
GPLv2+ is not a valid license string. Replace it with one that is.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-01-19 18:04:04 -08:00
Lee Jones 41ce25657b ab8500_fg: Remove pointless round_jiffies() call
As HZ is a full-second, there is little point in rounding it.
Let's save a few cycles by using HZ directly.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-01-15 17:44:46 -08:00
Paer-Olof Haakansson f902dadc12 ab8500_fg: Overflow in current calculation
When calculating the average current the nominator will
overflow when the charging current is high.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Henrik Sölver <henrik.solver@stericsson.com>
Reviewed-by: Par-Olof HAKANSSON <par-olof.hakansson@stericsson.com>
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
Tested-by: Par-Olof HAKANSSON <par-olof.hakansson@stericsson.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-01-15 17:44:44 -08:00
Marcus Cooper 4b45f4a9cd ab8500_charger: Adds support for legacy USB chargers
A Legacy USB charger should be handled directly by the charger
driver.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Marcus Cooper <marcus.xm.cooper@stericsson.com>
Reviewed-by: Karl KOMIEROWSKI <karl.komierowski@stericsson.com>
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-01-15 17:44:42 -08:00
Marcus Cooper 377345c2be ab8500_charger: Remove unused defines
Cleanup of the ab8500_charger driver.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Marcus Cooper <marcus.xm.cooper@stericsson.com>
Reviewed-by: Karl KOMIEROWSKI <karl.komierowski@stericsson.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-01-15 17:44:40 -08:00
Hakan Berg 8bcf3b39a8 ab8500_fg: Added support for BATT_OVV
Add support for the battery over-voltage situation

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Hakan Berg <hakan.berg@stericsson.com>
Reviewed-by: Karl KOMIEROWSKI <karl.komierowski@stericsson.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-01-15 17:44:38 -08:00
Hakan Berg 0cdaf9a900 ab8500_btemp: Remove superfluous BTEMP thermal comp
BTEMP thermal compensation factor times 10 is applied in two places, probe
and get_property. Removed from probe.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Hakan Berg <hakan.berg@stericsson.com>
Reviewed-by: Karl KOMIEROWSKI <karl.komierowski@stericsson.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-01-15 17:44:36 -08:00
pender01 6eaf8740da ab8500_fg: Round capacity output
Round the capacity values for better enduser experience.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: pender01 <peter.enderborg@stericsson.com>
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
Tested-by: Marcus COOPER <marcus.xm.cooper@stericsson.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-01-15 17:44:34 -08:00
Hakan Berg 74a8e349b1 ab8500_bm: Adds support for Car/Travel Adapters
The Travel and Carkit adapter should be handled directly by
the charger driver.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Marcus Cooper <marcus.xm.cooper@stericsson.com>
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-01-15 17:44:32 -08:00
Hakan Berg d36e3e6d50 ab8500_btemp: Ignore false btemp low interrupt
Ignore the low btemp interrupts for ab8500 3.0 and 3.3

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Hakan Berg <hakan.berg@stericsson.com>
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
Tested-by: Marcus COOPER <marcus.xm.cooper@stericsson.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-01-15 17:44:30 -08:00
Lee Jones 5b41aa9f2b ab8500_btemp: Allign battery temperature resolution with the framework
The Linux Power Supply framework expects battery temperatures to have
a resolution of 0.1 degree Celsius; however, the AB8500 btemp driver
supplies a battery temperature resolution of 1 degree Celsius. We
therefore have to use a factor 10 on the measured values.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-01-15 17:44:28 -08:00
Rickard Andersson 129d583b44 ab8500_fg: Balance IRQ enable
In case of time out error IRQ needs to be disabled
otherwise we will get unbalanced enable/disable pairs.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Rickard Andersson <rickard.andersson@stericsson.com>
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-01-15 17:44:26 -08:00
Marcus Cooper ea40240178 ab8500_bm: Recharge condition not optimal for battery
Today the battery recharge is determined with a voltage threshold. This
voltage threshold is only valid when the battery is relaxed. In charging
algorithm the voltage read is the loaded battery voltage and no
compensation is done to get the relaxed voltage. When maintenance
charging is not selected, this makes the recharging condition to almost
immediately activate when there is a discharge present on the battery.

Depending on which vendor the battery comes from this behavior can wear
out the battery much faster than normal.

The fuelgauge driver is responsible to monitor the actual battery
capacity and is able to estimate the remaining capacity. It is better to
use the remaining capacity as a limit to determine when battery should
be recharged.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Marcus Cooper <marcus.xm.cooper@stericsson.com>
Reviewed-by: Hakan BERG <hakan.berg@stericsson.com>
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-01-15 17:43:46 -08:00
Jonas Aaberg a864c5a869 ab8500_charger: Handle gpadc errors
Gracefully handle gpadc conversion errors.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Jonas Aaberg <jonas.aberg@stericsson.com>
Reviewed-by: Johan BJORNSTEDT <johan.bjornstedt@stericsson.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-01-15 17:35:21 -08:00
Jonas Aaberg 9a0bd070fd ab8500_fg: Replace msleep() with usleep_range() for greater accuracy
Doing so provides a greater degree of accuracy when dealing with
time-frames between 1us and 20ms. msleep() is only accurate for
wake-ups greater than 20ms.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Jonas ABERG <jonas.aberg@stericsson.com>
Reviewed-by: Johan BJORNSTEDT <johan.bjornstedt@stericsson.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-01-15 17:35:19 -08:00
Lee Jones b269fff4f9 ab8500_charger: Detect charger removal
Add two new work queues to provide USB and AC charger disconnect
detection.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-01-15 17:35:12 -08:00
Johan Bjornstedt 3988a4df34 ab8500_bm: Skip first CCEOC irq for instant current
When enabling the CCEOC irq we might get false interrupt
from ab8500-driver due to the latched value will be saved
and interpreted as an IRQ when enabled

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Johan Bjornstedt <johan.bjornstedt@stericsson.com>
Signed-off-by: Henrik Solver <henrik.solver@stericsson.com>
Reviewed-by: Karl KOMIEROWSKI <karl.komierowski@stericsson.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-01-15 17:10:17 -08:00
Paer-Olof Haakansson defbfa9cf8 ab8500_charger: Rename the power_loss function
Rename the ab8500_power_loss_handling function to a more
descriptive name ab8500_enable_disable_sw_fallback

Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Robert Marklund <robert.marklund@stericsson.com>
Reviewed-by: Par-Olof HAKANSSON <par-olof.hakansson@stericsson.com>
Reviewed-by: Karl KOMIEROWSKI <karl.komierowski@stericsson.com>
Tested-by: Par-Olof HAKANSSON <par-olof.hakansson@stericsson.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-01-15 17:10:16 -08:00
Linus Torvalds 974b33586b ARM: arm-soc fixes for 3.8-rc
People are back from the holiday breaks, and it shows. Here are a bunch of
 fixes for a number of platforms:
  - A couple of small fixes for Nomadik
  - A larger set of changes for kirkwood/mvebu
    - uart driver selection, dt clocks, gpio-poweroff fixups,
      a few __init annotation fixes and some error handling improvement
      in their xor dma driver.
  - i.MX had a couple of minor fixes (and a critical one for flexcan2
    clock setup)
  - MXS has a small board fix and a framebuffer bugfix
  - A set of fixes for Samsung Exynos, fixing default bootargs and some
    Exynos5440 clock issues
  - A set of OMAP changes including PM fixes and a few sparse warning
    fixups
 
 All in all a bit more positive code delta than we'd ideally want to see
 here, mostly from the OMAP PM changes, but nothing overly crazy.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJQ7GYhAAoJEIwa5zzehBx31HMP/jqBBdEAKBoQrVPXgCISTkGp
 WzpPbFnt17R9uxVZFjsmlcTgBOURSkbDwENVnyJ4ZkVFOAQHOSCriyQFrsgeBAEj
 WU2FK3E6/V4BHob8hSqmbCjwRUyzOM6z4+oMZQgpBS2y0sgVWFySOE3Fe7cf1IJr
 11D5/mzOqRYu8fkXar2ksK752N7O5m9sZoJ4A8cJs1DBL8/a0c6ASZGkaKql0WFn
 hel6nFznTe/qZwGqjIOaWrFhUe9pmqRlRtTDT5hlmMzC4+O12TEBaFIrJHlq8SkZ
 nxSdZcD9ERAgp58zMEMzDI0ZNkdXTV3xRtkehTvaJheCpeAGq0J63fEd/Yn4T/V3
 fUeNrUqNLl59dZEvFS1Xm/2dpYLrUDCkNWQoTAjLAfEmJ1v9vjcP22seXD9tzXtl
 XdcjEIOnAb+d3J6D3vW1EvgPiTrS0EId5Mkv/LSIAyR0OAjqJr3L/keUUG2OVH1q
 UW7V052KEW0P0jDQnmhxNkkl8fnZCQtLRH9ukVs2qIbH28QBaH3irdFv+S74P2l2
 MWBqh21dm//PBJQqg1ujf0nl7IuCqDVaUYt6VYholGaRoyMaCSVsazJwC0/kzTNz
 EYVI8kAUIWQnAxXL5uN3oiqoSASKOfwtHGOJB7CB2FgdEVNWhdUpLk0xDi5ssF8o
 Iatq6W91y3xCkLhIP+77
 =s9fE
 -----END PGP SIGNATURE-----

Merge tag 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull ARM SoC fixes from Olof Johansson:
 "People are back from the holiday breaks, and it shows.  Here are a
  bunch of fixes for a number of platforms:
   - A couple of small fixes for Nomadik
   - A larger set of changes for kirkwood/mvebu
     - uart driver selection, dt clocks, gpio-poweroff fixups, a few
       __init annotation fixes and some error handling improvement in
       their xor dma driver.
   - i.MX had a couple of minor fixes (and a critical one for flexcan2
     clock setup)
   - MXS has a small board fix and a framebuffer bugfix
   - A set of fixes for Samsung Exynos, fixing default bootargs and some
     Exynos5440 clock issues
   - A set of OMAP changes including PM fixes and a few sparse warning
     fixups

  All in all a bit more positive code delta than we'd ideally want to
  see here, mostly from the OMAP PM changes, but nothing overly crazy."

* tag 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (44 commits)
  ARM: clps711x: Fix bad merge of clockevents setup
  ARM: highbank: save and restore L2 cache and GIC on suspend
  ARM: highbank: add a power request clear
  ARM: highbank: fix secondary boot and hotplug
  ARM: highbank: fix typos with hignbank in power request functions
  ARM: dts: fix highbank cpu mpidr values
  ARM: dts: add device_type prop to cpu nodes on Calxeda platforms
  ARM: mx5: Fix MX53 flexcan2 clock
  ARM: OMAP2+: am33xx-hwmod: Fix wrongly terminated am33xx_usbss_mpu_irqs array
  pinctrl: mvebu: make pdma clock on dove mandatory
  ARM: Dove: Add pinctrl clock to DT
  dma: mv_xor: fix error handling for clocks
  dma: mv_xor: fix error handling of mv_xor_channel_add()
  arm: mvebu: Add missing ; for cpu node.
  arm: mvebu: Armada XP MV78230 has only three Ethernet interfaces
  arm: mvebu: Armada XP MV78230 has two cores, not one
  clk: mvebu: Remove inappropriate __init tagging
  ARM: Kirkwood: Use fixed-regulator instead of board gpio call
  ARM: Kirkwood: Fix missing sdio clock
  ARM: Kirkwood: Switch TWSI1 of 88f6282 to DT clock providers
  ...
2013-01-08 18:53:56 -08:00
Nickolai Zeldovich c4f3422630 da9052-battery: Avoid out-of-range array access
Avoid accessing vc_tbl_ref[3], which is one past the end of that array, in
da9052_determine_vc_tbl_index(), by adjusting the loop bound.

(Hint: there is 'i + 1' inside the loop.)

Signed-off-by: Nickolai Zeldovich <nickolai@csail.mit.edu>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-01-06 14:34:26 -08:00
Devendra Naga 00edfc65c2 max17040_battery: Use devm_kzalloc
use devm_kzalloc and no need of error path and unload frees.

Signed-off-by: Devendra Naga <devendra.aaru@gmail.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-01-06 14:18:58 -08:00
Kim, Milo d5c2b14cb2 lp8788-charger: Fix a parent device in kernel messages
Use 'platform_device' in kernel messages rather than i2c client device
node. lp8788_update_charger_params() needs additional argument, 'pdev'.
Then, remove unnecessary lp8788 private data in lp8788_irq_register().

Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-01-06 14:18:43 -08:00
Kim, Milo 05ac539b4f lp8788-charger: Fix a parent device in _probe()
The lp8788-charger is a platform driver of lp8788-mfd. The platform device
is allocated when mfd_add_devices() is called in lp8788-mfd. On the other
hand, 'lp->dev' is the i2c client device.

Therefore, this 'platform_device' is a proper parent device in case of
resource managed mem alloc and device kernel message.

Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-01-06 14:18:19 -08:00
Andrew Lunn ffd8f9a727 power/reset: Add a new driver implementing 'power off by restarting'
Some devices, Buffalo Linkstation LS-XHL and LS-CHLv2 for example,
power-off by restarting to letting u-boot hold the SoC until the user
presses a key. Add a generic driver to implement this. It binds a function
to pm_power_off, which calls arm_pm_restart.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Michael Walle <michael@walle.cc>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-01-06 14:00:31 -08:00
Andrew Lunn e8fc721a9a power/reset: Add a new driver to turn QNAP board power off
The QNAP NAS boxes have a microcontroller attached to the SoCs second
serial port. By sending it a simple command, it will turn the power for
the board off. This driver registers a function for pm_power_off to send
such a command.

Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-01-06 14:00:23 -08:00
Julia Lawall 0853699252 88pm860x_battery: Eliminate possible references to released resources
devm_kzalloc should not be followed by kfree, as this results in a double
free.  The problem was found using the following semantic match
(http://coccinelle.lip6.fr/):

// <smpl>
@@
expression x,e;
@@
x = devm_kzalloc(...)
... when != x = e
?-kfree(x,...);
// </smpl>

Furthermore, in the remove function, the calls to free_irq are moved up to
prevent a possible reference in the interrupt handler to resources freed by
power_supply_unregister.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-01-06 12:46:23 -08:00
Andrew Lunn 5343527bbf Power: gpio-poweroff: Fix documentation and gpio_is_valid
Improve the documentation to clarify level vs edge triggered power off.
Improve the comments for level vs edge triggered power off.
Make use of gpio_is_valid().

Reported-by: Stephen Warren <swarren@wwwdotorg.org>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
2013-01-06 17:53:00 +00:00
Sachin Kamat 8feffd1099 ab8500_charger: Use devm_regulator_get API
devm_regulator_get() is device managed and makes error handling and code
cleanup simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Arun Murthy <arun.murthy@stericsson.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-01-05 19:07:22 -08:00
NeilBrown bde83b9a6b bq27x00_battery: Fix bugs introduced with BQ27425 support
commit a66f59ba2e

    bq27x00_battery: Add support for BQ27425 chip

introduced 2 bugs.

1/ 'chip' was set to BQ27425 unconditionally - breaking support for
   other devices;

2/ BQ27425 does not support cycle count, how the code still tries to
   get the cycle count for BQ27425, and now does it twice for other chips.

Signed-off-by: NeilBrown <neilb@suse.de>
Cc: Saranya Gopal <saranya.gopal@intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-01-05 18:53:28 -08:00
Ramakrishna Pallala a05be99174 power_supply: Add watchdog and safety timer expiries under PROP_HEALTH_*
As most of the charger chips come with two kinds of safety features
related to timing:

1. Watchdog Timer (interms of seconds/mins)
2. Safety Timer (interms of hours)

This patch adds these to fault causes in POWER_SUPPLY_PROP_HEALTH_* enums
so that whenever there is either watchdog timeout or safety timer timeout
driver could notify the user space accurately about the fault and will
also be helpful for debug.

Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-01-05 18:51:18 -08:00
Sachin Kamat a9672e1356 bq2415x_charger: Use devm_kzalloc()
devm_kzalloc is device managed and makes error handling and code cleanup a
bit simpler.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-01-05 18:41:12 -08:00
Sachin Kamat 463df5147e bq2415x_charger: Use module_i2c_driver
module_i2c_driver() makes the code simpler by eliminating module_init and
module_exit calls.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-01-05 18:41:01 -08:00
Sachin Kamat d8ecb67581 bq2415x_charger: Remove unneeded version.h inclusion
<linux/version.h> is not required here.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2013-01-05 18:39:56 -08:00
Anton Vorontsov 240fbe2347 Merge branch 'for-anton' of git://git.linaro.org/people/ljones/linux-3.0-ux500 2013-01-05 17:14:22 -08:00
Tejun Heo 2fbb520d20 charger_manager: Don't use [delayed_]work_pending()
There's no need to test whether a (delayed) work item in pending
before queueing, flushing or cancelling it.  Most uses are unnecessary
and quite a few of them are buggy.

Remove unnecessary pending tests and rewrite _setup_polling() so that
it uses mod_delayed_work() if the next polling interval is sooner than
currently scheduled.  queue_delayed_work() is used otherwise.

Only compile tested.  I noticed that two work items - setup_polling
and cm_monitor_work - schedule each other.  It's a very unusual
construct and I'm fairly sure it's racy.  You can't break such
circular dependency by calling cancel on each.  I strongly recommend
revising the mechanism.

Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Anton Vorontsov <cbou@mail.ru>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Donggeun Kim <dg77.kim@samsung.com>
Cc: MyungJoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2013-01-05 14:03:26 -08:00
Chanwoo Choi 41468a1119 charger-manager: Split _probe funtion to make the code more clean
This patch split _probe function for readability because _probe function
is longer than 400 line.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2013-01-05 14:00:09 -08:00
Greg Kroah-Hartman 6d2cea4fca Drivers: power: remove __dev* attributes.
CONFIG_HOTPLUG is going away as an option.  As a result, the __dev*
markings need to be removed.

This change removes the use of __devinit, __devexit_p, __devinitconst,
and __devexit from these drivers.

Based on patches originally written by Bill Pemberton, but redone by me
in order to handle some of the coding style issues better, by hand.

Cc: Bill Pemberton <wfp5p@virginia.edu>
Cc: Anton Vorontsov <cbou@mail.ru>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Andrew Lunn <andrew@lunn.ch>
Cc: Jamie Lentin <jm@lentin.co.uk>
Cc: Jason Cooper <jason@lakedaemon.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-03 15:57:14 -08:00
Linus Torvalds 8d91a42e54 ARM: arm-soc: late cleanups for omap
From Tony Lindgren:
 Here are few more patches to finish the omap changes for
 multiplatform conversion that are not strictly fixes, but
 were too complex to do with the dependencies during the
 merge window. Those are to move of serial-omap.h to
 platform_data, and the removal of remaining cpu_is_omap
 macro usage outside mach-omap2.
 
 Then there are several trivial fixes for typos and few
 minimal omap2plus_defconfig updates.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJQ3es9AAoJEIwa5zzehBx3bpwP/j4k4mGm4RMLTY9e8KNNxrDW
 FAeU52h91qDONn3EXcF7oSd5IqbDoQRCQx9vn4XBfSm23uOzvP3hOSDe8iIz9t8C
 XdLSXJfJDuYKuEBYxFNOVBdBziZoE7Gtp1JP9s79qfGfQurUfnRQ9gg6zoMMoxMg
 KdVnzFbaCeN/Dgbyq/WToDdOCUv2jeiSNI0gf6oe3Tju0uVjBSmlZUnkbAsRMvOW
 RL2uwp66yS6uLc/w5cfPI/wcp1jRZDYm2E7JB+TmHWqCYx2qpDE5EuDuW5+cY/DR
 RTBr1c0fSl3k3o3iNOEijkFwGShivf1PksesMA+Fx9BrFwtrhtYT/dVZbuS3AjVL
 1vIn3c+8rp3p63EsS1WxAMBvBq3qgqAl2shgow1B3QlXdErB9HNRErFKjU9rJ1ES
 fZgtWkzLtCqFaN/WnQAj0nfooPmrmhaDrbHJd7Bt7g8dfgGBHl9nkmQ4tMAa/z4x
 f/mZ0MxtXwhSUYBDvJ9vvtcNdeo9WmVV5zCfHUiMB7LB4wjxJUf7xMT9AquQUGqj
 H5EkaSyRjWG35293WDmxAOKlAkMP+AH5cuROKNNwNN5+i7ypJC+jrMDcgwfwQoXl
 i0yJeJhzFg9WV9buNB7+uWTA9vz7uveHSeaVXbbTVbuZ+apTgWl+MTsua0C2hhbU
 81k7fmqW2fCWkiw5eUeZ
 =RE6Z
 -----END PGP SIGNATURE-----

Merge tag 'omap-late-cleanups' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull late ARM cleanups for omap from Olof Johansson:
 "From Tony Lindgren:

  Here are few more patches to finish the omap changes for multiplatform
  conversion that are not strictly fixes, but were too complex to do
  with the dependencies during the merge window.  Those are to move of
  serial-omap.h to platform_data, and the removal of remaining
  cpu_is_omap macro usage outside mach-omap2.

  Then there are several trivial fixes for typos and few minimal
  omap2plus_defconfig updates."

* tag 'omap-late-cleanups' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc:
  arch/arm/mach-omap2/dpll3xxx.c: drop if around WARN_ON
  OMAP2: Fix a typo - replace regist with register.
  ARM/omap: use module_platform_driver macro
  ARM: OMAP2+: PMU: Remove unused header
  ARM: OMAP4: remove duplicated include from omap_hwmod_44xx_data.c
  ARM: OMAP2+: omap2plus_defconfig: enable twl4030 SoC audio
  ARM: OMAP2+: omap2plus_defconfig: Add tps65217 support
  ARM: OMAP2+: enable devtmpfs and devtmpfs automount
  ARM: OMAP2+: omap_twl: Change TWL4030_MODULE_PM_RECEIVER to TWL_MODULE_PM_RECEIVER
  ARM: OMAP2+: Drop plat/cpu.h for omap2plus
  ARM: OMAP: Split fb.c to remove last remaining cpu_is_omap usage
  MAINTAINERS: Add an entry for omap related .dts files
2012-12-30 09:59:21 -08:00
Linus Torvalds 5031a2a7c1 In part2:
- A small patch for the RX51 OMAP board (Nokia N900 phone), the patch
   creates a battery monitor device instance, so that it can be probed. It
   was acked by the OMAP maintainer;
 
 - A couple of late bug fixes for the charger-manager: corrects corner
   cases for the battery full handling.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (GNU/Linux)
 
 iQIcBAABAgAGBQJQ0P/CAAoJEGgI9fZJve1b1FQP/2EmdDqZ/RLtiDskid4JC8sQ
 NZMGaqhtXzdr4Duukrt7mvmZR0i3mJcSiGMDonsJFPoUXK6Zwr4eWpdL71Ehn7Sh
 0X6ul2iipqUi1g78mpFE8BwwTyzKxsL/+Njj25s/VuBrOYfA+xF44AgDG90/YpUf
 xRwNGsLAESpKCxsT4NKoPSCg6T6SfprPlyECdtt4hWCetntVezc6TON14JU/E2OS
 5Bq07TWKAN/F9a4QIiYDaykTf4NrERwqHnmgA6kHG/Bf0q61ON91UCI4o+UVIGMe
 v3Rc52pZPbqsatOd/t5ujPwBiQwy1+70mMeuYmdw9oJHScAG2+KFKns4dw3zaiIE
 9rpyo3T2E1tiu1/Ny71hiBAqOG5Wuh6USQ02PyUXKnMaZ1Owcr47MfOMoY8LZLV1
 knAfduMi/jpHva3UBRvnShbZMelM5AJk2ctLq/lH8JxljYjh4jcsWNGm++1rLmOr
 jvRpqso4IJxhAoe2i23p7lalsAemwnfR2PfiP3PH/77jJISZrhXZs2e4DwR0N/KM
 pBvfS8DEp2xEcg/0OUXU5O90J6DBaVL0N8fntn9HW8VHf1o/6ETr46b562hAt9s8
 Mp/uPK/FMpMz+a8jsactUGsn2HVuYYDTIQqRW3AeUoaT6hXrYJEdd2iPCZCh1OBF
 KmpjWS3ZDeDTBMpfgZRk
 =hppb
 -----END PGP SIGNATURE-----

Merge tag 'for-v3.8-part2' of git://git.infradead.org/battery-2.6

Pull battery update, part 2, from Anton Vorontsov:
 "These are left overs that I didn't have time to review/apply before
  the merge window opened.  I didn't want to "spoil" the first pull
  request with these late patches, so they were not included:

   - A small patch for the RX51 OMAP board (Nokia N900 phone), the patch
     creates a battery monitor device instance, so that it can be
     probed.  It was acked by the OMAP maintainer;

   - A couple of late bug fixes for the charger-manager: corrects corner
     cases for the battery full handling."

* tag 'for-v3.8-part2' of git://git.infradead.org/battery-2.6:
  charger-manager: Fix bug when check dropped voltage after fullbatt event
  charger-manager: Fix bug related to checking fully charged state of battery
  ARM: OMAP: rx51: Register platform device for rx51_battery
2012-12-19 08:14:08 -08:00
Tony Lindgren e8d3d47a98 ARM: OMAP2+: Drop plat/cpu.h for omap2plus
The cpu_is_omap macros are now local to arch/arm/mach-omap2
in soc.h and plat/cpu.h can finally be dropped for omap2+.
Thanks everybody for help with fixing the drivers.

Note that we can now also remove the unused plat/cpu.h from
smartreflex.c and isp.c as they will cause compile errors
with ARCH_MULTIPLATFORM enabled.

Cc: Kevin Hilman <khilman@deeprootsystems.com>
Acked-by: Jean Pihet <jean.pihet@newoldbits.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2012-12-17 10:50:41 -08:00
Chanwoo Choi f36b9ddbab charger-manager: Fix bug when check dropped voltage after fullbatt event
This patch check difference value between current voltage of battery and
desc->fullbatt_uV whether positve or negative number. If difference value
is negative number when current voltage of battery is larger than
desc->fullbatt_uV, charger-manager return immediately because battery is
fully charged.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-12-16 22:45:58 -08:00
Chanwoo Choi 0fa11dbc23 charger-manager: Fix bug related to checking fully charged state of battery
This patch fix bug related to checking fully charged state of battery when
charger-manager call is_full_charged() function. After reading property of
charger/fuel-gauge through power_supply API, val.intval is more than 1.
So, is_full_charged() function always return true. If true, battery means
fully charged state.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-12-16 22:43:23 -08:00
Linus Torvalds 2dfea3803d This is the MFD patch set for the 3.8 merge window.
We have several new drivers, most of the time coming with their sub devices
 drivers:
 
 - Austria Microsystem's AS3711
 - Nano River's viperboard
 - TI's TPS80031, AM335x TS/ADC,
 - Realtek's MMC/memstick card reader
 - Nokia's retu
 
 We also got some notable cleanups and improvements:
 
 - tps6586x got converted to IRQ domains.
 - tps65910 and tps65090 moved to the regmap IRQ API.
 - STMPE is now Device Tree aware.
 - A general twl6040 and twl-core cleanup, with moves to the regmap I/O and IRQ
   APIs and a conversion to the recently added PWM framework.
 - sta2x11 gained regmap support.
 
 Then the rest is mostly tiny cleanups and fixes, among which we have Mark's
 wm5xxx and wm8xxx patchset.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJQznPnAAoJEIqAPN1PVmxKuA8P/0nOJduXFM1c0Gy+DD5DnJnG
 cXzzeSTV8iO3a3sHIye43QPJ5V2YUR5uxLTUEOo/G7my/MoZ/azeNidkUD3qLVlm
 wVIq35lcS8dWTZaY7nlpBcWc6e39UB0sEueuJNxyhOv5lnMKdi2tAow5f4vIRQnd
 Q67/EbrgqdltcOpGmVuCdQcvphvWgy+K65jzbJG5zXs7hGX13Q+M5RnYhx76kc8f
 TDd0APZ71n5/RyISFSBSu2vfl2kES6o47aMgqqXMEHri6d3puAaXM0rFoMzXg/4G
 eBdxndN25H7rW7xvt9tuUod2rn1AO7tif5d7jal3Cfj61y3iqKY30yb3OzS9XQXH
 9WZ2qDst11zvzQivxIkMGvfRXRfncNLWR4DrBSqVfSbYV2uQj2eS8C6ONwKVMXsQ
 5tjNp91PFqN19sWQjIjSMcrNswxgpvdQ9mqFTyOGmISbqrpPSTi+MuO8r9+xTfUF
 PnzUX2nVOW/i9NcI7uotjzh8jiw6t8XMVHhkehiSYR9hzCb6MaPsFPN4jWq9XA2m
 1htCHylNpHqHQ3Mup7Is6j0Li1ahdwfm4lbrgiVEA4t4Mqs5E/Ka+3V8laNAKylW
 PfCP/VmnJYzmgVTK/qobFNeKzRqR0i4WTL6T7oAxGL87Q4TJaqKpEkXWne8UXV+Q
 yIbN0fmWfCveCetM+vaf
 =F790
 -----END PGP SIGNATURE-----

Merge tag 'mfd-3.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6

Pull MFS update from Samuel Ortiz:
 "This is the MFD patch set for the 3.8 merge window.

  We have several new drivers, most of the time coming with their sub
  devices drivers:

   - Austria Microsystem's AS3711
   - Nano River's viperboard
   - TI's TPS80031, AM335x TS/ADC,
   - Realtek's MMC/memstick card reader
   - Nokia's retu

  We also got some notable cleanups and improvements:

   - tps6586x got converted to IRQ domains.
   - tps65910 and tps65090 moved to the regmap IRQ API.
   - STMPE is now Device Tree aware.
   - A general twl6040 and twl-core cleanup, with moves to the regmap
     I/O and IRQ APIs and a conversion to the recently added PWM
     framework.
   - sta2x11 gained regmap support.

  Then the rest is mostly tiny cleanups and fixes, among which we have
  Mark's wm5xxx and wm8xxx patchset."

Far amount of annoying but largely trivial conflicts.  Many due to
__devinit/exit removal, others due to one or two of the new drivers also
having come in through another tree.

* tag 'mfd-3.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/sameo/mfd-2.6: (119 commits)
  mfd: tps6507x: Convert to devm_kzalloc
  mfd: stmpe: Update DT support for stmpe driver
  mfd: wm5102: Add readback of DSP status 3 register
  mfd: arizona: Log if we fail to create the primary IRQ domain
  mfd: tps80031: MFD_TPS80031 needs to select REGMAP_IRQ
  mfd: tps80031: Add terminating entry for tps80031_id_table
  mfd: sta2x11: Fix potential NULL pointer dereference in __sta2x11_mfd_mask()
  mfd: wm5102: Add tuning for revision B
  mfd: arizona: Defer patch initialistation until after first device boot
  mfd: tps65910: Fix wrong ack_base register
  mfd: tps65910: Remove unused data
  mfd: stmpe: Get rid of irq_invert_polarity
  mfd: ab8500-core: Fix invalid free of devm_ allocated data
  mfd: wm5102: Mark DSP memory regions as volatile
  mfd: wm5102: Correct default for LDO1_CONTROL_2
  mfd: arizona: Register haptics devices
  mfd: wm8994: Make current device behaviour the default
  mfd: tps65090: MFD_TPS65090 needs to select REGMAP_IRQ
  mfd: Fix stmpe.c build when OF is not enabled
  mfd: jz4740-adc: Use devm_kzalloc
  ...
2012-12-16 18:55:20 -08:00
Linus Torvalds 7313264b89 Highlights:
- Two new drivers from Pali Rohár and N900 hackers: rx51_battery and
   bq2415x_charger. The drivers are a part of a solution to replace the
   proprietary Nokia BME stack;
 
 - Power supply core now registers devices with a thermal cooling
   subsystem, so we can now automatically throttle charging. Thanks to
   Ramakrishna Pallala!
 
 - Device tree support for ab8500 and max8925_power drivers;
 
 - Random fixups and enhancements for a bunch of drivers.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.19 (GNU/Linux)
 
 iQIcBAABAgAGBQJQyFGdAAoJEGgI9fZJve1bYy8P/iu4XRL2kNwmPD7fMO+bZSao
 xCSi8zRCnOtDutB48MQXIDTi1+I64+Qqq5xTuHW5n/T0zJ88biGBZfmJLjM88oQ4
 ZqfO/axT6/MNFXTQtxEvXtn/AoM6lp9ZLmIbs7mkSpcnuG8iY5eovKfeyyNiAoGh
 W6ISc9d1zZl8JYZXkkX4y5uxsH/t34rPjWJqygMulJrVdePpC9fNWwDYnul6T7iF
 /bbqIH/j88HSYNDN518dv/ot+OfPn0vuxD4WzGAqC7ddHICtuaw8TBfXHmr6j4Mf
 o9ytC/dH+AQ6Tcs+h7mbz/dfL4Gs9JK2LgRX2z1DtFa6uTw5jwEtZSuDF4DKovEg
 71T67dsHDKJkQgGMDfDw1BrlLjQr8hkaWroF8CdmbRO0rRsfKamLQANG7mGkSu8B
 l1W0ZzWEbHDteNB/wCkjoncXlcqoA8YiplyVSqf38aP8YuaeHMR3LRGLFwgXK3pB
 lELh3cYSYLVpcqUgkRWcPrCUnLA2CkQy2B4INj5jFZilux7DzyIHMhWI2OuUs2rH
 1rwTYO91gTVONuagZn8+lmsjs+Yq1n2BcyrGMG2+ZYzruFaQ+brQsCbQR0hdRuaU
 zWLENqwGJ/++XrFgw3/5orMZIZQzL/yq+MbIXtrgKcFRWwoxyzJuH63RMQf3S6yy
 hxi7pYQmb9if+HPJZVVg
 =Bb5O
 -----END PGP SIGNATURE-----

Merge tag 'for-v3.8-merged' of git://git.infradead.org/battery-2.6

Pull battery subsystem updates from Anton Vorontsov:
 "Highlights:

   - Two new drivers from Pali Rohár and N900 hackers: rx51_battery and
     bq2415x_charger.  The drivers are a part of a solution to replace
     the proprietary Nokia BME stack

   - Power supply core now registers devices with a thermal cooling
     subsystem, so we can now automatically throttle charging.  Thanks
     to Ramakrishna Pallala!

   - Device tree support for ab8500 and max8925_power drivers

   - Random fixups and enhancements for a bunch of drivers."

* tag 'for-v3.8-merged' of git://git.infradead.org/battery-2.6: (22 commits)
  max8925_power: Add support for device-tree initialization
  ab8500: Add devicetree support for chargalg
  ab8500: Add devicetree support for charger
  ab8500: Add devicetree support for btemp
  ab8500: Add devicetree support for fuelgauge
  twl4030_charger: Change TWL4030_MODULE_* ids to TWL_MODULE_*
  jz4740-battery: Use devm_request_and_ioremap
  jz4740-battery: Use devm_kzalloc
  bq27x00_battery: Fixup nominal available capacity reporting
  bq2415x_charger: Fix style issues
  bq2415x_charger: Add Kconfig/Makefile entries
  power_supply: Add bq2415x charger driver
  power_supply: Add new Nokia RX-51 (N900) power supply battery driver
  max17042_battery: Fix missing verify_model_lock() return value check
  ds2782_battery: Fix signedness bug in ds278x_read_reg16()
  lp8788-charger: Fix ADC channel names
  lp8788-charger: Fix wrong ADC conversion
  lp8788-charger: Use consumer device name on setting IIO channels
  power_supply: Register power supply for thermal cooling device
  power_supply: Add support for CHARGE_CONTROL_* attributes
  ...
2012-12-13 19:26:04 -08:00
Linus Torvalds a11da7df65 ARM: arm-soc: power management and clock changes
This branch contains a largeish set of updates of power management and
 clock setup. The bulk of it is for OMAP/AM33xx platforms, but also a
 few around hotplug/suspend/resume on Exynos.
 
 It includes a split-up of some of the OMAP clock data into separate
 files which adds to the diffstat, but gross delta is fairly reasonable.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJQySrdAAoJEIwa5zzehBx3XBMQAJCgrE/I1vbuiENiVMLpQkN7
 0Y5t89SwoALnme5jsM8vW/H0o6b163FfH+249UNs6dyk6MdCqqSv8cQVvSfCKRKn
 m4JTXS6njSnYgU025klNU9W3FyMuFcgH8b63+c5+sCcqfvdkxrjpNoKqAYNxQlgJ
 6DHgHCKZP3JB1e2EFqViw0GJgZIjTNxlWvx8XLcAShSapQ+Ovq/iAcKo41o7ZadB
 4zV//VkBMv0TLNTs6SoR0EO8qM+2nIUKE8fgPrRxvvb98tuasKPvlSq9VUeIjnYk
 kWjNTQYbD1IkrAMPYrwcpLU3xkEr14wrKDBtPK6GdCDcXzdyKq3fzROOXNsqrLmn
 Y8PkY+J39B59F0DKjyrCjasZyi0tQQV6ps5Xm2X2CB003GWEbo1yu+BodShYEyaL
 7OvkLiVpOtq+LOYcsScHtOGdO9le2O3yZevNRvlrCDCvJUYbXNjaM9ZrWcQuTlJc
 oseYNSRPaIP5PMv2c+Xup9qh/dyAjj8g6gSi9BlDvwVOu/+Cf3laaCAXaFph22jT
 /m8fW2paiP5UJ0gSt1MLAGFxKi0YI/Qxck8G11LJxUwMZd3SIfOPUAY27tnNC4yL
 GRynOi3BFRMUAe/Leu2qgwEyoME5nHn+OmAKb36WTYH/HL+PGzHq84e+Wfdan8ha
 YcSKc1A52LSoYTi4XTUX
 =h2Qo
 -----END PGP SIGNATURE-----

Merge tag 'pm-merge' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull ARM SoC power management and clock changes from Olof Johansson:
 "This branch contains a largeish set of updates of power management and
  clock setup.  The bulk of it is for OMAP/AM33xx platforms, but also a
  few around hotplug/suspend/resume on Exynos.

  It includes a split-up of some of the OMAP clock data into separate
  files which adds to the diffstat, but gross delta is fairly reasonable."

* tag 'pm-merge' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (60 commits)
  ARM: OMAP: Move plat-omap/dma-omap.h to include/linux/omap-dma.h
  ASoC: OMAP: mcbsp fixes for enabling ARM multiplatform support
  watchdog: OMAP: fixup for ARM multiplatform support
  ARM: EXYNOS: Add flush_cache_all in suspend finisher
  ARM: EXYNOS: Remove scu_enable from cpuidle
  ARM: EXYNOS: Fix soft reboot hang after suspend/resume
  ARM: EXYNOS: Add support for rtc wakeup
  ARM: EXYNOS: fix the hotplug for Cortex-A15
  ARM: OMAP2+: omap_device: Correct resource handling for DT boot
  ARM: OMAP2+: hwmod: Add possibility to count hwmod resources based on type
  ARM: OMAP2+: hwmod: Add support for per hwmod/module context lost count
  ARM: OMAP2+: PRM: initialize some PRM functions early
  ARM: OMAP2+: voltage: fixup oscillator handling when CONFIG_PM=n
  ARM: OMAP4: USB: power down MUSB PHY during boot
  ARM: OMAP2+: clock: Cleanup !CONFIG_COMMON_CLK parts
  ARM: OMAP2xxx: clock: drop obsolete clock data
  ARM: OMAP2: clock: Cleanup !CONFIG_COMMON_CLK parts
  ARM: OMAP3+: DPLL: drop !CONFIG_COMMON_CLK sections
  ARM: AM33xx: clock: drop obsolete clock data
  ARM: OMAP3xxx: clk: drop obsolete clock data
  ...
2012-12-13 10:58:20 -08:00
Linus Torvalds db5b0ae007 ARM: arm-soc: device tree conversions and enablement
Continued device tree conversion and enablement across a number of
 platforms; Kirkwood, tegra, i.MX, Exynos, zynq and a couple of other
 smaller series as well.
 
 ux500 has seen continued conversion for platforms. Several platforms have
 seen pinctrl-via-devicetree conversions for simpler multiplatform. Tegra
 is adding data for new devices/drivers, and Exynos has a bunch of new
 bindings and devices added as well.
 
 So, pretty much the same progression in the right direction as the last
 few releases.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.11 (GNU/Linux)
 
 iQIcBAABAgAGBQJQySW7AAoJEIwa5zzehBx39xcP/jzEQOTOJdK4zJd1OjgrQoX/
 WnhbGJT941RNjRjvDG6HmZzhpsRoE4q/zkjFEKoKELdikRW0hYoR+zPCGuB7XtN5
 aF1ZQrTx4gHf4KE7doIB8slaWeOq8aG2TLFhylyy+cuaIpRK0NG0pAR0ZqWaoga9
 tZFciqzplLeo50vZ+y+lVVsR40j/w29EjwPXhCV30//gGOYLyp/VDu5PRtrBdgh8
 EgpcT2EWJwMCN/Upcao/q2JbQktPHPpSwnpaUAALYB20uD7k5jo7wtYE/+L9nn6B
 bxcCDTMVmqzNTF+y0P16hDcs5jMLVjpI0xBiyZ1G6gShpggsSZCHY5ynjAtQ19se
 r+2WrNfOR23k6arJuOUAQSEnLdx0T5SlW6CJeFEofKv4uoebxAbKUiNO4ShWskhd
 nNptX1+L3hj3zpjGcEHmL6bd+nGtyMeoG9Yekcv1oZxdVcpKhFxh0s5PEJBEeXcN
 M7aAWlWJkplV22Olqhpc/3INCweq6E+zBrBxZaUBW/JCzGrqBUGC0BULDPAkmC4J
 CKL6IqIB73jGQ4OY14IaMU20GJrIGxZ7wzXOp4aw3OUpRlxsgurfyFQeIjUvVoZL
 PJ8DRoAVwreVHvKfgZZVKpSAY7dwcWbxpWsYlrH3zWIC5vRJ0UFwsD0TpLJWd6Vi
 XA8gQcJRWKGS8E5mRY39
 =Rk9v
 -----END PGP SIGNATURE-----

Merge tag 'dt' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc

Pull ARM SoC device tree conversions and enablement from Olof Johansson:
 "Continued device tree conversion and enablement across a number of
  platforms; Kirkwood, tegra, i.MX, Exynos, zynq and a couple of other
  smaller series as well.

  ux500 has seen continued conversion for platforms.  Several platforms
  have seen pinctrl-via-devicetree conversions for simpler
  multiplatform.  Tegra is adding data for new devices/drivers, and
  Exynos has a bunch of new bindings and devices added as well.

  So, pretty much the same progression in the right direction as the
  last few releases."

Fix up conflicts as per Olof.

* tag 'dt' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (185 commits)
  ARM: ux500: Rename dbx500 cpufreq code to be more generic
  ARM: dts: add missing ux500 device trees
  ARM: ux500: Stop registering the PCM driver from platform code
  ARM: ux500: Move board specific GPIO info out to subordinate DTS files
  ARM: ux500: Disable the MMCI gpio-regulator by default
  ARM: Kirkwood: remove kirkwood_ehci_init() from new boards
  ARM: Kirkwood: Add support LED of OpenBlocks A6
  ARM: Kirkwood: Convert to EHCI via DT for OpenBlocks A6
  ARM: kirkwood: Add NAND partiton map for OpenBlocks A6
  ARM: kirkwood: Add support second I2C bus and RTC on OpenBlocks A6
  ARM: kirkwood: Add support DT of second I2C bus
  ARM: kirkwood: Convert mplcec4 board to pinctrl
  ARM: Kirkwood: Convert km_kirkwood to pinctrl
  ARM: Kirkwood: support 98DX412x kirkwoods with pinctrl
  ARM: Kirkwood: Convert IX2-200 to pinctrl.
  ARM: Kirkwood: Convert lsxl boards to pinctrl.
  ARM: Kirkwood: Convert ib62x0 to pinctrl.
  ARM: Kirkwood: Convert GoFlex Net to pinctrl.
  ARM: Kirkwood: Convert dreamplug to pinctrl.
  ARM: Kirkwood: Convert dockstar to pinctrl.
  ...
2012-12-13 10:39:26 -08:00
Linus Torvalds 50851c6248 Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux
Pull thermal management update from Zhang Rui:
 "Highlights:

   - Introduction of thermal policy support, together with three new
     thermal governors, including step_wise, user_space, fire_share.

   - Introduction of ST-Ericsson db8500_thermal driver and ST-Ericsson
     db8500_cpufreq_cooling driver.

   - Thermal Kconfig file and Makefile refactor.

   - Fixes for generic thermal layer, generic cpucooling, rcar thermal
     driver and Exynos thermal driver."

* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux: (36 commits)
  Thermal: Fix DEFAULT_THERMAL_GOVERNOR
  Thermal: fix a NULL pointer dereference when generic thermal layer is built as a module
  thermal: rcar: add rcar_zone_to_priv() macro
  thermal: rcar: fixup the unit of temperature
  thermal: cpu cooling: allow module builds
  thermal: cpu cooling: use const parameter while registering
  Thermal: Add ST-Ericsson DB8500 thermal properties and platform data.
  Thermal: Add ST-Ericsson DB8500 thermal driver.
  drivers/thermal/Makefile refactor
  Exynos: Add missing dependency
  Refactor drivers/thermal/Kconfig
  thermal: cpu_cooling: Make 'notify_device' static
  Thermal: Remove the cooling_cpufreq_list.
  Thermal: fix bug of counting cpu frequencies.
  Thermal: add indent for code alignment.
  thermal: rcar_thermal: remove explicitly used devm_kfree/iounap()
  thermal: user_space: Add missing static storage class specifiers
  thermal: fair_share: Add missing static storage class specifiers
  thermal: step_wise: Add missing static storage class specifiers
  Thermal: Fix oops and unlocking in thermal_sys.c
  ...
2012-12-12 07:57:13 -08:00
Anton Vorontsov 76d8a23b12 Merge git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux
The merge is merely to fix conflicts before sending a pull request.

Conflicts:
	drivers/power/ab8500_btemp.c
	drivers/power/ab8500_charger.c
	drivers/power/ab8500_fg.c
	drivers/power/abx500_chargalg.c
	drivers/power/max8925_power.c

Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-12-11 22:15:57 -08:00
Lee Jones 215cf5c93d ab8500_bm: Make the battery Device Tree node reference less cryptic
Let's rename the Device Tree node which contains information about
an attached battery to something more easily readable.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
2012-12-11 08:43:55 +00:00
Lee Jones bdc56b4403 abx500_chargalg: Reorder obtainment of platform specific battery management data
Now that we always pass platform specific battery management data
through platform_data instead of obtaining it via different means
depending the way be boot the system (DT or ATAGs); we need to
re-jiggle the way we acquire it in the driver start-up functions.
Now it is wrong for it to be missing, but we still allow Device
Tree code to fiddle with it once we've confirmed it's there.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
2012-12-11 08:43:55 +00:00
Lee Jones 195c1c660c ab8500_fg: Reorder obtainment of platform specific battery management data
Now that we always pass platform specific battery management data
through platform_data instead of obtaining it via different means
depending the way be boot the system (DT or ATAGs); we need to
re-jiggle the way we acquire it in the driver start-up functions.
Now it is wrong for it to be missing, but we still allow Device
Tree code to fiddle with it once we've confirmed it's there.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
2012-12-11 08:43:55 +00:00
Lee Jones 7722b79964 ab8500_charger: Reorder obtainment of platform specific battery management data
Now that we always pass platform specific battery management data
through platform_data instead of obtaining it via different means
depending the way be boot the system (DT or ATAGs); we need to
re-jiggle the way we acquire it in the driver start-up functions.
Now it is wrong for it to be missing, but we still allow Device
Tree code to fiddle with it once we've confirmed it's there.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
2012-12-11 08:43:54 +00:00
Lee Jones 95820245ed ab8500_btemp: Reorder obtainment of platform specific battery management data
Now that we always pass platform specific battery management data
through platform_data instead of obtaining it via different means
depending the way be boot the system (DT or ATAGs); we need to
re-jiggle the way we acquire it in the driver start-up functions.
Now it is wrong for it to be missing, but we still allow Device
Tree code to fiddle with it once we've confirmed it's there.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
2012-12-11 08:43:54 +00:00
Lee Jones 23a04f9f40 ab8500_bm: Always send platform specific battery information via pdata
Currently the AB8500 battery management subsystem receives platform
specific information via two different means depending on how the
platform is booted. If DT is not enabled, a reference to a *_bm_data
data structure containing each platform specific attribute is passed
though platform_data. However, if DT is enabled, then platform_data
is empty and the reference is gained though a DT specific probe
function. There are two issues here 1) the same reference is
being collected each time and 2) the DT way doesn't allow any
provisions to select different platform specific attributes, which
kind of defeats the object.

Cc: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
2012-12-11 08:43:54 +00:00
Lee Jones b0284de05e ab8500_bm: Rename battery management platform data to something more logical
The platform specific battery management configuration data structure
is currently called 'bat' short for 'battery'; however, it contains
information for all components of the battery management group, rather
than information pertaining to the battery itself - there are other
structures for that. So, in keeping with its structure namesake
'abx500_bm_data', we rename it to 'bm' here. Using similar logic,
we're also renaming 'bmdevs_of_probe' to the more device specific
'ab8500_bm_of_probe'.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
2012-12-11 08:43:53 +00:00
Lee Jones 8e3a71e56c ab8500-bmdata: Re-jiggle bmdevs_of_probe to be more succinct
We can actually write bmdevs_of_probe to be easier to follow, use
less lines of code and we can even render a variable unused so
that we can remove it completely.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
2012-12-11 08:43:53 +00:00
Lee Jones 43dc4470e3 ab8500_btemp: Fix crazy tabbing implementation
Simple patch to rectify incorrect tabbing. Also adds some
coding style clean-ups to make it easier to read.

Signed-off-by: Lee Jones <lee.jones@linaro.org>
2012-12-11 08:43:52 +00:00
Jonas Aaberg f6271b4fb1 ab8500_btemp: Detect battery type in workqueue
Detect battery type in work queue instead of probe.

This reduces the system boot time with 1.5s.

Signed-off-by: Jonas Aaberg <jonas.aberg@stericsson.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Karl KOMIEROWSKI <karl.komierowski@stericsson.com>
2012-12-11 08:43:52 +00:00
Kalle Komierowski e32ad07cea ab8500_fg: Don't clear the CCMuxOffset bit
The CCMuxOffset bit is not kept set. This will force the
columb counter of the AB8500 to use the measure offset
calibration. This should increase the accuracy of the fuel
gauge.

Signed-off-by: Kalle Komierowski <karl.komierowski@stericsson.com>
Signed-off-by: Marcus Cooper <marcus.xm.cooper@stericsson.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Jonas ABERG <jonas.aberg@stericsson.com>
2012-12-11 08:43:52 +00:00
Johan Bjornstedt f8e96dff24 ab8500_charger: Charger current step-up/down
There is no state machine in the AB to step up/down the charger
current to avoid dips and spikes on VBUS and VBAT when charging
is started. Instead this is implemented in SW.

Signed-off-by: Johan Bjornstedt <johan.bjornstedt@stericsson.com>
Signed-off-by: Mattias Wallin <mattias.wallin@stericsson.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Karl KOMIEROWSKI <karl.komierowski@stericsson.com>
2012-12-11 08:43:51 +00:00
Rajanikanth H.V f5695a3983 ab8500: remove explicit handling of battery type
property, battery-type shall be one of supported technology type
instead blank
- refer: Documentation/devicetree/bindings/power_supply/ab8500/fg.txt
	for the list supported types
- this patch appends to ab8500 bm devs DT binding patch set
	ref: commit-id e0f1abeba5
		git://git.infradead.org/battery-2.6.git
- promote ab8500_fg probe to happen before ab8500_btemp probe as
	btemp driver depends on fuelgauge list,
	ref: ab8500_fg_get(...)

Signed-off-by: Rajanikanth H.V <rajanikanth.hv@stericsson.com>
2012-12-11 08:43:51 +00:00
Olof Johansson 9121dfca73 omap prcm changes via Paul Walmsley <paul@pwsan.com>:
Some miscellaneous OMAP hwmod changes for 3.8, along with a PRM
 change needed for one of the hwmod patches to function.
 
 Basic test logs for this branch on top of Tony's
 omap-for-v3.8/clock branch at commit
 558a0780b0 are here:
 
 http://www.pwsan.com/omap/testlogs/hwmod_devel_a_3.8/20121121161522/
 
 However, omap-for-v3.8/clock at 558a0780 does not include some fixes
 that are needed for a successful test.  With several reverts,
 fixes, and workarounds applied, the following test logs were
 obtained:
 
 http://www.pwsan.com/omap/testlogs/TEST_hwmod_devel_a_3.8/20121121162719/
 
 which indicate that the series tests cleanly.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1.4.12 (GNU/Linux)
 
 iQIcBAABAgAGBQJQs9J2AAoJEBvUPslcq6Vznz0QAM5Q8krs4fAZ35ekOnAAeh4a
 kWbkSq/VH74uPMbobUOeHVusJbfZBxm24CT/911wNXIHg/hku6WPhnQzStX2n/6w
 JKtHcQXeftgXecHBeyjDGdypcwknwTzIg78BECJi1FO+y/imaMjvxLDm74BXdBRF
 bLLmMLe2+Fnwz4IjwtOPz9mbje9NexMy+ppDyIVT36H+t9PQwDArOJMqLINWdioW
 e9LjUM4mr/5YZEOVu1tC30bJIcKq/m5yYS7dwifcSN67EsMUw90kQTKFtmNC2SzL
 DozIUHdsc990U65LhrH5EzoluT/tWPFl+ijkLmehfaVgSYIT5CmkDCgKUFNNY83r
 7eVcPYvK8Nf2V8s0rMwy2mBy8j9p3Yug/kmOpRxdI90YCqxikJD5zdW+yQVX4qnt
 GXOyfw9BwK8g0Y7lEea1MN2s+y1E3n8EcaVyvQAW4N0wCkm3ELE6rm9HZoBXD3+d
 4EovXn8DmTfvqiJ/M/FCqphyMMvp+NhO8Cg2vJUotEiCHdbIkaeXNI4AWg/sMlId
 aXUazd2i1WvynXvcSqJBbSKZQM+8GBPAuxqSQc8tP0JuOZo//sBYbXSUFClWksaw
 bvp+iJ6g/4/QqIG/B5EARSbkfCI1fTfTYObLe2Pd3cRdML3F0f/rCWRjPfl20BnQ
 weUVgyikcXT+aH2sfdIB
 =JSAM
 -----END PGP SIGNATURE-----

Merge tag 'omap-for-v3.8/devel-prcm-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/pm2

From Tony Lindgren:

omap prcm changes via Paul Walmsley <paul@pwsan.com>:

Some miscellaneous OMAP hwmod changes for 3.8, along with a PRM
change needed for one of the hwmod patches to function.

Basic test logs for this branch on top of Tony's
omap-for-v3.8/clock branch at commit
558a0780b0 are here:

http://www.pwsan.com/omap/testlogs/hwmod_devel_a_3.8/20121121161522/

However, omap-for-v3.8/clock at 558a0780 does not include some fixes
that are needed for a successful test.  With several reverts,
fixes, and workarounds applied, the following test logs were
obtained:

http://www.pwsan.com/omap/testlogs/TEST_hwmod_devel_a_3.8/20121121162719/

which indicate that the series tests cleanly.

* tag 'omap-for-v3.8/devel-prcm-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: (49 commits)
  ARM: OMAP2+: omap_device: Correct resource handling for DT boot
  ARM: OMAP2+: hwmod: Add possibility to count hwmod resources based on type
  ARM: OMAP2+: hwmod: Add support for per hwmod/module context lost count
  ARM: OMAP2+: PRM: initialize some PRM functions early
  ARM: OMAP2+: clock: Cleanup !CONFIG_COMMON_CLK parts
  ARM: OMAP2xxx: clock: drop obsolete clock data
  ARM: OMAP2: clock: Cleanup !CONFIG_COMMON_CLK parts
  ARM: OMAP3+: DPLL: drop !CONFIG_COMMON_CLK sections
  ARM: AM33xx: clock: drop obsolete clock data
  ARM: OMAP3xxx: clk: drop obsolete clock data
  ARM: OMAP3: clock: Cleanup !CONFIG_COMMON_CLK parts
  ARM: OMAP44xx: clock: drop obsolete clock data
  ARM: OMAP4: clock: Cleanup !CONFIG_COMMON_CLK parts
  ARM: OMAP: hwmod: Cleanup !CONFIG_COMMON_CLK parts
  ARM: OMAP: clock: Switch to COMMON clk
  ARM: OMAP2: clock: Add 24xx data using common struct clk
  ARM: OMAP3: clock: Add 3xxx data using common struct clk
  ARM: AM33XX: clock: add clock data in common clock format
  ARM: OMAP4: clock: Add 44xx data using common struct clk
  ARM: OMAP2+: clock: add OMAP CCF convenience macros to mach-omap2/clock.h
  ...

Some context conflicts due to nearby changes resolved in
arch/arm/mach-omap2/io.c.

Signed-off-by: Olof Johansson <olof@lixom.net>
2012-11-29 22:49:30 -08:00
Bill Pemberton 415ec69fb1 power: remove use of __devexit
CONFIG_HOTPLUG is going away as an option so __devexit is no
longer needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Anton Vorontsov <cbou@mail.ru>
Cc: David Woodhouse <dwmw2@infradead.org>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-28 11:43:22 -08:00
Bill Pemberton c8afa6406e power: remove use of __devinit
CONFIG_HOTPLUG is going away as an option so __devinit is no longer
needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Anton Vorontsov <cbou@mail.ru>
Cc: David Woodhouse <dwmw2@infradead.org>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-28 11:43:22 -08:00
Bill Pemberton 28ea73f4c6 power: remove use of __devexit_p
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer
needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Anton Vorontsov <cbou@mail.ru>
Cc: David Woodhouse <dwmw2@infradead.org>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-28 11:43:22 -08:00
Jamie Lentin 96ff0f5c7e power: Add simple poweroff-gpio driver
Given appropriate devicetree bindings, this driver registers a
pm_power_off function to set a GPIO line high/low to power down
your board.

Signed-off-by: Jamie Lentin <jm@lentin.co.uk>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Tested-by:Simon Baatz <gmbnomis@gmail.com>
Signed-off-by: Jason Cooper <jason@lakedaemon.net>
2012-11-24 02:56:38 +00:00
Fabio Estevam 4b5edf7887 power: da9052-battery: Convert to the new da9052 interrupt functions
Convert to the new da9052 interrupt functions, so that we can get rid of
irq_base references.

Acked-by: Anton Vorontsov <cbouatmailru@gmail.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2012-11-20 12:21:11 +01:00
Qing Xu eba3b670a9 max8925_power: Add support for device-tree initialization
This patch adds support for initializing platform data from the
device-tree description.

Signed-off-by: Qing Xu <qingx@marvell.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-11-18 23:54:07 -08:00
Rajanikanth H.V a12810ab9f ab8500: Add devicetree support for chargalg
This patch adds device tree support for charging algorithm driver

Signed-off-by: Rajanikanth H.V <rajanikanth.hv@stericsson.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-11-18 19:37:18 -08:00
Rajanikanth H.V 4aef72dbb2 ab8500: Add devicetree support for charger
This patch adds device tree support for ab8500-charger driver

Signed-off-by: Rajanikanth H.V <rajanikanth.hv@stericsson.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-11-18 19:37:16 -08:00
Rajanikanth H.V bd9e8ab2d5 ab8500: Add devicetree support for btemp
This patch adds device tree support for battery-temperature-monitor driver

Signed-off-by: Rajanikanth H.V <rajanikanth.hv@stericsson.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-11-18 19:37:14 -08:00
Rajanikanth H.V e0f1abeba5 ab8500: Add devicetree support for fuelgauge
- This patch adds device tree support for fuelgauge driver
- optimize bm devices platform_data usage and of_probe(...)
  Note: of_probe() routine for battery managed devices is made
  common across all bm drivers.
- test status:
  - interrupt numbers assigned differs between legacy and FDT mode.

Signed-off-by: Rajanikanth H.V <rajanikanth.hv@stericsson.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-11-18 19:37:04 -08:00
Peter Ujfalusi e9f14c18b8 twl4030_charger: Change TWL4030_MODULE_* ids to TWL_MODULE_*
To facilitate upcoming cleanup in twl stack. No functional changes.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-11-18 16:14:52 -08:00
Marcos Paulo de Souza 9790f98fdc jz4740-battery: Use devm_request_and_ioremap
No functional changes. Just a cleanup.

Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-11-18 16:10:45 -08:00
Marcos Paulo de Souza ec073c9b31 jz4740-battery: Use devm_kzalloc
This is just a small cleanup, makes a logic a little bit more simplier.

Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-11-18 16:10:36 -08:00
Pali Rohár e59ec4a189 bq27x00_battery: Fixup nominal available capacity reporting
We should not not report nominal available capacity if battery is not
calibrated, as we don't want to represent bogus values in the sysfs and
confuse userland.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-11-18 16:02:41 -08:00
Anton Vorontsov 6c47a3e00c bq2415x_charger: Fix style issues
I hate doing these style fixups myself, but I also hate inconsitent code.
Normally I just ask to resubmit the patch with the issues fixed, but N900
is special: I have a selfish interest in it. :)

Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2012-11-18 15:58:42 -08:00
Anton Vorontsov 7ad8583073 bq2415x_charger: Add Kconfig/Makefile entries
This commit adds Kconfig and Makefile entries so that we could actually
build the driver.

Signed-off-by: Anton Vorontsov <cbouatmailru@gmail.com>
2012-11-18 15:57:20 -08:00
Pali Rohár 0bc98cc615 power_supply: Add bq2415x charger driver
The bq2415x charger driver is needed for example on Nokia N900 for
charging battery. Driver is part of open source project to replace
proprietary battery management.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-11-18 15:39:04 -08:00
Pali Rohár 04930baf28 power_supply: Add new Nokia RX-51 (N900) power supply battery driver
This driver exporting battery design capacity, temperature and voltage for
battery in Nokia RX-51. This driver is needed for open source battery
management on Nokia RX-51 (N900).

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-11-18 15:11:33 -08:00
Alan Cox a879f19fe7 max17042_battery: Fix missing verify_model_lock() return value check
The second error check is unreachable because the lock function isn't
assigned to ret.

Signed-off-by: Alan Cox <alan@linux.intel.com>
Acked-by: Ramakrishna Pallala <ramakrishna.pallala@intel.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-11-18 14:59:47 -08:00
Dan Carpenter 8511748ba1 ds2782_battery: Fix signedness bug in ds278x_read_reg16()
We need to check for negative values before doing the swab16() for the
error handling to work.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-11-18 14:46:39 -08:00
Kim, Milo 08d816b8cb lp8788-charger: Fix ADC channel names
The name of ADC channel is configurable in the platform side. This name is
referenced in the IIO consumer driver. To get the IIO channel, specific
name in the platform data is used as an parameter of the
iio_channel_get(). Thus, lp8788_adc_id platform data are replaced with
specific names.

Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-11-17 20:44:44 -08:00
Kim, Milo 340968de48 lp8788-charger: Fix wrong ADC conversion
To get the battery voltage and temperature, IIO ADC functions are used.
LP8788 ADC driver provides RAW and SCALE channel information. This patch
fixes wrong ADC result.

Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>
Reviewed-by Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-11-17 20:42:12 -08:00
Kim, Milo 968a47836c lp8788-charger: Use consumer device name on setting IIO channels
To get the ADC value for the battery voltage and temperature, LP8788 ADC
driver is used. LP8788 charger driver is the consumer of LP8788 ADC
driver. Thus, specific ADC driver name is required on getting the channel
using iio_channel_get().

Signed-off-by: Milo(Woogyom) Kim <milo.kim@ti.com>
Acked-by: Jonathan Cameron <jic23@kernel.org>
Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
2012-11-17 20:40:59 -08:00