Merge tag 'trace-printf-v6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/trace...
[drm/drm-misc.git] / drivers / power / supply / ab8500-chargalg.h
blob8534d067ba950b7f18e50f8e873f21490bca0afc
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 /*
3 * Copyright (C) ST-Ericsson SA 2012
4 * Author: Johan Gardsmark <johan.gardsmark@stericsson.com> for ST-Ericsson.
5 */
7 #ifndef _AB8500_CHARGALG_H_
8 #define _AB8500_CHARGALG_H_
10 #include <linux/power_supply.h>
13 * Valid only for supplies of type:
14 * - POWER_SUPPLY_TYPE_MAINS,
15 * - POWER_SUPPLY_TYPE_USB,
16 * because only them store as drv_data pointer to struct ux500_charger.
18 #define psy_to_ux500_charger(x) power_supply_get_drvdata(x)
20 /* Forward declaration */
21 struct ux500_charger;
23 struct ux500_charger_ops {
24 int (*enable) (struct ux500_charger *, int, int, int);
25 int (*check_enable) (struct ux500_charger *, int, int);
26 int (*kick_wd) (struct ux500_charger *);
27 int (*update_curr) (struct ux500_charger *, int);
30 /**
31 * struct ux500_charger - power supply ux500 charger sub class
32 * @psy power supply base class
33 * @ops ux500 charger operations
34 * @max_out_volt_uv maximum output charger voltage in uV
35 * @max_out_curr_ua maximum output charger current in uA
36 * @enabled indicates if this charger is used or not
38 struct ux500_charger {
39 struct power_supply *psy;
40 struct ux500_charger_ops ops;
41 int max_out_volt_uv;
42 int max_out_curr_ua;
43 int wdt_refresh;
44 bool enabled;
47 #endif /* _AB8500_CHARGALG_H_ */