RE: [PATCH v5] extcon-axp288: Add axp288 extcon driver support

From: Pallala, Ramakrishna
Date: Tue Apr 28 2015 - 08:17:22 EST


Hi Choi,

> On Tue, Apr 28, 2015 at 8:20 PM, Pallala, Ramakrishna
> >> > > > diff --git a/include/linux/mfd/axp20x.h
> >> > > > b/include/linux/mfd/axp20x.h index dfabd6d..81152e2 100644
> >> > > > --- a/include/linux/mfd/axp20x.h
> >> > > > +++ b/include/linux/mfd/axp20x.h
> >> > > > @@ -275,4 +275,13 @@ struct axp20x_fg_pdata {
> >> > > > int thermistor_curve[MAX_THERM_CURVE_SIZE][2];
> >> > > > };
> >> > > >
> >> > > > +#define AXP288_EXTCON_CABLE_SDP "SLOW-CHARGER"
> >> > > > +#define AXP288_EXTCON_CABLE_CDP "CHARGE-
> >> > > DOWNSTREAM"
> >> > > > +#define AXP288_EXTCON_CABLE_DCP "FAST-CHARGER"
> >> > >
> >> > > #defines are meant to make things *easier* for humans to read. It
> >> > > is my opinion that these negatively impact the readability of the code.
> >> > These macros will be used in extcon and charger drivers. How can I
> >> > make it
> >> more readable?
> >>
> >> If the things you're defining are more readable than the defines
> >> themselves you're doing the opposite of what I'd expect.
> >>
> >> How about:
> >>
> >> AXP288_EXTCON_SLOW_CHARGER_CABLE
> >> AXP288_EXTCON_FAST_CHARGER_CABLE
> >> AXP288_EXTCON_CHARGE_DOWNSTREAM_CABLE
> >
> > Ok I will change the names similar to the above ones.
>
> This cable names are used in only extcon driver.
> I think that you don't need to define them on header file.
> You better to move this definition to extcon driver.
>
> Also, I'll review your patch on other mail.

Based on the these cable types I will be setting the charging parameters.
How will I know which charger cable is connected in extcon consumer driver?

Thanks,
Ram