rtc-max6902.c (c1f3ee120bb61045b1c0a3ead620d1d65af47130) | rtc-max6902.c (2a4e2b8780c6df42b19c053243dada7fa4d311ee) |
---|---|
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. --- 126 unchanged lines hidden (view full) --- 135 dt->tm_year = BCD2BIN(chip->buf[7]); 136 137 century = BCD2BIN(tmp) * 100; 138 139 dt->tm_year += century; 140 dt->tm_year -= 1900; 141 142#ifdef MAX6902_DEBUG | 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. --- 126 unchanged lines hidden (view full) --- 135 dt->tm_year = BCD2BIN(chip->buf[7]); 136 137 century = BCD2BIN(tmp) * 100; 138 139 dt->tm_year += century; 140 dt->tm_year -= 1900; 141 142#ifdef MAX6902_DEBUG |
143 printk("\n%s : Read RTC values\n",__FUNCTION__); | 143 printk("\n%s : Read RTC values\n",__func__); |
144 printk("tm_hour: %i\n",dt->tm_hour); 145 printk("tm_min : %i\n",dt->tm_min); 146 printk("tm_sec : %i\n",dt->tm_sec); 147 printk("tm_year: %i\n",dt->tm_year); 148 printk("tm_mon : %i\n",dt->tm_mon); 149 printk("tm_mday: %i\n",dt->tm_mday); 150 printk("tm_wday: %i\n",dt->tm_wday); 151#endif 152 153 return 0; 154} 155 156static int max6902_set_datetime(struct device *dev, struct rtc_time *dt) 157{ 158 dt->tm_year = dt->tm_year+1900; 159 160#ifdef MAX6902_DEBUG | 144 printk("tm_hour: %i\n",dt->tm_hour); 145 printk("tm_min : %i\n",dt->tm_min); 146 printk("tm_sec : %i\n",dt->tm_sec); 147 printk("tm_year: %i\n",dt->tm_year); 148 printk("tm_mon : %i\n",dt->tm_mon); 149 printk("tm_mday: %i\n",dt->tm_mday); 150 printk("tm_wday: %i\n",dt->tm_wday); 151#endif 152 153 return 0; 154} 155 156static int max6902_set_datetime(struct device *dev, struct rtc_time *dt) 157{ 158 dt->tm_year = dt->tm_year+1900; 159 160#ifdef MAX6902_DEBUG |
161 printk("\n%s : Setting RTC values\n",__FUNCTION__); | 161 printk("\n%s : Setting RTC values\n",__func__); |
162 printk("tm_sec : %i\n",dt->tm_sec); 163 printk("tm_min : %i\n",dt->tm_min); 164 printk("tm_hour: %i\n",dt->tm_hour); 165 printk("tm_mday: %i\n",dt->tm_mday); 166 printk("tm_wday: %i\n",dt->tm_wday); 167 printk("tm_year: %i\n",dt->tm_year); 168#endif 169 --- 110 unchanged lines hidden --- | 162 printk("tm_sec : %i\n",dt->tm_sec); 163 printk("tm_min : %i\n",dt->tm_min); 164 printk("tm_hour: %i\n",dt->tm_hour); 165 printk("tm_mday: %i\n",dt->tm_mday); 166 printk("tm_wday: %i\n",dt->tm_wday); 167 printk("tm_year: %i\n",dt->tm_year); 168#endif 169 --- 110 unchanged lines hidden --- |