Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * linux/drivers/i2c/chips/ds1337.c |
| 3 | * |
| 4 | * Copyright (C) 2005 James Chapman <jchapman@katalix.com> |
| 5 | * |
Ladislav Michl | 3e9d0ba | 2005-04-08 15:00:21 +0200 | [diff] [blame] | 6 | * based on linux/drivers/acorn/char/pcf8583.c |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 7 | * Copyright (C) 2000 Russell King |
| 8 | * |
| 9 | * This program is free software; you can redistribute it and/or modify |
| 10 | * it under the terms of the GNU General Public License version 2 as |
| 11 | * published by the Free Software Foundation. |
| 12 | * |
Ladislav Michl | 912b9c0 | 2005-05-10 14:08:04 +0200 | [diff] [blame] | 13 | * Driver for Dallas Semiconductor DS1337 and DS1339 real time clock chip |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 14 | */ |
| 15 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 16 | #include <linux/module.h> |
| 17 | #include <linux/init.h> |
| 18 | #include <linux/slab.h> |
| 19 | #include <linux/i2c.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 20 | #include <linux/string.h> |
| 21 | #include <linux/rtc.h> /* get the user-level API */ |
| 22 | #include <linux/bcd.h> |
| 23 | #include <linux/list.h> |
| 24 | |
| 25 | /* Device registers */ |
| 26 | #define DS1337_REG_HOUR 2 |
| 27 | #define DS1337_REG_DAY 3 |
| 28 | #define DS1337_REG_DATE 4 |
| 29 | #define DS1337_REG_MONTH 5 |
| 30 | #define DS1337_REG_CONTROL 14 |
| 31 | #define DS1337_REG_STATUS 15 |
| 32 | |
| 33 | /* FIXME - how do we export these interface constants? */ |
| 34 | #define DS1337_GET_DATE 0 |
| 35 | #define DS1337_SET_DATE 1 |
| 36 | |
| 37 | /* |
| 38 | * Functions declaration |
| 39 | */ |
| 40 | static unsigned short normal_i2c[] = { 0x68, I2C_CLIENT_END }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 41 | |
Jean Delvare | f4b5026 | 2005-07-31 21:49:03 +0200 | [diff] [blame] | 42 | I2C_CLIENT_INSMOD_1(ds1337); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 43 | |
| 44 | static int ds1337_attach_adapter(struct i2c_adapter *adapter); |
| 45 | static int ds1337_detect(struct i2c_adapter *adapter, int address, int kind); |
| 46 | static void ds1337_init_client(struct i2c_client *client); |
| 47 | static int ds1337_detach_client(struct i2c_client *client); |
| 48 | static int ds1337_command(struct i2c_client *client, unsigned int cmd, |
| 49 | void *arg); |
| 50 | |
| 51 | /* |
| 52 | * Driver data (common to all clients) |
| 53 | */ |
| 54 | static struct i2c_driver ds1337_driver = { |
| 55 | .owner = THIS_MODULE, |
| 56 | .name = "ds1337", |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 57 | .attach_adapter = ds1337_attach_adapter, |
| 58 | .detach_client = ds1337_detach_client, |
| 59 | .command = ds1337_command, |
| 60 | }; |
| 61 | |
| 62 | /* |
| 63 | * Client data (each client gets its own) |
| 64 | */ |
| 65 | struct ds1337_data { |
| 66 | struct i2c_client client; |
| 67 | struct list_head list; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 68 | }; |
| 69 | |
| 70 | /* |
| 71 | * Internal variables |
| 72 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 73 | static LIST_HEAD(ds1337_clients); |
| 74 | |
| 75 | static inline int ds1337_read(struct i2c_client *client, u8 reg, u8 *value) |
| 76 | { |
| 77 | s32 tmp = i2c_smbus_read_byte_data(client, reg); |
| 78 | |
| 79 | if (tmp < 0) |
| 80 | return -EIO; |
| 81 | |
| 82 | *value = tmp; |
| 83 | |
| 84 | return 0; |
| 85 | } |
| 86 | |
| 87 | /* |
| 88 | * Chip access functions |
| 89 | */ |
| 90 | static int ds1337_get_datetime(struct i2c_client *client, struct rtc_time *dt) |
| 91 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 92 | int result; |
| 93 | u8 buf[7]; |
| 94 | u8 val; |
| 95 | struct i2c_msg msg[2]; |
| 96 | u8 offs = 0; |
| 97 | |
| 98 | if (!dt) { |
Ladislav Michl | d01b79d | 2005-04-08 15:06:39 +0200 | [diff] [blame] | 99 | dev_dbg(&client->dev, "%s: EINVAL: dt=NULL\n", __FUNCTION__); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 100 | return -EINVAL; |
| 101 | } |
| 102 | |
| 103 | msg[0].addr = client->addr; |
| 104 | msg[0].flags = 0; |
| 105 | msg[0].len = 1; |
| 106 | msg[0].buf = &offs; |
| 107 | |
| 108 | msg[1].addr = client->addr; |
| 109 | msg[1].flags = I2C_M_RD; |
| 110 | msg[1].len = sizeof(buf); |
| 111 | msg[1].buf = &buf[0]; |
| 112 | |
Ladislav Michl | 3e9d0ba | 2005-04-08 15:00:21 +0200 | [diff] [blame] | 113 | result = i2c_transfer(client->adapter, msg, 2); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 114 | |
Ladislav Michl | d01b79d | 2005-04-08 15:06:39 +0200 | [diff] [blame] | 115 | dev_dbg(&client->dev, "%s: [%d] %02x %02x %02x %02x %02x %02x %02x\n", |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 116 | __FUNCTION__, result, buf[0], buf[1], buf[2], buf[3], |
| 117 | buf[4], buf[5], buf[6]); |
| 118 | |
Ladislav Michl | 0058824 | 2005-05-04 08:13:54 +0200 | [diff] [blame] | 119 | if (result == 2) { |
Ladislav Michl | 6069ffd | 2005-04-08 15:02:16 +0200 | [diff] [blame] | 120 | dt->tm_sec = BCD2BIN(buf[0]); |
| 121 | dt->tm_min = BCD2BIN(buf[1]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 122 | val = buf[2] & 0x3f; |
Ladislav Michl | 6069ffd | 2005-04-08 15:02:16 +0200 | [diff] [blame] | 123 | dt->tm_hour = BCD2BIN(val); |
| 124 | dt->tm_wday = BCD2BIN(buf[3]) - 1; |
| 125 | dt->tm_mday = BCD2BIN(buf[4]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 126 | val = buf[5] & 0x7f; |
Ladislav Michl | 0b46e33 | 2005-05-04 08:13:13 +0200 | [diff] [blame] | 127 | dt->tm_mon = BCD2BIN(val) - 1; |
| 128 | dt->tm_year = BCD2BIN(buf[6]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 129 | if (buf[5] & 0x80) |
| 130 | dt->tm_year += 100; |
| 131 | |
Ladislav Michl | d01b79d | 2005-04-08 15:06:39 +0200 | [diff] [blame] | 132 | dev_dbg(&client->dev, "%s: secs=%d, mins=%d, " |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 133 | "hours=%d, mday=%d, mon=%d, year=%d, wday=%d\n", |
| 134 | __FUNCTION__, dt->tm_sec, dt->tm_min, |
| 135 | dt->tm_hour, dt->tm_mday, |
| 136 | dt->tm_mon, dt->tm_year, dt->tm_wday); |
Ladislav Michl | 0058824 | 2005-05-04 08:13:54 +0200 | [diff] [blame] | 137 | |
| 138 | return 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 139 | } |
| 140 | |
Ladislav Michl | 0058824 | 2005-05-04 08:13:54 +0200 | [diff] [blame] | 141 | dev_err(&client->dev, "error reading data! %d\n", result); |
| 142 | return -EIO; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 143 | } |
| 144 | |
| 145 | static int ds1337_set_datetime(struct i2c_client *client, struct rtc_time *dt) |
| 146 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 147 | int result; |
| 148 | u8 buf[8]; |
| 149 | u8 val; |
| 150 | struct i2c_msg msg[1]; |
| 151 | |
| 152 | if (!dt) { |
Ladislav Michl | d01b79d | 2005-04-08 15:06:39 +0200 | [diff] [blame] | 153 | dev_dbg(&client->dev, "%s: EINVAL: dt=NULL\n", __FUNCTION__); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 154 | return -EINVAL; |
| 155 | } |
| 156 | |
Ladislav Michl | d01b79d | 2005-04-08 15:06:39 +0200 | [diff] [blame] | 157 | dev_dbg(&client->dev, "%s: secs=%d, mins=%d, hours=%d, " |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 158 | "mday=%d, mon=%d, year=%d, wday=%d\n", __FUNCTION__, |
| 159 | dt->tm_sec, dt->tm_min, dt->tm_hour, |
| 160 | dt->tm_mday, dt->tm_mon, dt->tm_year, dt->tm_wday); |
| 161 | |
| 162 | buf[0] = 0; /* reg offset */ |
Ladislav Michl | 6069ffd | 2005-04-08 15:02:16 +0200 | [diff] [blame] | 163 | buf[1] = BIN2BCD(dt->tm_sec); |
| 164 | buf[2] = BIN2BCD(dt->tm_min); |
Ladislav Michl | d91e169 | 2005-07-29 12:15:00 -0700 | [diff] [blame] | 165 | buf[3] = BIN2BCD(dt->tm_hour); |
James Chapman | ef96274 | 2005-11-06 23:07:38 +0100 | [diff] [blame] | 166 | buf[4] = BIN2BCD(dt->tm_wday + 1); |
Ladislav Michl | 6069ffd | 2005-04-08 15:02:16 +0200 | [diff] [blame] | 167 | buf[5] = BIN2BCD(dt->tm_mday); |
James Chapman | ef96274 | 2005-11-06 23:07:38 +0100 | [diff] [blame] | 168 | buf[6] = BIN2BCD(dt->tm_mon + 1); |
Ladislav Michl | 0b46e33 | 2005-05-04 08:13:13 +0200 | [diff] [blame] | 169 | val = dt->tm_year; |
| 170 | if (val >= 100) { |
| 171 | val -= 100; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 172 | buf[6] |= (1 << 7); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 173 | } |
Ladislav Michl | 6069ffd | 2005-04-08 15:02:16 +0200 | [diff] [blame] | 174 | buf[7] = BIN2BCD(val); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 175 | |
| 176 | msg[0].addr = client->addr; |
| 177 | msg[0].flags = 0; |
| 178 | msg[0].len = sizeof(buf); |
| 179 | msg[0].buf = &buf[0]; |
| 180 | |
Ladislav Michl | 3e9d0ba | 2005-04-08 15:00:21 +0200 | [diff] [blame] | 181 | result = i2c_transfer(client->adapter, msg, 1); |
Ladislav Michl | 0058824 | 2005-05-04 08:13:54 +0200 | [diff] [blame] | 182 | if (result == 1) |
| 183 | return 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 184 | |
Ladislav Michl | 0058824 | 2005-05-04 08:13:54 +0200 | [diff] [blame] | 185 | dev_err(&client->dev, "error writing data! %d\n", result); |
| 186 | return -EIO; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 187 | } |
| 188 | |
| 189 | static int ds1337_command(struct i2c_client *client, unsigned int cmd, |
| 190 | void *arg) |
| 191 | { |
Ladislav Michl | d01b79d | 2005-04-08 15:06:39 +0200 | [diff] [blame] | 192 | dev_dbg(&client->dev, "%s: cmd=%d\n", __FUNCTION__, cmd); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 193 | |
| 194 | switch (cmd) { |
| 195 | case DS1337_GET_DATE: |
| 196 | return ds1337_get_datetime(client, arg); |
| 197 | |
| 198 | case DS1337_SET_DATE: |
| 199 | return ds1337_set_datetime(client, arg); |
| 200 | |
| 201 | default: |
| 202 | return -EINVAL; |
| 203 | } |
| 204 | } |
| 205 | |
| 206 | /* |
| 207 | * Public API for access to specific device. Useful for low-level |
| 208 | * RTC access from kernel code. |
| 209 | */ |
Ladislav Michl | 8691983 | 2005-05-04 08:14:38 +0200 | [diff] [blame] | 210 | int ds1337_do_command(int bus, int cmd, void *arg) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 211 | { |
| 212 | struct list_head *walk; |
| 213 | struct list_head *tmp; |
| 214 | struct ds1337_data *data; |
| 215 | |
| 216 | list_for_each_safe(walk, tmp, &ds1337_clients) { |
| 217 | data = list_entry(walk, struct ds1337_data, list); |
Ladislav Michl | 8691983 | 2005-05-04 08:14:38 +0200 | [diff] [blame] | 218 | if (data->client.adapter->nr == bus) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 219 | return ds1337_command(&data->client, cmd, arg); |
| 220 | } |
| 221 | |
| 222 | return -ENODEV; |
| 223 | } |
| 224 | |
| 225 | static int ds1337_attach_adapter(struct i2c_adapter *adapter) |
| 226 | { |
Jean Delvare | 2ed2dc3 | 2005-07-31 21:42:02 +0200 | [diff] [blame] | 227 | return i2c_probe(adapter, &addr_data, ds1337_detect); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 228 | } |
| 229 | |
| 230 | /* |
| 231 | * The following function does more than just detection. If detection |
| 232 | * succeeds, it also registers the new chip. |
| 233 | */ |
| 234 | static int ds1337_detect(struct i2c_adapter *adapter, int address, int kind) |
| 235 | { |
| 236 | struct i2c_client *new_client; |
| 237 | struct ds1337_data *data; |
| 238 | int err = 0; |
| 239 | const char *name = ""; |
| 240 | |
| 241 | if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_BYTE_DATA | |
| 242 | I2C_FUNC_I2C)) |
| 243 | goto exit; |
| 244 | |
Deepak Saxena | 5263ebb | 2005-10-17 23:09:43 +0200 | [diff] [blame] | 245 | if (!(data = kzalloc(sizeof(struct ds1337_data), GFP_KERNEL))) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 246 | err = -ENOMEM; |
| 247 | goto exit; |
| 248 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 249 | INIT_LIST_HEAD(&data->list); |
| 250 | |
| 251 | /* The common I2C client data is placed right before the |
| 252 | * DS1337-specific data. |
| 253 | */ |
| 254 | new_client = &data->client; |
| 255 | i2c_set_clientdata(new_client, data); |
| 256 | new_client->addr = address; |
| 257 | new_client->adapter = adapter; |
| 258 | new_client->driver = &ds1337_driver; |
| 259 | new_client->flags = 0; |
| 260 | |
| 261 | /* |
| 262 | * Now we do the remaining detection. A negative kind means that |
| 263 | * the driver was loaded with no force parameter (default), so we |
| 264 | * must both detect and identify the chip. A zero kind means that |
| 265 | * the driver was loaded with the force parameter, the detection |
| 266 | * step shall be skipped. A positive kind means that the driver |
| 267 | * was loaded with the force parameter and a given kind of chip is |
| 268 | * requested, so both the detection and the identification steps |
| 269 | * are skipped. |
| 270 | * |
| 271 | * For detection, we read registers that are most likely to cause |
| 272 | * detection failure, i.e. those that have more bits with fixed |
| 273 | * or reserved values. |
| 274 | */ |
| 275 | |
| 276 | /* Default to an DS1337 if forced */ |
| 277 | if (kind == 0) |
| 278 | kind = ds1337; |
| 279 | |
| 280 | if (kind < 0) { /* detection and identification */ |
| 281 | u8 data; |
| 282 | |
| 283 | /* Check that status register bits 6-2 are zero */ |
| 284 | if ((ds1337_read(new_client, DS1337_REG_STATUS, &data) < 0) || |
| 285 | (data & 0x7c)) |
| 286 | goto exit_free; |
| 287 | |
| 288 | /* Check for a valid day register value */ |
| 289 | if ((ds1337_read(new_client, DS1337_REG_DAY, &data) < 0) || |
| 290 | (data == 0) || (data & 0xf8)) |
| 291 | goto exit_free; |
| 292 | |
| 293 | /* Check for a valid date register value */ |
| 294 | if ((ds1337_read(new_client, DS1337_REG_DATE, &data) < 0) || |
| 295 | (data == 0) || (data & 0xc0) || ((data & 0x0f) > 9) || |
| 296 | (data >= 0x32)) |
| 297 | goto exit_free; |
| 298 | |
| 299 | /* Check for a valid month register value */ |
| 300 | if ((ds1337_read(new_client, DS1337_REG_MONTH, &data) < 0) || |
| 301 | (data == 0) || (data & 0x60) || ((data & 0x0f) > 9) || |
| 302 | ((data >= 0x13) && (data <= 0x19))) |
| 303 | goto exit_free; |
| 304 | |
| 305 | /* Check that control register bits 6-5 are zero */ |
| 306 | if ((ds1337_read(new_client, DS1337_REG_CONTROL, &data) < 0) || |
| 307 | (data & 0x60)) |
| 308 | goto exit_free; |
| 309 | |
| 310 | kind = ds1337; |
| 311 | } |
| 312 | |
| 313 | if (kind == ds1337) |
| 314 | name = "ds1337"; |
| 315 | |
| 316 | /* We can fill in the remaining client fields */ |
| 317 | strlcpy(new_client->name, name, I2C_NAME_SIZE); |
| 318 | |
| 319 | /* Tell the I2C layer a new client has arrived */ |
| 320 | if ((err = i2c_attach_client(new_client))) |
| 321 | goto exit_free; |
| 322 | |
| 323 | /* Initialize the DS1337 chip */ |
| 324 | ds1337_init_client(new_client); |
| 325 | |
| 326 | /* Add client to local list */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 327 | list_add(&data->list, &ds1337_clients); |
| 328 | |
| 329 | return 0; |
| 330 | |
| 331 | exit_free: |
| 332 | kfree(data); |
| 333 | exit: |
| 334 | return err; |
| 335 | } |
| 336 | |
| 337 | static void ds1337_init_client(struct i2c_client *client) |
| 338 | { |
Michael Burian | f9e8957 | 2005-11-07 22:30:14 +0100 | [diff] [blame] | 339 | u8 status, control; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 340 | |
Michael Burian | f9e8957 | 2005-11-07 22:30:14 +0100 | [diff] [blame] | 341 | /* On some boards, the RTC isn't configured by boot firmware. |
| 342 | * Handle that case by starting/configuring the RTC now. |
| 343 | */ |
| 344 | status = i2c_smbus_read_byte_data(client, DS1337_REG_STATUS); |
| 345 | control = i2c_smbus_read_byte_data(client, DS1337_REG_CONTROL); |
| 346 | |
| 347 | if ((status & 0x80) || (control & 0x80)) { |
| 348 | /* RTC not running */ |
| 349 | u8 buf[16]; |
| 350 | struct i2c_msg msg[1]; |
| 351 | |
| 352 | dev_dbg(&client->dev, "%s: RTC not running!\n", __FUNCTION__); |
| 353 | |
| 354 | /* Initialize all, including STATUS and CONTROL to zero */ |
| 355 | memset(buf, 0, sizeof(buf)); |
| 356 | msg[0].addr = client->addr; |
| 357 | msg[0].flags = 0; |
| 358 | msg[0].len = sizeof(buf); |
| 359 | msg[0].buf = &buf[0]; |
| 360 | |
| 361 | i2c_transfer(client->adapter, msg, 1); |
| 362 | } else { |
| 363 | /* Running: ensure that device is set in 24-hour mode */ |
| 364 | s32 val; |
| 365 | |
| 366 | val = i2c_smbus_read_byte_data(client, DS1337_REG_HOUR); |
| 367 | if ((val >= 0) && (val & (1 << 6))) |
| 368 | i2c_smbus_write_byte_data(client, DS1337_REG_HOUR, |
| 369 | val & 0x3f); |
| 370 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 371 | } |
| 372 | |
| 373 | static int ds1337_detach_client(struct i2c_client *client) |
| 374 | { |
| 375 | int err; |
| 376 | struct ds1337_data *data = i2c_get_clientdata(client); |
| 377 | |
Jean Delvare | 7bef559 | 2005-07-27 22:14:49 +0200 | [diff] [blame] | 378 | if ((err = i2c_detach_client(client))) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 379 | return err; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 380 | |
| 381 | list_del(&data->list); |
| 382 | kfree(data); |
| 383 | return 0; |
| 384 | } |
| 385 | |
| 386 | static int __init ds1337_init(void) |
| 387 | { |
| 388 | return i2c_add_driver(&ds1337_driver); |
| 389 | } |
| 390 | |
| 391 | static void __exit ds1337_exit(void) |
| 392 | { |
| 393 | i2c_del_driver(&ds1337_driver); |
| 394 | } |
| 395 | |
| 396 | MODULE_AUTHOR("James Chapman <jchapman@katalix.com>"); |
| 397 | MODULE_DESCRIPTION("DS1337 RTC driver"); |
| 398 | MODULE_LICENSE("GPL"); |
| 399 | |
Ladislav Michl | da17838 | 2005-05-11 10:32:54 +0200 | [diff] [blame] | 400 | EXPORT_SYMBOL_GPL(ds1337_do_command); |
| 401 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 402 | module_init(ds1337_init); |
| 403 | module_exit(ds1337_exit); |