2017-10-31 03:50:36 +00:00
|
|
|
/*
|
|
|
|
|
* (C) Copyright 2017 Rockchip Electronics Co., Ltd
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: GPL-2.0+
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <command.h>
|
|
|
|
|
#include <common.h>
|
|
|
|
|
#include <dm.h>
|
|
|
|
|
#include <power/charge_display.h>
|
|
|
|
|
|
2019-04-30 02:11:31 +00:00
|
|
|
int charge_display_show(struct udevice *dev)
|
2017-10-31 03:50:36 +00:00
|
|
|
{
|
|
|
|
|
const struct dm_charge_display_ops *ops = dev_get_driver_ops(dev);
|
|
|
|
|
|
|
|
|
|
if (!ops || !ops->show)
|
|
|
|
|
return -ENOSYS;
|
|
|
|
|
|
|
|
|
|
return ops->show(dev);
|
|
|
|
|
}
|
|
|
|
|
|
2019-01-22 11:28:38 +00:00
|
|
|
int charge_display(void)
|
|
|
|
|
{
|
|
|
|
|
struct udevice *dev;
|
|
|
|
|
int ret;
|
|
|
|
|
|
|
|
|
|
ret = uclass_get_device(UCLASS_CHARGE_DISPLAY, 0, &dev);
|
|
|
|
|
if (ret) {
|
|
|
|
|
debug("Get charge display failed, ret=%d\n", ret);
|
|
|
|
|
return ret;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return charge_display_show(dev);
|
|
|
|
|
}
|
|
|
|
|
|
2017-10-31 03:50:36 +00:00
|
|
|
UCLASS_DRIVER(charge_display) = {
|
|
|
|
|
.id = UCLASS_CHARGE_DISPLAY,
|
|
|
|
|
.name = "charge_display",
|
|
|
|
|
};
|