1 /* 2 * (C) Copyright 2020 Rockchip Electronics Co., Ltd 3 * 4 * SPDX-License-Identifier: GPL-2.0+ 5 */ 6 7 #ifndef _power_delivery_H_ 8 #define _power_delivery_H_ 9 10 /* Capability */ 11 #define FG_CAP_FUEL_GAUGE BIT(0) 12 #define FG_CAP_CHARGER BIT(1) 13 14 struct dm_power_delivery_ops { 15 int (*get_voltage)(struct udevice *dev); 16 int (*get_current)(struct udevice *dev); 17 int (*get_online)(struct udevice *dev); 18 }; 19 20 struct power_delivery_data { 21 int voltage; 22 int current; 23 int online; 24 }; 25 26 #ifdef CONFIG_DM_POWER_DELIVERY 27 int power_delivery_get_data(struct udevice *dev, struct power_delivery_data *pd_data); 28 #else power_delivery_get_data(struct udevice * dev,struct power_delivery_data * pd_data)29inline int power_delivery_get_data(struct udevice *dev, 30 struct power_delivery_data *pd_data) 31 { 32 return -ENOSYS; 33 } 34 #endif 35 #endif 36