Lines Matching full:charger

3  * Power supply driver for ChromeOS EC based Peripheral Device Charger.
34 struct charger_data *charger; member
54 static int cros_pchg_ec_command(const struct charger_data *charger, in cros_pchg_ec_command() argument
62 struct cros_ec_dev *ec_dev = charger->ec_dev; in cros_pchg_ec_command()
78 ret = cros_ec_cmd_xfer_status(charger->ec_device, msg); in cros_pchg_ec_command()
88 static bool cros_pchg_cmd_ver_check(const struct charger_data *charger) in cros_pchg_cmd_ver_check() argument
95 ret = cros_pchg_ec_command(charger, 1, EC_CMD_GET_CMD_VERSIONS, in cros_pchg_cmd_ver_check()
98 dev_warn(charger->dev, in cros_pchg_cmd_ver_check()
107 static int cros_pchg_port_count(const struct charger_data *charger) in cros_pchg_port_count() argument
112 ret = cros_pchg_ec_command(charger, 0, EC_CMD_PCHG_COUNT, in cros_pchg_port_count()
115 dev_warn(charger->dev, in cros_pchg_port_count()
125 struct charger_data *charger = port->charger; in cros_pchg_get_status() local
128 struct device *dev = charger->dev; in cros_pchg_get_status()
134 ret = cros_pchg_ec_command(charger, pchg_cmd_version, EC_CMD_PCHG, in cros_pchg_get_status()
230 static int cros_pchg_event(const struct charger_data *charger) in cros_pchg_event() argument
234 for (i = 0; i < charger->num_registered_psy; i++) in cros_pchg_event()
235 cros_pchg_get_port_status(charger->ports[i], false); in cros_pchg_event()
245 struct charger_data *charger = in cros_ec_notify() local
258 return cros_pchg_event(charger); in cros_ec_notify()
267 struct charger_data *charger; in cros_pchg_probe() local
275 charger = devm_kzalloc(dev, sizeof(*charger), GFP_KERNEL); in cros_pchg_probe()
276 if (!charger) in cros_pchg_probe()
279 charger->dev = dev; in cros_pchg_probe()
280 charger->ec_dev = ec_dev; in cros_pchg_probe()
281 charger->ec_device = ec_device; in cros_pchg_probe()
283 platform_set_drvdata(pdev, charger); in cros_pchg_probe()
285 ret = cros_pchg_port_count(charger); in cros_pchg_probe()
296 if (!cros_pchg_cmd_ver_check(charger)) { in cros_pchg_probe()
318 port->charger = charger; in cros_pchg_probe()
337 charger->ports[charger->num_registered_psy++] = port; in cros_pchg_probe()
340 if (!charger->num_registered_psy) in cros_pchg_probe()
343 nb = &charger->notifier; in cros_pchg_probe()
356 struct charger_data *charger = dev_get_drvdata(dev); in cros_pchg_resume() local
362 cros_pchg_event(charger); in cros_pchg_resume()
381 MODULE_DESCRIPTION("ChromeOS EC peripheral device charger");