mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
power: test_power: add testpower dts-config
Change-Id: Ib2c78602f604d610a648397cbf08c56cdbd77eab Signed-off-by: Shengfei Xu <xsf@rock-chips.com>
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
#include <linux/errno.h>
|
||||
#include <linux/delay.h>
|
||||
#include <linux/vermagic.h>
|
||||
#include <linux/of.h>
|
||||
|
||||
enum test_power_id {
|
||||
TEST_AC,
|
||||
@@ -197,6 +198,19 @@ static int __init test_power_init(void)
|
||||
{
|
||||
int i;
|
||||
int ret;
|
||||
struct device_node *dev_node;
|
||||
|
||||
dev_node = of_find_node_by_name(NULL, "test-power");
|
||||
|
||||
if (!dev_node) {
|
||||
pr_info("%s: could not find dev node\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
if (!of_device_is_available(dev_node)) {
|
||||
pr_info("%s: test power disabled\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
of_node_put(dev_node);
|
||||
|
||||
BUILD_BUG_ON(TEST_POWER_NUM != ARRAY_SIZE(test_power_supplies));
|
||||
BUILD_BUG_ON(TEST_POWER_NUM != ARRAY_SIZE(test_power_configs));
|
||||
|
||||
Reference in New Issue
Block a user