All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Krzysztof Kozłowski" <k.kozlowski.k@gmail.com>
To: Laurentiu Palcu <laurentiu.palcu@intel.com>
Cc: "Nicolae, Anda-maria" <anda-maria.nicolae@intel.com>,
	"sre@kernel.org" <sre@kernel.org>,
	"dbaryshkov@gmail.com" <dbaryshkov@gmail.com>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"pawel.moll@arm.com" <pawel.moll@arm.com>,
	"mark.rutland@arm.com" <mark.rutland@arm.com>,
	"ijc+devicetree@hellion.org.uk" <ijc+devicetree@hellion.org.uk>,
	"galak@codeaurora.org" <galak@codeaurora.org>,
	"dwmw2@infradead.org" <dwmw2@infradead.org>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Subject: Re: [PATCHv2] power_supply: Add support for Richtek rt9455 battery charger
Date: Tue, 5 May 2015 14:35:16 +0900	[thread overview]
Message-ID: <CAJKOXPezR=gb7mNyG4OpumYq+NEzyhh8DaWmi_5P4j-F76onjg@mail.gmail.com> (raw)
In-Reply-To: <20150504152209.GF10973@lpalcu-linux>

2015-05-05 0:22 GMT+09:00 Laurentiu Palcu <laurentiu.palcu@intel.com>:
> Hi Anda,
>
> Can you please use a decent mail client to reply to emails? It was
> really hard for me to figure out which were my comments and which were
> yours... And I tested 3 different clients: mutt, evolution and
> outlook(the web app).
>
> More comments inline.
>
> laurentiu
>
> On Mon, May 04, 2015 at 05:12:07PM +0300, Nicolae, Anda-maria wrote:

(...)

>> > +
>> (...)
>> > +
>> > +static int rt9455_charger_set_voltage_max(struct rt9455_info *info,
>> > +                                       const union power_supply_propval *val)
>> > +{
>> > +     return rt9455_set_field_val(info, F_VMREG,
>> > +                                 rt9455_vmreg_values,
>> > +                                 ARRAY_SIZE(rt9455_vmreg_values),
>> > +                                 val->intval);
>> > +}
>> > +
>> > +static int rt9455_charger_set_property(struct power_supply *psy,
>> > +                                    enum power_supply_property psp,
>> > +                                    const union power_supply_propval *val)
>> > +{
>> > +     struct rt9455_info *info = power_supply_get_drvdata(psy);
>> > +
>> > +     switch (psp) {
>> > +     case POWER_SUPPLY_PROP_CONSTANT_CHARGE_CURRENT:
>> > +             return rt9455_charger_set_current(info, val);
>> > +     case POWER_SUPPLY_PROP_CONSTANT_CHARGE_VOLTAGE:
>> > +             return rt9455_charger_set_voltage(info, val);
>> Personally, I'm against having these properties writable. A user might
>> play with the charging voltage or current and then complain that the
>> battery does not charge at all, or it takes ages to charge. I'd leave
>> these to be set by manufacturer through DT/ACPI. But, it's just an
>> opinion.
>>
>> If the user really wants to damage his/her battery, he/she can charge
>> the values from DT/ACPI.

No, the end user does not change the DT/ACPI. It just runs some Linux
distro or Android phone. The userspace does not change DT either. So
allowing userspace to set this through regular sysfs API is rather
exceptional.

>> Also, numerous charger drivers expose these
>> properties as writable.  I prefer leaving them as they are.

I found only one mainline driver which exposes these properties as
writeable: bq24190_charger.c. Others do not. Many other drivers uses
power supply class only as a reading interface. The charger is
actually operated through respective regulator driver.

Best regards,
Krzysztof

      reply	other threads:[~2015-05-05  5:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-29 20:13 [PATCHv2] power_supply: Add support for Richtek rt9455 battery charger Anda-Maria Nicolae
2015-04-29 20:13 ` Anda-Maria Nicolae
2015-04-30  7:53 ` Krzysztof Kozlowski
2015-05-04 12:48   ` Nicolae, Anda-maria
2015-04-30  9:16 ` Laurentiu Palcu
2015-05-04 14:12   ` Nicolae, Anda-maria
2015-05-04 15:22     ` Laurentiu Palcu
2015-05-05  5:35       ` Krzysztof Kozłowski [this message]

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='CAJKOXPezR=gb7mNyG4OpumYq+NEzyhh8DaWmi_5P4j-F76onjg@mail.gmail.com' \
    --to=k.kozlowski.k@gmail.com \
    --cc=anda-maria.nicolae@intel.com \
    --cc=dbaryshkov@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dwmw2@infradead.org \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=laurentiu.palcu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=sre@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.