linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali.rohar@gmail.com>
To: Samuel Ortiz <sameo@linux.intel.com>, Anton Vorontsov <cbou@mail.ru>
Cc: linux-kernel@vger.kernel.org, "Pali Rohár" <pali.rohar@gmail.com>
Subject: [PATCH 2/2] power: rx51_battery: Fix reporting correct values
Date: Fri, 15 Feb 2013 23:56:50 +0100	[thread overview]
Message-ID: <1360969010-8571-2-git-send-email-pali.rohar@gmail.com> (raw)
In-Reply-To: <1360969010-8571-1-git-send-email-pali.rohar@gmail.com>

Tell twl4030_madc_conversion that this driver needs raw values.
Driver twl4030_madc has some hardcoded values and conversation
functions which are incorrect for Nokia RX-51 board. This driver
rx51_battery expects raw values which convert itself.

This patch fixing values reported by power supply interface.
Before this patch driver reported always incorrect values on
3.8 kernel (sometimes design capacity was negative).

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
---
 drivers/power/rx51_battery.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/power/rx51_battery.c b/drivers/power/rx51_battery.c
index 527d256..d1e17b0 100644
--- a/drivers/power/rx51_battery.c
+++ b/drivers/power/rx51_battery.c
@@ -42,6 +42,7 @@ static int rx51_battery_read_adc(int channel)
 	req.method = TWL4030_MADC_SW1;
 	req.func_cb = NULL;
 	req.type = TWL4030_MADC_WAIT;
+	req.raw = true;
 
 	if (twl4030_madc_conversion(&req) <= 0)
 		return -ENODATA;
-- 
1.7.10.4


  reply	other threads:[~2013-02-15 22:58 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-15 22:56 [PATCH 1/2] mfd: twl4030-madc: Add support for raw value in twl4030_madc_conversion Pali Rohár
2013-02-15 22:56 ` Pali Rohár [this message]
2013-02-16 21:39   ` [PATCH 2/2] power: rx51_battery: Fix reporting correct values Anton Vorontsov
2013-03-02 22:23 ` [PATCH 1/2] mfd: twl4030-madc: Add support for raw value in twl4030_madc_conversion Pali Rohár
2013-03-24 14:03   ` Pali Rohár
2013-04-04  9:32     ` Pali Rohár
2013-04-08 18:15       ` Tony Lindgren
2013-04-10 14:12         ` Pali Rohár
2013-04-10 17:00           ` Tony Lindgren
2013-04-04  9:38   ` Samuel Ortiz
2013-04-08 10:43     ` Pali Rohár
2013-03-02 23:16 ` Anton Vorontsov
2013-04-08 14:34 ` Samuel Ortiz

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=1360969010-8571-2-git-send-email-pali.rohar@gmail.com \
    --to=pali.rohar@gmail.com \
    --cc=cbou@mail.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sameo@linux.intel.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;
as well as URLs for NNTP newsgroup(s).