Commit Graph

1668 Commits

Author SHA1 Message Date
shengfei Xu
a6625d7dbb power: rk817: fix the display soc jump from 0 to 100
Change-Id: If930ed4804e502aaa4f6b18a51e671517784ff0b
Signed-off-by: shengfei Xu <xsf@rock-chips.com>
2018-03-13 14:52:25 +08:00
Tao Huang
3430c68a33 Merge branch 'linux-linaro-lsk-v4.4-android' of 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-09 19:10:14 +08:00
Tao Huang
cdb20a9b84 power/rk817_charger: fix compile warning when !PM_SLEEP
Change-Id: I673cf160c6cb3ae37b9b01d9d38fd4da13d76aa2
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2018-03-09 14:43:59 +08:00
David Wu
fd09897f20 PM / AVS: rockchip-io: add io selectors and supplies for rk3308
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-07 14:19:34 +08:00
Amit Pundir
24740dab5c Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android
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 7d5c08fd91
        ("f2fs: backport from (4c1fad64 - Merge tag 'for-f2fs-4.9' of git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs)")
2018-03-05 20:20:17 +05:30
Tao Huang
ef3a197ba6 power: rk817: fix compile warning
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-28 10:44:28 +08:00
shengfei Xu
c19ea2e315 power: rk817: smooth the display soc
Change-Id: I239df7d8812673a1ebc95cea012b18ab0ca3af9b
Signed-off-by: shengfei Xu <xsf@rock-chips.com>
2018-02-28 09:32:26 +08:00
Shunqing Chen
c800d4456e power_supply: cw201x: add hw_id check for android things SOM
Change-Id: Ic51abf5ccf89d3106858d029812ba6450422f1f5
Signed-off-by: Shunqing Chen <csq@rock-chips.com>
2018-02-25 19:33:19 +08:00
Shunqing Chen
9f2ddf5a0c power: add universal charger driver support
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-25 19:26:34 +08:00
Arnd Bergmann
e8988dbe21 power: bq27xxx_battery: mark some symbols __maybe_unused
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 703df6c097 ("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-25 11:03:50 +01:00
Arnd Bergmann
7131acefb9 Revert "power: bq27xxx_battery: Remove unneeded dependency in Kconfig"
This reverts commit 6bd03ce3c1, 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
703df6c097 ("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-25 11:03:50 +01:00
shengfei Xu
87dbd10b5f power: rk817: fix the OTG mode judgement
Change-Id: I23ecea8b26aa2aff0101bb5237fe89ad2b00fb9c
Signed-off-by: shengfei Xu <xsf@rock-chips.com>
2018-02-24 10:33:13 +08:00
Tao Huang
fa89f964b5 power: rk817: add pr_fmt() macro
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-23 16:52:13 +08:00
shengfei Xu
2c1c86dca0 power: rk817: fix the battery charging but dispaly soc not up
Change-Id: I3153dad46c959670f11dd91c7cbd687f4136c171
Signed-off-by: shengfei Xu <xsf@rock-chips.com>
2018-02-22 11:39:59 +08:00
shengfei Xu
edd344986f power: rk817: fix the error when plug in OTG
[   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-09 15:24:25 +08:00
Tao Huang
27ba838b5e power/rk817_charger: fix compile warning
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-07 18:59:05 +08:00
shengfei Xu
92e570a84f power: rk817: support rk817 battery driver
Change-Id: Ie0e2f4baab33949506ef835e068a10610863ab73
Signed-off-by: shengfei Xu <xsf@rock-chips.com>
2018-02-05 16:25:34 +08:00
shengfei Xu
90aca5321d power: rk817: support rk817 charger driver
Change-Id: I2c1aca9706ee43f0b119cf775140a11fdb837e47
Signed-off-by: shengfei Xu <xsf@rock-chips.com>
2018-02-05 16:22:18 +08:00
Jesse Chan
3f19b9ea13 power: reset: zx-reboot: add missing MODULE_DESCRIPTION/AUTHOR/LICENSE
commit 348c7cf5fc 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-03 17:04:25 +01:00
David Wu
9d155c640f power: avs: rockchip-io-domain: Change the name from vccio0 to vccio6 for px30
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-02-02 18:51:52 +08:00
Tao Huang
f9eefeeaa7 rk: add SPDX license identifier to files with no license
Change-Id: I754250669891307b0deab2bdab1bd01512713f79
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2018-01-31 20:56:06 +08:00
Joseph Chen
8c6943ea7c power: rk818-battery: fix 4250mv charge voltage missing
Update according to latest datasheet.

Change-Id: I980e3b9705c8e1ccce5d0fba9b1b40cbf1681abe
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2018-01-09 14:34:29 +08:00
Shunqing Chen
84a2162b28 power: rk818-charger: flush workqueue on shutdown
do not need to destroy workqueue on shutdown

Change-Id: I78262414e91d8e48e088fd1a54a36542e29af8a7
Signed-off-by: Shunqing Chen <csq@rock-chips.com>
2018-01-09 09:27:10 +08:00
Shunqing Chen
2223d1404c power: rk816: add power_supply property for CTS.
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-08 17:55:27 +08:00
Shunqing Chen
07f3a9425f power: rk818-charger: disable irq after otg power off
Change-Id: I5af9ad74d9f863427846c4b3da747ca7945b1a07
Signed-off-by: Shunqing Chen <csq@rock-chips.com>
2018-01-05 10:55:26 +08:00
David Wu
6a8aaf5f0a PM / AVS: rockchip-io: add io selectors and supplies for px30
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-12-06 21:18:22 +08:00
Shunqing Chen
0250b83f98 power: rk818: add power_supply property for CTS.
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-11-27 14:41:40 +08:00
Joseph Chen
c6151403e7 power: add rk816 battery support
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-31 09:39:03 +08:00
Joseph Chen
73c05faa7f power: rk818-battery: fix TS1 adc issue
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-10-25 14:37:17 +08:00
Joseph Chen
991cab4fc2 power: rk818-battery: add IRQF_ONESHOT for irq request
Change-Id: I1c049337d07d35148cfde37d91682b3799042e8c
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2017-08-22 14:10:03 +08:00
Joseph Chen
2ea6f7bb7a power: rk818-battery: dump hotdie status
Change-Id: I9de0410b2e3e436801ee27ae59c984df58cc4bc8
Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
2017-08-22 14:09:46 +08:00
Joseph Chen
a85656d090 power: rk818-battery: fix full charge sm_linek error
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-22 14:09:37 +08:00
Yankun Zheng
38c57424d4 power: charger: add new sy6982c/sy6982e driver
Change-Id: I3204b34234194d4a17ae0b2141744dbdbe5c4daa
Signed-off-by: Yankun Zheng <zyk@rock-chips.com>
2017-08-14 16:54:14 +08:00
William Wu
f7169a90bc power: rk818-charger: fix usb charger undetected
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-07 19:17:12 +08:00
shengfeiXu
d75db61d03 power_supply: Add support TI BQ25703 charger chip
Change-Id: I3689a9f108e6fb86db4800d47a3aa7da7f7010e7
Signed-off-by: shengfei Xu <xsf@rock-chips.com>
2017-07-06 09:32:57 +08:00
Jianhong Chen
e503851471 power: rk818-charger: set otg5v by regulator framework
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-22 10:49:58 +08:00
Jianhong Chen
d222955baf power: rk818-charger: support set charge current by battery temperature
Change-Id: I10b71fae6400f3c0125cab7af1524c2091c8924a
Signed-off-by: Jianhong Chen <chenjh@rock-chips.com>
2017-06-22 10:49:34 +08:00
Jianhong Chen
ab4d8e9a7b power: rk818-charger: fix input current 80ma define error
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-21 15:07:08 +08:00
Jianhong Chen
2bdcc84d45 power: rk818-battery: update ts1 current select
select 40uA when temperature lower than 0'C, otherwise 60uA.

Change-Id: Ib235441c3adb146b8d1746a435875c19b1d8624d
Signed-off-by: Jianhong Chen <chenjh@rock-chips.com>
2017-06-21 14:08:00 +08:00
Jianhong Chen
a51aee4744 power: rk818-battery: fix battery charging state report error
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-21 14:07:17 +08:00
Jianhong Chen
a427c42979 power: rk818-battery: add notify to broadcast battery temperature
Change-Id: I2ee392f1885e87b0398eaff5ab7d0a0c89527e93
Signed-off-by: Jianhong Chen <chenjh@rock-chips.com>
2017-06-21 14:07:01 +08:00
Shunqing Chen
be11109547 power_supply: add cw2015 battery support
Change-Id: I36d65b9765a3303169f0ff60025d9ae722ceb1a9
Signed-off-by: Shunqing Chen <csq@rock-chips.com>
2017-06-16 16:22:54 +08:00
Huang, Tao
ad2fc3b29a Merge tag 'lsk-v4.4-17.05-android' of git://git.linaro.org/kernel/linux-linaro-stable.git
LSK 17.05 v4.4-android

* tag 'lsk-v4.4-17.05-android': (266 commits)
  BACKPORT: mm/slab: clean up DEBUG_PAGEALLOC processing code
  Linux 4.4.70
  UPSTREAM: arm64: hibernate: Support DEBUG_PAGEALLOC
  BACKPORT: arm64: vmlinux.ld: Add mmuoff data sections and move mmuoff text into idmap
  BACKPORT: arm64: Create sections.h
  ANDROID: uid_sys_stats: defer io stats calulation for dead tasks
  ANDROID: AVB: Fix linter errors.
  ANDROID: AVB: Fix invalidate_vbmeta_submit().
  drivers: char: mem: Check for address space wraparound with mmap()
  nfsd: encoders mustn't use unitialized values in error cases
  drm/edid: Add 10 bpc quirk for LGD 764 panel in HP zBook 17 G2
  PCI: Freeze PME scan before suspending devices
  PCI: Fix pci_mmap_fits() for HAVE_PCI_RESOURCE_TO_USER platforms
  tracing/kprobes: Enforce kprobes teardown after testing
  osf_wait4(): fix infoleak
  genirq: Fix chained interrupt data ordering
  uwb: fix device quirk on big-endian hosts
  metag/uaccess: Check access_ok in strncpy_from_user
  metag/uaccess: Fix access_ok()
  iommu/vt-d: Flush the IOTLB to get rid of the initial kdump mappings
  ...
2017-06-07 10:03:03 +08:00
chenjh
ed73b95dec power: rk818-charger: move irq init to the last step
init irq later than workqueue_struct and delayed_work to
avoid NULL ponint

Change-Id: I715296a715cb07149a6dce236a3b8ccafe00622e
Signed-off-by: chenjh <chenjh@rock-chips.com>
2017-05-19 17:48:44 +08:00
chenjh
9decafdc60 power: rk818-charger: add TS2 voltage detect when update input current
rk818's input charge voltage limit function doesn't works well. If software
set input current over than charger's max support value, rk818 may cause
charger over current protect which means disconnecting.
To solve this problem, we need to detect vbus voltage by TS2 pin, if vbus
is upper than 4.4v, we can safely adjust input current step by step from
low to high until meeting the target input current value.

Change-Id: I01d63974f251ad8ef0037158b66f4b85d3928baf
Signed-off-by: chenjh <chenjh@rock-chips.com>
2017-05-19 15:31:03 +08:00
Alex Shi
9f3cb876f7 Merge branch 'linux-linaro-lsk-v4.4' into linux-linaro-lsk-v4.4-android 2017-05-15 17:32:20 +08:00
Liam Breck
f9893beaae power: supply: bq24190_charger: Handle fault before status on interrupt
commit ba52e75718 upstream.

Reading both fault and status registers and logging any fault should
take priority over handling status register update.

Fix by moving the status handling to later in interrupt routine.

Fixes: d7bf353fd0 ("bq24190_charger: Add support for TI BQ24190 Battery Charger")
Signed-off-by: Liam Breck <kernel@networkimprov.net>
Acked-by: Mark Greer <mgreer@animalcreek.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-14 13:32:54 +02:00
Liam Breck
98cbfaaf4e power: supply: bq24190_charger: Don't read fault register outside irq_handle_thread()
commit 68abfb8015 upstream.

Caching the fault register after a single I2C read may not keep an accurate
value.

Fix by doing two reads in irq_handle_thread() and using the cached value
elsewhere. If a safety timer fault later clears itself, we apparently don't get
an interrupt (INT), however other interrupts would refresh the register cache.

From the data sheet: "When a fault occurs, the charger device sends out INT
 and keeps the fault state in REG09 until the host reads the fault register.
 Before the host reads REG09 and all the faults are cleared, the charger
 device would not send any INT upon new faults. In order to read the
 current fault status, the host has to read REG09 two times consecutively.
 The 1st reads fault register status from the last read [1] and the 2nd reads
 the current fault register status."

[1] presumably a typo; should be "last fault"

Fixes: d7bf353fd0 ("bq24190_charger: Add support for TI BQ24190 Battery Charger")
Signed-off-by: Liam Breck <kernel@networkimprov.net>
Acked-by: Mark Greer <mgreer@animalcreek.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-14 13:32:54 +02:00
Liam Breck
092a9c8ba3 power: supply: bq24190_charger: Call power_supply_changed() for relevant component
commit 2d9fee6a42 upstream.

We wrongly get uevents for bq24190-charger and bq24190-battery on every
register change.

Fix by checking the association with charger and battery before
emitting uevent(s).

Fixes: d7bf353fd0 ("bq24190_charger: Add support for TI BQ24190 Battery Charger")
Signed-off-by: Liam Breck <kernel@networkimprov.net>
Acked-by: Mark Greer <mgreer@animalcreek.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-14 13:32:54 +02:00
Liam Breck
397cad3a37 power: supply: bq24190_charger: Install irq_handler_thread() at end of probe()
commit d62acc5ef0 upstream.

The device specific data is not fully initialized on
request_threaded_irq(). This may cause a crash when the IRQ handler
tries to reference them.

Fix the issue by installing IRQ handler at the end of the probe.

Fixes: d7bf353fd0 ("bq24190_charger: Add support for TI BQ24190 Battery Charger")
Signed-off-by: Liam Breck <kernel@networkimprov.net>
Acked-by: Mark Greer <mgreer@animalcreek.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-14 13:32:54 +02:00