test-power: add testpower dts-config

Signed-off-by: 许盛飞 <xsf@rock-chips.com>
This commit is contained in:
许盛飞
2014-11-24 12:00:21 +08:00
parent 2bb9a8534a
commit eb28b49bcc
2 changed files with 18 additions and 1 deletions

View File

@@ -351,6 +351,7 @@ CONFIG_BATTERY_RT5025=y
CONFIG_CHARGER_RT5036=y
CONFIG_RT_POWER=y
CONFIG_BATTERY_RICOH619=y
CONFIG_TEST_POWER=y
CONFIG_BATTERY_BQ24296=y
CONFIG_BATTERY_BQ27320=y
CONFIG_BATTERY_RK30_ADC_FAC=y
@@ -439,8 +440,8 @@ CONFIG_SND_RK_SOC_HDMI_I2S=y
CONFIG_SND_RK_SOC_SPDIF_CARD=y
CONFIG_SND_RK_SOC_RT5631=y
CONFIG_SND_RK_SOC_RT3224=y
CONFIG_SND_RK_SOC_RK312X=y
CONFIG_SND_RK_SOC_RK3036=y
CONFIG_SND_RK_SOC_RK312X=y
CONFIG_HID_BATTERY_STRENGTH=y
CONFIG_HIDRAW=y
CONFIG_UHID=y

View File

@@ -20,6 +20,10 @@
#include <linux/errno.h>
#include <linux/delay.h>
#include <linux/vermagic.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/err.h>
static int ac_online = 1;
static int usb_online = 1;
@@ -177,6 +181,18 @@ 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 (IS_ERR_OR_NULL(dev_node)) {
pr_info("not find %s dev node\n", __func__);
return 0;
}
if (!of_device_is_available(dev_node)) {
pr_info("test power disabled\n");
return 0;
}
for (i = 0; i < ARRAY_SIZE(test_power_supplies); i++) {
ret = power_supply_register(NULL, &test_power_supplies[i]);