- 18 4月, 2019 1 次提交
-
-
由 Wen Yang 提交于
The call to of_parse_phandle returns a node pointer with refcount incremented thus it must be explicitly decremented after the last usage. 492 int ab8500_bm_of_probe(struct device *dev, 493 struct device_node *np, 494 struct abx500_bm_data *bm) 495 { 496 const struct batres_vs_temp *tmp_batres_tbl; 497 struct device_node *battery_node; ... 501 /* get phandle to 'battery-info' node */ 502 battery_node = of_parse_phandle(np, "battery", 0); ... 509 if (!btech) { 510 dev_warn(dev, "missing property battery-name/type\n"); 511 return -EINVAL; ---> leaked here 512 } ... 540 of_node_put(battery_node); ---> released here 541 542 return 0; 543 } Detected by coccinelle with the following warnings: ./drivers/power/supply/ab8500_bmdata.c:511:2-8: ERROR: missing of_node_put; acquired a node pointer with refcount incremented on line 502, but without a corresponding object release within this function. Signed-off-by: NWen Yang <wen.yang99@zte.com.cn> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
- 16 4月, 2019 8 次提交
-
-
由 Tony Lindgren 提交于
With loadable modules we may get the following during init: could not initialize VBUS or ID IIO: -517 Let's not print any pointless error messages for deferred probe. Signed-off-by: NTony Lindgren <tony@atomide.com> Acked-by: NPavel Machek <pavel@ucw.cz> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
由 Tony Lindgren 提交于
With loadable modules we may get the following during init: could not initialize VBUS or ID IIO: -517 Let's not print any pointless error messages for deferred probe. Signed-off-by: NTony Lindgren <tony@atomide.com> Acked-by: NPavel Machek <pavel@ucw.cz> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
由 Tony Lindgren 提交于
We should not use measured current value for average since we have proper coulomb counter values available. Using measured current value should be only used when the value is queried at a higher rate than the 250 ms rate the coulomb counter is configured to run at. Cc: Pavel Machek <pavel@ucw.cz> Signed-off-by: NTony Lindgren <tony@atomide.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
由 Tony Lindgren 提交于
The coulomb counter calibration is not CCO, it's CCM. And the CCM is nine bits wide signed register, so let's use sign_extend32() for it. Signed-off-by: NTony Lindgren <tony@atomide.com> Acked-by: NPavel Machek <pavel@ucw.cz> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
由 Tony Lindgren 提交于
The accumulator sample register is signed 32-bits wide register on droid 4. And only the earlier version of cpcap has a signed 24-bits wide register. We're currently passing it around as unsigned, so let's fix that and use sign_extend32() for the earlier revision. Signed-off-by: NTony Lindgren <tony@atomide.com> Acked-by: NPavel Machek <pavel@ucw.cz> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
由 Tony Lindgren 提交于
We need to check current instead of the charge counter to see if a charger is connected. The charge counter shows the cumulated value instead of the current charge current and can be negative or positive. Cc: Pavel Machek <pavel@ucw.cz> Signed-off-by: NTony Lindgren <tony@atomide.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
由 Artur Rojek 提交于
Introduce optional support of POWER_SUPPLY_PROP_STATUS for chargers which provide charging status GPIO. Signed-off-by: NArtur Rojek <contact@artur-rojek.eu> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
由 Enric Balletbo i Serra 提交于
There is a spelling mistake in ps_get_cur_charge_cntl_limit function so replace 'chrage' for 'charge'. Signed-off-by: NEnric Balletbo i Serra <enric.balletbo@collabora.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
- 10 4月, 2019 3 次提交
-
-
由 Tony Lindgren 提交于
If called fast enough so samples do not increment, we can get division by zero in kernel: __div0 cpcap_battery_cc_raw_div cpcap_battery_get_property power_supply_get_property.part.1 power_supply_get_property power_supply_show_property power_supply_uevent Fixes: 874b2adb ("power: supply: cpcap-battery: Add a battery driver") Signed-off-by: NTony Lindgren <tony@atomide.com> Acked-by: NPavel Machek <pavel@ucw.cz> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
由 Michael Hennerich 提交于
rename only - no functional changes Signed-off-by: NMichael Hennerich <michael.hennerich@analog.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
由 Michael Hennerich 提交于
There never was a device called LTC3651, it always was just LT3651. This circumstance makes it pretty difficult to identify what this driver is meant to control.channges since Signed-off-by: NMichael Hennerich <michael.hennerich@analog.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
- 06 4月, 2019 2 次提交
-
-
由 Sven Van Asbroeck 提交于
Explicitly cancel/sync the irq_work delayed work, otherwise there's a chance that it will run after the device is removed, which would result in a use-after-free. Note that cancel/sync should happen: - after irq's have been disabled, as the isr re-schedules the work - before the power supply is unregistered, because the work func uses the power supply handle. Cc: Alexander Kurz <akurz@blala.de> Signed-off-by: NSven Van Asbroeck <TheSven73@gmail.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
由 Sven Van Asbroeck 提交于
Call order on probe(): - max14656_hw_init() enables interrupts on the chip - devm_request_irq() starts processing interrupts, isr could be called immediately - isr: schedules delayed work (irq_work) - irq_work: calls power_supply_changed() - devm_power_supply_register() registers the power supply Depending on timing, it's possible that power_supply_changed() is called on an unregistered power supply structure. Fix by registering the power supply before requesting the irq. Cc: Alexander Kurz <akurz@blala.de> Signed-off-by: NSven Van Asbroeck <TheSven73@gmail.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
- 05 4月, 2019 6 次提交
-
-
由 Claudiu Beznea 提交于
Add support for SAM9X60 shutdown controller. Signed-off-by: NClaudiu Beznea <claudiu.beznea@microchip.com> Acked-by: NNicolas Ferre <nicolas.ferre@microchip.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
由 Claudiu Beznea 提交于
Add RTT wakeup capability. Signed-off-by: NClaudiu Beznea <claudiu.beznea@microchip.com> Acked-by: NNicolas Ferre <nicolas.ferre@microchip.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
由 Gustavo A. R. Silva 提交于
Currently there is no check on platform_get_irq() return value in case it fails, hence never actually reporting any errors and causing unexpected behavior when using such value as argument for function regmap_irq_get_virq(). Fix this by adding a proper check, a message reporting any errors and returning *pirq* Addresses-Coverity-ID: 1443940 ("Improper use of negative value") Fixes: 843735b7 ("power: axp288_charger: axp288 charger driver") Cc: stable@vger.kernel.org Signed-off-by: NGustavo A. R. Silva <gustavo@embeddedor.com> Reviewed-by: NHans de Goede <hdegoede@redhat.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
由 Maxime Ripard 提交于
Commit c08b1f45 ("power: supply: core: Add power_supply_battery_info and API") introduced code to parse the simple-battery node and express battery charging constraints. However, it parsed that node using the properties constant_charge_current_max_microamp and constant_charge_voltage_max_microvolt, while the device tree binding for the simple-battery node uses dashes to separate the words in those properties (constant-charge-current-max-microamp and constant-charge-voltage-max-microvolt). Let's make the code match the binding. Fixes: c08b1f45 ("power: supply: core: Add power_supply_battery_info and API") Signed-off-by: NMaxime Ripard <maxime.ripard@bootlin.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
由 Kangjie Lu 提交于
In case create_freezable_workqueue fails, the fix return -ENOMEM to avoid a potential NULL pointer dereference. Signed-off-by: NKangjie Lu <kjlu@umn.edu> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
由 Martin Schiller 提交于
Make the syscon-reboot driver accept value and mask instead of just value. Prior to this patch, the property name for the value was 'mask'. If only the mask property is defined on a node, maintain compatibility by using it as the value. This patch is based on commit f2c199db ("power: reset: syscon-poweroff: add a mask property") and does the same change for the syscon-reboot driver. Signed-off-by: NMartin Schiller <ms@dev.tdt.de> Acked-by: NRob Herring <robh@kernel.org> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
- 20 2月, 2019 4 次提交
-
-
由 Nicolas Ferre 提交于
Add support for additional reset causes and the proper compatibility string for sam9x60 SoC. The restart function is the same as the samx7. Signed-off-by: NNicolas Ferre <nicolas.ferre@microchip.com> Reviewed-by: NAlexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
由 Sven Van Asbroeck 提交于
The work which is scheduled on a POR boot is potentially left pending or running until after the device module is removed, which could result in a use-after-free. Fix by registering a cancel/sync callback, which gets executed as part of standard resource unwinding. This issue was detected with the help of Coccinelle. Signed-off-by: NSven Van Asbroeck <TheSven73@gmail.com> Reviewed-by: NHans de Goede <hdegoede@redhat.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
由 Artur Rojek 提交于
Add a field for "voltage_max_design_uv" to present fully charged battery voltage. Signed-off-by: NArtur Rojek <contact@artur-rojek.eu> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
由 Arthur Demchenkov 提交于
The flags were just read by bq27xxx_battery_update(), no need to read them again. Signed-off-by: NArthur Demchenkov <spinal.by@gmail.com> Reviewed-by: NAndrew F. Davis <afd@ti.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
- 13 2月, 2019 1 次提交
-
-
由 Sven Van Asbroeck 提交于
In remove(), use cancel_delayed_work_sync() to cancel the delayed work. Otherwise there's a chance that this work will continue to run until after the device has been removed. While we're here, fix the deallocation order in remove(), to correspond to the inverse of the probe() allocation order. This guarantees that any remaining work can run to completion with all driver structures still intact. This issue was detected with the help of Coccinelle. Signed-off-by: NSven Van Asbroeck <TheSven73@gmail.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
- 24 1月, 2019 4 次提交
-
-
由 Michał Mirosław 提交于
Use firmware-provided limits for POWER_SUPPLY_*_MAX properties instead of chip max values. This will reflect the battery limits as those are the important ones. Signed-off-by: NMichał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
由 Yuanjiang Yu 提交于
We found sometimes we can not get the saving capacity to initialize the battery capacity, the reason is the user area registers are put on power always-on region, so we need delay some time to wait until values are updated successfully. Moreover we also should clear the USER_AREA_CLEAR register after setting the USER_AREA_SET register, otherwise we can not save the values in the USER_AREA_SET register. Signed-off-by: NYuanjiang Yu <yuanjiang.yu@unisoc.com> Signed-off-by: NBaolin Wang <baolin.wang@linaro.org> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
由 Baolin Wang 提交于
We should multiply the calibrated current data (cur_1000ma_adc) when converting current capacity (mAh) to coulomb counter, which can get an accurate coulomb counter from the fuel gauge controller. Signed-off-by: NBaolin Wang <baolin.wang@linaro.org> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
由 Baolin Wang 提交于
Add POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE property to get charge voltage sampling by ADC controller, which is used to validate if the charge voltage is in normal range or not in charger manager. Signed-off-by: NBaolin Wang <baolin.wang@linaro.org> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
- 22 1月, 2019 1 次提交
-
-
由 Roman Kiryanov 提交于
To comply with tests we need to support more power supply properties: POWER_SUPPLY_PROP_VOLTAGE_NOW POWER_SUPPLY_PROP_TEMP POWER_SUPPLY_PROP_CHARGE_COUNTER POWER_SUPPLY_PROP_CURRENT_NOW POWER_SUPPLY_PROP_CURRENT_AVG POWER_SUPPLY_PROP_CHARGE_FULL POWER_SUPPLY_PROP_CYCLE_COUNT POWER_SUPPLY_PROP_VOLTAGE_MAX POWER_SUPPLY_PROP_CURRENT_MAX Signed-off-by: NRoman Kiryanov <rkir@google.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
- 21 1月, 2019 10 次提交
-
-
由 Krzysztof Kozlowski 提交于
Fix few trivial language typos. Signed-off-by: NKrzysztof Kozlowski <krzk@kernel.org> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
由 Pavel Machek 提交于
The driver doesn't generate uevents on charger connect/disconnect. This leads to UPower not detecting when AC is on or off... and that is bad. Reported by Arthur D. on github ( https://github.com/maemo-leste/bugtracker/issues/206 ), thanks to Merlijn Wajer for suggesting a fix. Cc: stable@kernel.org Signed-off-by: NPavel Machek <pavel@ucw.cz> Acked-by: NTony Lindgren <tony@atomide.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
由 Yangtao Li 提交于
We include of.h twice. It's unnecessary,so just remove them. Signed-off-by: NYangtao Li <tiny.windzz@gmail.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
由 Kangjie Lu 提交于
If twl4030_bci_read() fails, the read data in "s" is incorrect, which is however used in the following execution. The fix checks the return value of twl4030_bci_read() and returns an error code upstream upon the failure of twl4030_bci_read(). Signed-off-by: NKangjie Lu <kjlu@umn.edu> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
由 Roman Kiryanov 提交于
Tabs are preferred. Signed-off-by: NRoman Kiryanov <rkir@google.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
由 Roman Kiryanov 提交于
Align two values as other values below. Signed-off-by: NRoman Kiryanov <rkir@google.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
由 Roman Kiryanov 提交于
The battery_data static variable was not used. Signed-off-by: NRoman Kiryanov <rkir@google.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
由 Roman Kiryanov 提交于
There was a line longer than 80 characters. Signed-off-by: NRoman Kiryanov <rkir@google.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
由 Roman Kiryanov 提交于
There was a checkpatch complain: "Missing or malformed SPDX-License-Identifier tag". Signed-off-by: NRoman Kiryanov <rkir@google.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-
由 Yangtao Li 提交于
Use DEFINE_SHOW_ATTRIBUTE macro to simplify the code. Signed-off-by: NYangtao Li <tiny.windzz@gmail.com> Signed-off-by: NSebastian Reichel <sebastian.reichel@collabora.com>
-