lkml.org 
[lkml]   [2013]   [Jan]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH 1/2] power_supply: Add charge control struct in power supply class
Date
> > +struct power_supply_charger_control {
> > + const char *name;
> > + /* get charging status */
> > + int (*is_charging_enabled)(void);
> > + int (*is_charger_enabled)(void);
> > +
> > + /* set charging parameters */
> > + int (*set_in_current_limit)(int uA);
> > + int (*set_charge_current)(int uA);
> > + int (*set_charge_voltage)(int uV);
> > +
> > + /* control battery charging */
> > + int (*enable_charging)(void);
> > + int (*disable_charging)(void);
> > +
> > + /* control VSYS or system supply */
> > + int (*turnon_charger)(void);
> > + int (*turnoff_charger)(void);
> > +};
> > +
>
> I'm all for this patch, but why do you need to place it into power_supply.h and
> power_supply_core.c? :) I see nothing generic here, it's pure charger-manager
> stuff. So, place everything into charger-manager.{c,h}.

Hi Anton,

The main reason for keeping this stuff in power_supply.h and power_supply_core.c is to make these interfaces uniform
Across multiple charger frameworks and to avoid each charger framework define it's own interfaces. If there is need for new callback
They can add to the existing struct defined above and it will available to all the frameworks. Also the work required to support a new
Framework will be reduced if the driver already support any one of the existing frameworks.

Thanks,
Ram
\
 
 \ /
  Last update: 2013-01-07 06:42    [W:0.110 / U:0.104 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site