intersil.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _SUN3_INTERSIL_H
  3. #define _SUN3_INTERSIL_H
  4. /* bits 0 and 1 */
  5. #define INTERSIL_FREQ_32K 0x00
  6. #define INTERSIL_FREQ_1M 0x01
  7. #define INTERSIL_FREQ_2M 0x02
  8. #define INTERSIL_FREQ_4M 0x03
  9. /* bit 2 */
  10. #define INTERSIL_12H_MODE 0x00
  11. #define INTERSIL_24H_MODE 0x04
  12. /* bit 3 */
  13. #define INTERSIL_STOP 0x00
  14. #define INTERSIL_RUN 0x08
  15. /* bit 4 */
  16. #define INTERSIL_INT_ENABLE 0x10
  17. #define INTERSIL_INT_DISABLE 0x00
  18. /* bit 5 */
  19. #define INTERSIL_MODE_NORMAL 0x00
  20. #define INTERSIL_MODE_TEST 0x20
  21. #define INTERSIL_HZ_100_MASK 0x02
  22. struct intersil_dt {
  23. unsigned char csec;
  24. unsigned char hour;
  25. unsigned char minute;
  26. unsigned char second;
  27. unsigned char month;
  28. unsigned char day;
  29. unsigned char year;
  30. unsigned char weekday;
  31. };
  32. struct intersil_7170 {
  33. struct intersil_dt counter;
  34. struct intersil_dt alarm;
  35. unsigned char int_reg;
  36. unsigned char cmd_reg;
  37. };
  38. extern volatile char* clock_va;
  39. #define intersil_clock ((volatile struct intersil_7170 *) clock_va)
  40. #define intersil_clear() (void)intersil_clock->int_reg
  41. #endif