All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
To: Jeppe Ledet-Pedersen <jlp@gomspace.com>
Cc: Rob Herring <robh@kernel.org>,
	lee.jones@linaro.org, arnd@arndb.de, gregkh@linuxfoundation.org,
	a.zummo@towertech.it, pawel.moll@arm.com, mark.rutland@arm.com,
	ijc+devicetree@hellion.org.uk, galak@codeaurora.org,
	rtc-linux@googlegroups.com, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] mfd: add Cypress FM33256B Processor Companion driver
Date: Tue, 3 May 2016 10:14:18 +0200	[thread overview]
Message-ID: <20160503081418.GC2335@piout.net> (raw)
In-Reply-To: <571F7BD2.60201@gomspace.com>

On 26/04/2016 at 16:31:46 +0200, Jeppe Ledet-Pedersen wrote :
> > Good catch, I didn't look at this patch but it includes a lot of code
> > that should be going to the RTC driver.
> > If trickle charging is not enabled, I guess the RTC will not charge its
> > backup battery.
> 
> Thank you for the comments.
> 
> Alexandre is correct. If the "cypress,charge-enabled" property is
> present, the internal 80 uA trickle charger is enabled to charge a
> backup capacitor on the VBAK pin.
> 
> Do you want more code than the trickle charger setup moved to the RTC
> driver?
> 

I guess the 32k oscillator could go in the rtc driver too.

> >>> +- cypress,charge-fast: enable fast (1 mA) charging
> >>
> >> What does fast mean?
> >>
> 
> Fast charging means charging with 1 mA instead of 80 uA. The wording is
> from the datasheet, but I agree it should be renamed to something that
> better explains what the difference is.
> 
> >> I think it is time for a common binding here. There's all sorts of 
> >> variations on setting the charge current in bindings. Add something like 
> >> "charge-current-microamp" in power_supply.txt and use it here. Then 
> >> 1000uA implies "fast charge".
> > 
> > Well, this is not a power supply, it is an RTC.
> > 
> > I think both properties should got to the RTC subdevice and be parsed in
> > the RTC driver.
> 
> The backup capacitor is primarily used to supply current to the RTC, but
> a couple of other registers are also battery-backed (watchdog reset
> cause, event counter), so I put the charger setup in the main MFD file.
> 
> If you prefer, I can move them both to the RTC driver?

I would prefer unless you think that many people are not using the RTC
while still using the watchdog (I'd say that is not the case).

> 
> > Note that for trickle charging, we currently have the following
> > properties:
> >  - trickle-resistor-ohms
> >  - trickle-diode-disable
> >  - abracon,tc-diode
> >  - abracon,tc-resistor
> > 
> > abracon,tc-resistor can be replaced by trickle-resistor-ohms, I'll make
> > a patch but abracon,tc-diode allows to select a diode type (and in
> > particular a voltage drop).
> > 
> > I think we could add a trickle-current-microamp like you suggested and
> > trickle-diode-disable can be reused.
> 
> So replace "cypress,charge-enabled/charge-fast" with
> "trickle-current-microamp" and a check for 0/80/1000 uA?
> 

Yeah, seems fine.

-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

WARNING: multiple messages have this Message-ID (diff)
From: Alexandre Belloni <alexandre.belloni@free-electrons.com>
To: Jeppe Ledet-Pedersen <jlp@gomspace.com>
Cc: Rob Herring <robh@kernel.org>,
	lee.jones@linaro.org, arnd@arndb.de, gregkh@linuxfoundation.org,
	a.zummo@towertech.it, pawel.moll@arm.com, mark.rutland@arm.com,
	ijc+devicetree@hellion.org.uk, galak@codeaurora.org,
	rtc-linux@googlegroups.com, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [rtc-linux] Re: [PATCH 1/3] mfd: add Cypress FM33256B Processor Companion driver
Date: Tue, 3 May 2016 10:14:18 +0200	[thread overview]
Message-ID: <20160503081418.GC2335@piout.net> (raw)
In-Reply-To: <571F7BD2.60201@gomspace.com>

On 26/04/2016 at 16:31:46 +0200, Jeppe Ledet-Pedersen wrote :
> > Good catch, I didn't look at this patch but it includes a lot of code
> > that should be going to the RTC driver.
> > If trickle charging is not enabled, I guess the RTC will not charge its
> > backup battery.
> 
> Thank you for the comments.
> 
> Alexandre is correct. If the "cypress,charge-enabled" property is
> present, the internal 80 uA trickle charger is enabled to charge a
> backup capacitor on the VBAK pin.
> 
> Do you want more code than the trickle charger setup moved to the RTC
> driver?
> 

I guess the 32k oscillator could go in the rtc driver too.

> >>> +- cypress,charge-fast: enable fast (1 mA) charging
> >>
> >> What does fast mean?
> >>
> 
> Fast charging means charging with 1 mA instead of 80 uA. The wording is
> from the datasheet, but I agree it should be renamed to something that
> better explains what the difference is.
> 
> >> I think it is time for a common binding here. There's all sorts of 
> >> variations on setting the charge current in bindings. Add something like 
> >> "charge-current-microamp" in power_supply.txt and use it here. Then 
> >> 1000uA implies "fast charge".
> > 
> > Well, this is not a power supply, it is an RTC.
> > 
> > I think both properties should got to the RTC subdevice and be parsed in
> > the RTC driver.
> 
> The backup capacitor is primarily used to supply current to the RTC, but
> a couple of other registers are also battery-backed (watchdog reset
> cause, event counter), so I put the charger setup in the main MFD file.
> 
> If you prefer, I can move them both to the RTC driver?

I would prefer unless you think that many people are not using the RTC
while still using the watchdog (I'd say that is not the case).

> 
> > Note that for trickle charging, we currently have the following
> > properties:
> >  - trickle-resistor-ohms
> >  - trickle-diode-disable
> >  - abracon,tc-diode
> >  - abracon,tc-resistor
> > 
> > abracon,tc-resistor can be replaced by trickle-resistor-ohms, I'll make
> > a patch but abracon,tc-diode allows to select a diode type (and in
> > particular a voltage drop).
> > 
> > I think we could add a trickle-current-microamp like you suggested and
> > trickle-diode-disable can be reused.
> 
> So replace "cypress,charge-enabled/charge-fast" with
> "trickle-current-microamp" and a check for 0/80/1000 uA?
> 

Yeah, seems fine.

-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

-- 
-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

WARNING: multiple messages have this Message-ID (diff)
From: Alexandre Belloni <alexandre.belloni-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
To: Jeppe Ledet-Pedersen <jlp-jTq9jD7AHYRWk0Htik3J/w@public.gmane.org>
Cc: Rob Herring <robh-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	lee.jones-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org,
	arnd-r2nGTMty4D4@public.gmane.org,
	gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org,
	a.zummo-BfzFCNDTiLLj+vYz1yj4TQ@public.gmane.org,
	pawel.moll-5wv7dgnIgG8@public.gmane.org,
	mark.rutland-5wv7dgnIgG8@public.gmane.org,
	ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg@public.gmane.org,
	galak-sgV2jX0FEOL9JmXXK+q4OQ@public.gmane.org,
	rtc-linux-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org,
	devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 1/3] mfd: add Cypress FM33256B Processor Companion driver
Date: Tue, 3 May 2016 10:14:18 +0200	[thread overview]
Message-ID: <20160503081418.GC2335@piout.net> (raw)
In-Reply-To: <571F7BD2.60201-jTq9jD7AHYRWk0Htik3J/w@public.gmane.org>

On 26/04/2016 at 16:31:46 +0200, Jeppe Ledet-Pedersen wrote :
> > Good catch, I didn't look at this patch but it includes a lot of code
> > that should be going to the RTC driver.
> > If trickle charging is not enabled, I guess the RTC will not charge its
> > backup battery.
> 
> Thank you for the comments.
> 
> Alexandre is correct. If the "cypress,charge-enabled" property is
> present, the internal 80 uA trickle charger is enabled to charge a
> backup capacitor on the VBAK pin.
> 
> Do you want more code than the trickle charger setup moved to the RTC
> driver?
> 

I guess the 32k oscillator could go in the rtc driver too.

> >>> +- cypress,charge-fast: enable fast (1 mA) charging
> >>
> >> What does fast mean?
> >>
> 
> Fast charging means charging with 1 mA instead of 80 uA. The wording is
> from the datasheet, but I agree it should be renamed to something that
> better explains what the difference is.
> 
> >> I think it is time for a common binding here. There's all sorts of 
> >> variations on setting the charge current in bindings. Add something like 
> >> "charge-current-microamp" in power_supply.txt and use it here. Then 
> >> 1000uA implies "fast charge".
> > 
> > Well, this is not a power supply, it is an RTC.
> > 
> > I think both properties should got to the RTC subdevice and be parsed in
> > the RTC driver.
> 
> The backup capacitor is primarily used to supply current to the RTC, but
> a couple of other registers are also battery-backed (watchdog reset
> cause, event counter), so I put the charger setup in the main MFD file.
> 
> If you prefer, I can move them both to the RTC driver?

I would prefer unless you think that many people are not using the RTC
while still using the watchdog (I'd say that is not the case).

> 
> > Note that for trickle charging, we currently have the following
> > properties:
> >  - trickle-resistor-ohms
> >  - trickle-diode-disable
> >  - abracon,tc-diode
> >  - abracon,tc-resistor
> > 
> > abracon,tc-resistor can be replaced by trickle-resistor-ohms, I'll make
> > a patch but abracon,tc-diode allows to select a diode type (and in
> > particular a voltage drop).
> > 
> > I think we could add a trickle-current-microamp like you suggested and
> > trickle-diode-disable can be reused.
> 
> So replace "cypress,charge-enabled/charge-fast" with
> "trickle-current-microamp" and a check for 0/80/1000 uA?
> 

Yeah, seems fine.

-- 
Alexandre Belloni, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2016-05-03  8:14 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-20 11:07 [PATCH 0/3] Cypress FM33256B processor companion support Jeppe Ledet-Pedersen
2016-04-20 11:07 ` Jeppe Ledet-Pedersen
2016-04-20 11:07 ` [rtc-linux] " Jeppe Ledet-Pedersen
2016-04-20 11:07 ` [PATCH 1/3] mfd: add Cypress FM33256B Processor Companion driver Jeppe Ledet-Pedersen
2016-04-20 11:07   ` Jeppe Ledet-Pedersen
2016-04-20 11:07   ` [rtc-linux] " Jeppe Ledet-Pedersen
2016-04-22  0:47   ` kbuild test robot
2016-04-22  0:47     ` kbuild test robot
2016-04-22  0:47     ` [rtc-linux] " kbuild test robot
2016-04-22 19:32   ` Rob Herring
2016-04-22 19:32     ` Rob Herring
2016-04-22 19:32     ` [rtc-linux] " Rob Herring
2016-04-22 20:11     ` Alexandre Belloni
2016-04-22 20:11       ` [rtc-linux] " Alexandre Belloni
2016-04-26 14:31       ` Jeppe Ledet-Pedersen
2016-04-26 14:31         ` Jeppe Ledet-Pedersen
2016-04-26 14:31         ` [rtc-linux] " Jeppe Ledet-Pedersen
2016-05-03  8:14         ` Alexandre Belloni [this message]
2016-05-03  8:14           ` Alexandre Belloni
2016-05-03  8:14           ` [rtc-linux] " Alexandre Belloni
2016-04-26 14:42     ` Jeppe Ledet-Pedersen
2016-04-26 14:42       ` Jeppe Ledet-Pedersen
2016-04-26 14:42       ` [rtc-linux] " Jeppe Ledet-Pedersen
2016-04-20 11:07 ` [PATCH 2/3] misc: eeprom: add Cypress FM33256B FRAM driver Jeppe Ledet-Pedersen
2016-04-20 11:07   ` Jeppe Ledet-Pedersen
2016-04-20 11:07   ` [rtc-linux] " Jeppe Ledet-Pedersen
2016-04-21 23:54   ` Alexandre Belloni
2016-04-21 23:54     ` [rtc-linux] " Alexandre Belloni
2016-04-26 12:08     ` Jeppe Ledet-Pedersen
2016-04-26 12:08       ` Jeppe Ledet-Pedersen
2016-04-26 12:08       ` [rtc-linux] " Jeppe Ledet-Pedersen
2016-04-20 11:07 ` [PATCH 3/3] rtc: add Cypress FM33256B RTC driver Jeppe Ledet-Pedersen
2016-04-20 11:07   ` Jeppe Ledet-Pedersen
2016-04-20 11:07   ` [rtc-linux] " Jeppe Ledet-Pedersen
2016-04-21 23:44   ` Alexandre Belloni
2016-04-21 23:44     ` [rtc-linux] " Alexandre Belloni
2016-04-26 12:17     ` Jeppe Ledet-Pedersen
2016-04-26 12:17       ` Jeppe Ledet-Pedersen
2016-04-26 12:17       ` [rtc-linux] " Jeppe Ledet-Pedersen

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=20160503081418.GC2335@piout.net \
    --to=alexandre.belloni@free-electrons.com \
    --cc=a.zummo@towertech.it \
    --cc=arnd@arndb.de \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=jlp@gomspace.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=robh@kernel.org \
    --cc=rtc-linux@googlegroups.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 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.