mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Anton Vorontsov <anton@enomsg.org>
To: "Tc, Jenny" <jenny.tc@intel.com>
Cc: "Pallala, Ramakrishna" <ramakrishna.pallala@intel.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Myungjoo Ham <myungjoo.ham@samsung.com>
Subject: Re: [PATCH 1/2] power_supply: Add charge control struct in power supply class
Date: Sun, 6 Jan 2013 21:35:19 -0800	[thread overview]
Message-ID: <20130107053519.GA24341@lizard.gateway.2wire.net> (raw)
In-Reply-To: <20ADAB092842284E95860F279283C564E70A93@BGSMSX101.gar.corp.intel.com>

On Mon, Jan 07, 2013 at 05:23:36AM +0000, Tc, Jenny wrote:
> > 
> > > > +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.
> > 
> 
> Rama,
> 
> The similar functionalities are exposed by patch https://lkml.org/lkml/2012/10/18/219.
> As per Anton's review comments on this patch, I'll be moving the macros to power_supply.h.
> Wouldn't that be enough ?

Btw, how do these two sets relate to each other? Both seem to control
chargers in some way... But yours approach uses properties, which I like
more.

I guess you should coordinate on this?

Thanks,
Anton

  reply	other threads:[~2013-01-07  5:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-27  7:47 [PATCH 0/2] power supply class support for charger managers Ramakrishna Pallala
2012-11-27  7:47 ` [PATCH 1/2] power_supply: Add charge control struct in power supply class Ramakrishna Pallala
2013-01-06  2:50   ` Anton Vorontsov
2013-01-07  5:09     ` Pallala, Ramakrishna
2013-01-07  5:23       ` Tc, Jenny
2013-01-07  5:35         ` Anton Vorontsov [this message]
2013-01-07  5:47           ` Pallala, Ramakrishna
2013-01-07  5:43         ` Pallala, Ramakrishna
2013-01-07  6:11           ` Anton Vorontsov
2012-11-27  7:47 ` [PATCHv2 2/2] charger_manager: Enable power supply driver support for charge controls Ramakrishna Pallala
  -- strict thread matches above, loose matches on Subject: below --
2012-11-27  7:39 [PATCH 0/2] power supply class support for charger managers Ramakrishna Pallala
2012-11-27  7:39 ` [PATCH 1/2] power_supply: Add charge control struct in power supply class Ramakrishna Pallala

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130107053519.GA24341@lizard.gateway.2wire.net \
    --to=anton@enomsg.org \
    --cc=jenny.tc@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=myungjoo.ham@samsung.com \
    --cc=ramakrishna.pallala@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®