+ rtc-ab8500-add-calibration-attribute-to-ab8500-rtc-v3.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: rtc-ab8500-add-calibration-attribute-to-ab8500-rtc-v3
has been added to the -mm tree.  Its filename is
     rtc-ab8500-add-calibration-attribute-to-ab8500-rtc-v3.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
From: Mark Godfrey <mark.godfrey@xxxxxxxxxxxxxx>
Subject: rtc-ab8500-add-calibration-attribute-to-ab8500-rtc-v3

ChangeLog v2->v3:
- back to square 1. 0x80 is not allowed because the representation
  is not two's complement but bit 7 is a sign bit, thus 0x80 is
  just another way to say "zero". Sorry for the mess, clarified this
  with a comment in the code.

Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@xxxxxxxxxxxx>
Signed-off-by: Mark Godfrey <mark.godfrey@xxxxxxxxxxxxxx>
Signed-off-by: Linus Walleij <linus.walleij@xxxxxxxxxxxxxx>
Cc: Alessandro Zummo <a.zummo@xxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 drivers/rtc/rtc-ab8500.c |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff -puN drivers/rtc/rtc-ab8500.c~rtc-ab8500-add-calibration-attribute-to-ab8500-rtc-v3 drivers/rtc/rtc-ab8500.c
--- a/drivers/rtc/rtc-ab8500.c~rtc-ab8500-add-calibration-attribute-to-ab8500-rtc-v3
+++ a/drivers/rtc/rtc-ab8500.c
@@ -265,8 +265,11 @@ static int ab8500_rtc_set_calibration(st
 	u8  rtccal = 0;
 
 	/*
-	 * Check that the calibration value (which is in units of 0.5 parts-per-million)
-	 * is in the AB8500's range for RtcCalibration register.
+	 * Check that the calibration value (which is in units of 0.5
+	 * parts-per-million) is in the AB8500's range for RtcCalibration
+	 * register. -128 (0x80) is not permitted because the AB8500 uses
+	 * a sign-bit rather than two's complement, so 0x80 is just another
+	 * representation of zero.
 	 */
 	if ((calibration < -127) || (calibration > 127)) {
 		dev_err(dev, "RtcCalibration value outside permitted range\n");
@@ -281,7 +284,7 @@ static int ab8500_rtc_set_calibration(st
 	if (calibration >= 0)
 		rtccal = 0x7F & calibration;
 	else
-		rtccal = ~(calibration - 1) | 0x80;
+		rtccal = ~(calibration -1) | 0x80;
 
 	retval = abx500_set_register_interruptible(dev, AB8500_RTC,
 			AB8500_RTC_CALIB_REG, rtccal);
_
Subject: Subject: rtc-ab8500-add-calibration-attribute-to-ab8500-rtc-v3

Patches currently in -mm which might be from mark.godfrey@xxxxxxxxxxxxxx are

rtc-ab8500-add-calibration-attribute-to-ab8500-rtc.patch
rtc-ab8500-add-calibration-attribute-to-ab8500-rtc-checkpatch-fixes.patch
rtc-ab8500-add-calibration-attribute-to-ab8500-rtc-v3.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux