sja1000.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef _CAN_PLATFORM_SJA1000_H
  2. #define _CAN_PLATFORM_SJA1000_H
  3. /* clock divider register */
  4. #define CDR_CLKOUT_MASK 0x07
  5. #define CDR_CLK_OFF 0x08 /* Clock off (CLKOUT pin) */
  6. #define CDR_RXINPEN 0x20 /* TX1 output is RX irq output */
  7. #define CDR_CBP 0x40 /* CAN input comparator bypass */
  8. #define CDR_PELICAN 0x80 /* PeliCAN mode */
  9. /* output control register */
  10. #define OCR_MODE_BIPHASE 0x00
  11. #define OCR_MODE_TEST 0x01
  12. #define OCR_MODE_NORMAL 0x02
  13. #define OCR_MODE_CLOCK 0x03
  14. #define OCR_MODE_MASK 0x07
  15. #define OCR_TX0_INVERT 0x04
  16. #define OCR_TX0_PULLDOWN 0x08
  17. #define OCR_TX0_PULLUP 0x10
  18. #define OCR_TX0_PUSHPULL 0x18
  19. #define OCR_TX1_INVERT 0x20
  20. #define OCR_TX1_PULLDOWN 0x40
  21. #define OCR_TX1_PULLUP 0x80
  22. #define OCR_TX1_PUSHPULL 0xc0
  23. #define OCR_TX_MASK 0xfc
  24. #define OCR_TX_SHIFT 2
  25. struct sja1000_platform_data {
  26. u32 osc_freq; /* CAN bus oscillator frequency in Hz */
  27. u8 ocr; /* output control register */
  28. u8 cdr; /* clock divider register */
  29. };
  30. #endif /* !_CAN_PLATFORM_SJA1000_H */