public inbox for linux-tegra@vger.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Reichel <sre-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Peter Rosin <peda-koto5C5qi+TLoDKTGw+V6w@public.gmane.org>,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: bq24735 charger and ac-detect
Date: Wed, 14 Dec 2016 15:59:51 +0100	[thread overview]
Message-ID: <20161214145951.uuoijetzat2bxmbv@earth> (raw)
In-Reply-To: <20161214142502.su4auesnlqmgxspv@earth>

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

Hi,

Ok, Darbha Sriharsha's mail address no longer works, so I Cc'd
linux-tegra instead. Maybe some of the people there have the
schematics for one of the Tegra boards using the bq24735 and/or
could check if charger presence detection actually works on
those boards with current mainline kernel.

-- Sebastian

On Wed, Dec 14, 2016 at 03:25:02PM +0100, Sebastian Reichel wrote:
> Hi Peter,
> 
> On Mon, Dec 12, 2016 at 12:12:47AM +0100, Peter Rosin wrote:
> > Hi!
> > 
> > I'm wondering about the dt bindings for the bq24735 charger. Specifically
> > the ac-detect property. The bindings say:
> 
> I don't have a device with bq24735 and the driver has been added
> before I was the maintainer of the power-supply subsystem.
> 
> >  - ti,ac-detect-gpios : This GPIO is optionally used to read the AC adapter
> >    presence. This is a Host GPIO that is configured as an input and
> >    connected to the bq24735.
> > 
> > The only way I can make sense of that is if this is the pin on the bq24735
> > that is named ACOK.
> 
> Yes. I would expect the same.
> 
> > But that pin is active high, and the code has this:
> > 
> > static bool bq24735_charger_is_present(struct bq24735 *charger)
> > {
> > 	if (charger->status_gpio)
> > 		return !gpiod_get_value_cansleep(charger->status_gpio);
> > ...
> > 
> > 
> > (status_gpio is what holds the gpio_desc of ac-detect)
> > 
> > In other words, the code seems to want a signal that is effectively
> > active low (the code negates the signal and thus returns "present"
> > when the signal is zero). The existing dts users all have active high
> > in their bindings, so it's not like they say active low to work around
> > the negation in the code...
> > 
> > This just makes no sense to me and I'm wondering what I'm missing and
> > what pin is really meant to be fed to ac-detect???
> > 
> > Yes, there is a pin on the bq24735 that is named ACDET which seems like
> > a good match, but that is a signal that is entering the bq24735. And it
> > is also active high, at least the way I read it so the problem persists...
> > 
> > Cheers,
> > Peter
> 
> As far as I can see all current users are Tegra boards and the
> driver is also from Nvidia, so let's ask them directly. I guess
> the driver was ported incorrectly and the "!" should be removed.
> 
> -- Sebastian



[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

       reply	other threads:[~2016-12-14 14:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <d796f6f9-1b6a-647c-100b-b3e85fc2f4c0@axentia.se>
     [not found] ` <20161214142502.su4auesnlqmgxspv@earth>
2016-12-14 14:59   ` Sebastian Reichel [this message]
2016-12-14 17:22     ` bq24735 charger and ac-detect Jon Hunter
2016-12-14 17:54     ` Jon Hunter
2016-12-14 21:22       ` Peter Rosin
     [not found]         ` <84ede737-9e4c-b0ba-5a37-a96a7e86c3ec-koto5C5qi+TLoDKTGw+V6w@public.gmane.org>
2016-12-15 10:45           ` Jon Hunter
     [not found]             ` <21e09552-96b9-fb72-60be-7a4b9347b761-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-12-15 12:04               ` Peter Rosin
2016-12-15 14:04                 ` Jon Hunter
     [not found]                   ` <721122dd-dda8-1830-9224-40b5ed79e463-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
2016-12-15 14:07                     ` Jon Hunter
2016-12-15 15:34                     ` Peter Rosin
     [not found]                       ` <1316ab3d-8a75-6a03-e1d0-7dee55f2c90f-koto5C5qi+TLoDKTGw+V6w@public.gmane.org>
2016-12-15 16:10                         ` Jon Hunter

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=20161214145951.uuoijetzat2bxmbv@earth \
    --to=sre-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=peda-koto5C5qi+TLoDKTGw+V6w@public.gmane.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox