summaryrefslogtreecommitdiff
path: root/drivers/power
AgeCommit message (Collapse)AuthorFilesLines
2014-11-18power: charger-manager: Support to change polling rate in runtime.Jonghwa Lee1-0/+62
Add 'polling_ms' sysfs node to change charger-manager's monitoring rate in runtime. It can set only bigger than 2 jiffies (for 200 HZ system it is 10 msecs.) as it's allowed for minimum poling rate in previous. It resets poller and re-configure polling rate based on new input if next polling time is far enough. Otherwise, it just waits expiration of timer and new polling rate will affects the next scheduling. Change-Id: I6a9a07b96db2554e2ec047224df818dcc4ab1a17 Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
2014-11-18power: charger-manager: Support different polling mode for sleep state.Jonghwa Lee1-3/+16
Add additional polling mode for sleep state to define different mode with normal state. With this change, charger-manager can work differently in normal state or sleep state. e.g, polling aways for normal and polling only when charing for sleep. If there is no defined polling mode for sleep state it just follows the normal state's. In addition to, polling rate is still same in sleep. Change-Id: I787a3abd646bdc0be81dccbafbd635c22c84951c Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
2014-11-18power: max17040: WA: Add flag 'using_19_bits' to determine SoC in double.Jonghwa Lee1-0/+17
No information about actual meaning of using 19 bits, it's just copied from vendor's code. However, It is clear that it represents doubled SoC if the chip is marked with 'using 19 bits'. Rinato needs to half the SoC register's value to get correct one. Change-Id: I0d873de3e7671c2494955735364934156ab756d9 Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
2014-11-18power: max17040: Fix data transfering size from 8bits to 16bits.Jonghwa Lee1-17/+19
Even max17040 fuelgauge chip's registers are segmented in size of 8bits (MSB, LSB), it transfers data only in 16bits. So, it should read both of MSB, LSB registers at once. Change-Id: I87150fbf9b14adf65fc9fdf912f963ab591586e3 Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
2014-11-18power: charger-manager: Update essential battery information at once.Jonghwa Lee1-179/+117
In current code, charger-manager may attemps to read battery state more than once in a same period. And it already did such when user accesses uevent, it reads battery voltage several times. This patch makes charger-manager to read current battery state including SoC, voltage and temperature at the start of monitoring and re-use it during whole period. Change-Id: Ic69ddb465a75237ded0488cb3eb41f47bb909311 Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
2014-11-18power: charger-manager: Not to start charging directly in cable nofitication.Jonghwa Lee1-10/+2
This patch prevents direct charging control in cable notification. It sets only input current limit according to cable type and yields charging control to be done by cm_monitor() where charging management proceeds. It may loose few ms to enable charging compared to before, even though it's more important that charging is enabled only for safe context. Change-Id: Ic736b9d18829f6d6dab946515dd0fe62fe7b75c4 Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
2014-11-18power: charger-manager: Make chraging decision focused on battery status.Jonghwa Lee1-119/+60
In cm_monitor() where charging management starts, it checks various charging condition sequentially to decide next charging operation. However, as it follows sequential process, cascade if statements, it does some duplicated jobs which is already done in previous stage. It results delay in decision making. And moreover, starting point of charing is spreaded all around, so it makes maintain codes and debugging difficult. Both of problems mentioned above becomes clean if it manages battery charging with focusing battery status not following sequential condition checking. Now, cm_monitor() moves battery state diagram and does optimal operation for current state. As a result, it reduces whole monitoring time almost in half. Change-Id: I1c8cfe57cea6fc8c02a4c0bf7bde6a0d8395b786 Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
2014-11-18power: charger-manager: Get external power souce information only from EXTCON.Jonghwa Lee1-14/+13
When charger-manager checks whether external power source is available, it gets information from charger IC driver. However, it's not correct source, charger IC doesn't have responsibilty to give cable connection status. The charger-manager already gets cable information from EXTCON susbsystem, so it can re-use it. Change-Id: I408546beefe63707fcb927db7d92c4005f3848f8 Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
2014-11-18power: charger-manager: Concentrate scattered power_supply_changed() calls.Jonghwa Lee1-12/+6
Current charger-manager calls power_suuply_changed() whenever charging status is changed. This patch removes seperated power_supply_changed() use and let it be called at end of try_charger_enable() function which is called to set charging/discharging. Change-Id: I98c823268207a891fba9d38dc71692e2e0791ae7 Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
2014-11-18power: max14577_charger: Fix to represent cable type properly.Jonghwa Lee1-1/+0
It shows '1' even for none-typed cable that might mislead user or charging managment to understand that there is a charge-able cable which is truly not. It should return 0 for none-typed cable to prevent wrong attempt for charging. Change-Id: I851ac424b6895867e611f6786bdb18e540d7f2d4 Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
2014-11-18power: charger-manager: Hold wakeup event until userspace notice.Jonghwa Lee1-1/+7
This is workaround to let userspace notice about battery's status chaiging during suspend and resume. It holds wakeup event to prevent system goes into sleep. Holding wakeup event time is heuristic value and it could be varied. To make this works, it needs CONFIG_PM_AUTOSLEEP kernel option. Change-Id: I22a818e69632574a2d684cd957f62b3329d57c8f Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
2014-11-18power: charger-manager: Prevent ktimer's nsecs value exceeds its size.Jonghwa Lee1-1/+2
When charger-manager sets alarmtimer, it has used nanoseconds converted from polling period which is in milliseconds. However ktimer's nanoseconds is limited to represent as size of unsinged long type, and the previous use often exceeds its limitation. It fixes to divide target timer period into seconds part and remains in nanoseconds to prevent abnormal timer period is set. Change-Id: I7a5cad5569505c901a4822bbd7a4ad0fa149570b Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
2014-11-18power: charger-manager: Add num_chargers variable to desc structure.Jonghwa Lee1-11/+10
To confirm NULL point exception and also follow the common convention of 'for loop' control, fix the driver to use scalar variable, 'num_chargers' when it retrieves the power_supply pointer array. Change-Id: Iab834cf93822b1a03419ca9933e82d6396cc0474 Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
2014-11-18power: charger-manager: Fix to use CHARGE_NOW/FULL property correctly.Jonghwa Lee1-52/+34
The POWER_SUPPLY_CHARGE_NOW/FULL property reflects battery's charges in uAh unit, but charger-manager has been used it wrongly. This patch makes it to use those propeties correctly and change to be optional. Change-Id: I68b3940a9388a095f47205207f1bc6bc863bd407 Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
2014-11-18power: charger-manager: Use power_supply_changed() not private uevent.Jonghwa Lee1-75/+6
Whenever battery status is changed, charger manager tries to trigger uevent through private interface. This patch modifies it to use power_supply_changed() since it belongs to power supply subsystem. Change-Id: I9f25664a2196745f3a303d57ded073f5eb604180 Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
2014-11-18power: charger-manager: Remove deprecated function, cm_notify_event().Jonghwa Lee1-190/+6
cm_notify_event() is introduced to get event associated with battery status externally, but no one had been used. Moreover it makes charger manager driver more complicated. This patch tries to drop the function and all data related to simplify the driver. Change-Id: I89d802f57a3005c9102e8d342318f2bf77ccce48 Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
2014-11-18power: charger-manager: Monitoring temperature becomes mandatory option.Jonghwa Lee2-59/+17
Monitoring battery temperature becomes mandatory for charger manager working. If there is no way to measure temperature, it stops probing and won't work. And also it will use thermal susbsystem inteface only to make driver simple. Change-Id: Idef5f8f29a104f5f51532c3321f6bebe887deb24 Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
2014-11-18power: charger-manager: Use alarmtimer for battery monitoring in suspend.Jonghwa Lee2-207/+82
To guerantee proper charing and managing batteries even in suspend, charger-manager has used rtc device with rtc framework interface. However, it is better to use alarmtimer for cleaner and more appropriate operation. This patch makes driver to use alamtimer for polling work in suspend and removes all deprecated codes related with using rtc interface. Change-Id: I0c84ccd62653b50fc9c9b687fddcaba7ea58e8ca Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
2014-11-18power: charger-manager: Rebase charger-manager up-to-date.Jonghwa Lee1-241/+199
Drop all local commits and adjust it to up-to-date version of mainline to make it easy to maintain. Change-Id: Id5dc3314afd6498e704bcc1bdebe2c226b8fa07c Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
2014-11-18power_supply: allow power supply devices registered w/o wakeup sourceZhang Rui1-2/+13
Currently, all the power supply devices are registered with wakeup source, this results in that every power_supply_changed() invocation brings the system out of suspend-to-freeze state. This is overkill as some device drivers, e.g. ACPI battery driver, have the ability to check the device status and wake up the system from sleeping only when necessary. Thus introduce a new API which allows device to be registered w/o wakeup source. Change-Id: If0ea9720c9c2161e3a33db0988bcd464b79f2b91 Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2014-11-18power_supply: Add power_supply_get_by_phandleSebastian Reichel1-0/+26
Add method to get power supply by device tree phandle. Change-Id: I486cb12098d96a0c0b1a930b194dd899fb5a61c8 Signed-off-by: Sebastian Reichel <sre@debian.org> Reviewed-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2014-11-18power_supply: Add power_supply notifierPali Rohár1-0/+18
This patch adds a notifier chain to the power_supply, this helps drivers in other subsystem to listen to changes in power supply subsystem. This would help to take some actions in those drivers on changing the power supply properties. One such scenario is to increase/decrease system performance based on the battery capacity/voltage. Another scenario is to adjust the h/w peak current detection voltage/current thresholds based on battery voltage/capacity. The notifier helps drivers to listen to changes in power_suppy susbystem without polling the power_supply properties Change-Id: I06d5b614d1ad836826f87f24791c94d2fa6c4aa6 Signed-off-by: Jenny TC <jenny.tc@intel.com> Signed-off-by: Pali Rohár <pali.rohar@gmail.com> Acked-by: Jenny TC <jenny.tc@intel.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2014-11-18power_supply: Fix Oops from NULL pointer dereference from wakeup_source_activateShuah Khan1-6/+6
power_supply_register() calls device_init_wakeup() to register a wakeup source before initializing dev_name. As a result, device_wakeup_enable() end up registering wakeup source with a null name when wakeup_source_register() gets called with dev_name(dev) which is null at the time. When kernel is booted with wakeup_source_activate enabled, it will panic when the trace point code tries to dereference ws->name. Fixed the problem by moving up the kobject_set_name() call prior to accesses to dev_name(). Replaced kobject_set_name() with dev_set_name() which is the right interface to be called from drivers. Fixed the call to device_del() prior to device_add() in for wakeup_init_failed error handling code. Trace after the change: bash-2143 [003] d... 132.280697: wakeup_source_activate: BAT1 state=0x20001 kworker/3:2-1169 [003] d... 132.281305: wakeup_source_deactivate: BAT1 state=0x30000 Oops message: [ 819.769934] device: 'BAT1': device_add [ 819.770078] PM: Adding info for No Bus:BAT1 [ 819.770235] BUG: unable to handle kernel NULL pointer dereference at (null) [ 819.770435] IP: [<ffffffff813381c0>] skip_spaces+0x30/0x30 [ 819.770572] PGD 3efd90067 PUD 3eff61067 PMD 0 [ 819.770716] Oops: 0000 [#1] SMP [ 819.770829] Modules linked in: arc4 iwldvm mac80211 x86_pkg_temp_thermal coretemp kvm_intel joydev i915 kvm uvcvideo ghash_clmulni_intel videobuf2_vmalloc aesni_intel videobuf2_memops videobuf2_core aes_x86_64 ablk_helper cryptd videodev iwlwifi lrw rfcomm gf128mul glue_helper bnep btusb media bluetooth parport_pc hid_generic ppdev snd_hda_codec_hdmi drm_kms_helper snd_hda_codec_realtek cfg80211 drm tpm_infineon samsung_laptop snd_hda_intel usbhid snd_hda_codec hid snd_hwdep snd_pcm microcode snd_page_alloc snd_timer psmouse i2c_algo_bit lpc_ich tpm_tis video wmi mac_hid serio_raw ext2 lp parport r8169 mii [ 819.771802] CPU: 0 PID: 2167 Comm: bash Not tainted 3.12.0+ #25 [ 819.771876] Hardware name: SAMSUNG ELECTRONICS CO., LTD. 900X3C/900X3D/900X4C/900X4D/SAMSUNG_NP1234567890, BIOS P03AAC 07/12/2012 [ 819.772022] task: ffff88002e6ddcc0 ti: ffff8804015ca000 task.ti: ffff8804015ca000 [ 819.772119] RIP: 0010:[<ffffffff813381c0>] [<ffffffff813381c0>] skip_spaces+0x30/0x30 [ 819.772242] RSP: 0018:ffff8804015cbc70 EFLAGS: 00010046 [ 819.772310] RAX: 0000000000000003 RBX: ffff88040cfd6d40 RCX: 0000000000000018 [ 819.772397] RDX: 0000000000020001 RSI: 0000000000000000 RDI: 0000000000000000 [ 819.772484] RBP: ffff8804015cbcc0 R08: 0000000000000000 R09: ffff8803f0768d40 [ 819.772570] R10: ffffea001033b800 R11: 0000000000000000 R12: ffffffff81c519c0 [ 819.772656] R13: 0000000000020001 R14: 0000000000000000 R15: 0000000000020001 [ 819.772744] FS: 00007ff98309b740(0000) GS:ffff88041f200000(0000) knlGS:0000000000000000 [ 819.772845] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 819.772917] CR2: 0000000000000000 CR3: 00000003f59dc000 CR4: 00000000001407f0 [ 819.773001] Stack: [ 819.773030] ffffffff81114003 ffff8804015cbcb0 0000000000000000 0000000000000046 [ 819.773146] ffff880409757a18 ffff8803f065a160 0000000000000000 0000000000020001 [ 819.773273] 0000000000000000 0000000000000000 ffff8804015cbce8 ffffffff8143e388 [ 819.773387] Call Trace: [ 819.773434] [<ffffffff81114003>] ? ftrace_raw_event_wakeup_source+0x43/0xe0 [ 819.773520] [<ffffffff8143e388>] wakeup_source_report_event+0xb8/0xd0 [ 819.773595] [<ffffffff8143e3cd>] __pm_stay_awake+0x2d/0x50 [ 819.773724] [<ffffffff8153395c>] power_supply_changed+0x3c/0x90 [ 819.773795] [<ffffffff8153407c>] power_supply_register+0x18c/0x250 [ 819.773869] [<ffffffff813d8d18>] sysfs_add_battery+0x61/0x7b [ 819.773935] [<ffffffff813d8d69>] battery_notify+0x37/0x3f [ 819.774001] [<ffffffff816ccb7c>] notifier_call_chain+0x4c/0x70 [ 819.774071] [<ffffffff81073ded>] __blocking_notifier_call_chain+0x4d/0x70 [ 819.774149] [<ffffffff81073e26>] blocking_notifier_call_chain+0x16/0x20 [ 819.774227] [<ffffffff8109397a>] pm_notifier_call_chain+0x1a/0x40 [ 819.774316] [<ffffffff81095b66>] hibernate+0x66/0x1c0 [ 819.774407] [<ffffffff81093931>] state_store+0x71/0xa0 [ 819.774507] [<ffffffff81331d8f>] kobj_attr_store+0xf/0x20 [ 819.774613] [<ffffffff811f8618>] sysfs_write_file+0x128/0x1c0 [ 819.774735] [<ffffffff8118579d>] vfs_write+0xbd/0x1e0 [ 819.774841] [<ffffffff811861d9>] SyS_write+0x49/0xa0 [ 819.774939] [<ffffffff816d1052>] system_call_fastpath+0x16/0x1b [ 819.775055] Code: 89 f8 48 89 e5 f6 82 c0 a6 84 81 20 74 15 0f 1f 44 00 00 48 83 c0 01 0f b6 10 f6 82 c0 a6 84 81 20 75 f0 5d c3 66 0f 1f 44 00 00 <80> 3f 00 55 48 89 e5 74 15 48 89 f8 0f 1f 40 00 48 83 c0 01 80 [ 819.775760] RIP [<ffffffff813381c0>] skip_spaces+0x30/0x30 [ 819.775881] RSP <ffff8804015cbc70> [ 819.775949] CR2: 0000000000000000 [ 819.794175] ---[ end trace c4ef25127039952e ]--- Change-Id: I69c2ff4750e66344e28b7fed6f4bf3357614d77c Signed-off-by: Shuah Khan <shuah.kh@samsung.com> Acked-by: Anton Vorontsov <anton@enomsg.org> Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: stable@vger.kernel.org Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2014-11-18power_supply: Prevent suspend until power supply events are processedZoran Markovic1-6/+32
This patch, originally authored by Arve Hjonnevag and Todd Poynor, prevents the system from entering suspend mode until the power supply plug, unplug, or any other change of state event is fully processed. This guarantees that the screen lights up and displays the battery charging state. The implementation uses the power supply wakeup_source object. Change-Id: I541e6a5d0567f2a731f14abc16fda30256ae93fe Cc: David Woodhouse <dwmw2@infradead.org> Cc: Arve Hjonnevag <arve@android.com> Cc: Todd Poynor <toddpoynor@google.com> Cc: John Stultz <john.stultz@linaro.org> Signed-off-by: Zoran Markovic <zoran.markovic@linaro.org> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2014-11-18power_supply: Add of_node_put to fix refcountRhyland Klein1-0/+4
of_parse_phandle increments the refcount for a dt node before returning it. Add of_node_put where needed to properly decrement the refcount when we are done using a given node. Change-Id: I49584e6d17ba5cc7f431a8a0b193fcbc2b6a2f34 Signed-off-by: Rhyland Klein <rklein@nvidia.com> Signed-off-by: Anton Vorontsov <anton@enomsg.org>
2014-11-18power: charger-manager: Add uevent_notify for cable notificationJonghwa Lee1-1/+3
Charger-manager works with cable notification from extcon sub system, and it has to notify users when charging status is updated due to the cable connection. Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
2014-11-18power: charger-manager: Notify chainging of battery soc to userJonghwa Lee1-2/+22
Some system might want to notice changing of battery soc, so this patch makes charger-manager to trigger uevent whenver battery soc changes. It is configurable operation via setting flag, 'cm-poll-batt-soc', in dt. Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
2014-11-18power: max17040: Update MAX17040 fuel-gague deviceChanwoo Choi1-101/+90
This patch update max17040 fuel-gague device as following: - Use regmap instead of old i2c interface - Normalize capacity and vcell values - Add ID for MAX77836 fuel-gauge block - Add basic support for pdata-less operation - Add match table entry for MAX17048 Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Tomasz Figa <t.figa@samsung.com>
2014-11-18power: Add charger support for Maxim 14577/77836Krzysztof Kozlowski3-0/+368
MAX14577/77836 chip is a multi-function device which includes MUIC, charger and voltage regulator. The driver is located in drivers/mfd. This patch supports battery charging control of MAX14577/77836 chip and provides power supply class information to userspace. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
2014-11-18charger-manager: Fix unit of temperature to deci centigrade.Jonghwa Lee1-4/+4
Fix temperature unit to follow the standard as document describes. Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
2014-11-18Revert "battery: max17042/7: Fix temperature unit to milli centigrade."Jonghwa Lee1-2/+2
This reverts commit 79b1d3591b35022b93f2d70c299e74eb54bfec09.
2014-11-18charger-manager: Parse charger_desc from device tree.Jonghwa Lee1-88/+123
With this patch, charger-manager can support device tree fully. Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
2014-11-18battery: max17042/7: Fix temperature unit to milli centigrade.Jonghwa Lee1-2/+2
Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
2014-11-18charger-manager : Add default battery temperature checking funtion.Jonghwa Lee1-18/+79
During the charger manager driver's probing time, it can't succeed if there's no pre-defined .temperature_out_of_range callback function. But if fuel gauge supports battery temperature measurement, we can use it directly. That's what cm_default_get_temp() function does. With flag measure_batter_temp ON, we normally use cm_default_get_temp() for .temperature_out_of_range callback funtion. The TEMP_AMBIENT property is only used for pre-defined one. Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
2014-11-18charger-manager : Replace kzalloc to devm_kzalloc and remove uneccessary code.Jonghwa Lee1-53/+22
Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
2014-11-18charger-manager: Add cm_chg_add_prorperty() macro.Jonghwa Lee1-16/+10
Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
2014-11-18M0 : charging : Make to charge battery fully.Jonghwa Lee2-2/+2
Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
2014-11-18Fuel Guague: MAX17042: Use regmap to interface with internal registersJonghwa Lee1-165/+155
Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
2014-11-18charger-manager : Make charge_now node under batter sysfs directory.Jonghwa Lee1-1/+6
CHARGE_NOW property has beed used in wrong way, it should be fixed as it is planned initially. But for now, we just leave it for upper layer (e.g. OAL) for a while. Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
2014-11-18charger: max77693: Fix initial charger configuration properly.Jonghwa Lee1-39/+12
Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
2014-11-18charger: max77693: code cleaningJonghwa Lee1-120/+5
- Remove duplicated macro data. - Improve readability. Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
2014-11-18max77693_charger: fix section mismatchSeung-Woo Kim1-1/+1
max77693_charger_of_match with __initconst flag is referenced from max77693_charger_driver which is non init data and this causes section mismatch. So flag __initconst is removed. Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2014-11-18power: charger-manager: Fix a bug when it unregisters notifier block of extcon.Jonghwa Lee1-1/+3
This patch prevents NULL pointer error cauesed by unregistering unregistered exton notifier block. At the probing time of charger manager, it tries to remove extcon notifier block when it fails to initialize them. It has to be applied for only registered one. Otherwise, it'd make kernel panic. To make it work right, it checks extcon_specific_cable_nb's extcon_dev node. If extcon cable notifier block was registered successfully, it has proper extcon_dev pointer if not so it has NULL pointer. Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
2014-11-18power: charger-manager: regulator_get() never returns NULL.Jonghwa Lee1-3/+2
This patch fixes return value checking of regulator_get() in charger-manager driver. The API, regulator_get(), returns ERR_PTR() when it fails to get regulator with given name, not NULL. Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
2014-11-18charger_manager: Workaround for supporting platform data without DT parsing.Jonghwa Lee1-1/+114
All data will be move into DT later. Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
2014-11-18power: max17042: Fix deadlock caused by deferred initializationTomasz Figa1-20/+20
There is no need to defer chip initialization from probe. In addition, current implementation caused a deadlock, which made boot hang from time to time. This patch removes deferred initialization and adds chip initialization to probe, before the power supply is registered. Signed-off-by: Tomasz Figa <t.figa@samsung.com>
2014-11-18fuelgauge: max1704xx: Fix max17042 driver to work properly.Jonghwa Lee1-2/+8
Fixed : - Read battery capacity from VFG(voltage fuel gauge) for ModelGuage M1. - Fix error of registering alarm irq to generic irq framework. Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
2014-11-18power: max77693: Add kernel configuation of Max77693 chargerJonghwa Lee2-1/+7
The patch 'power: max77693: Add max77693 charger driver.' omitted CHARGER_MAX77693 kerenel configuration. Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
2014-11-18power: max77693: Add max77693 charger dirver.Jonghwa Lee2-0/+691
Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com>
2014-11-18power: max8997-charger: Fix getting platform dataTomasz Figa1-1/+1
This patch fixes incorrect way of getting platform data, which should be read from MFD private data structure instead. Signed-off-by: Tomasz Figa <t.figa@samsung.com>