rtc-max6902.c (e5451c8f8330e03ad3cfa16048b4daf961af434f) rtc-max6902.c (22652ba72453d35c8a637d5c0f06b3dc29ff9eb0)
1/* drivers/rtc/rtc-max6902.c
2 *
3 * Copyright (C) 2006 8D Technologies inc.
4 * Copyright (C) 2004 Compulab Ltd.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.

--- 71 unchanged lines hidden (view full) ---

80 if (err != 0)
81 return err;
82
83 century = bcd2bin(buf[0]) * 100;
84
85 dt->tm_year += century;
86 dt->tm_year -= 1900;
87
1/* drivers/rtc/rtc-max6902.c
2 *
3 * Copyright (C) 2006 8D Technologies inc.
4 * Copyright (C) 2004 Compulab Ltd.
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.

--- 71 unchanged lines hidden (view full) ---

80 if (err != 0)
81 return err;
82
83 century = bcd2bin(buf[0]) * 100;
84
85 dt->tm_year += century;
86 dt->tm_year -= 1900;
87
88 return rtc_valid_tm(dt);
88 return 0;
89}
90
91static int max6902_set_time(struct device *dev, struct rtc_time *dt)
92{
93 dt->tm_year = dt->tm_year + 1900;
94
95 /* Remove write protection */
96 max6902_set_reg(dev, MAX6902_REG_CONTROL, 0);

--- 62 unchanged lines hidden ---
89}
90
91static int max6902_set_time(struct device *dev, struct rtc_time *dt)
92{
93 dt->tm_year = dt->tm_year + 1900;
94
95 /* Remove write protection */
96 max6902_set_reg(dev, MAX6902_REG_CONTROL, 0);

--- 62 unchanged lines hidden ---