Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1234522 > unrolled thread

[PATCH v4 12/26] ARM: pxa: magician: Rename charger cable detection EGPIOs

Started byPetr Cvek <petr.cvek@tul.cz>
First post2015-09-28 23:40 +0200
Last post2015-10-03 14:40 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v4 12/26] ARM: pxa: magician: Rename charger cable detection  EGPIOs Petr Cvek <petr.cvek@tul.cz> - 2015-09-28 23:40 +0200
    Re: [PATCH v4 12/26] ARM: pxa: magician: Rename charger cable  detection EGPIOs Philipp Zabel <philipp.zabel@gmail.com> - 2015-10-03 14:40 +0200

#1234522 — [PATCH v4 12/26] ARM: pxa: magician: Rename charger cable detection EGPIOs

FromPetr Cvek <petr.cvek@tul.cz>
Date2015-09-28 23:40 +0200
Subject[PATCH v4 12/26] ARM: pxa: magician: Rename charger cable detection EGPIOs
Message-ID<qdOjn-3fZ-11@gated-at.bofh.it>
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>
---
 arch/arm/mach-pxa/include/mach/magician.h | 11 ++++++++---
 arch/arm/mach-pxa/magician.c              |  8 ++++----
 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 af4cdc2..5f6b850 100644
--- a/arch/arm/mach-pxa/include/mach/magician.h
+++ b/arch/arm/mach-pxa/include/mach/magician.h
@@ -107,8 +107,13 @@
 
 /* input */
 
-#define EGPIO_MAGICIAN_CABLE_STATE_AC	MAGICIAN_EGPIO(4, 0)
-#define EGPIO_MAGICIAN_CABLE_STATE_USB	MAGICIAN_EGPIO(4, 1)
+/* USB or AC charger type */
+#define EGPIO_MAGICIAN_CABLE_TYPE	MAGICIAN_EGPIO(4, 0)
+/*
+ * Vbus is detected
+ * FIXME behaves like (6,3), may differ for host/device
+ */
+#define EGPIO_MAGICIAN_CABLE_VBUS	MAGICIAN_EGPIO(4, 1)
 
 #define EGPIO_MAGICIAN_BOARD_ID0	MAGICIAN_EGPIO(5, 0)
 #define EGPIO_MAGICIAN_BOARD_ID1	MAGICIAN_EGPIO(5, 1)
@@ -118,6 +123,6 @@
 
 #define EGPIO_MAGICIAN_EP_INSERT	MAGICIAN_EGPIO(6, 1)
 /* FIXME behaves like (4,1), may differ for host/device */
-#define EGPIO_MAGICIAN_CABLE_INSERTED	MAGICIAN_EGPIO(6, 4)
+#define EGPIO_MAGICIAN_CABLE_INSERTED	MAGICIAN_EGPIO(6, 3)
 
 #endif /* _MAGICIAN_H_ */
diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c
index bf0760e..b645288 100644
--- a/arch/arm/mach-pxa/magician.c
+++ b/arch/arm/mach-pxa/magician.c
@@ -579,7 +579,7 @@ static struct resource gpio_vbus_resource = {
 
 static struct gpio_vbus_mach_info gpio_vbus_info = {
 	.gpio_pullup	= GPIO27_MAGICIAN_USBC_PUEN,
-	.gpio_vbus	= EGPIO_MAGICIAN_CABLE_STATE_USB,
+	.gpio_vbus	= EGPIO_MAGICIAN_CABLE_VBUS,
 };
 
 static struct platform_device gpio_vbus = {
@@ -598,17 +598,17 @@ static struct platform_device gpio_vbus = {
 
 static int power_supply_init(struct device *dev)
 {
-	return gpio_request(EGPIO_MAGICIAN_CABLE_STATE_AC, "CABLE_STATE_AC");
+	return gpio_request(EGPIO_MAGICIAN_CABLE_TYPE, "Cable USB/AC type");
 }
 
 static int magician_is_ac_online(void)
 {
-	return gpio_get_value(EGPIO_MAGICIAN_CABLE_STATE_AC);
+	return gpio_get_value(EGPIO_MAGICIAN_CABLE_TYPE);
 }
 
 static void power_supply_exit(struct device *dev)
 {
-	gpio_free(EGPIO_MAGICIAN_CABLE_STATE_AC);
+	gpio_free(EGPIO_MAGICIAN_CABLE_TYPE);
 }
 
 static char *magician_supplicants[] = {
-- 
1.7.12.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1238843 — Re: [PATCH v4 12/26] ARM: pxa: magician: Rename charger cable detection EGPIOs

FromPhilipp Zabel <philipp.zabel@gmail.com>
Date2015-10-03 14:40 +0200
SubjectRe: [PATCH v4 12/26] ARM: pxa: magician: Rename charger cable detection EGPIOs
Message-ID<qfugy-1TL-19@gated-at.bofh.it>
In reply to#1234522
Am Montag, den 28.09.2015, 23:32 +0200 schrieb Petr Cvek:
> 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>

Just to be sure, please tell me what are the values of those three
EGPIOs while
  a) wall plug charger plugged in
  b) usb cable connected to a host plugged in
  c) no cable plugged in

It could well be there are differences between our boards.

regards
Philipp
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web