Add extcon support for AXP288 PMIC
Subsystems (4)
cover Add extcon support for AXP288 PMIC
This patch series adds the support for axp288 extcon driver and also adds the cell info for extcon device in axp20x mfd driver.
Ramakrishna Pallala (2):
mfd/axp20x: add support for extcon cell
extcon-axp288: Add axp288 extcon driver support
drivers/extcon/Kconfig | 7 + drivers/extcon/Makefile | 1 + drivers/extcon/extcon-axp288.c | 479 ++++++++++++++++++++++++++++++++++++++++ drivers/mfd/axp20x.c | 28 +++ include/linux/mfd/axp20x.h | 5 + 5 files changed, 520 insertions(+) create mode 100644 drivers/extcon/extcon-axp288.c
Signature · 1 line
1.7.9.5
PATCH 1/2 mfd/axp20x: add support for extcon cell
This patch adds the mfd cell info for axp288 extcon device.
--- drivers/mfd/axp20x.c | 28 ++++++++++++++++++++++++++++ include/linux/mfd/axp20x.h | 5 +++++ 2 files changed, 33 insertions(+)
drivers/mfd/axp20x.c +28 -0
@@ -290,6 +290,29 @@ static struct resource axp288_adc_resources[] = { }, }; +static struct resource axp288_extcon_resources[] = { + { + .start =AXP288_IRQ_VBUS_FALL , + .end =AXP288_IRQ_VBUS_FALL , + .flags =IORESOURCE_IRQ , + }, + { + .start =AXP288_IRQ_VBUS_RISE , + .end =AXP288_IRQ_VBUS_RISE , + .flags =IORESOURCE_IRQ , + }, + { + .start =AXP288_IRQ_MV_CHNG , + .end =AXP288_IRQ_MV_CHNG , + .flags =IORESOURCE_IRQ , + }, + { + .start =AXP288_IRQ_BC_USB_CHNG , + .end =AXP288_IRQ_BC_USB_CHNG , + .flags =IORESOURCE_IRQ , + }, +}; +static struct resource axp288_charger_resources[] = { { .start =AXP288_IRQ_OV ,
@@ -345,6 +368,11 @@ static struct mfd_cell axp288_cells[] = { .resources = axp288_adc_resources, }, { + .name = "axp288_extcon", + .num_resources = ARRAY_SIZE(axp288_extcon_resources), + .resources = axp288_extcon_resources, + }, + { .name = "axp288_charger", .num_resources = ARRAY_SIZE(axp288_charger_resources), .resources = axp288_charger_resources,
include/linux/mfd/axp20x.h +5 -0
@@ -275,4 +275,9 @@ struct axp20x_fg_pdata { int thermistor_curve[MAX_THERM_CURVE_SIZE][2]; }; +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
Re: [PATCH v1 1/2] mfd/axp20x: add support for extcon cell
Quoted 7 lines · Ramakrishna Pallala
This patch adds the mfd cell info for axp288 extcon device.
Signed-off-by Ramakrishna Pallala <[email protected]>--- drivers/mfd/axp20x.c | 28 ++++++++++++++++++++++++++++ include/linux/mfd/axp20x.h | 5 +++++ 2 files changed, 33 insertions(+)
[...]
include/linux/mfd/axp20x.h struct axp20x_fg_pdata { · line 281
Quoted 12 lines
include/linux/mfd/axp20x.h +4
-0@@ -275,4 +275,9 @@ struct axp20x_fg_pdata {int thermistor_curve[MAX_THERM_CURVE_SIZE ][2 ]; }; +struct axp288_extcon_pdata { +/* GPIO pin control to switch D+/D- lines b/w PMIC and SOC */ +struct gpio_desc *gpio_mux_cntl; +};
This chunk of code is unrelated to this patch.
... and does it need to be in a struct of its own?
Signature · 4 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
RE: [PATCH v1 1/2] mfd/axp20x: add support for extcon cell
Hi,
Quoted 8 lines
Quoted 8 lines
include/linux/mfd/axp20x.h +0
-0@@ -275,4 +275,9 @@ struct axp20x_fg_pdata {int thermistor_curve[MAX_THERM_CURVE_SIZE ][2 ]; };
Quoted 6 lines
include/linux/mfd/axp20x.h struct axp20x_fg_pdata { · line 281
Quoted 4 lines
include/linux/mfd/axp20x.h +4
-0+struct axp288_extcon_pdata { +/* GPIO pin control to switch D+/D- lines b/w PMIC and SOC */ +struct gpio_desc *gpio_mux_cntl; +};This chunk of code is unrelated to this patch.
As it's axp20x.h file change I added it here...if you don’t feel logical to have it in the patch I can move this to patch 2/2.
Quoted 2 lines
... and does it need to be in a struct of its own?
Yes, I am planning to add another gpio control for VBUS boost.
Thanks,
Ram ���{.n�+�������+%�����ݶ��w��{.n�+����{��G�����{ay�ʇڙ�,j��f���h��������z_�(�階�ݢj"���m������G������?����&���~��iO��z��v�^�m����������?�I�
Re: [PATCH v1 1/2] mfd/axp20x: add support for extcon cell
Quoted 10 lines · Ramakrishna
Hi,
Quoted 8 lines
Quoted 8 lines
include/linux/mfd/axp20x.h +0
-0@@ -275,4 +275,9 @@ struct axp20x_fg_pdata {int thermistor_curve[MAX_THERM_CURVE_SIZE ][2 ]; };
Quoted 7 lines
Quoted 6 lines
include/linux/mfd/axp20x.h struct axp20x_fg_pdata { · line 281
Quoted 4 lines
include/linux/mfd/axp20x.h +4
-0+struct axp288_extcon_pdata { +/* GPIO pin control to switch D+/D- lines b/w PMIC and SOC */ +struct gpio_desc *gpio_mux_cntl; +};This chunk of code is unrelated to this patch.
As it's
axp20x.hfile change I added it here...if you don’t feel logical to have it in the patch I can move this to patch 2/2.
You should add it to the patch that first uses it.
Quoted 2 lines
Quoted 1 line
... and does it need to be in a struct of its own?
Yes, I am planning to add another gpio control for VBUS boost.
Okay, thanks for clarifying.
Signature · 4 lines
Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | Twitter | Blog
RE: [PATCH v1 1/2] mfd/axp20x: add support for extcon cell
Quoted 13 lines
Quoted 13 lines
Quoted 13 lines
include/linux/mfd/axp20x.h struct axp20x_fg_pdata { · line 280
Quoted 11 lines
(quoted diff) +0
-0
b/include/linux/mfd/axp20x.hindex dfabd6d..4ed8071 100644include/linux/mfd/axp20x.h +3
-0@@ -275,4 +275,9 @@ struct axp20x_fg_pdata {int thermistor_curve[MAX_THERM_CURVE_SIZE ][2 ]; }; +struct axp288_extcon_pdata { +/* GPIO pin control to switch D+/D- lines b/w PMIC and SOC */ +struct gpio_desc *gpio_mux_cntl; };This chunk of code is unrelated to this patch.
Quoted 4 lines
Quoted 1 line
As it's
axp20x.hfile change I added it here...if you don’t feel logical to have itin the patch I can move this to patch 2/2.
You should add it to the patch that first uses it.
Ok I will fix it.
Thanks,
Ram ���{.n�+�������+%�����ݶ��w��{.n�+����{��G�����{ay�ʇڙ�,j��f���h��������z_�(�階�ݢj"���m������G������?����&���~��iO��z��v�^�m����������?�I�
PATCH 2/2 extcon-axp288: Add axp288 extcon driver support
In reply to Ramakrishna PallalaThis 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 | 479 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 487 insertions(+) create mode 100644 drivers/extcon/extcon-axp288.c
drivers/extcon/Kconfig +7 -0
@@ -93,4 +93,11 @@ config EXTCON_SM5502 Silicon Mitus SM5502. The SM5502 is a USB port accessory detector and switch. +config EXTCON_AXP288 + tristate "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 AXP288 PMIC. + endif # MULTISTATE_SWITCH
drivers/extcon/Makefile +1 -0
@@ -12,3 +12,4 @@ obj-$(CONFIG_EXTCON_MAX8997) += extcon-max8997.o obj-$(CONFIG_EXTCON_PALMAS) += extcon-palmas.o obj-$(CONFIG_EXTCON_RT8973A) += extcon-rt8973a.o obj-$(CONFIG_EXTCON_SM5502) += extcon-sm5502.o +obj-$(CONFIG_EXTCON_AXP288) += extcon-axp288.o
drivers/extcon/extcon-axp288.c new file +479 -0
479 lines not on this page · raw message
Signature · 1 line
1.7.9.5