summaryrefslogtreecommitdiff
path: root/drivers/power
AgeCommit message (Collapse)Author
2018-04-27UPSTREAM: usb: gadget: move gadget API functions to udc-coreFelipe Balbi
instead of defining all functions as static inlines, let's move them to udc-core and export them with EXPORT_SYMBOL_GPL, that way we can make sure that only GPL drivers will use them. As a side effect, it'll be nicer to add tracepoints to the gadget API. While at that, also fix Kconfig dependencies to avoid randconfig build failures. Change-Id: I3fcc99c0730608076cfa8624908e58b7ee6f1bef Acked-By: Sebastian Reichel <sre@kernel.org> Acked-by: Peter Chen <peter.chen@nxp.com> Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com> Signed-off-by: William Wu <william.wu@rock-chips.com> (cherry-picked from commit 5a8d651a2bde01e00caf78496390d6ae46df80af)
2018-04-08Merge branch 'linux-linaro-lsk-v4.4-android' of ↵Tao Huang
git://git.linaro.org/kernel/linux-linaro-stable.git * linux-linaro-lsk-v4.4-android: (395 commits) Linux 4.4.126 net: systemport: Rewrite __bcm_sysport_tx_reclaim() net: fec: Fix unbalanced PM runtime calls ieee802154: 6lowpan: fix possible NULL deref in lowpan_device_event() s390/qeth: on channel error, reject further cmd requests s390/qeth: lock read device while queueing next buffer s390/qeth: when thread completes, wake up all waiters s390/qeth: free netdevice when removing a card team: Fix double free in error path skbuff: Fix not waking applications when errors are enqueued net: Only honor ifindex in IP_PKTINFO if non-0 netlink: avoid a double skb free in genlmsg_mcast() net/iucv: Free memory obtained by kzalloc net: ethernet: ti: cpsw: add check for in-band mode setting with RGMII PHY interface net: ethernet: arc: Fix a potential memory leak if an optional regulator is deferred l2tp: do not accept arbitrary sockets ipv6: fix access to non-linear packet in ndisc_fill_redirect_hdr_option() dccp: check sk for closed state in dccp_sendmsg() net: Fix hlist corruptions in inet_evict_bucket() Revert "genirq: Use irqd_get_trigger_type to compare the trigger type for shared IRQs" ... Conflicts: include/linux/usb/quirks.h Change-Id: I125065cef66846e4cdee799f4b34d07c309d353e
2018-04-02power: rk817-battery: add power_supply property for CTS.Shunqing Chen
Change-Id: I31bca691bc404d95b448bfbf1d92897fed2a5767 Signed-off-by: Shunqing Chen <csq@rock-chips.com>
2018-04-02power: rk817-battery: get charging state from charger driverShunqing Chen
Change-Id: I1cbf9befcb902a46c2e7a42664e4417ce1b441ea Signed-off-by: Shunqing Chen <csq@rock-chips.com>
2018-03-26power: rk816-battery: judge 'is_initialized' firstlyJoseph Chen
U-Boot fuel gauge may do ocv calibration which would update rsoc, and it would lead a wrong halt judgement for kernel fuel gauge driver. So we judege is_initialized firstly. Change-Id: Ifed343b85d3f7e7a42545fc57efe460338f30e17 Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-03-26power: rk818-battery: judge 'is_initialized' firstlyJoseph Chen
U-Boot fuel gauge may do ocv calibration which would update rsoc, and it would lead a wrong halt judgement for kernel fuel gauge driver. So we judege is_initialized firstly. Change-Id: I2957c464dfde1dde4b7dd32778d373904209d575 Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-03-26Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-androidAlex Shi
2018-03-24power: supply: pda_power: move from timer to delayed_workMichael Trimarchi
[ Upstream commit 633e8799ddc09431be2744c4a1efdbda13af2b0b ] This changed is needed to avoid locking problem during boot as shown: <5>[ 8.824096] Registering SWP/SWPB emulation handler <6>[ 8.977294] clock: disabling unused clocks to save power <3>[ 9.108154] BUG: sleeping function called from invalid context at kernel_albert/kernel/mutex.c:269 <3>[ 9.122894] in_atomic(): 1, irqs_disabled(): 0, pid: 1, name: swapper/0 <4>[ 9.130249] 3 locks held by swapper/0/1: <4>[ 9.134613] #0: (&__lockdep_no_validate__){......}, at: [<c0342430>] __driver_attach+0x58/0xa8 <4>[ 9.144500] #1: (&__lockdep_no_validate__){......}, at: [<c0342440>] __driver_attach+0x68/0xa8 <4>[ 9.154357] #2: (&polling_timer){......}, at: [<c0053770>] run_timer_softirq+0x108/0x3ec <4>[ 9.163726] Backtrace: <4>[ 9.166473] [<c001269c>] (dump_backtrace+0x0/0x114) from [<c067e5f0>] (dump_stack+0x20/0x24) <4>[ 9.175811] r6:00203230 r5:0000010d r4:d782e000 r3:60000113 <4>[ 9.182250] [<c067e5d0>] (dump_stack+0x0/0x24) from [<c007441c>] (__might_sleep+0x10c/0x128) <4>[ 9.191650] [<c0074310>] (__might_sleep+0x0/0x128) from [<c0688f60>] (mutex_lock_nested+0x34/0x36c) <4>[ 9.201660] r5:c02d5350 r4:d79a0c64 <4>[ 9.205688] [<c0688f2c>] (mutex_lock_nested+0x0/0x36c) from [<c02d5350>] (regulator_set_current_limit+0x30/0x118) <4>[ 9.217071] [<c02d5320>] (regulator_set_current_limit+0x0/0x118) from [<c0435ce0>] (update_charger+0x84/0xc4) <4>[ 9.228027] r7:d782fb20 r6:00000101 r5:c1767e94 r4:00000000 <4>[ 9.234436] [<c0435c5c>] (update_charger+0x0/0xc4) from [<c0435d40>] (psy_changed+0x20/0x48) <4>[ 9.243804] r5:d782e000 r4:c1767e94 <4>[ 9.247802] [<c0435d20>] (psy_changed+0x0/0x48) from [<c0435dec>] (polling_timer_func+0x84/0xb8) <4>[ 9.257537] r4:c1767e94 r3:00000002 <4>[ 9.261566] [<c0435d68>] (polling_timer_func+0x0/0xb8) from [<c00537e4>] (run_timer_softirq+0x17c/0x3ec) <4>[ 9.272033] r4:c1767eb0 r3:00000000 <4>[ 9.276062] [<c0053668>] (run_timer_softirq+0x0/0x3ec) from [<c004b000>] (__do_softirq+0xf0/0x298) <4>[ 9.286010] [<c004af10>] (__do_softirq+0x0/0x298) from [<c004b650>] (irq_exit+0x98/0xa0) <4>[ 9.295013] [<c004b5b8>] (irq_exit+0x0/0xa0) from [<c000edbc>] (handle_IRQ+0x60/0xc0) <4>[ 9.303680] r4:c1194e98 r3:c00bc778 <4>[ 9.307708] [<c000ed5c>] (handle_IRQ+0x0/0xc0) from [<c0008504>] (gic_handle_irq+0x34/0x68) <4>[ 9.316955] r8:000ac383 r7:d782fc3c r6:d782fc08 r5:c11936c4 r4:e0802100 <4>[ 9.324310] r3:c026ba48 <4>[ 9.327301] [<c00084d0>] (gic_handle_irq+0x0/0x68) from [<c068c2c0>] (__irq_svc+0x40/0x74) <4>[ 9.336456] Exception stack(0xd782fc08 to 0xd782fc50) <4>[ 9.342041] fc00: d6e30e6c ac383627 00000000 ac383417 ea19c000 ea200000 <4>[ 9.351104] fc20: beffffff 00000667 000ac383 d6e30670 d6e3066c d782fc94 d782fbe8 d782fc50 <4>[ 9.360168] fc40: c026ba48 c001d1f0 00000113 ffffffff Fixes: b2998049cfae ("[BATTERY] pda_power platform driver") Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> Signed-off-by: Anthony Brandon <anthony@amarulasolutions.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-16power: rk817_charger: enable boost if charger offlineshengfei Xu
Change-Id: I43d1ded1098c7b37c40bc6a66949b77a0c1e1172 Signed-off-by: shengfei Xu <xsf@rock-chips.com>
2018-03-13power: rk817: fix the display soc jump from 0 to 100shengfei Xu
Change-Id: If930ed4804e502aaa4f6b18a51e671517784ff0b Signed-off-by: shengfei Xu <xsf@rock-chips.com>
2018-03-09Merge branch 'linux-linaro-lsk-v4.4-android' of ↵Tao Huang
git://git.linaro.org/kernel/linux-linaro-stable.git * linux-linaro-lsk-v4.4-android: (660 commits) ANDROID: keychord: Check for write data size ANDROID: sdcardfs: Set num in extension_details during make_item ANDROID: sdcardfs: Hold i_mutex for i_size_write BACKPORT, FROMGIT: crypto: speck - add test vectors for Speck64-XTS BACKPORT, FROMGIT: crypto: speck - add test vectors for Speck128-XTS BACKPORT, FROMGIT: crypto: arm/speck - add NEON-accelerated implementation of Speck-XTS FROMGIT: crypto: speck - export common helpers BACKPORT, FROMGIT: crypto: speck - add support for the Speck block cipher UPSTREAM: ANDROID: binder: synchronize_rcu() when using POLLFREE. f2fs: updates on v4.16-rc1 BACKPORT: tee: shm: Potential NULL dereference calling tee_shm_register() BACKPORT: tee: shm: don't put_page on null shm->pages BACKPORT: tee: shm: make function __tee_shm_alloc static BACKPORT: tee: optee: check type of registered shared memory BACKPORT: tee: add start argument to shm_register callback BACKPORT: tee: optee: fix header dependencies BACKPORT: tee: shm: inline tee_shm_get_id() BACKPORT: tee: use reference counting for tee_context BACKPORT: tee: optee: enable dynamic SHM support BACKPORT: tee: optee: add optee-specific shared pool implementation ... Conflicts: drivers/irqchip/Kconfig drivers/media/i2c/tc35874x.c drivers/media/v4l2-core/v4l2-compat-ioctl32.c drivers/usb/gadget/function/f_fs.c fs/f2fs/node.c Change-Id: Icecd73a515821b536fa3d81ea91b63d9b3699916
2018-03-09power/rk817_charger: fix compile warning when !PM_SLEEPTao Huang
Change-Id: I673cf160c6cb3ae37b9b01d9d38fd4da13d76aa2 Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2018-03-07PM / AVS: rockchip-io: add io selectors and supplies for rk3308David Wu
This adds the necessary data for handling io voltage domains on the rk3308. As interesting tidbit, the rk3308 contains one iodomain area at grf, Change-Id: Ife72a284a8926d02ef5df7a422d41924494d0300 Signed-off-by: David Wu <david.wu@rock-chips.com>
2018-03-05Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-androidAmit Pundir
Signed-off-by: Amit Pundir <amit.pundir@linaro.org> Conflicts: fs/f2fs/extent_cache.c Pick changes from AOSP Change-Id: Icd8a85ac0c19a8aa25cd2591a12b4e9b85bdf1c5 ("f2fs: catch up to v4.14-rc1") fs/f2fs/namei.c Pick changes from AOSP F2FS backport commit 7d5c08fd9194 ("f2fs: backport from (4c1fad64 - Merge tag 'for-f2fs-4.9' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs)")
2018-02-28power: rk817: fix compile warningTao Huang
drivers/power/rk817_battery.c:2129:4: warning: this if clause does not guard... [-Wmisleading-indentation] drivers/power/rk817_battery.c:2920 rk817_bat_pm_resume() error: uninitialized symbol 'time_step'. Change-Id: I9af73c85192279cc0546a5844da65542806279d5 Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2018-02-28power: rk817: smooth the display socshengfei Xu
Change-Id: I239df7d8812673a1ebc95cea012b18ab0ca3af9b Signed-off-by: shengfei Xu <xsf@rock-chips.com>
2018-02-25power_supply: cw201x: add hw_id check for android things SOMShunqing Chen
Change-Id: Ic51abf5ccf89d3106858d029812ba6450422f1f5 Signed-off-by: Shunqing Chen <csq@rock-chips.com>
2018-02-25power: add universal charger driver supportShunqing Chen
1.This driver only report charging status. 2.Support usb and dc charging. 3.Applicable to all charger IC that the charging current is determined by hardware. Change-Id: I1c125580248cc1ba770b3c22f0b8dc3c21b980e0 Signed-off-by: Shunqing Chen <csq@rock-chips.com>
2018-02-25power: bq27xxx_battery: mark some symbols __maybe_unusedArnd Bergmann
Without the I2C driver, we get a few warnings: drivers/power/bq27xxx_battery.c:288:12: error: 'bq27xxx_regs' defined but not used [-Werror=unused-variable] static u8 *bq27xxx_regs[] = { ^ drivers/power/bq27xxx_battery.c:994:12: error: 'bq27xxx_powersupply_init' defined but not used [-Werror=unused-function] static int bq27xxx_powersupply_init(struct bq27xxx_device_info *di, ^ drivers/power/bq27xxx_battery.c:1029:13: error: 'bq27xxx_powersupply_unregister' defined but not used [-Werror=unused-function] static void bq27xxx_powersupply_unregister(struct bq27xxx_device_info *di) ^ In mainline kernels, this was addressed by a larger rework in 703df6c09795 ("power: bq27xxx_battery: Reorganize I2C into a module"). We probably don't want this backported into stable kernels, so instead let's shut up the warnings by marking the symbols as __maybe_unused. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-25Revert "power: bq27xxx_battery: Remove unneeded dependency in Kconfig"Arnd Bergmann
This reverts commit 6bd03ce3c12a22d86f59070f1da15aaa2bde8a51, it was applied in error and cuased this link failure drivers/built-in.o: In function `bq27xxx_battery_i2c_read': core.c:(.text+0xa6da8): undefined reference to `i2c_transfer' drivers/built-in.o: In function `bq27xxx_battery_init': core.c:(.init.text+0x68e0): undefined reference to `i2c_register_driver' drivers/built-in.o: In function `bq27xxx_battery_exit': core.c:(.exit.text+0xc6c): undefined reference to `i2c_del_driver' Later upstream kernels fixed this with a larger rework in commit 703df6c09795 ("power: bq27xxx_battery: Reorganize I2C into a module"), but we cannot backport that to 4.4. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-24power: rk817: fix the OTG mode judgementshengfei Xu
Change-Id: I23ecea8b26aa2aff0101bb5237fe89ad2b00fb9c Signed-off-by: shengfei Xu <xsf@rock-chips.com>
2018-02-23power: rk817: add pr_fmt() macroTao Huang
Make the printks look a bit nicer by adding a prefix. Change-Id: Id268a55a1681c6805e7c3f5929350891e92df816 Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2018-02-22power: rk817: fix the battery charging but dispaly soc not upshengfei Xu
Change-Id: I3153dad46c959670f11dd91c7cbd687f4136c171 Signed-off-by: shengfei Xu <xsf@rock-chips.com>
2018-02-09power: rk817: fix the error when plug in OTGshengfei Xu
[ 36.485506] [<ffffff80080b97c0>] __queue_delayed_work+0x6c/0x148 [ 36.485523] [<ffffff80080b98ec>] queue_delayed_work_on+0x50/0x6c [ 36.485543] [<ffffff80087315c4>] rk817_charge_host_evt_notifier+0x20/0x2c [ 36.485561] [<ffffff80080c0c54>] notifier_call_chain+0x48/0x80 [ 36.485576] [<ffffff80080c0cdc>] raw_notifier_call_chain+0x14/0x1c [ 36.485596] [<ffffff8008855b10>] extcon_sync+0x74/0x1c4 [ 36.485615] [<ffffff80083c3118>] rockchip_usb2phy_id_irq+0x270/0x2b8 [ 36.485633] [<ffffff80080f84ac>] irq_thread_fn+0x28/0x68 [ 36.485648] [<ffffff80080f8070>] irq_thread+0x100/0x1d8 [ 36.485662] [<ffffff80080bfc80>] kthread+0xe8/0xf0 [ 36.485678] [<ffffff80080832a0>] ret_from_fork+0x10/0x30 Change-Id: Ib1a50dbf2210e43efb056835e4fef1caae2ca059 Signed-off-by: shengfei Xu <xsf@rock-chips.com>
2018-02-07power/rk817_charger: fix compile warningTao Huang
drivers/power/rk817_charger.c:735:2: warning: this else clause does not guard... [-Wmisleading-indentation] Change-Id: Ib65d2f54463c39d7fe9fd1dfb39a76035df05172 Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2018-02-05power: rk817: support rk817 battery drivershengfei Xu
Change-Id: Ie0e2f4baab33949506ef835e068a10610863ab73 Signed-off-by: shengfei Xu <xsf@rock-chips.com>
2018-02-05power: rk817: support rk817 charger drivershengfei Xu
Change-Id: I2c1aca9706ee43f0b119cf775140a11fdb837e47 Signed-off-by: shengfei Xu <xsf@rock-chips.com>
2018-02-03power: reset: zx-reboot: add missing MODULE_DESCRIPTION/AUTHOR/LICENSEJesse Chan
commit 348c7cf5fcbcb68838255759d4cb45d039af36d2 upstream. This change resolves a new compile-time warning when built as a loadable module: WARNING: modpost: missing MODULE_LICENSE() in drivers/power/reset/zx-reboot.o see include/linux/module.h for more information This adds the license as "GPL v2", which matches the header of the file. MODULE_DESCRIPTION and MODULE_AUTHOR are also added. Signed-off-by: Jesse Chan <jc@linux.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-02power: avs: rockchip-io-domain: Change the name from vccio0 to vccio6 for px30David Wu
Checked with ic colleague, the name should be same as the datasheet, so need to change the name, they also change it at trm. Change-Id: Ie98ba5397cf0e5a2dba4e07fc0ca31a3330f05a6 Signed-off-by: David Wu <david.wu@rock-chips.com>
2018-01-31rk: add SPDX license identifier to files with no licenseTao Huang
Change-Id: I754250669891307b0deab2bdab1bd01512713f79 Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2018-01-09power: rk818-battery: fix 4250mv charge voltage missingJoseph Chen
Update according to latest datasheet. Change-Id: I980e3b9705c8e1ccce5d0fba9b1b40cbf1681abe Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-01-09power: rk818-charger: flush workqueue on shutdownShunqing Chen
do not need to destroy workqueue on shutdown Change-Id: I78262414e91d8e48e088fd1a54a36542e29af8a7 Signed-off-by: Shunqing Chen <csq@rock-chips.com>
2018-01-08power: rk816: add power_supply property for CTS.Shunqing Chen
Android8.0 CTS needs to get max charging current, max charging voltage and battery charge counter. Change-Id: I83371d5b9f126ee17979f56e92d78b7887c316c6 Signed-off-by: Shunqing Chen <csq@rock-chips.com>
2018-01-05power: rk818-charger: disable irq after otg power offShunqing Chen
Change-Id: I5af9ad74d9f863427846c4b3da747ca7945b1a07 Signed-off-by: Shunqing Chen <csq@rock-chips.com>
2017-12-06PM / AVS: rockchip-io: add io selectors and supplies for px30David Wu
This adds the necessary data for handling io voltage domains on the px30. As interesting tidbit, the px30 contains two separate iodomain areas. One in the regular General Register Files (GRF) and one in PMUGRF in the pmu power domain. Change-Id: Icff058b310e8ffaa4e03b8090443b3a7dba35f1f Signed-off-by: David Wu <david.wu@rock-chips.com>
2017-11-27power: rk818: add power_supply property for CTS.Shunqing Chen
Android8.0 CTS needs to get max charging current, max charging voltage and battery charge counter. Change-Id: Ia0e6589e92f24ece179299040336e050b21258b1 Signed-off-by: Shunqing Chen <csq@rock-chips.com>
2017-10-31power: add rk816 battery supportJoseph Chen
porting from kernel 3.10, it includes fuel gauge and charger. Change-Id: Ib1dbc6a2c869a44459570f5368900e9dbfe93ed0 Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2017-10-25power: rk818-battery: fix TS1 adc issueJoseph Chen
Due to hardware design, "Vdelta = (R_sample + R_other) * I_avg" will be included into TS1 adc value. We must subtract it to get correct adc value. Change-Id: I71eb0b53d1a9ef14efb2c4a798f4cf8c8b49e950 Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2017-08-22power: rk818-battery: add IRQF_ONESHOT for irq requestJoseph Chen
Change-Id: I1c049337d07d35148cfde37d91682b3799042e8c Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2017-08-22power: rk818-battery: dump hotdie statusJoseph Chen
Change-Id: I9de0410b2e3e436801ee27ae59c984df58cc4bc8 Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2017-08-22power: rk818-battery: fix full charge sm_linek errorJoseph Chen
on the situation that: charger is connected and fuel gauge gives state 'CC or CV', but actually battery is discharging from 100% to 99%. At this moment we may treat this as normal full charging by mistake, so we must add current judgement to avoid that. Change-Id: I7b6692c17dc053fd96bd42df05c3f7763728bba2 Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2017-08-14power: charger: add new sy6982c/sy6982e driverYankun Zheng
Change-Id: I3204b34234194d4a17ae0b2141744dbdbe5c4daa Signed-off-by: Yankun Zheng <zyk@rock-chips.com>
2017-07-07power: rk818-charger: fix usb charger undetectedWilliam Wu
On some platforms (e.g. rk3399), we use extcon notify framework to receive USB charger notifier from USB PHY driver. Generally, the USB PHY driver uses a work to check vbus status and the USB charger type every 2 seconds, this polling mechanism may cause USB charger undetected if we plug in/out USB charger quickly. A typical error case is: 1. Plug in an USB DCP Adapter. - USB PHY driver sends notifier to rk818-charger 2. Plug out the USB Adapter, and plug in again immediately - rk818 detects plug out irq, and turns off charging - USB PHY driver schedule work doesn't detect the plug out/in operations, and doesn't send usb charger notifier Fortunately, rk818 can detect plug in irq, so let's check the USB charger type in rk818 plug in irq handler. Change-Id: Iee45769c8a98c709da2dbfa514198ab0f648fd20 Signed-off-by: William Wu <william.wu@rock-chips.com>
2017-07-06power_supply: Add support TI BQ25703 charger chipshengfeiXu
Change-Id: I3689a9f108e6fb86db4800d47a3aa7da7f7010e7 Signed-off-by: shengfei Xu <xsf@rock-chips.com>
2017-06-22power: rk818-charger: set otg5v by regulator frameworkJianhong Chen
because rk818 regulator driver registers all regulators into system without checking whether they are defined in dts, so we have to control it by regulator framework. Otherwise, psci_system_suspend_finish() will disable it after system wakeup. Change-Id: Ia9d9c0b7a8cf42ccee071ac0416c1ef2f711df2f Signed-off-by: Jianhong Chen <chenjh@rock-chips.com>
2017-06-22power: rk818-charger: support set charge current by battery temperatureJianhong Chen
Change-Id: I10b71fae6400f3c0125cab7af1524c2091c8924a Signed-off-by: Jianhong Chen <chenjh@rock-chips.com>
2017-06-21power: rk818-charger: fix input current 80ma define errorJianhong Chen
1. input current 800ma should be 80ma, it's safe to change, because 800ma was not used; 2. set lowest one as default value when decode charge parameter. Change-Id: I1683ebff708a62db2711b40f8f449f07936245f4 Signed-off-by: Jianhong Chen <chenjh@rock-chips.com>
2017-06-21power: rk818-battery: update ts1 current selectJianhong Chen
select 40uA when temperature lower than 0'C, otherwise 60uA. Change-Id: Ib235441c3adb146b8d1746a435875c19b1d8624d Signed-off-by: Jianhong Chen <chenjh@rock-chips.com>
2017-06-21power: rk818-battery: fix battery charging state report errorJianhong Chen
RK818_VB_MON_REG register needs at least 100ms to be correct status for checking whether charger is online or offline. So We search power_supply_class to get usb and ac psy for charging state. Change-Id: Ic332c055100309481d0dcd6d4bf030cc8db77d2d Signed-off-by: Jianhong Chen <chenjh@rock-chips.com>
2017-06-21power: rk818-battery: add notify to broadcast battery temperatureJianhong Chen
Change-Id: I2ee392f1885e87b0398eaff5ab7d0a0c89527e93 Signed-off-by: Jianhong Chen <chenjh@rock-chips.com>