Change-Id: Ib2c78602f604d610a648397cbf08c56cdbd77eab
Signed-off-by: Shengfei Xu <xsf@rock-chips.com>
#include <linux/errno.h>
#include <linux/delay.h>
#include <linux/vermagic.h>
+#include <linux/of.h>
enum test_power_id {
TEST_AC,
{
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));