Skip to content

Commit 09bacc0

Browse files
author
Andreas Kemnade
committed
Merge branch 'kobo/power-6.13' into kobo/drm-merged-6.13
2 parents 69963b2 + 7b8c64f commit 09bacc0

File tree

12 files changed

+4780
-39
lines changed

12 files changed

+4780
-39
lines changed

Documentation/devicetree/bindings/power/supply/battery.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,25 @@ properties:
119119
- description: alert when battery temperature is lower than this value
120120
- description: alert when battery temperature is higher than this value
121121

122+
temp-degrade-table:
123+
$ref: /schemas/types.yaml#/definitions/uint32-matrix
124+
description: |
125+
An array of value triplets. First value is "capacity change per degree C"
126+
when temperature differs from 'set point'. Second value is "capacity
127+
degradation at given 'set point' temperature" and third value is "the
128+
'set-point' temperature" where given degradation is correct.
129+
Up to 100 value triplets can be provided to specify different degradation
130+
for different temperature ranges. When capacity change caused by
131+
temperatures is computed the range which 'set point' is closest to the
132+
current temperature is used. Capacity change should be in units of
133+
micro Ah. Temperature is in units of 0.1 C degree.
134+
maxItems: 100
135+
items:
136+
items:
137+
- description: capacity drop per degree C in micro Ah
138+
- description: capacity drop at 'set point' temperature in micro Ah
139+
- description: 'set point' temperature for this range in 0.1 degree C
140+
122141
required:
123142
- compatible
124143

drivers/mfd/rohm-bd71828.c

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ static const struct resource bd71828_rtc_irqs[] = {
4545

4646
static struct resource bd71815_power_irqs[] = {
4747
DEFINE_RES_IRQ_NAMED(BD71815_INT_DCIN_RMV, "bd71815-dcin-rmv"),
48-
DEFINE_RES_IRQ_NAMED(BD71815_INT_CLPS_OUT, "bd71815-clps-out"),
49-
DEFINE_RES_IRQ_NAMED(BD71815_INT_CLPS_IN, "bd71815-clps-in"),
48+
DEFINE_RES_IRQ_NAMED(BD71815_INT_CLPS_OUT, "bd71815-dcin-clps-out"),
49+
DEFINE_RES_IRQ_NAMED(BD71815_INT_CLPS_IN, "bd71815-dcin-clps-in"),
5050
DEFINE_RES_IRQ_NAMED(BD71815_INT_DCIN_OVP_RES, "bd71815-dcin-ovp-res"),
5151
DEFINE_RES_IRQ_NAMED(BD71815_INT_DCIN_OVP_DET, "bd71815-dcin-ovp-det"),
5252
DEFINE_RES_IRQ_NAMED(BD71815_INT_DCIN_MON_RES, "bd71815-dcin-mon-res"),
@@ -56,7 +56,7 @@ static struct resource bd71815_power_irqs[] = {
5656
DEFINE_RES_IRQ_NAMED(BD71815_INT_VSYS_LOW_RES, "bd71815-vsys-low-res"),
5757
DEFINE_RES_IRQ_NAMED(BD71815_INT_VSYS_LOW_DET, "bd71815-vsys-low-det"),
5858
DEFINE_RES_IRQ_NAMED(BD71815_INT_VSYS_MON_RES, "bd71815-vsys-mon-res"),
59-
DEFINE_RES_IRQ_NAMED(BD71815_INT_VSYS_MON_RES, "bd71815-vsys-mon-det"),
59+
DEFINE_RES_IRQ_NAMED(BD71815_INT_VSYS_MON_DET, "bd71815-vsys-mon-det"),
6060
DEFINE_RES_IRQ_NAMED(BD71815_INT_CHG_WDG_TEMP, "bd71815-chg-wdg-temp"),
6161
DEFINE_RES_IRQ_NAMED(BD71815_INT_CHG_WDG_TIME, "bd71815-chg-wdg"),
6262
DEFINE_RES_IRQ_NAMED(BD71815_INT_CHG_RECHARGE_RES, "bd71815-rechg-res"),
@@ -87,10 +87,10 @@ static struct resource bd71815_power_irqs[] = {
8787
DEFINE_RES_IRQ_NAMED(BD71815_INT_BAT_OVER_CURR_2_DET, "bd71815-bat-oc2-det"),
8888
DEFINE_RES_IRQ_NAMED(BD71815_INT_BAT_OVER_CURR_3_RES, "bd71815-bat-oc3-res"),
8989
DEFINE_RES_IRQ_NAMED(BD71815_INT_BAT_OVER_CURR_3_DET, "bd71815-bat-oc3-det"),
90-
DEFINE_RES_IRQ_NAMED(BD71815_INT_TEMP_BAT_LOW_RES, "bd71815-bat-low-res"),
91-
DEFINE_RES_IRQ_NAMED(BD71815_INT_TEMP_BAT_LOW_DET, "bd71815-bat-low-det"),
92-
DEFINE_RES_IRQ_NAMED(BD71815_INT_TEMP_BAT_HI_RES, "bd71815-bat-hi-res"),
93-
DEFINE_RES_IRQ_NAMED(BD71815_INT_TEMP_BAT_HI_DET, "bd71815-bat-hi-det"),
90+
DEFINE_RES_IRQ_NAMED(BD71815_INT_TEMP_BAT_LOW_RES, "bd71815-temp-bat-low-res"),
91+
DEFINE_RES_IRQ_NAMED(BD71815_INT_TEMP_BAT_LOW_DET, "bd71815-temp-bat-low-det"),
92+
DEFINE_RES_IRQ_NAMED(BD71815_INT_TEMP_BAT_HI_RES, "bd71815-temp-bat-hi-res"),
93+
DEFINE_RES_IRQ_NAMED(BD71815_INT_TEMP_BAT_HI_DET, "bd71815-temp-bat-hi-det"),
9494
};
9595

9696
static struct mfd_cell bd71815_mfd_cells[] = {
@@ -109,6 +109,29 @@ static struct mfd_cell bd71815_mfd_cells[] = {
109109
},
110110
};
111111

112+
static const struct resource bd71828_power_irqs[] = {
113+
DEFINE_RES_IRQ_NAMED(BD71828_INT_CHG_TOPOFF_TO_DONE,
114+
"bd71828-chg-done"),
115+
DEFINE_RES_IRQ_NAMED(BD71828_INT_DCIN_DET, "bd71828-pwr-dcin-in"),
116+
DEFINE_RES_IRQ_NAMED(BD71828_INT_DCIN_RMV, "bd71828-pwr-dcin-out"),
117+
DEFINE_RES_IRQ_NAMED(BD71828_INT_BAT_LOW_VOLT_RES,
118+
"bd71828-vbat-normal"),
119+
DEFINE_RES_IRQ_NAMED(BD71828_INT_BAT_LOW_VOLT_DET, "bd71828-vbat-low"),
120+
DEFINE_RES_IRQ_NAMED(BD71828_INT_TEMP_BAT_HI_DET, "bd71828-btemp-hi"),
121+
DEFINE_RES_IRQ_NAMED(BD71828_INT_TEMP_BAT_HI_RES, "bd71828-btemp-cool"),
122+
DEFINE_RES_IRQ_NAMED(BD71828_INT_TEMP_BAT_LOW_DET, "bd71828-btemp-lo"),
123+
DEFINE_RES_IRQ_NAMED(BD71828_INT_TEMP_BAT_LOW_RES,
124+
"bd71828-btemp-warm"),
125+
DEFINE_RES_IRQ_NAMED(BD71828_INT_TEMP_CHIP_OVER_VF_DET,
126+
"bd71828-temp-hi"),
127+
DEFINE_RES_IRQ_NAMED(BD71828_INT_TEMP_CHIP_OVER_VF_RES,
128+
"bd71828-temp-norm"),
129+
DEFINE_RES_IRQ_NAMED(BD71828_INT_TEMP_CHIP_OVER_125_DET,
130+
"bd71828-temp-125-over"),
131+
DEFINE_RES_IRQ_NAMED(BD71828_INT_TEMP_CHIP_OVER_125_RES,
132+
"bd71828-temp-125-under"),
133+
};
134+
112135
static struct mfd_cell bd71828_mfd_cells[] = {
113136
{ .name = "bd71828-pmic", },
114137
{ .name = "bd71828-gpio", },
@@ -118,8 +141,11 @@ static struct mfd_cell bd71828_mfd_cells[] = {
118141
* BD70528 clock gate are the register address and mask.
119142
*/
120143
{ .name = "bd71828-clk", },
121-
{ .name = "bd71827-power", },
122144
{
145+
.name = "bd71828-power",
146+
.resources = bd71828_power_irqs,
147+
.num_resources = ARRAY_SIZE(bd71828_power_irqs),
148+
}, {
123149
.name = "bd71828-rtc",
124150
.resources = bd71828_rtc_irqs,
125151
.num_resources = ARRAY_SIZE(bd71828_rtc_irqs),

drivers/power/supply/Kconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ menuconfig POWER_SUPPLY
99

1010
if POWER_SUPPLY
1111

12+
config POWER_SIMPLE_GAUGE
13+
tristate
14+
1215
config POWER_SUPPLY_DEBUG
1316
bool "Power supply debug"
1417
help
@@ -928,6 +931,17 @@ config CHARGER_UCS1002
928931
Say Y to enable support for Microchip UCS1002 Programmable
929932
USB Port Power Controller with Charger Emulation.
930933

934+
config CHARGER_BD71828
935+
tristate "Power-supply driver for ROHM BD71828 and BD71815 PMIC"
936+
depends on MFD_ROHM_BD71828
937+
select POWER_SIMPLE_GAUGE
938+
help
939+
Say Y here to enable support for charger, battery and fuel gauge
940+
in ROHM BD71815, BD71817, BD71827, ROHM BD71828 power management
941+
ICs. This driver gets various bits of information about battery
942+
and charger states and also implements fuel gauge based on
943+
coulomb counters on PMIC.
944+
931945
config CHARGER_BD99954
932946
tristate "ROHM bd99954 charger driver"
933947
depends on I2C

drivers/power/supply/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ power_supply-y := power_supply_core.o
55
power_supply-$(CONFIG_SYSFS) += power_supply_sysfs.o
66
power_supply-$(CONFIG_LEDS_TRIGGERS) += power_supply_leds.o
77

8+
obj-$(CONFIG_POWER_SIMPLE_GAUGE) += simple-gauge.o
89
obj-$(CONFIG_POWER_SUPPLY) += power_supply.o
910
obj-$(CONFIG_POWER_SUPPLY_HWMON) += power_supply_hwmon.o
1011
obj-$(CONFIG_GENERIC_ADC_BATTERY) += generic-adc-battery.o
@@ -109,6 +110,7 @@ obj-$(CONFIG_CHARGER_CROS_PCHG) += cros_peripheral_charger.o
109110
obj-$(CONFIG_CHARGER_SC2731) += sc2731_charger.o
110111
obj-$(CONFIG_FUEL_GAUGE_SC27XX) += sc27xx_fuel_gauge.o
111112
obj-$(CONFIG_CHARGER_UCS1002) += ucs1002_power.o
113+
obj-$(CONFIG_CHARGER_BD71828) += bd71827-power.o
112114
obj-$(CONFIG_CHARGER_BD99954) += bd99954-charger.o
113115
obj-$(CONFIG_CHARGER_WILCO) += wilco-charger.o
114116
obj-$(CONFIG_RN5T618_POWER) += rn5t618_power.o

0 commit comments

Comments
 (0)