Loading arch/arm/configs/magician_defconfig +5 −1 Original line number Diff line number Diff line Loading @@ -695,7 +695,11 @@ CONFIG_I2C_PXA=m # CONFIG_SPI is not set # CONFIG_SPI_MASTER is not set # CONFIG_W1 is not set # CONFIG_POWER_SUPPLY is not set CONFIG_POWER_SUPPLY=y # CONFIG_POWER_SUPPLY_DEBUG is not set CONFIG_PDA_POWER=y # CONFIG_APM_POWER is not set # CONFIG_BATTERY_DS2760 is not set # CONFIG_HWMON is not set # CONFIG_WATCHDOG is not set Loading arch/arm/mach-pxa/magician.c +54 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ #include <linux/mtd/mtd.h> #include <linux/mtd/map.h> #include <linux/mtd/physmap.h> #include <linux/pda_power.h> #include <asm/gpio.h> #include <asm/hardware.h> Loading Loading @@ -202,6 +203,58 @@ static struct platform_device backlight = { }; /* * External power */ static int magician_is_ac_online(void) { return gpio_get_value(EGPIO_MAGICIAN_CABLE_STATE_AC); } static int magician_is_usb_online(void) { return gpio_get_value(EGPIO_MAGICIAN_CABLE_STATE_USB); } static void magician_set_charge(int flags) { gpio_set_value(GPIO30_MAGICIAN_nCHARGE_EN, !flags); gpio_set_value(EGPIO_MAGICIAN_CHARGE_EN, flags); } static struct pda_power_pdata power_supply_info = { .is_ac_online = magician_is_ac_online, .is_usb_online = magician_is_usb_online, .set_charge = magician_set_charge, }; static struct resource power_supply_resources[] = { [0] = { .name = "ac", .flags = IORESOURCE_IRQ, .start = IRQ_MAGICIAN_AC, .end = IRQ_MAGICIAN_AC, }, [1] = { .name = "usb", .flags = IORESOURCE_IRQ, .start = IRQ_MAGICIAN_AC, .end = IRQ_MAGICIAN_AC, }, }; static struct platform_device power_supply = { .name = "pda-power", .id = -1, .dev = { .platform_data = &power_supply_info, }, .resource = power_supply_resources, .num_resources = ARRAY_SIZE(power_supply_resources), }; /* * MMC/SD */ Loading Loading @@ -299,6 +352,7 @@ static struct platform_device *devices[] __initdata = { &gpio_keys, &egpio, &backlight, &power_supply, &strataflash, }; Loading Loading
arch/arm/configs/magician_defconfig +5 −1 Original line number Diff line number Diff line Loading @@ -695,7 +695,11 @@ CONFIG_I2C_PXA=m # CONFIG_SPI is not set # CONFIG_SPI_MASTER is not set # CONFIG_W1 is not set # CONFIG_POWER_SUPPLY is not set CONFIG_POWER_SUPPLY=y # CONFIG_POWER_SUPPLY_DEBUG is not set CONFIG_PDA_POWER=y # CONFIG_APM_POWER is not set # CONFIG_BATTERY_DS2760 is not set # CONFIG_HWMON is not set # CONFIG_WATCHDOG is not set Loading
arch/arm/mach-pxa/magician.c +54 −0 Original line number Diff line number Diff line Loading @@ -22,6 +22,7 @@ #include <linux/mtd/mtd.h> #include <linux/mtd/map.h> #include <linux/mtd/physmap.h> #include <linux/pda_power.h> #include <asm/gpio.h> #include <asm/hardware.h> Loading Loading @@ -202,6 +203,58 @@ static struct platform_device backlight = { }; /* * External power */ static int magician_is_ac_online(void) { return gpio_get_value(EGPIO_MAGICIAN_CABLE_STATE_AC); } static int magician_is_usb_online(void) { return gpio_get_value(EGPIO_MAGICIAN_CABLE_STATE_USB); } static void magician_set_charge(int flags) { gpio_set_value(GPIO30_MAGICIAN_nCHARGE_EN, !flags); gpio_set_value(EGPIO_MAGICIAN_CHARGE_EN, flags); } static struct pda_power_pdata power_supply_info = { .is_ac_online = magician_is_ac_online, .is_usb_online = magician_is_usb_online, .set_charge = magician_set_charge, }; static struct resource power_supply_resources[] = { [0] = { .name = "ac", .flags = IORESOURCE_IRQ, .start = IRQ_MAGICIAN_AC, .end = IRQ_MAGICIAN_AC, }, [1] = { .name = "usb", .flags = IORESOURCE_IRQ, .start = IRQ_MAGICIAN_AC, .end = IRQ_MAGICIAN_AC, }, }; static struct platform_device power_supply = { .name = "pda-power", .id = -1, .dev = { .platform_data = &power_supply_info, }, .resource = power_supply_resources, .num_resources = ARRAY_SIZE(power_supply_resources), }; /* * MMC/SD */ Loading Loading @@ -299,6 +352,7 @@ static struct platform_device *devices[] __initdata = { &gpio_keys, &egpio, &backlight, &power_supply, &strataflash, }; Loading