[381a2f18] | 1 | #ifndef DS1375_I2C_RTC_H |
---|
| 2 | #define DS1375_I2C_RTC_H |
---|
| 3 | /* Driver for the Maxim 1375 i2c RTC (TOD only; very simple...) */ |
---|
| 4 | |
---|
| 5 | /* |
---|
| 6 | * Authorship |
---|
| 7 | * ---------- |
---|
| 8 | * This software was created by |
---|
| 9 | * |
---|
| 10 | * Till Straumann <strauman@slac.stanford.edu>, 2005-2007, |
---|
| 11 | * Stanford Linear Accelerator Center, Stanford University. |
---|
| 12 | * |
---|
| 13 | * Acknowledgement of sponsorship |
---|
| 14 | * ------------------------------ |
---|
| 15 | * The software was produced by |
---|
| 16 | * the Stanford Linear Accelerator Center, Stanford University, |
---|
| 17 | * under Contract DE-AC03-76SFO0515 with the Department of Energy. |
---|
| 18 | * |
---|
| 19 | * Government disclaimer of liability |
---|
| 20 | * ---------------------------------- |
---|
| 21 | * Neither the United States nor the United States Department of Energy, |
---|
| 22 | * nor any of their employees, makes any warranty, express or implied, or |
---|
| 23 | * assumes any legal liability or responsibility for the accuracy, |
---|
| 24 | * completeness, or usefulness of any data, apparatus, product, or process |
---|
| 25 | * disclosed, or represents that its use would not infringe privately owned |
---|
| 26 | * rights. |
---|
| 27 | * |
---|
| 28 | * Stanford disclaimer of liability |
---|
| 29 | * -------------------------------- |
---|
| 30 | * Stanford University makes no representations or warranties, express or |
---|
| 31 | * implied, nor assumes any liability for the use of this software. |
---|
| 32 | * |
---|
| 33 | * Stanford disclaimer of copyright |
---|
| 34 | * -------------------------------- |
---|
| 35 | * Stanford University, owner of the copyright, hereby disclaims its |
---|
| 36 | * copyright and all other rights in this software. Hence, anyone may |
---|
| 37 | * freely use it for any purpose without restriction. |
---|
| 38 | * |
---|
| 39 | * Maintenance of notices |
---|
| 40 | * ---------------------- |
---|
| 41 | * In the interest of clarity regarding the origin and status of this |
---|
| 42 | * SLAC software, this and all the preceding Stanford University notices |
---|
| 43 | * are to remain affixed to any copy or derivative of this software made |
---|
| 44 | * or distributed by the recipient and are to be affixed to any copy of |
---|
| 45 | * software made or distributed by the recipient that contains a copy or |
---|
| 46 | * derivative of this software. |
---|
| 47 | * |
---|
| 48 | * ------------------ SLAC Software Notices, Set 4 OTT.002a, 2004 FEB 03 |
---|
| 49 | */ |
---|
| 50 | |
---|
| 51 | #include <rtems.h> |
---|
| 52 | #include <libchip/rtc.h> |
---|
| 53 | #include <stdint.h> |
---|
| 54 | |
---|
| 55 | #ifdef __cplusplus |
---|
| 56 | extern "C" { |
---|
| 57 | #endif |
---|
| 58 | |
---|
| 59 | extern rtc_fns rtc_ds1375_fns; |
---|
| 60 | |
---|
| 61 | boolean |
---|
| 62 | rtc_ds1375_device_probe( int minor ); |
---|
| 63 | |
---|
| 64 | uint32_t |
---|
| 65 | rtc_ds1375_get_register( uint32_t port, uint8_t reg ); |
---|
| 66 | |
---|
| 67 | void |
---|
| 68 | rtc_ds1375_set_register( uint32_t port, uint8_t reg, uint32_t value ); |
---|
| 69 | |
---|
| 70 | /* |
---|
| 71 | * BSP must supply string constant argument 'i2cname' which matches |
---|
| 72 | * the registered device name of the raw i2c device (created with mknod). |
---|
| 73 | * E.g., "/dev/i2c.ds1375-raw" |
---|
| 74 | */ |
---|
| 75 | #define DS1375_RTC_TBL_ENTRY(i2cname) \ |
---|
| 76 | { \ |
---|
| 77 | sDeviceName: "/dev/rtc", \ |
---|
| 78 | deviceType: RTC_CUSTOM, \ |
---|
| 79 | pDeviceFns: &rtc_ds1375_fns, \ |
---|
| 80 | deviceProbe: rtc_ds1375_device_probe, \ |
---|
| 81 | ulCtrlPort1: (uint32_t)(i2cname), \ |
---|
| 82 | ulDataPort: 0, \ |
---|
| 83 | getRegister: rtc_ds1375_get_register, \ |
---|
| 84 | setRegister: rtc_ds1375_set_register, \ |
---|
| 85 | } |
---|
| 86 | |
---|
| 87 | #ifdef __cplusplus |
---|
| 88 | } |
---|
| 89 | #endif |
---|
| 90 | |
---|
| 91 | #endif |
---|