Ralf Baechle | 42a3b4f | 2005-09-03 15:56:17 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Dallas Semiconductors 1603 RTC driver |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 3 | * |
Ralf Baechle | 42a3b4f | 2005-09-03 15:56:17 -0700 | [diff] [blame] | 4 | * Brian Murphy <brian@murphy.dk> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 5 | * |
| 6 | */ |
| 7 | #ifndef __DS1603_H |
| 8 | #define __DS1603_H |
| 9 | |
| 10 | struct ds_defs { |
| 11 | volatile u32 *reg; |
| 12 | volatile u32 *data_reg; |
| 13 | u32 rst; |
| 14 | u32 clk; |
| 15 | u32 data; |
| 16 | u32 data_read_shift; |
| 17 | char data_reversed; |
| 18 | u32 huge_delay; |
| 19 | }; |
| 20 | |
| 21 | extern struct ds_defs *ds1603; |
| 22 | |
| 23 | unsigned long ds1603_read(void); |
| 24 | int ds1603_set(unsigned long); |
| 25 | void ds1603_set_trimmer(unsigned int); |
| 26 | void ds1603_enable(void); |
| 27 | void ds1603_disable(void); |
| 28 | void ds1603_init(struct ds_defs *); |
| 29 | |
| 30 | #define TRIMMER_DEFAULT 3 |
| 31 | #define TRIMMER_DISABLE_RTC 0 |
| 32 | |
| 33 | #endif |