提交 0b4cf181 编写于 作者: L Lars-Peter Clausen 提交者: Ralf Baechle

MIPS: JZ4740: qi_lb60: Add gpio-charger device

Register the gpio-charger device which reports whether device is currently
charging or not.
Signed-off-by: NLars-Peter Clausen <lars@metafoo.de>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Patchwork: https://patchwork.linux-mips.org/patch/2059/Signed-off-by: NRalf Baechle <ralf@linux-mips.org>
上级 1bbf2875
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <linux/spi/spi_gpio.h> #include <linux/spi/spi_gpio.h>
#include <linux/power_supply.h> #include <linux/power_supply.h>
#include <linux/power/jz4740-battery.h> #include <linux/power/jz4740-battery.h>
#include <linux/power/gpio-charger.h>
#include <asm/mach-jz4740/jz4740_fb.h> #include <asm/mach-jz4740/jz4740_fb.h>
#include <asm/mach-jz4740/jz4740_mmc.h> #include <asm/mach-jz4740/jz4740_mmc.h>
...@@ -396,6 +397,28 @@ static struct platform_device qi_lb60_pwm_beeper = { ...@@ -396,6 +397,28 @@ static struct platform_device qi_lb60_pwm_beeper = {
}, },
}; };
/* charger */
static char *qi_lb60_batteries[] = {
"battery",
};
static struct gpio_charger_platform_data qi_lb60_charger_pdata = {
.name = "usb",
.type = POWER_SUPPLY_TYPE_USB,
.gpio = JZ_GPIO_PORTD(28),
.gpio_active_low = 1,
.supplied_to = qi_lb60_batteries,
.num_supplicants = ARRAY_SIZE(qi_lb60_batteries),
};
static struct platform_device qi_lb60_charger_device = {
.name = "gpio-charger",
.dev = {
.platform_data = &qi_lb60_charger_pdata,
},
};
static struct platform_device *jz_platform_devices[] __initdata = { static struct platform_device *jz_platform_devices[] __initdata = {
&jz4740_udc_device, &jz4740_udc_device,
&jz4740_mmc_device, &jz4740_mmc_device,
...@@ -410,6 +433,7 @@ static struct platform_device *jz_platform_devices[] __initdata = { ...@@ -410,6 +433,7 @@ static struct platform_device *jz_platform_devices[] __initdata = {
&jz4740_adc_device, &jz4740_adc_device,
&qi_lb60_gpio_keys, &qi_lb60_gpio_keys,
&qi_lb60_pwm_beeper, &qi_lb60_pwm_beeper,
&qi_lb60_charger_device,
}; };
static void __init board_gpio_setup(void) static void __init board_gpio_setup(void)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册