All of lore.kernel.org
 help / color / mirror / Atom feed
* bq24735 charger and ac-detect
@ 2016-12-11 23:12 Peter Rosin
  2016-12-14 14:25 ` Sebastian Reichel
  0 siblings, 1 reply; 12+ messages in thread
From: Peter Rosin @ 2016-12-11 23:12 UTC (permalink / raw)
  To: linux-pm, Sebastian Reichel

Hi!

I'm wondering about the dt bindings for the bq24735 charger. Specifically
the ac-detect property. The bindings say:

 - 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. 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

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

end of thread, other threads:[~2016-12-15 16:10 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-11 23:12 bq24735 charger and ac-detect Peter Rosin
2016-12-14 14:25 ` Sebastian Reichel
2016-12-14 14:59   ` Sebastian Reichel
2016-12-14 17:22     ` 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

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.