Skip to content

Commit f3076cd

Browse files
stephan-ghsre
authored andcommitted
power: supply: rt5033_battery: Fix device tree enumeration
The fuel gauge in the RT5033 PMIC has its own I2C bus and interrupt line. Therefore, it is not actually part of the RT5033 MFD and needs its own of_match_table to probe properly. Also, given that it's independent of the MFD, there is actually no need to make the Kconfig depend on MFD_RT5033. Although the driver uses the shared <linux/mfd/rt5033.h> header, there is no compile or runtime dependency on the RT5033 MFD driver. Cc: Beomho Seo <[email protected]> Cc: Chanwoo Choi <[email protected]> Fixes: b847dd9 ("power: rt5033_battery: Add RT5033 Fuel gauge device driver") Signed-off-by: Stephan Gerhold <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]>
1 parent 4a8fd33 commit f3076cd

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

drivers/power/supply/Kconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -712,7 +712,8 @@ config BATTERY_GOLDFISH
712712

713713
config BATTERY_RT5033
714714
tristate "RT5033 fuel gauge support"
715-
depends on MFD_RT5033
715+
depends on I2C
716+
select REGMAP_I2C
716717
help
717718
This adds support for battery fuel gauge in Richtek RT5033 PMIC.
718719
The fuelgauge calculates and determines the battery state of charge

drivers/power/supply/rt5033_battery.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,16 @@ static const struct i2c_device_id rt5033_battery_id[] = {
164164
};
165165
MODULE_DEVICE_TABLE(i2c, rt5033_battery_id);
166166

167+
static const struct of_device_id rt5033_battery_of_match[] = {
168+
{ .compatible = "richtek,rt5033-battery", },
169+
{ }
170+
};
171+
MODULE_DEVICE_TABLE(of, rt5033_battery_of_match);
172+
167173
static struct i2c_driver rt5033_battery_driver = {
168174
.driver = {
169175
.name = "rt5033-battery",
176+
.of_match_table = rt5033_battery_of_match,
170177
},
171178
.probe = rt5033_battery_probe,
172179
.remove = rt5033_battery_remove,

0 commit comments

Comments
 (0)