devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: Trickle charging for rtc-bq32k
       [not found] ` <20140822142852.GA1545@katana>
@ 2014-08-22 14:38   ` Pavel Machek
  2014-09-02 11:51     ` Wolfram Sang
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Machek @ 2014-08-22 14:38 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: a.zummo-BfzFCNDTiLLj+vYz1yj4TQ, rtc-linux-/JYPxA39Uh5TLH3MbocFFw,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA

On Fri 2014-08-22 09:28:52, Wolfram Sang wrote:
> 
> > _But_ this should probably be enabled using device tree entry, right?
> > Unfortunately, the driver is i2c driver, not platform one, so I don't
> > see how to do that easily...
> 
> Trickle charging is usually depending on the hardware setup, so
> devicetree is actually a good place to put it. We'd just need generic
> bindings so that they could be applied to various RTC. Just guessing,
> resistor value would probably be one such property? We would not need
> putting plain register values into DT.

Well, for bq32000 there's selection between "no charging", "diode +
resistor", "different resistor".

> There should be no difference regarding DT between i2c and platform
> drivers.

Do you have example how to acces of_ from i2c driver?

Platform drivers do:

static int palmas_rtc_probe(struct platform_device *pdev)
{
        struct palmas *palmas = dev_get_drvdata(pdev->dev.parent);
        struct palmas_rtc *palmas_rtc = NULL;
	int ret;
        bool enable_bb_charging = false;
        bool high_bb_charging;

        if (pdev->dev.of_node) {
	   enable_bb_charging =
	   of_property_read_bool(pdev->dev.of_node,
                                        "ti,backup-battery-chargeable");
					        high_bb_charging =
	   of_property_read_bool(pdev->dev.of_node,
                                        "ti,backup-battery-charge-high-current");

Thanks,
									Pavel
-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Trickle charging for rtc-bq32k
  2014-08-22 14:38   ` Trickle charging for rtc-bq32k Pavel Machek
@ 2014-09-02 11:51     ` Wolfram Sang
  0 siblings, 0 replies; 2+ messages in thread
From: Wolfram Sang @ 2014-09-02 11:51 UTC (permalink / raw)
  To: Pavel Machek
  Cc: a.zummo-BfzFCNDTiLLj+vYz1yj4TQ, rtc-linux-/JYPxA39Uh5TLH3MbocFFw,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	linux-i2c-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA

[-- Attachment #1: Type: text/plain, Size: 238 bytes --]


> Do you have example how to acces of_ from i2c driver?
> 
> Platform drivers do:
> 
>         if (pdev->dev.of_node) {

As I said, this is basically the same. Just use the node from the
client's device. Nothing special here.


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-09-02 11:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20140822131150.GA26724@amd>
     [not found] ` <20140822142852.GA1545@katana>
2014-08-22 14:38   ` Trickle charging for rtc-bq32k Pavel Machek
2014-09-02 11:51     ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).