drivers/rtc/rtc-isl1208.c | 357 +++++++++++++++++++++-------------------------
1 file changed, 170 insertions(+), 187 deletions(-)
-Index: linux-2.6.25.4/drivers/rtc/rtc-isl1208.c
-===================================================================
---- linux-2.6.25.4.orig/drivers/rtc/rtc-isl1208.c
-+++ linux-2.6.25.4/drivers/rtc/rtc-isl1208.c
+--- a/drivers/rtc/rtc-isl1208.c
++++ b/drivers/rtc/rtc-isl1208.c
@@ -15,16 +15,15 @@
#include <linux/bcd.h>
#include <linux/rtc.h>
BUG_ON(reg > ISL1208_REG_USR2);
BUG_ON(reg + len > ISL1208_REG_USR2 + 1);
-@@ -103,15 +84,14 @@ isl1208_i2c_read_regs(struct i2c_client
+@@ -103,15 +84,14 @@
/* block write */
static int
isl1208_i2c_set_regs(struct i2c_client *client, u8 reg, u8 const buf[],
BUG_ON(reg > ISL1208_REG_USR2);
BUG_ON(reg + len > ISL1208_REG_USR2 + 1);
-@@ -125,7 +105,8 @@ isl1208_i2c_set_regs(struct i2c_client *
+@@ -125,7 +105,8 @@
}
/* simple check to see wether we have a isl1208 */
{
u8 regs[ISL1208_RTC_SECTION_LEN] = { 0, };
u8 zero_mask[ISL1208_RTC_SECTION_LEN] = {
-@@ -139,24 +120,29 @@ static int isl1208_i2c_validate_client(s
+@@ -139,24 +120,29 @@
return ret;
for (i = 0; i < ISL1208_RTC_SECTION_LEN; ++i) {
/* The 6bit value in the ATR register controls the load
* capacitance C_load * in steps of 0.25pF
-@@ -169,51 +155,54 @@ static int isl1208_i2c_get_atr(struct i2
+@@ -169,51 +155,54 @@
*
*/
{
struct i2c_client *const client = to_i2c_client(dev);
int sr, dtr, atr, usr;
-@@ -230,20 +219,19 @@ static int isl1208_rtc_proc(struct devic
+@@ -230,20 +219,19 @@
(sr & ISL1208_REG_SR_ALM) ? " ALM" : "",
(sr & ISL1208_REG_SR_WRTC) ? " WRTC" : "",
(sr & ISL1208_REG_SR_XTOSCB) ? " XTOSCB" : "",
usr = isl1208_i2c_get_usr(client);
if (usr >= 0)
-@@ -252,9 +240,8 @@ static int isl1208_rtc_proc(struct devic
+@@ -252,9 +240,8 @@
return 0;
}
{
int sr;
u8 regs[ISL1208_RTC_SECTION_LEN] = { 0, };
-@@ -274,27 +261,30 @@ static int isl1208_i2c_read_time(struct
+@@ -274,27 +261,30 @@
tm->tm_sec = BCD2BIN(regs[ISL1208_REG_SC]);
tm->tm_min = BCD2BIN(regs[ISL1208_REG_MN]);
{
struct rtc_time *const tm = &alarm->time;
u8 regs[ISL1208_ALARM_SECTION_LEN] = { 0, };
-@@ -307,7 +297,7 @@ static int isl1208_i2c_read_alarm(struct
+@@ -307,7 +297,7 @@
}
sr = isl1208_i2c_read_regs(client, ISL1208_REG_SCA, regs,
if (sr < 0) {
dev_err(&client->dev, "%s: reading alarm section failed\n",
__func__);
-@@ -315,23 +305,25 @@ static int isl1208_i2c_read_alarm(struct
+@@ -315,23 +305,25 @@
}
/* MSB of each alarm register is an enable bit */
{
int sr;
u8 regs[ISL1208_RTC_SECTION_LEN] = { 0, };
-@@ -353,7 +345,7 @@ static int isl1208_i2c_set_time(struct i
+@@ -353,7 +345,7 @@
}
/* set WRTC */
sr | ISL1208_REG_SR_WRTC);
if (sr < 0) {
dev_err(&client->dev, "%s: writing SR failed\n", __func__);
-@@ -369,7 +361,7 @@ static int isl1208_i2c_set_time(struct i
+@@ -369,7 +361,7 @@
}
/* clear WRTC again */
sr & ~ISL1208_REG_SR_WRTC);
if (sr < 0) {
dev_err(&client->dev, "%s: writing SR failed\n", __func__);
-@@ -380,70 +372,69 @@ static int isl1208_i2c_set_time(struct i
+@@ -380,70 +372,69 @@
}
{
int usr = -1;
-@@ -460,124 +451,116 @@ static ssize_t isl1208_sysfs_store_usr(s
+@@ -460,124 +451,116 @@
return isl1208_i2c_set_usr(to_i2c_client(dev), usr) ? -EIO : count;
}