RE: [PATCH 1/2] mfd/axp20x: add support for extcon cell

From: Pallala, Ramakrishna
Date: Wed Apr 01 2015 - 12:33:54 EST


> On Thu, 02 Apr 2015, Ramakrishna Pallala wrote:
>
> > This patch adds the mfd cell info for axp288 extcon device.
> >
> > Signed-off-by: Ramakrishna Pallala <ramakrishna.pallala@xxxxxxxxx>
> > ---
> > drivers/mfd/axp20x.c | 28 ++++++++++++++++++++++++++++
> > include/linux/mfd/axp20x.h | 5 +++++
> > 2 files changed, 33 insertions(+)
> >
> > diff --git a/drivers/mfd/axp20x.c b/drivers/mfd/axp20x.c index
> > 0acbe52..30af1a3 100644
> > --- a/drivers/mfd/axp20x.c
> > +++ b/drivers/mfd/axp20x.c
> > @@ -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 = "extcon-axp288",
>
> This naming convention is not consistent with the others in the container.
Ok agreed. I will fix it.


> > + .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, diff --git
> > a/include/linux/mfd/axp20x.h b/include/linux/mfd/axp20x.h index
> > dfabd6d..4ed8071 100644
> > --- a/include/linux/mfd/axp20x.h
> > +++ b/include/linux/mfd/axp20x.h
> > @@ -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;
> > +};
>
> Is this going to be added to? Seems like overkill to have a struct with only one
> attribute.
Yes, I will be adding to this struct in future.

Thanks,
Ram