Skip to content

Commit 448ecd5

Browse files
committed
Merge tag 'for-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply
Pull power supply and reset updates from Sebastian Reichel: "Power-supply core: - replace power_supply_register_no_ws() with power_supply_register() and a new "no_wakeup_source" field in struct power_supply_config - constify battery info tables in the core and all drivers - switch back to remove callback for all platform drivers - allow power_supply_put() to be called from atomic context - mark attribute arrays read-only after init Power-supply drivers: - new driver for TWL6030 and TWL6032 - rk817: improve battery capacity calibration - misc small cleanups and fixes" * tag 'for-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply: (42 commits) power: reset: ep93xx: add AUXILIARY_BUS dependency dt-bindings: power: reset: Convert mode-.* properties to array power: supply: sc27xx: Fix battery detect GPIO probe dt-bindings: power: supply: sc27xx-fg: document deprecated bat-detect-gpio reset: keystone-reset: remove unused macros power: supply: axp20x_battery: Use scaled iio_read_channel power: supply: axp20x_usb_power: Use scaled iio_read_channel power: supply: generic-adc-battery: change my gmail power: supply: pmu_battery: Set power supply type to BATTERY power: Switch back to struct platform_driver::remove() power: supply: hwmon: move interface to private header power: supply: rk817: Update battery capacity calibration power: supply: rk817: stop updating info in suspend power: supply: rt9471: Use IC status regfield to report real charger status power: supply: rt9471: Fix wrong WDT function regfield declaration dt-bindings: power/supply: qcom,pmi8998-charger: Drop incorrect "#interrupt-cells" from example power: supply: core: mark attribute arrays as ro_after_init power: supply: core: unexport power_supply_property_is_writeable() power: supply: core: use device mutex wrappers power: supply: bq27xxx: Fix registers of bq27426 ...
2 parents 1fdae00 + b6d445f commit 448ecd5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

70 files changed

+971
-292
lines changed

Documentation/devicetree/bindings/power/reset/nvmem-reboot-mode.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ properties:
3131
allOf:
3232
- $ref: reboot-mode.yaml#
3333

34+
patternProperties:
35+
"^mode-.*$":
36+
maxItems: 1
37+
3438
required:
3539
- compatible
3640
- nvmem-cells

Documentation/devicetree/bindings/power/reset/qcom,pon.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@ required:
5454
- compatible
5555
- reg
5656

57+
patternProperties:
58+
"^mode-.*$":
59+
maxItems: 1
60+
5761
unevaluatedProperties: false
5862

5963
allOf:
@@ -75,6 +79,9 @@ allOf:
7579
reg-names:
7680
items:
7781
- const: pon
82+
else:
83+
patternProperties:
84+
"^mode-.*$": false
7885

7986
# Special case for pm8941, which doesn't store reset mode
8087
- if:

Documentation/devicetree/bindings/power/reset/reboot-mode.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ description: |
2828
2929
properties:
3030
mode-normal:
31-
$ref: /schemas/types.yaml#/definitions/uint32
31+
$ref: /schemas/types.yaml#/definitions/uint32-array
3232
description:
3333
Default value to set on a reboot if no command was provided.
3434

3535
patternProperties:
3636
"^mode-.*$":
37-
$ref: /schemas/types.yaml#/definitions/uint32
37+
$ref: /schemas/types.yaml#/definitions/uint32-array
3838

3939
additionalProperties: true
4040

Documentation/devicetree/bindings/power/reset/syscon-reboot-mode.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ properties:
3232
allOf:
3333
- $ref: reboot-mode.yaml#
3434

35+
patternProperties:
36+
"^mode-.*$":
37+
maxItems: 1
38+
3539
unevaluatedProperties: false
3640

3741
required:

Documentation/devicetree/bindings/power/reset/syscon-reboot.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,10 @@ properties:
3131
$ref: /schemas/types.yaml#/definitions/uint32
3232
description: Offset in the register map for the reboot register (in bytes).
3333

34+
reg:
35+
maxItems: 1
36+
description: Base address and size for the reboot register.
37+
3438
regmap:
3539
$ref: /schemas/types.yaml#/definitions/phandle
3640
deprecated: true
@@ -45,9 +49,14 @@ properties:
4549
priority:
4650
default: 192
4751

52+
oneOf:
53+
- required:
54+
- offset
55+
- required:
56+
- reg
57+
4858
required:
4959
- compatible
50-
- offset
5160

5261
additionalProperties: false
5362

Documentation/devicetree/bindings/power/supply/qcom,pmi8998-charger.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ examples:
6060
pmic {
6161
#address-cells = <1>;
6262
#size-cells = <0>;
63-
#interrupt-cells = <4>;
6463
6564
charger@1000 {
6665
compatible = "qcom,pmi8998-charger";

Documentation/devicetree/bindings/power/supply/sc27xx-fg.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ properties:
2727
battery-detect-gpios:
2828
maxItems: 1
2929

30+
bat-detect-gpio:
31+
maxItems: 1
32+
deprecated: true
33+
description: use battery-detect-gpios instead
34+
3035
interrupts:
3136
maxItems: 1
3237

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/power/supply/ti,twl6030-charger.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: TWL6030/32 BCI (Battery Charger Interface)
8+
9+
description:
10+
The battery charger needs to be configured to do any charging besides of
11+
precharging. The GPADC in the PMIC has to be used to get the related
12+
voltages.
13+
14+
maintainers:
15+
- Andreas Kemnade <[email protected]>
16+
17+
allOf:
18+
- $ref: power-supply.yaml#
19+
20+
properties:
21+
compatible:
22+
oneOf:
23+
- const: ti,twl6030-charger
24+
- items:
25+
- const: ti,twl6032-charger
26+
- const: ti,twl6030-charger
27+
28+
interrupts:
29+
items:
30+
- description: Charger Control Interrupt
31+
- description: Charger Fault Interrupt
32+
33+
io-channels:
34+
items:
35+
- description: VBUS Voltage Channel
36+
37+
io-channel-names:
38+
items:
39+
- const: vusb
40+
41+
monitored-battery: true
42+
43+
required:
44+
- compatible
45+
- interrupts
46+
- monitored-battery
47+
48+
additionalProperties: false

drivers/acpi/battery.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -853,6 +853,7 @@ static int sysfs_add_battery(struct acpi_battery *battery)
853853
struct power_supply_config psy_cfg = {
854854
.drv_data = battery,
855855
.attr_grp = acpi_battery_groups,
856+
.no_wakeup_source = true,
856857
};
857858
bool full_cap_broken = false;
858859

@@ -888,7 +889,7 @@ static int sysfs_add_battery(struct acpi_battery *battery)
888889
battery->bat_desc.type = POWER_SUPPLY_TYPE_BATTERY;
889890
battery->bat_desc.get_property = acpi_battery_get_property;
890891

891-
battery->bat = power_supply_register_no_ws(&battery->device->dev,
892+
battery->bat = power_supply_register(&battery->device->dev,
892893
&battery->bat_desc, &psy_cfg);
893894

894895
if (IS_ERR(battery->bat)) {

drivers/power/reset/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ config POWER_RESET_EP93XX
7979
bool "Cirrus EP93XX reset driver" if COMPILE_TEST
8080
depends on MFD_SYSCON
8181
default ARCH_EP93XX
82+
select AUXILIARY_BUS
8283
help
8384
This driver provides restart support for Cirrus EP93XX SoC.
8485

drivers/power/reset/at91-poweroff.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ MODULE_DEVICE_TABLE(of, at91_poweroff_of_match);
223223

224224
static struct platform_driver at91_poweroff_driver = {
225225
.probe = at91_poweroff_probe,
226-
.remove_new = at91_poweroff_remove,
226+
.remove = at91_poweroff_remove,
227227
.driver = {
228228
.name = "at91-poweroff",
229229
.of_match_table = at91_poweroff_of_match,

drivers/power/reset/at91-reset.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -427,7 +427,7 @@ static void at91_reset_remove(struct platform_device *pdev)
427427

428428
static struct platform_driver at91_reset_driver = {
429429
.probe = at91_reset_probe,
430-
.remove_new = at91_reset_remove,
430+
.remove = at91_reset_remove,
431431
.driver = {
432432
.name = "at91-reset",
433433
.of_match_table = at91_reset_of_match,

drivers/power/reset/at91-sama5d2_shdwc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ static void at91_shdwc_remove(struct platform_device *pdev)
441441

442442
static struct platform_driver at91_shdwc_driver = {
443443
.probe = at91_shdwc_probe,
444-
.remove_new = at91_shdwc_remove,
444+
.remove = at91_shdwc_remove,
445445
.driver = {
446446
.name = "at91-shdwc",
447447
.of_match_table = at91_shdwc_of_match,

drivers/power/reset/keystone-reset.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include <linux/mfd/syscon.h>
1717
#include <linux/of.h>
1818

19-
#define RSTYPE_RG 0x0
2019
#define RSCTRL_RG 0x4
2120
#define RSCFG_RG 0x8
2221
#define RSISO_RG 0xc
@@ -28,7 +27,6 @@
2827
#define RSMUX_OMODE_MASK 0xe
2928
#define RSMUX_OMODE_RESET_ON 0xa
3029
#define RSMUX_OMODE_RESET_OFF 0x0
31-
#define RSMUX_LOCK_MASK 0x1
3230
#define RSMUX_LOCK_SET 0x1
3331

3432
#define RSCFG_RSTYPE_SOFT 0x300f

drivers/power/reset/ltc2952-poweroff.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ MODULE_DEVICE_TABLE(of, of_ltc2952_poweroff_match);
305305

306306
static struct platform_driver ltc2952_poweroff_driver = {
307307
.probe = ltc2952_poweroff_probe,
308-
.remove_new = ltc2952_poweroff_remove,
308+
.remove = ltc2952_poweroff_remove,
309309
.driver = {
310310
.name = "ltc2952-poweroff",
311311
.of_match_table = of_ltc2952_poweroff_match,

drivers/power/reset/qnap-poweroff.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ static void qnap_power_off_remove(struct platform_device *pdev)
118118

119119
static struct platform_driver qnap_power_off_driver = {
120120
.probe = qnap_power_off_probe,
121-
.remove_new = qnap_power_off_remove,
121+
.remove = qnap_power_off_remove,
122122
.driver = {
123123
.name = "qnap_power_off",
124124
.of_match_table = of_match_ptr(qnap_power_off_of_match_table),

drivers/power/reset/syscon-reboot.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ static int syscon_reboot_probe(struct platform_device *pdev)
6161
priority = 192;
6262

6363
if (of_property_read_u32(pdev->dev.of_node, "offset", &ctx->offset))
64-
return -EINVAL;
64+
if (of_property_read_u32(pdev->dev.of_node, "reg", &ctx->offset))
65+
return -EINVAL;
6566

6667
value_err = of_property_read_u32(pdev->dev.of_node, "value", &ctx->value);
6768
mask_err = of_property_read_u32(pdev->dev.of_node, "mask", &ctx->mask);

drivers/power/supply/88pm860x_battery.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,7 @@ static irqreturn_t pm860x_batt_handler(int irq, void *data)
422422
info->temp_type = PM860X_TEMP_TINT;
423423
}
424424
mutex_unlock(&info->lock);
425-
/* clear ccnt since battery is attached or dettached */
425+
/* clear ccnt since battery is attached or detached */
426426
clear_ccnt(info, &ccnt_data);
427427
return IRQ_HANDLED;
428428
}
@@ -566,7 +566,7 @@ static int measure_temp(struct pm860x_battery_info *info, int *data)
566566
ret = measure_12bit_voltage(info, PM8607_GPADC1_MEAS1, data);
567567
if (ret)
568568
return ret;
569-
/* meausered Vtbat(mV) / Ibias_current(11uA)*/
569+
/* measured Vtbat(mV) / Ibias_current(11uA)*/
570570
*data = (*data * 1000) / GPBIAS2_GPADC1_UA;
571571

572572
if (*data > TBAT_NEG_25D) {

drivers/power/supply/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,16 @@ config CHARGER_TWL4030
493493
help
494494
Say Y here to enable support for TWL4030 Battery Charge Interface.
495495

496+
config CHARGER_TWL6030
497+
tristate "OMAP TWL6030 BCI charger driver"
498+
depends on IIO && TWL4030_CORE
499+
help
500+
Say Y here to enable support for TWL6030/6032 Battery Charge
501+
Interface.
502+
503+
This driver can be build as a module. If so, the module will be
504+
called twl6030_charger.
505+
496506
config CHARGER_LP8727
497507
tristate "TI/National Semiconductor LP8727 charger driver"
498508
depends on I2C

drivers/power/supply/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ obj-$(CONFIG_CHARGER_CPCAP) += cpcap-charger.o
6969
obj-$(CONFIG_CHARGER_ISP1704) += isp1704_charger.o
7070
obj-$(CONFIG_CHARGER_MAX8903) += max8903_charger.o
7171
obj-$(CONFIG_CHARGER_TWL4030) += twl4030_charger.o
72+
obj-$(CONFIG_CHARGER_TWL6030) += twl6030_charger.o
7273
obj-$(CONFIG_CHARGER_LP8727) += lp8727_charger.o
7374
obj-$(CONFIG_CHARGER_LP8788) += lp8788-charger.o
7475
obj-$(CONFIG_CHARGER_GPIO) += gpio-charger.o

drivers/power/supply/ab8500_bmdata.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
/* Default: temperature hysteresis */
1717
#define AB8500_TEMP_HYSTERESIS 3
1818

19-
static struct power_supply_battery_ocv_table ocv_cap_tbl[] = {
19+
static const struct power_supply_battery_ocv_table ocv_cap_tbl[] = {
2020
{ .ocv = 4186000, .capacity = 100},
2121
{ .ocv = 4163000, .capacity = 99},
2222
{ .ocv = 4114000, .capacity = 95},
@@ -48,7 +48,7 @@ static struct power_supply_battery_ocv_table ocv_cap_tbl[] = {
4848
* temperature values to work. Factory resistance is 300 mOhm and the
4949
* resistance values to the right are percentages of 300 mOhm.
5050
*/
51-
static struct power_supply_resistance_temp_table temp_to_batres_tbl_thermistor[] = {
51+
static const struct power_supply_resistance_temp_table temp_to_batres_tbl_thermistor[] = {
5252
{ .temp = 40, .resistance = 40 /* 120 mOhm */ },
5353
{ .temp = 30, .resistance = 45 /* 135 mOhm */ },
5454
{ .temp = 20, .resistance = 55 /* 165 mOhm */ },

drivers/power/supply/ab8500_btemp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ static void ab8500_btemp_periodic_work(struct work_struct *work)
283283
dev_warn(di->dev, "failed to identify the battery\n");
284284
}
285285

286-
/* Failover if a reading is erroneous, use last meausurement */
286+
/* Failover if a reading is erroneous, use last measurement */
287287
ret = thermal_zone_get_temp(di->tz, &bat_temp);
288288
if (ret) {
289289
dev_err(di->dev, "error reading temperature\n");
@@ -818,7 +818,7 @@ MODULE_DEVICE_TABLE(of, ab8500_btemp_match);
818818

819819
struct platform_driver ab8500_btemp_driver = {
820820
.probe = ab8500_btemp_probe,
821-
.remove_new = ab8500_btemp_remove,
821+
.remove = ab8500_btemp_remove,
822822
.driver = {
823823
.name = "ab8500-btemp",
824824
.of_match_table = ab8500_btemp_match,

drivers/power/supply/ab8500_chargalg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1837,7 +1837,7 @@ static const struct of_device_id ab8500_chargalg_match[] = {
18371837

18381838
struct platform_driver ab8500_chargalg_driver = {
18391839
.probe = ab8500_chargalg_probe,
1840-
.remove_new = ab8500_chargalg_remove,
1840+
.remove = ab8500_chargalg_remove,
18411841
.driver = {
18421842
.name = "ab8500_chargalg",
18431843
.of_match_table = ab8500_chargalg_match,

drivers/power/supply/ab8500_charger.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3711,7 +3711,7 @@ MODULE_DEVICE_TABLE(of, ab8500_charger_match);
37113711

37123712
static struct platform_driver ab8500_charger_driver = {
37133713
.probe = ab8500_charger_probe,
3714-
.remove_new = ab8500_charger_remove,
3714+
.remove = ab8500_charger_remove,
37153715
.driver = {
37163716
.name = "ab8500-charger",
37173717
.of_match_table = ab8500_charger_match,

drivers/power/supply/ab8500_fg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3242,7 +3242,7 @@ MODULE_DEVICE_TABLE(of, ab8500_fg_match);
32423242

32433243
struct platform_driver ab8500_fg_driver = {
32443244
.probe = ab8500_fg_probe,
3245-
.remove_new = ab8500_fg_remove,
3245+
.remove = ab8500_fg_remove,
32463246
.driver = {
32473247
.name = "ab8500-fg",
32483248
.of_match_table = ab8500_fg_match,

drivers/power/supply/acer_a500_battery.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,14 +233,15 @@ static int a500_battery_probe(struct platform_device *pdev)
233233

234234
psy_cfg.of_node = pdev->dev.parent->of_node;
235235
psy_cfg.drv_data = bat;
236+
psy_cfg.no_wakeup_source = true;
236237

237238
bat->regmap = dev_get_regmap(pdev->dev.parent, "KB930");
238239
if (!bat->regmap)
239240
return -EINVAL;
240241

241-
bat->psy = devm_power_supply_register_no_ws(&pdev->dev,
242-
&a500_battery_desc,
243-
&psy_cfg);
242+
bat->psy = devm_power_supply_register(&pdev->dev,
243+
&a500_battery_desc,
244+
&psy_cfg);
244245
if (IS_ERR(bat->psy))
245246
return dev_err_probe(&pdev->dev, PTR_ERR(bat->psy),
246247
"failed to register battery\n");
@@ -285,7 +286,7 @@ static struct platform_driver a500_battery_driver = {
285286
.pm = &a500_battery_pm_ops,
286287
},
287288
.probe = a500_battery_probe,
288-
.remove_new = a500_battery_remove,
289+
.remove = a500_battery_remove,
289290
};
290291
module_platform_driver(a500_battery_driver);
291292

drivers/power/supply/act8945a_charger.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ static struct platform_driver act8945a_charger_driver = {
651651
.name = "act8945a-charger",
652652
},
653653
.probe = act8945a_charger_probe,
654-
.remove_new = act8945a_charger_remove,
654+
.remove = act8945a_charger_remove,
655655
};
656656
module_platform_driver(act8945a_charger_driver);
657657

0 commit comments

Comments
 (0)