public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
From: Michael Buesch <mb@bu3sch.de>
To: Tony Lindgren <tony@atomide.com>
Cc: linux-omap <linux-omap@vger.kernel.org>, Felipe Balbi <balbi@ti.com>
Subject: [PATCH] cbus-tahvo: Add battery related register defines
Date: Sat, 26 Feb 2011 00:23:24 +0100	[thread overview]
Message-ID: <1298676204.27500.9.camel@marge> (raw)

This adds battery related register defines to the tahvo driver.

Signed-off-by: Michael Buesch <mb@bu3sch.de>

---

The knowledge originates from various reverse engineering efforts.
So naming might differ from the original unreleased documentation.

Index: linux-omap-2.6/drivers/cbus/tahvo.h
===================================================================
--- linux-omap-2.6.orig/drivers/cbus/tahvo.h	2011-02-26 00:12:47.660828705 +0100
+++ linux-omap-2.6/drivers/cbus/tahvo.h	2011-02-26 00:12:52.757873087 +0100
@@ -30,12 +30,23 @@
 #define TAHVO_REG_IDR		0x01	/* Interrupt ID */
 #define TAHVO_REG_IDSR		0x02	/* Interrupt status */
 #define TAHVO_REG_IMR		0x03	/* Interrupt mask */
+#define TAHVO_REG_CHGCURR	0x04	/* Charge current control PWM (8-bit) */
 #define TAHVO_REG_LEDPWMR	0x05	/* LED PWM */
 #define TAHVO_REG_USBR		0x06	/* USB control */
+#define TAHVO_REG_CHGCTL	0x08	/* Charge control register */
+#define  TAHVO_REG_CHGCTL_EN		0x0001	/* Global charge enable */
+#define  TAHVO_REG_CHGCTL_PWMOVR	0x0004	/* PWM override. Force charge PWM to 0%/100% duty cycle. */
+#define  TAHVO_REG_CHGCTL_PWMOVRZERO	0x0008	/* If set, PWM override is 0% (If unset -> 100%) */
+#define  TAHVO_REG_CHGCTL_CURMEAS	0x0040	/* Enable battery current measurement. */
+#define  TAHVO_REG_CHGCTL_CURTIMRST	0x0080	/* Current measure timer reset. */
+#define TAHVO_REG_BATCURRTIMER	0x0c	/* Battery current measure timer (8-bit) */
+#define TAHVO_REG_BATCURR	0x0d	/* Battery (dis)charge current (signed 16-bit) */
+
 #define TAHVO_REG_MAX		0x0d
 
 /* Interrupt sources */
 #define TAHVO_INT_VBUSON	0
+#define TAHVO_INT_BATCURR	7 /* Battery current measure timer */
 
 #define MAX_TAHVO_IRQ_HANDLERS	8
 



             reply	other threads:[~2011-02-25 23:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-25 23:23 Michael Buesch [this message]
2011-02-28  8:32 ` [PATCH] cbus-tahvo: Add battery related register defines Felipe Balbi

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=1298676204.27500.9.camel@marge \
    --to=mb@bu3sch.de \
    --cc=balbi@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=tony@atomide.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