48 lines · c
1/* SPDX-License-Identifier: GPL-2.0-only */2/*3 * Copyright (C) ST-Ericsson SA 20124 * Author: Johan Gardsmark <johan.gardsmark@stericsson.com> for ST-Ericsson.5 */6 7#ifndef _AB8500_CHARGALG_H_8#define _AB8500_CHARGALG_H_9 10#include <linux/power_supply.h>11 12/*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.17 */18#define psy_to_ux500_charger(x) power_supply_get_drvdata(x)19 20/* Forward declaration */21struct ux500_charger;22 23struct 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);28};29 30/**31 * struct ux500_charger - power supply ux500 charger sub class32 * @psy power supply base class33 * @ops ux500 charger operations34 * @max_out_volt_uv maximum output charger voltage in uV35 * @max_out_curr_ua maximum output charger current in uA36 * @enabled indicates if this charger is used or not37 */38struct 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;45};46 47#endif /* _AB8500_CHARGALG_H_ */48