Commit graph

589 commits

Author SHA1 Message Date
Artem Borisov
d7992e6feb Merge remote-tracking branch 'stable/linux-3.4.y' into lineage-15.1
All bluetooth-related changes were omitted because of our ancient incompatible bt stack.

Change-Id: I96440b7be9342a9c1adc9476066272b827776e64
2017-12-27 17:13:15 +03:00
Valentin Rothberg
7c3bbea90b wm831x_power: Use IRQF_ONESHOT to request threaded IRQs
commit 90adf98d9530054b8e665ba5a928de4307231d84 upstream.

Since commit 1c6c69525b ("genirq: Reject bogus threaded irq requests")
threaded IRQs without a primary handler need to be requested with
IRQF_ONESHOT, otherwise the request will fail.

scripts/coccinelle/misc/irqf_oneshot.cocci detected this issue.

Fixes: b5874f33bb ("wm831x_power: Use genirq")
Signed-off-by: Valentin Rothberg <valentinrothberg@gmail.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Zefan Li <lizefan@huawei.com>
2016-10-26 23:15:22 +08:00
Krzysztof Kozlowski
9fa2377fcc power: charger-manager: Fix NULL pointer exception with missing cm-fuel-gauge
commit 661a888602 upstream.

NULL pointer exception happens during charger-manager probe if
'cm-fuel-gauge' property is not present.

[    2.448536] Unable to handle kernel NULL pointer dereference at virtual address 00000000
[    2.456572] pgd = c0004000
[    2.459217] [00000000] *pgd=00000000
[    2.462759] Internal error: Oops: 5 [#1] PREEMPT SMP ARM
[    2.468047] Modules linked in:
[    2.471089] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.17.0-rc6-00251-ge44cf96cd525-dirty #969
[    2.479765] task: ea890000 ti: ea87a000 task.ti: ea87a000
[    2.485161] PC is at strcmp+0x4/0x30
[    2.488719] LR is at power_supply_match_device_by_name+0x10/0x1c
[    2.494695] pc : [<c01f4220>]    lr : [<c030fe38>]    psr: a0000113
[    2.494695] sp : ea87bde0  ip : 00000000  fp : eaa97010
[    2.506150] r10: 00000004  r9 : ea97269c  r8 : ea3bbfd0
[    2.511360] r7 : eaa97000  r6 : c030fe28  r5 : 00000000  r4 : ea3b0000
[    2.517869] r3 : 0000006d  r2 : 00000000  r1 : 00000000  r0 : c057c195
[    2.524381] Flags: NzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
[    2.531671] Control: 10c5387d  Table: 4000404a  DAC: 00000015
[    2.537399] Process swapper/0 (pid: 1, stack limit = 0xea87a240)
[    2.543388] Stack: (0xea87bde0 to 0xea87c000)
[    2.547733] bde0: ea3b0210 c026b1c8 eaa97010 eaa97000 eaa97010 eabb60a8 ea3b0210 00000000
[    2.555891] be00: 00000008 ea2db210 ea1a3410 c030fee0 ea3bbf90 c03138fc c068969c c013526c
[    2.564050] be20: eaa040c0 00000000 c068969c 00000000 eaa040c0 ea2da300 00000002 00000000
[    2.572208] be40: 00000001 ea2da3c0 00000000 00000001 00000000 eaa97010 c068969c 00000000
[    2.580367] be60: 00000000 c068969c 00000000 00000002 00000000 c026b71c c026b6f0 eaa97010
[    2.588527] be80: c0e82530 c026a330 00000000 eaa97010 c068969c eaa97044 00000000 c061df50
[    2.596686] bea0: ea87a000 c026a4dc 00000000 c068969c c026a448 c0268b5c ea8054a8 eaa8fd50
[    2.604845] bec0: c068969c ea2db180 c06801f8 c0269b18 c0590f68 c068969c c0656c98 c068969c
[    2.613004] bee0: c0656c98 ea3bbe40 c06988c0 c026aaf0 00000000 c0656c98 c0656c98 c00088a4
[    2.621163] bf00: 00000000 c0055f48 00000000 00000004 00000000 ea890000 c05dbc54 c062c178
[    2.629323] bf20: c0603518 c005f674 00000001 ea87a000 eb7ff83b c0476440 00000091 c003d41c
[    2.637482] bf40: c05db344 00000007 eb7ff858 00000007 c065a76c c0647d24 00000007 c062c170
[    2.645642] bf60: c06988c0 00000091 c062c178 c0603518 00000000 c0603cc4 00000007 00000007
[    2.653801] bf80: c0603518 c0c0c0c0 00000000 c0453948 00000000 00000000 00000000 00000000
[    2.661959] bfa0: 00000000 c0453950 00000000 c000e728 00000000 00000000 00000000 00000000
[    2.670118] bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[    2.678277] bfe0: 00000000 00000000 00000000 00000000 00000013 00000000 c0c0c0c0 c0c0c0c0
[    2.686454] [<c01f4220>] (strcmp) from [<c030fe38>] (power_supply_match_device_by_name+0x10/0x1c)
[    2.695303] [<c030fe38>] (power_supply_match_device_by_name) from [<c026b1c8>] (class_find_device+0x54/0xac)
[    2.705106] [<c026b1c8>] (class_find_device) from [<c030fee0>] (power_supply_get_by_name+0x1c/0x30)
[    2.714137] [<c030fee0>] (power_supply_get_by_name) from [<c03138fc>] (charger_manager_probe+0x3d8/0xe58)
[    2.723683] [<c03138fc>] (charger_manager_probe) from [<c026b71c>] (platform_drv_probe+0x2c/0x5c)
[    2.732532] [<c026b71c>] (platform_drv_probe) from [<c026a330>] (driver_probe_device+0x10c/0x224)
[    2.741384] [<c026a330>] (driver_probe_device) from [<c026a4dc>] (__driver_attach+0x94/0x98)
[    2.749813] [<c026a4dc>] (__driver_attach) from [<c0268b5c>] (bus_for_each_dev+0x54/0x88)
[    2.757969] [<c0268b5c>] (bus_for_each_dev) from [<c0269b18>] (bus_add_driver+0xd4/0x1d0)
[    2.766123] [<c0269b18>] (bus_add_driver) from [<c026aaf0>] (driver_register+0x78/0xf4)
[    2.774110] [<c026aaf0>] (driver_register) from [<c00088a4>] (do_one_initcall+0x80/0x1bc)
[    2.782276] [<c00088a4>] (do_one_initcall) from [<c0603cc4>] (kernel_init_freeable+0x100/0x1cc)
[    2.790952] [<c0603cc4>] (kernel_init_freeable) from [<c0453950>] (kernel_init+0x8/0xec)
[    2.799029] [<c0453950>] (kernel_init) from [<c000e728>] (ret_from_fork+0x14/0x2c)
[    2.806572] Code: e12fff1e e1a03000 eafffff7 e4d03001 (e4d12001)
[    2.812832] ---[ end trace 7f12556111b9e7ef ]---

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Fixes: 856ee6115e ("charger-manager: Support deivce tree in charger manager driver")
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Zefan Li <lizefan@huawei.com>
2015-02-02 17:04:43 +08:00
Krzysztof Kozlowski
7db019a232 power: max17040: Fix NULL pointer dereference when there is no platform_data
commit ac323d8d80 upstream.

Fix NULL pointer dereference of "chip->pdata" if platform_data was not
supplied to the driver.

The driver during probe stored the pointer to the platform_data:
	chip->pdata = client->dev.platform_data;
Later it was dereferenced in max17040_get_online() and
max17040_get_status().

If platform_data was not supplied, the NULL pointer exception would
happen:

[    6.626094] Unable to handle kernel  of a at virtual address 00000000
[    6.628557] pgd = c0004000
[    6.632868] [00000000] *pgd=66262564
[    6.634636] Unable to handle kernel paging request at virtual address e6262000
[    6.642014] pgd = de468000
[    6.644700] [e6262000] *pgd=00000000
[    6.648265] Internal error: Oops: 5 [#1] PREEMPT SMP ARM
[    6.653552] Modules linked in:
[    6.656598] CPU: 0 PID: 31 Comm: kworker/0:1 Not tainted 3.10.14-02717-gc58b4b4 #505
[    6.664334] Workqueue: events max17040_work
[    6.668488] task: dfa11b80 ti: df9f6000 task.ti: df9f6000
[    6.673873] PC is at show_pte+0x80/0xb8
[    6.677687] LR is at show_pte+0x3c/0xb8
[    6.681503] pc : [<c001b7b8>]    lr : [<c001b774>]    psr: 600f0113
[    6.681503] sp : df9f7d58  ip : 600f0113  fp : 00000009
[    6.692965] r10: 00000000  r9 : 00000000  r8 : dfa11b80
[    6.698171] r7 : df9f7ea0  r6 : e6262000  r5 : 00000000  r4 : 00000000
[    6.704680] r3 : 00000000  r2 : e6262000  r1 : 600f0193  r0 : c05b3750
[    6.711194] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
[    6.718485] Control: 10c53c7d  Table: 5e46806a  DAC: 00000015
[    6.724218] Process kworker/0:1 (pid: 31, stack limit = 0xdf9f6238)
[    6.730465] Stack: (0xdf9f7d58 to 0xdf9f8000)
[    6.914325] [<c001b7b8>] (show_pte+0x80/0xb8) from [<c047107c>] (__do_kernel_fault.part.9+0x44/0x74)
[    6.923425] [<c047107c>] (__do_kernel_fault.part.9+0x44/0x74) from [<c001bb7c>] (do_page_fault+0x2c4/0x360)
[    6.933144] [<c001bb7c>] (do_page_fault+0x2c4/0x360) from [<c0008400>] (do_DataAbort+0x34/0x9c)
[    6.941825] [<c0008400>] (do_DataAbort+0x34/0x9c) from [<c000e5d8>] (__dabt_svc+0x38/0x60)
[    6.950058] Exception stack(0xdf9f7ea0 to 0xdf9f7ee8)
[    6.955099] 7ea0: df0c1790 00000000 00000002 00000000 df0c1794 df0c1790 df0c1790 00000042
[    6.963271] 7ec0: df0c1794 00000001 00000000 00000009 00000000 df9f7ee8 c0306268 c0306270
[    6.971419] 7ee0: a00f0113 ffffffff
[    6.974902] [<c000e5d8>] (__dabt_svc+0x38/0x60) from [<c0306270>] (max17040_work+0x8c/0x144)
[    6.983317] [<c0306270>] (max17040_work+0x8c/0x144) from [<c003f364>] (process_one_work+0x138/0x440)
[    6.992429] [<c003f364>] (process_one_work+0x138/0x440) from [<c003fa64>] (worker_thread+0x134/0x3b8)
[    7.001628] [<c003fa64>] (worker_thread+0x134/0x3b8) from [<c00454bc>] (kthread+0xa4/0xb0)
[    7.009875] [<c00454bc>] (kthread+0xa4/0xb0) from [<c000eb28>] (ret_from_fork+0x14/0x2c)
[    7.017943] Code: e1a03005 e2422480 e0826104 e59f002c (e7922104)
[    7.024017] ---[ end trace 73bc7006b9cc5c79 ]---

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Fixes: c6f4a42de6
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-22 10:32:46 -08:00
Hank_Lee
c15d2bff5e power: bq27541: cancel poll work first to prevent querying gauge interleaved
Bug: 11632540
Change-Id: Idb7809c03807c254b33de4cd3242a6eeefb41dab
Signed-off-by: Hank_Lee <Hank_Lee@asus.com>
2013-12-12 23:04:27 +00:00
Hank_Lee
b60cd31fc3 charger: smb345: report wireless online = 0 when OTG is plugged
OTG has higher priority than wireless charging, we need to:
1. bypass wireless irq work when OTG is plugged
2. report wireless online = 0 when using wireless charging then
   plugging OTG
or it will show charging icon even battery status is "Not Charging"

Bug: 11073722
Change-Id: I5a807817a5733d043316d2ad04dde50b0b506895
Signed-off-by: Hank_Lee <Hank_Lee@asus.com>
2013-11-08 23:27:22 +00:00
Hank_Lee
f3041f511e charger: smb345: reduce JEITA hot limit temperature to stop charging
modify hot limit temperature from 55°C  to 45°C  to stop charging

Bug: 11222237
Change-Id: I81bc8d75bba59635d5b136bbf41cf3090d4d2b4f
Signed-off-by: Hank_Lee <Hank_Lee@asus.com>
2013-10-15 17:16:56 +00:00
Hank_Lee
e7204e7b83 charger: smb345: monitor AICL result in case of VBUS drop
VBUS drop level may not affect VBUS_DET to trigger IRQ,
it results in AICL result much lower without being noticed,
we check AICL result during battery polling and reconfig it
if neccessary

Bug: 10812199
Change-Id: I98dde8cdd5061d02851cb5f519c437b220906add
Signed-off-by: Hank_Lee <Hank_Lee@asus.com>
2013-10-09 00:05:05 +00:00
Hank_Lee
77f043e2e3 power: bq27541: add error handle to report previous valid capacity
Bug: 9984381
Change-Id: Ie27d105c8e42b9e9f69dfa219759de23526b21f9
Signed-off-by: Hank_Lee <Hank_Lee@asus.com>
2013-08-13 06:42:10 +00:00
Ajay Dudani
6f78c7af16 power: pm8921-bms: expose coulomb counter based charge
Average current drawn can be calculated by reading the coulomb
counter based charge before and after the usecase is run and
dividing the difference in the charge by the time it took to
run the usecase.

Use power supply property POWER_SUPPLY_PROP_CHARGE_NOW, to
expose the coulomb counter based charge.

Change-Id: I43e26a2932ab3e3d9d79bb5af7daf2364ca133b7
Signed-off-by: Abhijeet Dharmapurikar <adharmap@codeaurora.org>
Signed-off-by: Ajay Dudani <adudani@codeaurora.org>
2013-07-17 10:23:28 -07:00
Hank_Lee
b647aab926 power: bq27541: re-read capacity to insure valid return value
Bug: 9772236
Change-Id: I294bd8ded38080b4b86b8878a52ee9d048ffaa5b
Signed-off-by: Hank_Lee <Hank_Lee@asus.com>
2013-07-16 16:22:02 +08:00
Hank_Lee
149c49f191 charger: smb345: refine JEITA to avoid battery over voltage
In high temperature environment, charger will occur over-voltage
and it will latch charging battery function, we need to refine
JEITA function to avoid it

Bug: 9847839
Change-Id: I1185fd3a49e318ebd83b30d843d2b72c39f22e40
Signed-off-by: Hank_Lee <Hank_Lee@asus.com>
2013-07-15 17:31:52 +00:00
Kees Cook
46796ed300 charger-manager: Ensure event is not used as format string
commit 3594f4c0d7 upstream.

The exposed interface for cm_notify_event() could result in the event msg
string being parsed as a format string. Make sure it is only used as a
literal string.

Signed-off-by: Kees Cook <keescook@chromium.org>
Cc: Anton Vorontsov <cbou@mail.ru>
Cc: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: Anton Vorontsov <anton@enomsg.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-07-13 11:03:40 -07:00
Hank_Lee
bf432b3836 charger: smb345: hold wakelock when wireless charging
Bug: 9474292
Change-Id: I6d149bfbf5b2d7557f6aa2a28b1168e5fc7b4499
Signed-off-by: Hank_Lee <Hank_Lee@asus.com>
2013-07-11 02:48:17 +00:00
Hank_Lee
b38c87af16 charger: smb345: disable wireless charging IRQ when AC plugged
Because AC has first priority of charging, we need to
disable wireless charging IRQ when AC plugged to avoid
reconfig AC input current frequently

Bug: 9615541
Change-Id: I908b4825193dc463ef11d7eaf47ac61204b6692a
Signed-off-by: Hank_Lee <Hank_Lee@asus.com>
2013-06-28 18:34:23 +00:00
Hank_Lee
7c8ac74b83 charger: smb345: reconfig USBIN input current limit
USBIN input current limit may load smb345 default(500mA)
even AC adapter due to VBUS drop, we need to reconfig it

Bug: 9474296
Change-Id: I46ae320180a6ec6c3f9c6e9bab6a2b1f7c7ce05a
Signed-off-by: Hank_Lee <Hank_Lee@asus.com>
2013-06-18 19:16:39 +08:00
Hank_Lee
35b0d3174f charger: smb345: hold 2s tiemout wakelock during resume
The system resume then suspend too fast
when put on or remove wireless charging dock

Change-Id: Idddb823036b58f1c390aee500574d8379a91731f
Signed-off-by: Hank_Lee <Hank_Lee@asus.com>
2013-06-17 20:28:24 +00:00
singhome_lee
19ff52b7dc charger mode: one scenario of charger mode.
Reboot the device to charger mode when user turn off device and
Wirless/AC/USB is plugged.
verify ok in android-msm-flo-3.4-wip-debug.

Change-Id: I9b0ff5c9f4cb0f11677d978cb34bbd2db2082c51
Signed-off-by: singhome_lee <singhome_lee@asus.com>
2013-06-12 21:46:24 +00:00
Hank_Lee
a5cefa74bb charger: smb345: set float voltage as 4.3V
Bug: 9263415
Change-Id: I6ba49f7d2409476eb85963509ce90f9423b15be7
Signed-off-by: alan_lu <alan_lu@asus.com>
Signed-off-by: Hank_Lee <Hank_Lee@asus.com>
2013-06-05 00:13:10 +00:00
alan_lu
e9835c3117 charger: smb345: shutdown system when battery capacity is 0%
To avoid battery is drained to critial low state,
it needs to shutdown device when charging + battery capacity = 0%

Change-Id: If62f1808fdfa527fba065f16268907fedc319601
Signed-off-by: hank_lee <hank_lee@asus.com>
Signed-off-by: alan_lu <alan_lu@asus.com>
2013-05-23 16:29:14 +00:00
Hank_Lee
7d34741b7e power: bq27541: speed up reporting battery status during resume
Bug: 9005526
Change-Id: Ie1d4451a1872549294fc7443bf91cc66c350da36
Signed-off-by: Hank_Lee <Hank_Lee@asus.com>
2013-05-23 07:46:50 +08:00
alan_lu
b7e372e772 power: bq27541: hold 5s timeout wakelock when plug/unplug cable
For the system suspend/resume issue.

Bug: 8747455

Change-Id: Ic4a8eac520efc73e8313f3a1832d043cc19644b0
Signed-off-by: alan_lu <alan_lu@asus.com>
2013-05-22 16:37:30 +00:00
Hank_Lee
97a9311d96 charger: smb345: add JEITA function
1. If there is charging source, set Hard/Soft Hot Limit
   when system is awake or suspend(shutdown)
2. Monitor battery temperature to set corresponding float voltage
   and disable/enable charger

Change-Id: Ia804a935570bbb5a1fe22067a712eaef36e903c0
Signed-off-by: Hank_Lee <Hank_Lee@asus.com>
2013-05-16 17:42:08 +00:00
Hank_Lee
56659cd8ce power: bq27541: support negative temperature from -20°C ~ 80°C
Change-Id: I206e4bc4eaa6268631d988b8d712fee4cdd0bb33
Signed-off-by: Hank_Lee <Hank_Lee@asus.com>
2013-05-10 17:17:07 +08:00
Hank_Lee
b9076c3865 power: bq27541: just notify read temp fail instead of shutdown
Bug: 8785774
Change-Id: Ib494c82a0d14d3af3523b3b2a2d780243a651461
Signed-off-by: Hank_Lee <Hank_Lee@asus.com>
2013-05-10 03:24:23 +00:00
Hank_Lee
3291013b3d charger: smb345: setup wireless charging current limit orderly
1. detect wireless charging
2. set input current limit as 300 mA and disable AICL
3. after 2 seconds, set input current limit as 500 mA
4. after 2 seconds, set input current limit as 700 mA

Change-Id: Ia91ea674ba7eea45f92421d13b75a578a2d21a77
Signed-off-by: Hank_Lee <Hank_Lee@asus.com>
2013-05-09 16:41:50 +00:00
Hank_Lee
fdf1b1cd3a charger: smb345: config charging type priority since hardware rev_c
Priority is : 1. AC, 2. wireless charging, 3. USB.
Charger default setting is that wireless charger has higher priority,
so disable wireless charging when AC is plugged in since hardare rev_c.

Bug: 8411313
Change-Id: I6da25d1d6fbdf683421918229babba0ab97afebc
Signed-off-by: Hank_Lee <Hank_Lee@asus.com>
2013-04-30 16:30:18 +08:00
Hank_Lee
846a2318df power: bq27541: only show "Full" status when charging source exists
If there is no charging source, we should not report "Full"
battery status or it will show charging icon

Bug: 8728645

Change-Id: If74cedaca272428208c536e647094cf81af20619
Signed-off-by: Hank_Lee <Hank_Lee@asus.com>
2013-04-30 14:34:24 +08:00
alan_lu
5fc86932ed charger: smb345: support wireless charging
Change-Id: I8dc909a5befdb4a2d6bbb0457c6ab4ea3e732f28
Signed-off-by: hank_lee <hank_lee@asus.com>
Signed-off-by: alan_lu <alan_lu@asus.com>
Signed-off-by: Iliyan Malchev <malchev@google.com>
2013-04-18 16:08:47 -07:00
mars_kao
a7984c9884 TouchScreen: add update power source state.
add callback function in power driver.

Change-Id: I3f6749d21d0fde61e77d4fb12008d08618a43947
Signed-off-by: mars_kao <mars_kao@asus.com>
2013-04-18 16:08:19 -07:00
Iliyan Malchev
62fa6ca3f3 bq27541: correctly sign-extend 16-bit current value
Signed-off-by: Iliyan Malchev <malchev@google.com>
2013-04-18 16:08:19 -07:00
alan_lu
1f5fde7c3a power: bq27541: add battery current property
Report battery current to check charging/discharging
of system

Change-Id: I49705758992c9d21529a2e3f7874b990c7474d1b
Signed-off-by: hank_lee <hank_lee@asus.com>
Signed-off-by: alan_lu <alan_lu@asus.com>
Signed-off-by: Iliyan Malchev <malchev@google.com>
2013-04-18 16:08:16 -07:00
hank_lee
816adc29f5 power: bq27541: show charging status when USB plugged
Change-Id: I6dd4eb88eef83b6f647b7d2fbbcab3f2bf13c60a
Reviewed-on: http://mcrd1-5.corpnet.asus/code-review/master/68990
Reviewed-by: Nick Cheng <nick_cheng@asus.com>
Tested-by: Nick Cheng <nick_cheng@asus.com>
2013-04-18 16:08:02 -07:00
jerryyc_hu
026fab6399 charger: Add smb345 battery charger driver.
Change-Id: Ifec1f2671989258a7dd53afa2e828d90a4e69e3c
Change-Id: Ieeeea299f3302db284c5eadaa06cc66d35495d7a
Reviewed-on: http://mcrd1-5.corpnet.asus/code-review/master/68144
Reviewed-by: Nick Cheng <nick_cheng@asus.com>
Tested-by: Nick Cheng <nick_cheng@asus.com>
2013-04-18 16:07:58 -07:00
hank_lee
8540d346be power: bq27541: add support for bq27541 fuel gauge chip
Change-Id: I901dbf45efe2926e999105e64025484bcd2a91f8
Reviewed-on: http://mcrd1-5.corpnet.asus/code-review/master/68185
Reviewed-by: Nick Cheng <nick_cheng@asus.com>
Tested-by: Nick Cheng <nick_cheng@asus.com>
2013-04-18 16:07:57 -07:00
choongryeol.lee
d477b42619 power: pm8921-bms: fix divide by 0 issue when charging
The current code can divide by zero in the scale_soc_while_chg
function if calculated_soc drops while charging.
This patch fix it.

Change-Id: I83c7e9c7056990499f474c9e1882f0377df05f0c
2013-03-15 17:13:30 -07:00
Iliyan Malchev
bd000f8543 Revert "use msm8960_defconfig instead of mako_defconfig"
This reverts commit b78236b2d8.
2013-03-15 17:13:29 -07:00
David Keitel
4a52ad6f2b power: pm8921-charger: fix sub revision check
Rather than checking for the value 1 check that
bit zero is set.

Change-Id: Ie2842b28648084d8970329d7c76fcf0d0666a847
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
Signed-off-by: Iliyan Malchev <malchev@google.com>
2013-03-15 17:13:28 -07:00
David Keitel
dd8dd68b32 power: pm8921-charger: distinguish between PMIC 3.0.1 and 3.0
Some workarounds that are required for PMIC die version 3.0
differ slightly for die version 3.0.1.

Fix this by checking the PMIC subversion register to distinguish
between 3.0 and 3.0.1.

CRs-Fixed: 403150
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
(cherry picked from commit 913c55e2706c36132fd42f90c05530b8e55a26ed)

Conflicts:

	drivers/power/pm8921-charger.c

Change-Id: I11155d6180de09e1b9e0137f7943603d44102d07
Signed-off-by: Sridhar Gujje <sgujje@codeaurora.org>
Signed-off-by: Iliyan Malchev <malchev@google.com>
2013-03-15 17:13:27 -07:00
choongryeol.lee
37c59c5e44 power: pm8921-bms: increase accuracy of voltage during charging adjusting
During charging adjustment, the measurement of voltage is not accurate.
Since the measured voltage during charging adjustment is not OCV
(open circuit voltage), it cannot show real battery voltage at CC to CV
point. But current implementation use inaccurate voltage as a voltage of
CC to CV point. This inaccurate voltage of CC to CV point can cause
wrong SoC adjusting. For instance, the SoC could stick at fixed value
until end of charging.
This patch increase accuracy of voltage measurement by using battery
current and battery resister.

Change-Id: I3a4cc4e58e409be5422ec6bf64678a9a92b9fe25
2013-03-15 17:13:26 -07:00
choongryeol.lee
1819bd4e44 power: pm8921-bms: fix soc rising from 99% to 100% during discharging
We observed that SoC suddenly increase from 98% or 99% to 100%
right after charger removal. This issue caused by charging adjusting
algorithm which adjust SoC to sync 100% with end of charging.
During charging adjustment, the adjusted SoC could be smaller than
original SoC. So when we remove charger, charging adjusting algorithm
stop adjusting SoC and then bms report original SoC which is larger
than before.

Previously, bms driver considered most of this case by using previous
SoC when SoC increase during discharging. But if SoC is 100%, previous
patch doesn't work.
So this patch add SoC 100% case by checking if charger is enabled.

Change-Id: I70945d391c9d821eaf875f1bcd1e8787077b98da
2013-03-15 17:13:26 -07:00
Iliyan Malchev
491b58e1ca Revert "msm: power: Revert LGE power patches"
This reverts commit 2f24cb771c.
2013-03-15 17:13:25 -07:00
Iliyan Malchev
b8c65bc60a Revert "msm: power: update power drivers to msm-3.4 tip"
This reverts commit fae0afd7be.
2013-03-15 17:13:24 -07:00
Iliyan Malchev
2625e4584b Revert "msm: power: update copyright markings"
This reverts commit 3f9f19a7c50fe47e1b963c25c68cc3ed89dd25a8.
2013-03-15 17:13:23 -07:00
Iliyan Malchev
a0e2488b39 Revert "power: pm8921-charger: don't apply kickstart unless it is 8921 pmic"
This reverts commit 22e27d01fe204b41e0ae415cafaf320ac1500234.
2013-03-15 17:13:23 -07:00
Iliyan Malchev
0fd7b8e1a9 Revert "power: pm8921-bms: fix the mismatch of container_of member type"
This reverts commit 879df6553254868150616f051a641f2d2e4bdfc6.
2013-03-15 17:13:22 -07:00
Iliyan Malchev
995c4f62d3 Revert "power: pm8921-charger: fix a potential array out of bound access"
This reverts commit 0f1be62ee48338994611035d664d26fadabeb2fb.
2013-03-15 17:13:22 -07:00
Iliyan Malchev
4f9e5f593a Revert "power: pm8921-charger: Support multiple vbus requests"
This reverts commit 51ab66c6a8cc19898971570d41fdf846c18f43eb.
2013-03-15 17:13:21 -07:00
Iliyan Malchev
c5d10ae0e5 Revert "power: pm8921-charger: disable AICL"
This reverts commit a6a33432dc20a3e43539dfa22ca25d51c6c9d57f.
2013-03-15 17:13:20 -07:00
Iliyan Malchev
3d2444690c Revert "power: pm8921-charger: force 19.2Mhz while writing to a register"
This reverts commit c77b173eebe4781dd37103a505e246c20213ab03.
2013-03-15 17:13:20 -07:00