From: petr.cvek@tul•cz (Petr Cvek)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH v4 12/26] ARM: pxa: magician: Rename charger cable detection EGPIOs
Date: Mon, 28 Sep 2015 23:32:40 +0200 [thread overview]
Message-ID: <5609B1F8.8070104@tul.cz> (raw)
In-Reply-To: <cover.1443472089.git.petr.cvek@tul.cz>
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
next prev parent reply other threads:[~2015-09-28 21:32 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1443472089.git.petr.cvek@tul.cz>
2015-09-28 21:09 ` [PATCH v4 01/26] ARM: pxa: magician: Fix indentation in machine files Petr Cvek
2015-10-03 12:14 ` Philipp Zabel
2015-09-28 21:10 ` [PATCH v4 02/26] ARM: pxa: magician: Change comments to be more informative Petr Cvek
2015-10-03 12:19 ` Philipp Zabel
2015-10-13 20:08 ` Robert Jarzmik
2015-09-28 21:10 ` [PATCH v4 03/26] ARM: pxa: magician: Print more specific error message for global GPIOs Petr Cvek
2015-10-03 12:19 ` Philipp Zabel
2015-09-28 21:11 ` [PATCH v4 04/26] ARM: pxa: magician: Optimize debug messages for LCD power Petr Cvek
2015-10-03 12:20 ` Philipp Zabel
2015-09-28 21:11 ` [PATCH v4 05/26] ARM: pxa: magician: Change description of LCD power GPIO Petr Cvek
2015-10-03 12:21 ` Philipp Zabel
2015-09-28 21:15 ` [PATCH v4 06/26] ARM: pxa: magician: Add new discovered EGPIO pins Petr Cvek
2015-10-03 12:23 ` Philipp Zabel
2015-09-28 21:15 ` [PATCH v4 07/26] ARM: pxa: magician: Fix HTC Magician pin mux definitions Petr Cvek
2015-10-03 12:30 ` Philipp Zabel
2015-10-05 2:15 ` Petr Cvek
2015-10-13 20:09 ` Robert Jarzmik
2015-09-28 21:15 ` [PATCH v4 08/26] ARM: pxa: magician: Rename abstract LCD GPIOs Petr Cvek
2015-10-03 12:31 ` Philipp Zabel
2015-09-28 21:16 ` [PATCH v4 09/26] ARM: pxa: magician: Optimize powerup delays for Samsung LCD Petr Cvek
2015-10-03 12:32 ` Philipp Zabel
2015-09-28 21:32 ` [PATCH v4 10/26] ARM: pxa: magician: Optimize Samsung LCD refresh to 50Hz Petr Cvek
2015-10-03 12:33 ` Philipp Zabel
2015-09-28 21:32 ` [PATCH v4 11/26] ARM: pxa: magician: Optimize EGPIO initial values Petr Cvek
2015-10-03 12:35 ` Philipp Zabel
2015-10-07 19:45 ` Robert Jarzmik
2015-09-28 21:32 ` Petr Cvek [this message]
2015-10-03 12:38 ` [PATCH v4 12/26] ARM: pxa: magician: Rename charger cable detection EGPIOs Philipp Zabel
2015-10-09 2:33 ` Petr Cvek
2015-09-28 21:33 ` [PATCH v4 13/26] ARM: pxa: magician: Fix and add charging detection functions Petr Cvek
2015-09-28 21:33 ` [PATCH v4 14/26] ARM: pxa: magician: Fix platform data for both PXA27x I2C controllers Petr Cvek
2015-10-03 12:41 ` Philipp Zabel
2015-09-28 21:34 ` [PATCH v4 15/26] ARM: pxa: magician: Fix redundant GPIO request for pxaficp_ir Petr Cvek
2015-09-28 21:34 ` [PATCH v4 16/26] ARM: pxa: magician: Fix support for Intel Strata NOR Flash Petr Cvek
2015-09-28 21:38 ` [PATCH v4 17/26] ARM: pxa: magician: Fix wrongly enabled USB host ports Petr Cvek
2015-10-03 12:45 ` Philipp Zabel
2015-10-05 2:03 ` Petr Cvek
2015-09-28 21:38 ` [PATCH v4 18/26] ARM: pxa: magician: Add support for ADS7846 Petr Cvek
2015-10-03 12:49 ` Philipp Zabel
2015-10-12 4:39 ` Petr Cvek
2015-09-28 21:38 ` [PATCH v4 19/26] ARM: pxa: magician: Add support for Omnivision OV9640 camera Petr Cvek
2015-10-03 12:50 ` Philipp Zabel
2015-10-07 19:49 ` Robert Jarzmik
2015-10-08 6:05 ` Petr Cvek
2015-09-28 21:39 ` [PATCH v4 20/26] ARM: pxa: magician: Add support for MAX1587A Vcore regulator Petr Cvek
2015-10-03 12:57 ` Philipp Zabel
2015-10-13 20:16 ` Robert Jarzmik
2015-09-28 21:39 ` [PATCH v4 21/26] ARM: pxa: magician: Add support for PXA27x UDC Petr Cvek
2015-10-03 12:58 ` Philipp Zabel
2015-10-13 20:29 ` Robert Jarzmik
2015-09-28 21:39 ` [PATCH v4 22/26] ARM: pxa: magician: Remove pdata for pasic3-leds Petr Cvek
2015-10-03 12:59 ` Philipp Zabel
2015-10-13 20:32 ` Robert Jarzmik
2015-09-28 21:40 ` [PATCH v4 23/26] ARM: pxa: magician: Remove definition of the STUART port Petr Cvek
2015-09-28 21:40 ` [PATCH v4 24/26] ARM: pxa: magician: Add debug message for backlight brightness function Petr Cvek
2015-09-28 21:40 ` [PATCH v4 25/26] ARM: pxa: magician: Add missing regulator for PWM backlight Petr Cvek
2015-10-03 13:02 ` Philipp Zabel
2015-09-28 21:42 ` [PATCH v4 26/26] ARM: pxa: magician: Move platform_add_devices() to the end of magician_init() Petr Cvek
2015-10-03 13:04 ` Philipp Zabel
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5609B1F8.8070104@tul.cz \
--to=petr.cvek@tul$(echo .)cz \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox