aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Cvek <petr.cvek@tul.cz>2015-09-28 17:32:40 -0400
committerRobert Jarzmik <robert.jarzmik@free.fr>2015-10-14 17:06:55 -0400
commitf78b3a126bf40535444a1fe087826019b3d72594 (patch)
tree1a3c6a075db1b943e3733e9ee39990506c1ababd
parentfa5407ad9cd9aa41e00102073958475a89ac5456 (diff)
ARM: pxa: magician: Rename charger cable detection EGPIOs
This patch renames EGPIOs, which are used for the charging cable presence and type detection. Old names did not correspond with an observed functionality (on board_id 0x3a). The behavior is not: - AC charger - USB charger - Cable detection , but: - AC/USB type - Cable detection1 - Cable detection2 This patch fixes a possible typo in the bit offset for the cable detection EGPIO declaration, too. Signed-off-by: Petr Cvek <petr.cvek@tul.cz> Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
-rw-r--r--arch/arm/mach-pxa/include/mach/magician.h11
-rw-r--r--arch/arm/mach-pxa/magician.c8
2 files changed, 12 insertions, 7 deletions
diff --git a/arch/arm/mach-pxa/include/mach/magician.h b/arch/arm/mach-pxa/include/mach/magician.h
index af4cdc2172d5..5f6b850ebe33 100644
--- a/arch/arm/mach-pxa/include/mach/magician.h
+++ b/arch/arm/mach-pxa/include/mach/magician.h
@@ -107,8 +107,13 @@
107 107
108/* input */ 108/* input */
109 109
110#define EGPIO_MAGICIAN_CABLE_STATE_AC MAGICIAN_EGPIO(4, 0) 110/* USB or AC charger type */
111#define EGPIO_MAGICIAN_CABLE_STATE_USB MAGICIAN_EGPIO(4, 1) 111#define EGPIO_MAGICIAN_CABLE_TYPE MAGICIAN_EGPIO(4, 0)
112/*
113 * Vbus is detected
114 * FIXME behaves like (6,3), may differ for host/device
115 */
116#define EGPIO_MAGICIAN_CABLE_VBUS MAGICIAN_EGPIO(4, 1)
112 117
113#define EGPIO_MAGICIAN_BOARD_ID0 MAGICIAN_EGPIO(5, 0) 118#define EGPIO_MAGICIAN_BOARD_ID0 MAGICIAN_EGPIO(5, 0)
114#define EGPIO_MAGICIAN_BOARD_ID1 MAGICIAN_EGPIO(5, 1) 119#define EGPIO_MAGICIAN_BOARD_ID1 MAGICIAN_EGPIO(5, 1)
@@ -118,6 +123,6 @@
118 123
119#define EGPIO_MAGICIAN_EP_INSERT MAGICIAN_EGPIO(6, 1) 124#define EGPIO_MAGICIAN_EP_INSERT MAGICIAN_EGPIO(6, 1)
120/* FIXME behaves like (4,1), may differ for host/device */ 125/* FIXME behaves like (4,1), may differ for host/device */
121#define EGPIO_MAGICIAN_CABLE_INSERTED MAGICIAN_EGPIO(6, 4) 126#define EGPIO_MAGICIAN_CABLE_INSERTED MAGICIAN_EGPIO(6, 3)
122 127
123#endif /* _MAGICIAN_H_ */ 128#endif /* _MAGICIAN_H_ */
diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c
index 4846f5a70696..82a64c3b34e8 100644
--- a/arch/arm/mach-pxa/magician.c
+++ b/arch/arm/mach-pxa/magician.c
@@ -501,7 +501,7 @@ static struct resource gpio_vbus_resource = {
501 501
502static struct gpio_vbus_mach_info gpio_vbus_info = { 502static struct gpio_vbus_mach_info gpio_vbus_info = {
503 .gpio_pullup = GPIO27_MAGICIAN_USBC_PUEN, 503 .gpio_pullup = GPIO27_MAGICIAN_USBC_PUEN,
504 .gpio_vbus = EGPIO_MAGICIAN_CABLE_STATE_USB, 504 .gpio_vbus = EGPIO_MAGICIAN_CABLE_VBUS,
505}; 505};
506 506
507static struct platform_device gpio_vbus = { 507static struct platform_device gpio_vbus = {
@@ -520,17 +520,17 @@ static struct platform_device gpio_vbus = {
520 520
521static int power_supply_init(struct device *dev) 521static int power_supply_init(struct device *dev)
522{ 522{
523 return gpio_request(EGPIO_MAGICIAN_CABLE_STATE_AC, "CABLE_STATE_AC"); 523 return gpio_request(EGPIO_MAGICIAN_CABLE_TYPE, "Cable USB/AC type");
524} 524}
525 525
526static int magician_is_ac_online(void) 526static int magician_is_ac_online(void)
527{ 527{
528 return gpio_get_value(EGPIO_MAGICIAN_CABLE_STATE_AC); 528 return gpio_get_value(EGPIO_MAGICIAN_CABLE_TYPE);
529} 529}
530 530
531static void power_supply_exit(struct device *dev) 531static void power_supply_exit(struct device *dev)
532{ 532{
533 gpio_free(EGPIO_MAGICIAN_CABLE_STATE_AC); 533 gpio_free(EGPIO_MAGICIAN_CABLE_TYPE);
534} 534}
535 535
536static char *magician_supplicants[] = { 536static char *magician_supplicants[] = {