summaryrefslogtreecommitdiffstats
path: root/drivers (follow)
Commit message (Collapse)AuthorAgeFilesLines
* power: supply: bq24190_charger: convert comma to semicolonZheng Yongjun2021-01-161-1/+1
| | | | | | | Replace a comma between expression statements by a semicolon. Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: ab8500_fg: convert comma to semicolonZheng Yongjun2021-01-161-1/+1
| | | | | | | Replace a comma between expression statements by a semicolon. Signed-off-by: Zheng Yongjun <zhengyongjun3@huawei.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: ds2780: Switch to using the new API kobj_to_dev()Tian Tao2021-01-161-4/+4
| | | | | | | | | | | | | | | fixed the following coccicheck: drivers/power/supply/ds2780_battery.c:627:60-61: WARNING opportunity for kobj_to_dev() drivers/power/supply/ds2780_battery.c:672:60-61: WARNING opportunity for kobj_to_dev() drivers/power/supply/ds2780_battery.c:640:60-61: WARNING opportunity for kobj_to_dev() drivers/power/supply/ds2780_battery.c:685:60-61: WARNING opportunity for kobj_to_dev() Signed-off-by: Tian Tao <tiantao6@hisilicon.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: bq27xxx: Support CHARGE_NOW for bq27z561/bq28z610/bq34z100Hermes Zhang2021-01-161-1/+34
| | | | | | | | | | | | | | | | | | | | | Currently REG_NAC (nominal available capacity) is mapped to power-supply's CHARGE_NOW property. Some chips do not have REG_NAC and do not expose CHARGE_NOW at the moment. Some bq27xxx chips also have another register REG_RM (remaining capacity). The difference between REG_NAC and REG_RM is load compensation. This patch adds register information for REG_RM for all supported fuel gauges. On systems having REG_NAC it is ignored, so behaviour does not change. On systems without REG_NAC, REG_RM will be used to provide CHARGE_NOW functionality. As a result there are three more chips exposing CHARGE_NOW: bq27z561, bq28z610 and bq34z100 Signed-off-by: Hermes Zhang <chenhuiz@axis.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: cpcap-charger: Fix power_supply_put on null battery pointerColin Ian King2021-01-151-1/+2
| | | | | | | | | | | | Currently if the pointer battery is null there is a null pointer dereference on the call to power_supply_put. Fix this by only performing the put if battery is not null. Addresses-Coverity: ("Dereference after null check") Fixes: 4bff91bb3231 ("power: supply: cpcap-charger: Fix missing power_supply_put()") Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: cpcap-battery: constify psy_descSebastian Reichel2021-01-151-15/+13
| | | | | | | | | | | | | There is no dynamic information in cpcap-battery's power-supply description struct, so let's make it static const. Cc: Arthur Demchenkov <spinal.by@gmail.com> Cc: Carl Philipp Klemm <philipp@uvos.xyz> Cc: Merlijn Wajer <merlijn@wizzup.org> Acked-by: Pavel Machek <pavel@ucw.cz> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: cpcap-battery: Fix typoPavel Machek2021-01-141-1/+1
| | | | | | | | | | | | | Fix typo Cc: Arthur Demchenkov <spinal.by@gmail.com> Cc: Carl Philipp Klemm <philipp@uvos.xyz> Cc: Merlijn Wajer <merlijn@wizzup.org> Cc: Pavel Machek <pavel@ucw.cz> Signed-off-by: Pavel Machek <pavel@ucw.cz> [tony@atomide.com: separated out from charger changes] Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: cpcap-battery: Add charge_now propertyArthur Demchenkov2021-01-141-0/+11
| | | | | | | | | | | | | Add charge_now property for capacity reporting. Cc: Arthur Demchenkov <spinal.by@gmail.com> Cc: Carl Philipp Klemm <philipp@uvos.xyz> Cc: Merlijn Wajer <merlijn@wizzup.org> Cc: Pavel Machek <pavel@ucw.cz> Signed-off-by: Arthur Demchenkov <spinal.by@gmail.com> [tony@atomide.com: updated to apply for naming changes] Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: cpcap-battery: Implement capacity reportingArthur Demchenkov2021-01-141-1/+12
| | | | | | | | | | | | | Calculate percentage using charge_full value provided. Cc: Arthur Demchenkov <spinal.by@gmail.com> Cc: Carl Philipp Klemm <philipp@uvos.xyz> Cc: Merlijn Wajer <merlijn@wizzup.org> Cc: Pavel Machek <pavel@ucw.cz> Signed-off-by: Arthur Demchenkov <spinal.by@gmail.com> [tony@atomide.com: updated to apply after dropping my earlier patch] Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: cpcap-battery: Keep track of state for capacity reportingArthur Demchenkov2021-01-141-1/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | Save the battery empty and full states so we can use those to estimate the battery capacity in the following patches. If the user provides us with charge_full value (which it could save in a permanent storage between reboots), initialize low and high counter_uah with calculated values. If we hit battery low once, we should stick on reporting it until the charger is connected. This way low->counter_uah will be updated properly, and that will allow us to get more accurate charge_full value. Based on an earlier patch by Tony Lindgren with charge_full usage and other improvments done by Arthur Demchenkov. Cc: Arthur Demchenkov <spinal.by@gmail.com> Cc: Carl Philipp Klemm <philipp@uvos.xyz> Cc: Merlijn Wajer <merlijn@wizzup.org> Cc: Pavel Machek <pavel@ucw.cz> Co-developed-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Arthur Demchenkov <spinal.by@gmail.com> [tony@atomide.com: combined earlier patches, updated comments] Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: cpcap-battery: Add charge_full propertyArthur Demchenkov2021-01-141-0/+17
| | | | | | | | | | | | | | Add charge_full property and let user update it. This is needed for capacity reporting in the following patches. Cc: Arthur Demchenkov <spinal.by@gmail.com> Cc: Carl Philipp Klemm <philipp@uvos.xyz> Cc: Merlijn Wajer <merlijn@wizzup.org> Cc: Pavel Machek <pavel@ucw.cz> Signed-off-by: Arthur Demchenkov <spinal.by@gmail.com> [tony@atomide.com: updated comments] Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: cpcap-battery: Use charger status for battery full detectionTony Lindgren2021-01-141-4/+52
| | | | | | | | | | | | | | | | | | We now get battery full notification from cpcap-charger, so let's use that for battery full status and charger disconnect. Note that any current based battery full detection we have tried earlier is flakey as it won't account for example for CPU load increasing the battery current. Anyways, if current based battery full detection is also still needed, we can reconsider adding it in addition to the charger status based detection. Cc: Arthur Demchenkov <spinal.by@gmail.com> Cc: Carl Philipp Klemm <philipp@uvos.xyz> Cc: Merlijn Wajer <merlijn@wizzup.org> Cc: Pavel Machek <pavel@ucw.cz> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: cpcap-charger: Provide state updates for battery from chargerTony Lindgren2021-01-142-7/+40
| | | | | | | | | | | | | | | | | | | | We want to have the battery update it's status when the charge is done, and when the charger is disconnected. Otherwise the battery does not know when it's full unless there's a userspace app polling the battery status. To do this, we add supplied_to handling to cpcap-battery, and implement power_supply_changed() for cpcap-charger. When cpcap-charger calls power_supply_changed(), cpcap-battery will update it's status. Let's also use new_state variable for the POWER_SUPPLY_STATUS_CHARGING case to have unified handling for the switch. Cc: Arthur Demchenkov <spinal.by@gmail.com> Cc: Carl Philipp Klemm <philipp@uvos.xyz> Cc: Merlijn Wajer <merlijn@wizzup.org> Cc: Pavel Machek <pavel@ucw.cz> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: cpcap-charger: Simplify things with enable and disableTony Lindgren2021-01-141-42/+39
| | | | | | | | | | | | | | Let's turn cpcap_charger_set_state() into separate cpcap_charger_enable() and cpcap_charger_disable() to simplify things, and to allow managing status separately. This can be then used for the follow-up patches to make battery full status behave a bit nicer. Cc: Arthur Demchenkov <spinal.by@gmail.com> Cc: Carl Philipp Klemm <philipp@uvos.xyz> Cc: Merlijn Wajer <merlijn@wizzup.org> Cc: Pavel Machek <pavel@ucw.cz> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: cpcap-charger: Drop internal state and use generic statsTony Lindgren2021-01-141-39/+42
| | | | | | | | | | | | We currently have both state and status, get rid of state and use generic status instead. Cc: Arthur Demchenkov <spinal.by@gmail.com> Cc: Carl Philipp Klemm <philipp@uvos.xyz> Cc: Merlijn Wajer <merlijn@wizzup.org> Cc: Pavel Machek <pavel@ucw.cz> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: cpcap-charger: Limiting charge current on Droid 4Pavel Machek2021-01-141-6/+43
| | | | | | | | | | | | | | Droid 4 has same problem as N900: it is often necessary to manually tweak current draw from USB, for example when using thin charging cable. Cc: Arthur Demchenkov <spinal.by@gmail.com> Cc: Carl Philipp Klemm <philipp@uvos.xyz> Cc: Merlijn Wajer <merlijn@wizzup.org> Cc: Pavel Machek <pavel@ucw.cz> Signed-off-by: Pavel Machek <pavel@ucw.cz> [tony@atomide.com: rebased, cleaned up whitespace issues, updated comments] Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: cpcap-charger: Use standard enumerationTony Lindgren2021-01-141-20/+19
| | | | | | | | | | | Just get rid of the custom enumeration if favor of the standard one. Cc: Arthur Demchenkov <spinal.by@gmail.com> Cc: Carl Philipp Klemm <philipp@uvos.xyz> Cc: Merlijn Wajer <merlijn@wizzup.org> Cc: Pavel Machek <pavel@ucw.cz> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: cpcap-charger: Make VBUS already provided debug onlyTony Lindgren2021-01-141-1/+1
| | | | | | | | | | | This should be only shown when debug is enabled. Cc: Arthur Demchenkov <spinal.by@gmail.com> Cc: Carl Philipp Klemm <philipp@uvos.xyz> Cc: Merlijn Wajer <merlijn@wizzup.org> Cc: Pavel Machek <pavel@ucw.cz> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: cpcap-charger: Fix flakey reboot with charger connectedTony Lindgren2021-01-141-1/+7
| | | | | | | | | | | | | | If we have a USB charger connected, reboot is flakey and often fails to reboot the device with the charger LED staying on. Let's fix this by implementing .shutdown. Cc: Arthur Demchenkov <spinal.by@gmail.com> Cc: Carl Philipp Klemm <philipp@uvos.xyz> Cc: Merlijn Wajer <merlijn@wizzup.org> Cc: Pavel Machek <pavel@ucw.cz> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: cpcap-battery: Fix missing power_supply_put()Tony Lindgren2021-01-141-3/+7
| | | | | | | | | | | | Fix missing power_supply_put(). Cc: Arthur Demchenkov <spinal.by@gmail.com> Cc: Carl Philipp Klemm <philipp@uvos.xyz> Cc: Merlijn Wajer <merlijn@wizzup.org> Cc: Pavel Machek <pavel@ucw.cz> Fixes: 8b0134cc14b9 ("power: supply: cpcap-battery: Fix handling of lowered charger voltage") Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: cpcap-charger: Fix missing power_supply_put()Tony Lindgren2021-01-141-0/+1
| | | | | | | | | | | | Fix missing power_supply_put(). Cc: Arthur Demchenkov <spinal.by@gmail.com> Cc: Carl Philipp Klemm <philipp@uvos.xyz> Cc: Merlijn Wajer <merlijn@wizzup.org> Cc: Pavel Machek <pavel@ucw.cz> Fixes: 5688ea049233 ("power: supply: cpcap-charger: Allow changing constant charge voltage") Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: Add battery gauge driver for Acer Iconia Tab A500Dmitry Osipenko2021-01-143-0/+304
| | | | | | | | | This patch adds battery gauge driver for Acer Iconia Tab A500 device. The battery gauge function is provided via the Embedded Controller, which is found on the Acer A500. Signed-off-by: Dmitry Osipenko <digetx@gmail.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* power: supply: bq256xx: Fix BQ256XX_NUM_WD_VAL and bq256xx_watchdog_time[] ↵Ricardo Rivera-Matos2021-01-141-1/+5
| | | | | | | | | | | | overrun Corrects BQ256XX_NUM_WD_VAL from value of "8" to "4" and fixes the issue when 'i' is equal to array size then array index over runs the array Fixes: 32e4978bb920 ("power: supply: bq256xx: Introduce the BQ256XX charger driver") Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Ricardo Rivera-Matos <r-rivera-matos@ti.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* Merge tag 'ib-psy-pxa-for-5.12-signed' into psy-nextSebastian Reichel2021-01-132-51/+40
|\ | | | | | | | | | | | | | | | | | | Immutable branch between mach-pxa and power-supply for for 5.12 This immutable branch replaces legacy gpio API in wm97xx_battery and z2_battery with new gpiod API, which involves the drivers in power-supply and some mach-pxa board files. Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
| * power: supply: wm97xx_battery: Convert to GPIO descriptorLinus Walleij2021-01-131-26/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This converts the WM97xx driver to use a GPIO descriptor instead of passing a GPIO number thru platform data. Like everything else in the driver, use a simple local variable for the descriptor, it can only ever appear in one instance anyway so it should not hurt. After converting the driver I noticed that none of the boardfiles actually define a meaningful GPIO line for this, but hey, it is converted. Cc: Haojian Zhuang <haojian.zhuang@gmail.com> Cc: Robert Jarzmik <robert.jarzmik@free.fr> Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Daniel Mack <daniel@zonque.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
| * power: supply: z2_battery: Convert to GPIO descriptorsLinus Walleij2021-01-131-25/+21
| | | | | | | | | | | | | | | | | | | | | | This converts the Palm Z2 battery driver to use GPIO descriptors. Cc: Haojian Zhuang <haojian.zhuang@gmail.com> Cc: Robert Jarzmik <robert.jarzmik@free.fr> Cc: linux-arm-kernel@lists.infradead.org Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Daniel Mack <daniel@zonque.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* | power: reset: Add poweroff driver for ATC260x PMICsCristian Ciocaltea2021-01-133-1/+270
| | | | | | | | | | | | | | | | | | This driver provides poweroff and reboot support for a system through the ATC2603C and ATC2609A chip variants of the Actions Semi ATC260x family of PMICs. Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@gmail.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* | power: supply: core: Constify static struct attribute_groupRikard Falkeborn2021-01-131-1/+1
| | | | | | | | | | | | | | | | | | The only usage of it is to put its address in an array of pointers to const static structs. Make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* | power: supply: ltc4162-l: Constify static struct attribute_groupRikard Falkeborn2021-01-131-1/+1
| | | | | | | | | | | | | | | | | | The only usage of it is to put its address in an array of pointers to const static structs. Make it const to allow the compiler to put it in read-only memory. Signed-off-by: Rikard Falkeborn <rikard.falkeborn@gmail.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* | power/supply: Add ltc4162-l-chargerMike Looijmans2021-01-133-0/+940
| | | | | | | | | | | | | | | | | | Add support for the LTC4162-L Li-Ion battery charger. The driver allows reading back telemetry and to set some charging options like the input current limit. Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* | power: supply: max8903: Convert to GPIO descriptorsLinus Walleij2021-01-121-220/+168
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The MAX8903 uses up to 5 different GPIO lines to control and monitor charging. When converting to use GPIO descriptors instead of the old GPIO numbers the following side-refactorings were done: - Decomission the platform data container struct as all GPIO descriptors are now "live" members of the driver state container. The "dc_valid" and "usb_valid" just indicate the presence of a DC or USB charger detection line, and this can be handled by just checking if the optional GPIO descriptor for each is != NULL. - The gpiolib will now respect the GPIO_ACTIVE_LOW flag for each of the lines, meaning gpiod_get_value() for example will return 1 (asserted) if a line is flagged as active low and is also physically low. The same applies to output lines, vice versa mutatis mutandis. The code has been augmented to account for this in all sites. - The terse parenthesis such as this: gpio_set_value(pdata->cen, ta_in ? 0 : (data->usb_in ? 0 : 1)); have been expanded to more readable if / else if / else statements that are easier for humans to read. - Comments were inserted to underscore polarity in each case where it could be confusing to users of the old code. One thing is notable: the device tree bindings does not show an example of polarity assigned for the line "dcm-gpios" DC current monitor, is assumed to be flagged GPIO_ACTIVE_HIGH and driving it high (asserted) will achieve DC charger current limits and driving it low will achieve USB charger current limits. Device trees with this (optional) GPIO line defined should definately be flagged as GPIO_ACTIVE_HIGH. Cc: Chris Lapa <chris@lapa.com.au> Cc: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* | power: supply: max8903: Absorb pdata headerLinus Walleij2021-01-121-1/+31
| | | | | | | | | | | | | | | | | | | | | | The platform data header is not included by any other file in the kernel but the driver itself. Decomission the stand-alone header and absorb it into the driver itself. Cc: Chris Lapa <chris@lapa.com.au> Cc: MyungJoo Ham <myungjoo.ham@samsung.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* | power: supply: max14656: Drop unused includesLinus Walleij2021-01-121-2/+0
| | | | | | | | | | | | | | | | | | The driver includes two GPIO headers but does not use symbols from any of them, so drop these includes. Cc: Alexander Kurz <akurz@blala.de> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* | power: supply: remove duplicated argument in power_supply_hwmon_infoMenglong Dong2021-01-121-2/+0
| | | | | | | | | | | | | | | | 'HWMON_T_INPUT' and 'HWMON_T_MIN_ALARM' in power_supply_hwmon_info are duplicated and can be removed. Signed-off-by: Menglong Dong <dong.menglong@zte.com.cn> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* | power: supply: axp288_fuel_gauge: Add Mele PCG03 to the deny-listHans de Goede2021-01-121-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | The Mele PCG03 is another mini PC using the AXP288 PMIC where the EFI code does not disable the charger part of the PMIC causing us to report a discharging battery with a random battery charge to userspace. Add it to the deny-list to avoid the bogus battery status reporting. Cc: Rasmus Porsager <rasmus@beat.dk> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* | power: supply: bq256xx: Introduce the BQ256XX charger driverRicardo Rivera-Matos2021-01-063-0/+1757
| | | | | | | | | | | | | | | | The BQ256XX family of devices are highly integrated buck chargers for single cell batteries. Signed-off-by: Ricardo Rivera-Matos <r-rivera-matos@ti.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* | power: supply: max8997_charger: fix spelling mistake "diconnected" -> ↵Colin Ian King2021-01-061-1/+1
| | | | | | | | | | | | | | | | | | "disconnected" There is a spelling mistake in a dev_dbg message. Fix it. Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* | power: supply: max8997_charger: Set CHARGER current limitTimon Baetz2021-01-052-0/+97
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Register for extcon notification and set charging current depending on the detected cable type. Current values are taken from vendor kernel, where most charger types end up setting 650mA [0]. Also enable and disable the CHARGER regulator based on extcon events. [0] https://github.com/krzk/linux-vendor-backup/blob/samsung/galaxy-s2-epic-4g-touch-sph-d710-exynos4210-dump/drivers/misc/max8997-muic.c#L1675-L1678 Signed-off-by: Timon Baetz <timon.baetz@protonmail.com> Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* | power: supply: cpcap: Add missing IRQF_ONESHOT to fix regressionTony Lindgren2021-01-022-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 25d76fed7ffe ("phy: cpcap-usb: Use IRQF_ONESHOT") started causing errors loading phy-cpcap-usb driver: cpcap_battery cpcap_battery.0: failed to register power supply genirq: Flags mismatch irq 211. 00002080 (se0conn) vs. 00000080 (se0conn) cpcap-usb-phy cpcap-usb-phy.0: could not get irq se0conn: -16 Let's fix this by adding the missing IRQF_ONESHOT to also cpcap-battery and cpcap-charger drivers. Fixes: 25d76fed7ffe ("phy: cpcap-usb: Use IRQF_ONESHOT") Reported-by: Merlijn Wajer <merlijn@wizzup.org> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
* | power: supply: ingenic: remove unneeded semicolonTom Rix2020-12-301-1/+1
| | | | | | | | | | | | | | | | A semicolon is not needed after a switch statement. Signed-off-by: Tom Rix <trix@redhat.com> Acked-by: Paul Cercueil <paul@crapouillou.net> Signed-off-by: Sebastian Reichel <sre@kernel.org>
* | power: supply: cpcap-battery: improve handling of 3rd party batteries.Carl Philipp Klemm2020-12-301-2/+9
| | | | | | | | | | | | | | | | | | Adds a module option to ignore a missing temperature sensor. Useful for 3rd party batteries. Signed-off-by: Carl Philipp Klemm <carl@uvos.xyz> Acked-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
* | power: reset: linkstation-poweroff: add missing put_device()Daniel González Cabanelas2020-12-291-0/+1
|/ | | | | | | | The of_mdio_find_bus() takes a reference to the underlying device structure, we should release that reference using a put_device() call. Signed-off-by: Daniel González Cabanelas <dgcbueu@gmail.com> Signed-off-by: Sebastian Reichel <sre@kernel.org>
* Merge tag 'ntb-5.11' of git://github.com/jonmason/ntbLinus Torvalds2020-12-274-3/+44
|\ | | | | | | | | | | | | | | | | Pull NTB fixes from Jon Mason: "Bug fix for IDT NTB and Intel NTB LTR management support" * tag 'ntb-5.11' of git://github.com/jonmason/ntb: ntb: intel: add Intel NTB LTR vendor support for gen4 NTB ntb: idt: fix error check in ntb_hw_idt.c
| * ntb: intel: add Intel NTB LTR vendor support for gen4 NTBDave Jiang2020-12-073-1/+42
| | | | | | | | | | | | | | | | | | Intel NTB device has custom LTR management that is not compliant with the PCIe standard. Add support to set LTR status triggered by link status change. Signed-off-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Jon Mason <jdmason@kudzu.us>
| * ntb: idt: fix error check in ntb_hw_idt.cWang Qing2020-12-071-2/+2
| | | | | | | | | | | | | | | | idt_create_dev never return NULL and fix smatch warning. Signed-off-by: Wang Qing <wangqing@vivo.com> Acked-by: Serge Semin <fancer.lancer@gmail.com> Signed-off-by: Jon Mason <jdmason@kudzu.us>
* | Merge branch 'linus' of ↵Linus Torvalds2020-12-272-2/+4
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 Pull crypto fixes from Herbert Xu: "Fix a number of autobuild failures due to missing Kconfig dependencies" * 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: qat - add CRYPTO_AES to Kconfig dependencies crypto: keembay - Add dependency on HAS_IOMEM crypto: keembay - CRYPTO_DEV_KEEMBAY_OCS_AES_SM4 should depend on ARCH_KEEMBAY
| * | crypto: qat - add CRYPTO_AES to Kconfig dependenciesMarco Chiappero2020-12-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch includes a missing dependency (CRYPTO_AES) which may lead to an "undefined reference to `aes_expandkey'" linking error. Fixes: 5106dfeaeabe ("crypto: qat - add AES-XTS support for QAT GEN4 devices") Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Marco Chiappero <marco.chiappero@intel.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
| * | crypto: keembay - Add dependency on HAS_IOMEMDaniele Alessandrelli2020-12-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add dependency for CRYPTO_DEV_KEEMBAY_OCS_AES_SM4 on HAS_IOMEM to prevent build failures. Fixes: 88574332451380f4 ("crypto: keembay - Add support for Keem Bay OCS AES/SM4") Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Daniele Alessandrelli <daniele.alessandrelli@intel.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
| * | crypto: keembay - CRYPTO_DEV_KEEMBAY_OCS_AES_SM4 should depend on ARCH_KEEMBAYGeert Uytterhoeven2020-12-231-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Intel Keem Bay Offload and Crypto Subsystem (OCS) is only present on Intel Keem Bay SoCs. Hence add a dependency on ARCH_KEEMBAY, to prevent asking the user about this driver when configuring a kernel without Intel Keem Bay platform support. While at it, fix a misspelling of "cipher". Fixes: 88574332451380f4 ("crypto: keembay - Add support for Keem Bay OCS AES/SM4") Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Acked-by: Daniele Alessandrelli <daniele.alessandrelli@intel.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
* | | mfd: ab8500-debugfs: Remove extraneous seq_putcLinus Torvalds2020-12-261-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit c9a3c4e637ac ("mfd: ab8500-debugfs: Remove extraneous curly brace") removed a left-over curly brace that caused build failures, but Joe Perches points out that the subsequent 'seq_putc()' should also be removed, because the commit that caused all these problems already added the final '\n' to the seq_printf() above it. Reported-by: Joe Perches <joe@perches.com> Fixes: 886c8121659d ("mfd: ab8500-debugfs: Remove the racy fiddling with irq_desc") Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Nathan Chancellor <natechancellor@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>