xref: /rk3399_rockchip-uboot/drivers/power/charge-display-uclass.c (revision e17ddcea32b2fa7b82fb079f37195855a55e39a2)
1 /*
2  * (C) Copyright 2017 Rockchip Electronics Co., Ltd
3  *
4  * SPDX-License-Identifier:     GPL-2.0+
5  */
6 
7 #include <command.h>
8 #include <common.h>
9 #include <dm.h>
10 #include <power/charge_display.h>
11 
12 int charge_display_show(struct udevice *dev)
13 {
14 	const struct dm_charge_display_ops *ops = dev_get_driver_ops(dev);
15 
16 	if (!ops || !ops->show)
17 		return -ENOSYS;
18 
19 	return ops->show(dev);
20 }
21 
22 UCLASS_DRIVER(charge_display) = {
23 	.id	= UCLASS_CHARGE_DISPLAY,
24 	.name	= "charge_display",
25 };
26