From 2c3c1048746a4622d8c89a29670120dc8fab93c4 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 20:49:45 +0200 Subject: Adding upstream version 6.1.76. Signed-off-by: Daniel Baumann --- drivers/power/supply/ab8500-chargalg.h | 47 ++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 drivers/power/supply/ab8500-chargalg.h (limited to 'drivers/power/supply/ab8500-chargalg.h') diff --git a/drivers/power/supply/ab8500-chargalg.h b/drivers/power/supply/ab8500-chargalg.h new file mode 100644 index 000000000..8534d067b --- /dev/null +++ b/drivers/power/supply/ab8500-chargalg.h @@ -0,0 +1,47 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Copyright (C) ST-Ericsson SA 2012 + * Author: Johan Gardsmark for ST-Ericsson. + */ + +#ifndef _AB8500_CHARGALG_H_ +#define _AB8500_CHARGALG_H_ + +#include + +/* + * Valid only for supplies of type: + * - POWER_SUPPLY_TYPE_MAINS, + * - POWER_SUPPLY_TYPE_USB, + * because only them store as drv_data pointer to struct ux500_charger. + */ +#define psy_to_ux500_charger(x) power_supply_get_drvdata(x) + +/* Forward declaration */ +struct ux500_charger; + +struct ux500_charger_ops { + int (*enable) (struct ux500_charger *, int, int, int); + int (*check_enable) (struct ux500_charger *, int, int); + int (*kick_wd) (struct ux500_charger *); + int (*update_curr) (struct ux500_charger *, int); +}; + +/** + * struct ux500_charger - power supply ux500 charger sub class + * @psy power supply base class + * @ops ux500 charger operations + * @max_out_volt_uv maximum output charger voltage in uV + * @max_out_curr_ua maximum output charger current in uA + * @enabled indicates if this charger is used or not + */ +struct ux500_charger { + struct power_supply *psy; + struct ux500_charger_ops ops; + int max_out_volt_uv; + int max_out_curr_ua; + int wdt_refresh; + bool enabled; +}; + +#endif /* _AB8500_CHARGALG_H_ */ -- cgit v1.2.3