summaryrefslogtreecommitdiff
path: root/drivers/power/supply/sbs-battery.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/power/supply/sbs-battery.c')
-rw-r--r--drivers/power/supply/sbs-battery.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/drivers/power/supply/sbs-battery.c b/drivers/power/supply/sbs-battery.c
index c4a95b01463a..943c82ee978f 100644
--- a/drivers/power/supply/sbs-battery.c
+++ b/drivers/power/supply/sbs-battery.c
@@ -16,11 +16,12 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/property.h>
-#include <linux/of_device.h>
+#include <linux/of.h>
#include <linux/power/sbs-battery.h>
#include <linux/power_supply.h>
#include <linux/slab.h>
#include <linux/stat.h>
+#include <linux/string_choices.h>
enum {
REG_MANUFACTURER_DATA,
@@ -320,8 +321,8 @@ static int sbs_update_presence(struct sbs_info *chip, bool is_present)
client->flags &= ~I2C_CLIENT_PEC;
}
- dev_dbg(&client->dev, "PEC: %s\n", (client->flags & I2C_CLIENT_PEC) ?
- "enabled" : "disabled");
+ dev_dbg(&client->dev, "PEC: %s\n",
+ str_enabled_disabled(client->flags & I2C_CLIENT_PEC));
if (!chip->is_present && is_present && !chip->charger_broadcasts)
sbs_disable_charger_broadcasts(chip);
@@ -1135,9 +1136,9 @@ static int sbs_probe(struct i2c_client *client)
if (!chip)
return -ENOMEM;
- chip->flags = (u32)(uintptr_t)device_get_match_data(&client->dev);
+ chip->flags = (uintptr_t)i2c_get_match_data(client);
chip->client = client;
- psy_cfg.of_node = client->dev.of_node;
+ psy_cfg.fwnode = dev_fwnode(&client->dev);
psy_cfg.drv_data = chip;
chip->last_state = POWER_SUPPLY_STATUS_UNKNOWN;
sbs_invalidate_cached_props(chip);
@@ -1253,9 +1254,9 @@ static SIMPLE_DEV_PM_OPS(sbs_pm_ops, sbs_suspend, NULL);
#endif
static const struct i2c_device_id sbs_id[] = {
- { "bq20z65", 0 },
- { "bq20z75", 0 },
- { "sbs-battery", 1 },
+ { "bq20z65", SBS_FLAGS_TI_BQ20ZX5 },
+ { "bq20z75", SBS_FLAGS_TI_BQ20ZX5 },
+ { "sbs-battery", 0 },
{}
};
MODULE_DEVICE_TABLE(i2c, sbs_id);
@@ -1275,7 +1276,7 @@ static const struct of_device_id sbs_dt_ids[] = {
MODULE_DEVICE_TABLE(of, sbs_dt_ids);
static struct i2c_driver sbs_battery_driver = {
- .probe_new = sbs_probe,
+ .probe = sbs_probe,
.alert = sbs_alert,
.id_table = sbs_id,
.driver = {