Skip to contentSkip to conversation

extcon-axp288: Add axp288 extcon driver support

PATCH Superseded Ramakrishna Pallala 2 participants 3 messages Apr 28, 2015

Subsystems (4)

v6 of 9 Superseded Latest is v9 →

lore
Share & tools
lore
#0 lore raw

PATCH v6 1/1 extcon-axp288: Add axp288 extcon driver support

This patch adds the extcon support for AXP288 PMIC which has the BC1.2 charger detection capability. Additionally it also adds the USB mux switching support b/w SOC and PMIC based on GPIO control.

---
 drivers/extcon/Kconfig         |    7 +
 drivers/extcon/Makefile        |    1 +
 drivers/extcon/extcon-axp288.c |  399 ++++++++++++++++++++++++++++++++++++++++
 include/linux/mfd/axp20x.h     |    9 +
 4 files changed, 416 insertions(+)
 create mode 100644 drivers/extcon/extcon-axp288.c
drivers/extcon/Kconfig +7 -0
index fdc0bf0..2305edc 100644
@@ -28,6 +28,13 @@ config EXTCON_ARIZONA
 	  with Wolfson Arizona devices. These are audio CODECs with
 	  advanced audio accessory detection support.
 
+config EXTCON_AXP288
+	tristate "X-Power AXP288 EXTCON support"
+	depends on MFD_AXP20X && USB_PHY
+	help
+	  Say Y here to enable support for USB peripheral detection
+	  and USB MUX switching by X-Power AXP288 PMIC.
+
 config EXTCON_GPIO
 	tristate "GPIO extcon support"
 	depends on GPIOLIB
drivers/extcon/Makefile +1 -0
index 9204114..ba787d0 100644
@@ -5,6 +5,7 @@
 obj-$(CONFIG_EXTCON)		+= extcon.o
 obj-$(CONFIG_EXTCON_ADC_JACK)	+= extcon-adc-jack.o
 obj-$(CONFIG_EXTCON_ARIZONA)	+= extcon-arizona.o
+obj-$(CONFIG_EXTCON_AXP288)	+= extcon-axp288.o
 obj-$(CONFIG_EXTCON_GPIO)	+= extcon-gpio.o
 obj-$(CONFIG_EXTCON_MAX14577)	+= extcon-max14577.o
 obj-$(CONFIG_EXTCON_MAX77693)	+= extcon-max77693.o
drivers/extcon/extcon-axp288.c new file +399 -0

399 lines not on this page · raw message

include/linux/mfd/axp20x.h +9 -0
index dfabd6d..38653e0 100644
@@ -275,4 +275,13 @@ struct axp20x_fg_pdata {
 	int thermistor_curve[MAX_THERM_CURVE_SIZE][2];
 };
 
+#define AXP288_EXTCON_SLOW_CHARGER		"SLOW-CHARGER"
+#define AXP288_EXTCON_DOWNSTREAM_CHARGER	"CHARGE-DOWNSTREAM"
+#define AXP288_EXTCON_FAST_CHARGER		"FAST-CHARGER"
+
+struct axp288_extcon_pdata {
+	/* GPIO pin control to switch D+/D- lines b/w PMIC and SOC */
+	struct gpio_desc *gpio_mux_cntl;
+};
+
 #endif /* __LINUX_MFD_AXP20X_H */
Signature · 1 line
1.7.9.5
Acked-by on v6 1/1
#1 lore raw
Quoted 13 lines · Ramakrishna Pallala

This patch adds the extcon support for AXP288 PMIC which has the BC1.2 charger detection capability. Additionally it also adds the USB mux switching support b/w SOC and PMIC based on GPIO control.

---
 drivers/extcon/Kconfig         |    7 +
 drivers/extcon/Makefile        |    1 +
 drivers/extcon/extcon-axp288.c |  399 ++++++++++++++++++++++++++++++++++++++++
 include/linux/mfd/axp20x.h     |    9 +
 4 files changed, 416 insertions(+)
 create mode 100644 drivers/extcon/extcon-axp288.c

[...]

Quoted 8 lines
include/linux/mfd/axp20x.h +0 -0
index dfabd6d..38653e0 100644
@@ -275,4 +275,13 @@ struct axp20x_fg_pdata {
 	int thermistor_curve[MAX_THERM_CURVE_SIZE][2];
 };
 

include/linux/mfd/axp20x.h struct axp20x_fg_pdata { · line 287

Quoted 10 lines
include/linux/mfd/axp20x.h +9 -0
+#define AXP288_EXTCON_SLOW_CHARGER		"SLOW-CHARGER"
+#define AXP288_EXTCON_DOWNSTREAM_CHARGER	"CHARGE-DOWNSTREAM"
+#define AXP288_EXTCON_FAST_CHARGER		"FAST-CHARGER"
+
+struct axp288_extcon_pdata {
+	/* GPIO pin control to switch D+/D- lines b/w PMIC and SOC */
+	struct gpio_desc *gpio_mux_cntl;
+};
+
 #endif /* __LINUX_MFD_AXP20X_H */

Not sure what you decided since sending this, but in order for me to avoid becoming the bottle-neck:

Signature · 4 lines
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
#2 lore raw

Hi Lee Jones,

I have agreed to move the AXP288_EXTCON_* macros to driver source file as Choi is going to submit another extcon class driver patch to fix the consumer driver access issue.

I will submit the v7 patch now with this change. Thank you for your time.

Quoted 39 lines
Quoted 9 lines

This patch adds the extcon support for AXP288 PMIC which has the BC1.2 charger detection capability. Additionally it also adds the USB mux switching support b/w SOC and PMIC based on GPIO control.

---
 drivers/extcon/Kconfig         |    7 +
 drivers/extcon/Makefile        |    1 +
 drivers/extcon/extcon-axp288.c |  399

++++++++++++++++++++++++++++++++++++++++

Quoted 3 lines
 include/linux/mfd/axp20x.h     |    9 +
 4 files changed, 416 insertions(+)
 create mode 100644 drivers/extcon/extcon-axp288.c

[...]

include/linux/mfd/axp20x.h struct axp20x_fg_pdata { · line 279

Quoted 10 lines
include/linux/mfd/axp20x.h +2 -0
index dfabd6d..38653e0 100644
@@ -275,4 +275,13 @@ struct axp20x_fg_pdata {
 	int thermistor_curve[MAX_THERM_CURVE_SIZE][2];
 };
 
+#define AXP288_EXTCON_SLOW_CHARGER		"SLOW-CHARGER"
+#define AXP288_EXTCON_DOWNSTREAM_CHARGER	"CHARGE-

DOWNSTREAM"

include/linux/mfd/axp20x.h struct axp20x_fg_pdata { · line 287

Quoted 8 lines
include/linux/mfd/axp20x.h +7 -0
+#define AXP288_EXTCON_FAST_CHARGER		"FAST-CHARGER"
+
+struct axp288_extcon_pdata {
+	/* GPIO pin control to switch D+/D- lines b/w PMIC and SOC */
+	struct gpio_desc *gpio_mux_cntl;
+};
+
 #endif /* __LINUX_MFD_AXP20X_H */

Not sure what you decided since sending this, but in order for me to avoid becoming the bottle-neck:

Quoted 1 line

Thanks,
Ram ���{.n�+�������+%�����ݶ��w��{.n�+����{��G�����{ay�ʇڙ�,j��f���h��������z_�(�階�ݢj"���m������G������?����&���~��iO��z��v�^�m���� ������?�I�