lkml.org 
[lkml]   [2015]   [Apr]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v5] extcon-axp288: Add axp288 extcon driver support
From
Hi Ram,

On Tue, Apr 28, 2015 at 9:17 PM, Pallala, Ramakrishna
<ramakrishna.pallala@intel.com> wrote:
> 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?

I'm working to implement the unique id for all external connectors instead of
string name when registering the external connectors [1]. But It is
not completed and ongoing.
[1] https://git.kernel.org/cgit/linux/kernel/git/chanwoo/extcon.git/commit/?h=v4.2/extcon-next&id=52d1f16a650cc3b20ab5d5e281b874cfc5f659bc

Also, extcon consumer driver can use the unique id (enum extcon) when
executing extcon_register_interest() function.
After implementing patch[1], all extcon provider/consumer driver would
not pass the string of external connector directly.

Thanks,
Chanwoo Choi


\
 
 \ /
  Last update: 2015-04-28 15:41    [W:0.037 / U:0.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site