- 14 Jan, 2020 9 commits
-
-
Yauhen Kharuzhy authored
Support BQ25892 and BQ25896 chips by this driver. They shared one chip ID 0, so distinquish them by device revisions (2 for 25896 and 1 for 25892). Signed-off-by: Yauhen Kharuzhy <jekhor@gmail.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
-
Dan Murphy authored
Add the "Over Current" string to /sys/class/power_supply/<supply_name>/health description. Fixes: e3e83cc6 ("power: supply: core: Add POWER_SUPPLY_HEALTH_OVERCURRENT constant") Signed-off-by: Dan Murphy <dmurphy@ti.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
-
Dan Carpenter authored
The "mode" variable is an enum and in this context GCC treats it as an unsigned int so the error handling is never triggered. Fixes: 51d07566 ("bq20z75: Add support for charge properties") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
-
Sven Van Asbroeck authored
This driver's remove path calls cancel_delayed_work(). However, that function does not wait until the work function finishes. This could mean that the work function is still running after the driver's remove function has finished, which would result in a use-after-free. Fix by calling cancel_delayed_work_sync(), which ensures that that the work is properly cancelled, no longer running, and unable to re-schedule itself. This issue was detected with the help of Coccinelle. Cc: stable <stable@vger.kernel.org> Signed-off-by: Sven Van Asbroeck <TheSven73@gmail.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
-
Marek Szyprowski authored
Don't disable IRQ wake feature without prior enabling it. This fixes following warning observed on Exynos3250-based Rinato board: ------------[ cut here ]------------ WARNING: CPU: 0 PID: 1288 at kernel/irq/manage.c:724 irq_set_irq_wake+0xfc/0x134 Unbalanced IRQ 83 wake disable Modules linked in: CPU: 0 PID: 1288 Comm: rtcwake Not tainted 5.5.0-rc5-next-20200110-00031-g6289fffbb3f5 #7266 Hardware name: Samsung Exynos (Flattened Device Tree) [<c0112e48>] (unwind_backtrace) from [<c010e090>] (show_stack+0x10/0x14) [<c010e090>] (show_stack) from [<c0b25b28>] (dump_stack+0xa4/0xd0) [<c0b25b28>] (dump_stack) from [<c0128088>] (__warn+0xf4/0x10c) [<c0128088>] (__warn) from [<c0128114>] (warn_slowpath_fmt+0x74/0xb8) [<c0128114>] (warn_slowpath_fmt) from [<c019e9a0>] (irq_set_irq_wake+0xfc/0x134) [<c019e9a0>] (irq_set_irq_wake) from [<c0772708>] (max17040_suspend+0x50/0x58) [<c0772708>] (max17040_suspend) from [<c05f55ac>] (dpm_run_callback+0xb4/0x400) [<c05f55ac>] (dpm_run_callback) from [<c05f5e38>] (__device_suspend+0x140/0x814) [<c05f5e38>] (__device_suspend) from [<c05f9548>] (dpm_suspend+0x16c/0x564) [<c05f9548>] (dpm_suspend) from [<c05fa2e4>] (dpm_suspend_start+0x90/0x98) [<c05fa2e4>] (dpm_suspend_start) from [<c01977f4>] (suspend_devices_and_enter+0xec/0xc0c) [<c01977f4>] (suspend_devices_and_enter) from [<c019862c>] (pm_suspend+0x318/0x3e8) [<c019862c>] (pm_suspend) from [<c01963cc>] (state_store+0x68/0xc8) [<c01963cc>] (state_store) from [<c03531a4>] (kernfs_fop_write+0x10c/0x220) [<c03531a4>] (kernfs_fop_write) from [<c02b44c4>] (__vfs_write+0x2c/0x1c4) [<c02b44c4>] (__vfs_write) from [<c02b7288>] (vfs_write+0xa4/0x180) [<c02b7288>] (vfs_write) from [<c02b74d0>] (ksys_write+0x58/0xcc) [<c02b74d0>] (ksys_write) from [<c0101000>] (ret_fast_syscall+0x0/0x28) Exception stack(0xd6e83fa8 to 0xd6e83ff0) ... irq event stamp: 18028 hardirqs last enabled at (18027): [<c014b99c>] cancel_delayed_work+0x84/0xf8 hardirqs last disabled at (18028): [<c0b49b1c>] _raw_spin_lock_irqsave+0x1c/0x58 softirqs last enabled at (17876): [<c01026d8>] __do_softirq+0x4f0/0x5e4 softirqs last disabled at (17869): [<c0130d34>] irq_exit+0x16c/0x170 ---[ end trace 0728005730004e60 ]--- Fixes: 2e17ed94 ("power: supply: max17040: Add IRQ handler for low SOC alert") Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
-
Samuel Holland authored
This member of struct axp20x_usb_power is not used anywhere. Remove it. Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Samuel Holland <samuel@sholland.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
-
Samuel Holland authored
The AC power supply input can be used as a wakeup source. Hook up the ACIN_PLUGIN IRQ to trigger wakeup based on userspace configuration. To do this, we must remember the list of IRQs for the life of the device. To know how much space to allocate for the flexible array member, we switch from using a NULL sentinel to using an array length. Because we now depend on the specific order of the IRQs (we assume ACIN_PLUGIN is first and always present), failing to acquire an IRQ during probe must be a fatal error. To avoid spuriously waking up the system when the AC power supply is not configured as a wakeup source, we must explicitly disable all non- wake IRQs during system suspend. This is because the SoC's NMI input is shared among all IRQs on the AXP PMIC. Due to the use of regmap-irq, the individual IRQs within the PMIC are nested threaded interrupts, and are therefore not automatically disabled during system suspend. The upshot is that if any other device within the MFD (such as the power key) is an enabled wakeup source, all enabled IRQs within the PMIC will cause wakeup. We still need to call enable_irq_wake() when we *do* want wakeup, in case those other wakeup sources on the PMIC are all disabled. Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Samuel Holland <samuel@sholland.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
-
Samuel Holland authored
AXP803/AXP813 have a flag that enables/disables the AC power supply input. Allow control of this flag via the ONLINE property on those variants. Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Samuel Holland <samuel@sholland.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
-
Samuel Holland authored
AXP803/AXP813 have a flag that enables/disables the AC power supply input. This flag does not affect the status bits in PWR_INPUT_STATUS. Its effect can be verified by checking the battery charge/discharge state (bit 2 of PWR_INPUT_STATUS), or by examining the current draw on the AC input. Take this flag into account when getting the ONLINE property of the AC input, on PMICs where this flag is present. Fixes: 7693b564 ("power: supply: add AC power supply driver for AXP813") Cc: stable@vger.kernel.org Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
-
- 19 Dec, 2019 23 commits
-
-
Ma Feng authored
Fixes coccicheck warning: drivers/power/supply/abx500_chargalg.c:1826:2-3: Unneeded semicolon Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Ma Feng <mafeng.ma@huawei.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
-
Ma Feng authored
Fixes coccicheck warning: drivers/power/supply/ab8500_charger.c:1082:2-3: Unneeded semicolon drivers/power/supply/ab8500_charger.c:792:2-3: Unneeded semicolon drivers/power/supply/ab8500_charger.c:2430:2-3: Unneeded semicolon Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Ma Feng <mafeng.ma@huawei.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
-
Ma Feng authored
Fixes coccicheck warning: drivers/power/supply/ab8500_fg.c:2224:5-6: Unneeded semicolon drivers/power/supply/ab8500_fg.c:2227:4-5: Unneeded semicolon drivers/power/supply/ab8500_fg.c:2334:3-4: Unneeded semicolon drivers/power/supply/ab8500_fg.c:2342:3-4: Unneeded semicolon drivers/power/supply/ab8500_fg.c:2350:3-4: Unneeded semicolon drivers/power/supply/ab8500_fg.c:2358:3-4: Unneeded semicolon drivers/power/supply/ab8500_fg.c:2366:3-4: Unneeded semicolon Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Ma Feng <mafeng.ma@huawei.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
-
Jean-Francois Dagenais authored
"Battery mode" is the name of the register, the bit manipulated by this code is "CAPACITY_MODE" (Smart Battery System Specifications). Signed-off-by: Jean-Francois Dagenais <jeff.dagenais@gmail.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
-
Jean-Francois Dagenais authored
Symbolic permissions 'S_IRUSR | S_IRGRP | S_IROTH' are not preferred. Use octal permissions '0444'. Signed-off-by: Jean-Francois Dagenais <jeff.dagenais@gmail.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
-
Krzysztof Kozlowski authored
Adjust indentation from spaces to tab (+optional two spaces) as in coding style with command like: $ sed -e 's/^ /\t/' -i */Kconfig Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
-
Enric Balletbo i Serra authored
When a device has no support to get the charger number of ports, it doesn't have to result in a dev_err(), print saying "Could not get charger port count" using a dev_info() would suffice. In such case, the dev_info() message is already printed but the dev_err() is annoying, specially, on those devices that doesn't support the command. So remove the dev_err(). Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Reviewed-by: Guenter Roeck <groeck@chromium.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
-
Matheus Castello authored
Notify core through power_supply_changed() in case of changes in state of charge and power supply status. This is useful for user-space to efficiently update current battery level. Signed-off-by: Matheus Castello <matheus@castello.eng.br> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
-
Matheus Castello authored
For configuration of fuel gauge alert for a low level state of charge interrupt we add a function to config level threshold and a device tree binding property to set it in flatned device tree node. Now we can use "maxim,alert-low-soc-level" property with the values from 1% up to 32% to configure alert interrupt threshold. Signed-off-by: Matheus Castello <matheus@castello.eng.br> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
-
Matheus Castello authored
According datasheet max17040 has a pin for alert host for low SOC. This pin can be used as external interrupt, so we need to check for interrupts assigned for device and handle it. In handler we are checking and storing fuel gauge registers values and send an uevent to notificate user space, so user space can decide save work or turn off since the alert demonstrate that the battery may no have the power to keep the system turned on for much longer. Signed-off-by: Matheus Castello <matheus@castello.eng.br> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
-
Matheus Castello authored
Documentation of max17040 based fuel gauge characteristics. For configure low level state of charge threshold alert signaled from max17043/max17044 we add "maxim,alert-low-soc-level" property. Signed-off-by: Matheus Castello <matheus@castello.eng.br> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
-
Baolin Wang authored
There are some deviations between the real resistance and the ideal resistance of coulomb counter, which will affect the accuracy of the coulomb counter, thus calibrate the real resistance of coulomb counter to improve the accuracy. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Baolin Wang <baolin.wang7@gmail.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
-
Baolin Wang authored
dt-bindings: power: sc27xx: Add a new property to describe the real resistance of coulomb counter chip Add a new property to describe the real resistance of coulomb counter chip, which is used to calibrate the accuracy of the coulomb counter chip. Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Baolin Wang <baolin.wang7@gmail.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
-
Yuanjiang Yu authored
Optimize the battery internal resistance in a certain temerature to get a accurate battery internal resistance. Signed-off-by: Yuanjiang Yu <yuanjiang.yu@unisoc.com> Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Baolin Wang <baolin.wang7@gmail.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
-
Baolin Wang authored
Since the battery internal resistance can be changed with the temperature changes, thus add a resistance temperature table support to look up the accurate battery internal resistance in a certain temperature. Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Baolin Wang <baolin.wang7@gmail.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
-
Baolin Wang authored
dt-bindings: power: Introduce one property to describe the battery resistance with temperature changes Since the battery internal resistance can be changed as the temperature changes, thus add one table to describe the battery resistance percent in different temperatures to get a accurate battery internal resistance. Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Baolin Wang <baolin.wang7@gmail.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
-
Bartosz Golaszewski authored
We need the of_match table if we want to use the compatible string in the pmic's child node and get the charger driver loaded automatically. Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
-
Angus Ainslie (Purism) authored
The MAX17055 is very similar to the MAX17042 so extend the driver. Signed-off-by: Angus Ainslie (Purism) <angus@akkea.ca> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
-
Angus Ainslie (Purism) authored
The bindings are missing documentation for some of the compatible strings. Signed-off-by: Angus Ainslie (Purism) <angus@akkea.ca> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Acked-by: Rob Herring <robh@kernel.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
-
Lucas Stach authored
For some devices userspace needs the ability to completely cut the power to the USB devices connected to the charge controller. An easy way to achieve this is by allowing 0 as a valid max current and forcibly disable the output in that case, as well as enable it again if the regulator is in use and a non-0 max current is set. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Tested-by: Chris Healy <cphealy@gmail.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
-
Krzysztof Kozlowski authored
Adjust indentation from spaces to tab (+optional two spaces) as in coding style with command like: $ sed -e 's/^ /\t/' -i */Kconfig Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
-
Paul Cercueil authored
The ADC in the JZ4740 can work either in high-precision mode with a 2.5V range, or in low-precision mode with a 7.5V range. The code in place in this driver will select the proper scale according to the maximum voltage of the battery. The JZ4770 however only has one mode, with a 6.6V range. If only one scale is available, there's no need to change it (and nothing to change it to), and trying to do so will fail with -EINVAL. Fixes: fb24ccfb ("power: supply: add Ingenic JZ47xx battery driver.") Signed-off-by: Paul Cercueil <paul@crapouillou.net> Acked-by: Artur Rojek <contact@artur-rojek.eu> Cc: stable@vger.kernel.org Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
-
Chuhong Yuan authored
The driver forgets to unregister the notifier in remove. Add the call to fix it. Signed-off-by: Chuhong Yuan <hslester96@gmail.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
-
- 18 Dec, 2019 1 commit
-
-
Chris Packham authored
Don't generate an error message when devm_gpiod_get fails with -EPROBE_DEFER. Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
-
- 08 Dec, 2019 7 commits
-
-
Linus Torvalds authored
-
git://git.kernel.org/pub/scm/linux/kernel/git/netdev/netLinus Torvalds authored
Pull networking fixes from David Miller: 1) More jumbo frame fixes in r8169, from Heiner Kallweit. 2) Fix bpf build in minimal configuration, from Alexei Starovoitov. 3) Use after free in slcan driver, from Jouni Hogander. 4) Flower classifier port ranges don't work properly in the HW offload case, from Yoshiki Komachi. 5) Use after free in hns3_nic_maybe_stop_tx(), from Yunsheng Lin. 6) Out of bounds access in mqprio_dump(), from Vladyslav Tarasiuk. 7) Fix flow dissection in dsa TX path, from Alexander Lobakin. 8) Stale syncookie timestampe fixes from Guillaume Nault. [ Did an evil merge to silence a warning introduced by this pull - Linus ] * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (84 commits) r8169: fix rtl_hw_jumbo_disable for RTL8168evl net_sched: validate TCA_KIND attribute in tc_chain_tmplt_add() r8169: add missing RX enabling for WoL on RTL8125 vhost/vsock: accept only packets with the right dst_cid net: phy: dp83867: fix hfs boot in rgmii mode net: ethernet: ti: cpsw: fix extra rx interrupt inet: protect against too small mtu values. gre: refetch erspan header from skb->data after pskb_may_pull() pppoe: remove redundant BUG_ON() check in pppoe_pernet tcp: Protect accesses to .ts_recent_stamp with {READ,WRITE}_ONCE() tcp: tighten acceptance of ACKs not matching a child socket tcp: fix rejected syncookies due to stale timestamps lpc_eth: kernel BUG on remove tcp: md5: fix potential overestimation of TCP option space net: sched: allow indirect blocks to bind to clsact in TC net: core: rename indirect block ingress cb function net-sysfs: Call dev_hold always in netdev_queue_add_kobject net: dsa: fix flow dissection on Tx path net/tls: Fix return values to avoid ENOTSUPP net: avoid an indirect call in ____sys_recvmsg() ...
-
git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsiLinus Torvalds authored
Pull more SCSI updates from James Bottomley: "Eleven patches, all in drivers (no core changes) that are either minor cleanups or small fixes. They were late arriving, but still safe for -rc1" * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: MAINTAINERS: Add the linux-scsi mailing list to the ISCSI entry scsi: megaraid_sas: Make poll_aen_lock static scsi: sd_zbc: Improve report zones error printout scsi: qla2xxx: Fix qla2x00_request_irqs() for MSI scsi: qla2xxx: unregister ports after GPN_FT failure scsi: qla2xxx: fix rports not being mark as lost in sync fabric scan scsi: pm80xx: Remove unused include of linux/version.h scsi: pm80xx: fix logic to break out of loop when register value is 2 or 3 scsi: scsi_transport_sas: Fix memory leak when removing devices scsi: lpfc: size cpu map by last cpu id set scsi: ibmvscsi_tgt: Remove unneeded variable rc
-
git://git.samba.org/sfrench/cifs-2.6Linus Torvalds authored
Pull cifs fixes from Steve French: "Nine cifs/smb3 fixes: - one fix for stable (oops during oplock break) - two timestamp fixes including important one for updating mtime at close to avoid stale metadata caching issue on dirty files (also improves perf by using SMB2_CLOSE_FLAG_POSTQUERY_ATTRIB over the wire) - two fixes for "modefromsid" mount option for file create (now allows mode bits to be set more atomically and accurately on create by adding "sd_context" on create when modefromsid specified on mount) - two fixes for multichannel found in testing this week against different servers - two small cleanup patches" * tag '5.5-rc-smb3-fixes-part2' of git://git.samba.org/sfrench/cifs-2.6: smb3: improve check for when we send the security descriptor context on create smb3: fix mode passed in on create for modetosid mount option cifs: fix possible uninitialized access and race on iface_list cifs: Fix lookup of SMB connections on multichannel smb3: query attributes on file close smb3: remove unused flag passed into close functions cifs: remove redundant assignment to pointer pneg_ctxt fs: cifs: Fix atime update check vs mtime CIFS: Fix NULL-pointer dereference in smb2_push_mandatory_locks
-
git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfsLinus Torvalds authored
Pull misc vfs cleanups from Al Viro: "No common topic, just three cleanups". * 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: make __d_alloc() static fs/namespace: add __user to open_tree and move_mount syscalls fs/fnctl: fix missing __user in fcntl_rw_hint()
-
git://github.com/jonmason/ntbLinus Torvalds authored
Pull NTB update from Jon Mason: "Just a simple patch to add a new Hygon Device ID to the AMD NTB device driver" * tag 'ntb-5.5' of git://github.com/jonmason/ntb: NTB: Add Hygon Device ID
-
git://git.kernel.org/pub/scm/linux/kernel/git/dtor/inputLinus Torvalds authored
Pull more input updates from Dmitry Torokhov: - fixups for Synaptics RMI4 driver - a quirk for Goodinx touchscreen on Teclast tablet - a new keycode definition for activating privacy screen feature found on a few "enterprise" laptops - updates to snvs_pwrkey driver - polling uinput device for writing (which is always allowed) now works * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: synaptics-rmi4 - don't increment rmiaddr for SMBus transfers Input: synaptics-rmi4 - re-enable IRQs in f34v7_do_reflash Input: goodix - add upside-down quirk for Teclast X89 tablet Input: add privacy screen toggle keycode Input: uinput - fix returning EPOLLOUT from uinput_poll Input: snvs_pwrkey - remove gratuitous NULL initializers Input: snvs_pwrkey - send key events for i.MX6 S, DL and Q
-