The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: linux-kernel@vger.kernel.org
Cc: David Woodhouse <dwmw2@infradead.org>,
	Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>,
	"Mark A. Greer" <mgreer@animalcreek.com>
Subject: bq24190: What's the correct API to turn boost mode (OTG) on for the battery charger ?
Date: Thu, 15 May 2014 22:29:26 +0200	[thread overview]
Message-ID: <2044381.o3QyvTfyIx@avalon> (raw)

Hello,

I'm trying to enable battery charging on an OMAP4 board based on a twl6030 
PMIC with external bq24190 battery charger and bq27510 fuel gauge.

The system has an OTG USB port that can be used to charge the battery, and 
that can also be used in host mode. In that case the bq24190 needs to be 
switched to boost mode to provide the +5V power supply from the battery.

The bq24190 has a charge configuration register field that supports charge 
disabled, charge enabled and OTG (boost mode). The field is set by the bq24190 
driver in response to setting the charge type : POWER_SUPPLY_CHARGE_TYPE_NONE 
will disable charing, and POWER_SUPPLY_CHARGE_TYPE_TRICKLE and 
POWER_SUPPLY_CHARGE_TYPE_FAST will enable it. However, OTG boost mode is not 
supported.

The driver exposes most register fields as sysfs attributes (which doesn't 
sound very safe to me, but that's another story). I can thus enable OTG boost 
mode directly from userspace through the driver-specific API, but that just 
bypasses the power supply API. I'm thus not very fond of that solution.

Possibly due to my really basic (not to say nonexistent) knowledge of the 
power supply subsystem I haven't found an API to expose this feature. I was 
wondering if someone had given a though regarding how to implement this 
properly.

-- 
Regards,

Laurent Pinchart


             reply	other threads:[~2014-05-15 20:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-15 20:29 Laurent Pinchart [this message]
2014-05-15 22:08 ` bq24190: What's the correct API to turn boost mode (OTG) on for the battery charger ? Mark A. Greer
2014-05-15 22:35   ` Laurent Pinchart
2014-05-21 18:25     ` Mark A. Greer
2014-05-21 18:32       ` Mark A. Greer
2014-05-21 19:01       ` Mark A. Greer

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=2044381.o3QyvTfyIx@avalon \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=dbaryshkov@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mgreer@animalcreek.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox