bt878.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. bt878.h - Bt878 audio module (register offsets)
  4. Copyright (C) 2002 Peter Hettkamp <[email protected]>
  5. */
  6. #ifndef _BT878_H_
  7. #define _BT878_H_
  8. #include <linux/interrupt.h>
  9. #include <linux/pci.h>
  10. #include <linux/sched.h>
  11. #include <linux/spinlock.h>
  12. #include <linux/mutex.h>
  13. #include "bt848.h"
  14. #include "bttv.h"
  15. #define BT878_VERSION_CODE 0x000000
  16. #define BT878_AINT_STAT 0x100
  17. #define BT878_ARISCS (0xf<<28)
  18. #define BT878_ARISC_EN (1<<27)
  19. #define BT878_ASCERR (1<<19)
  20. #define BT878_AOCERR (1<<18)
  21. #define BT878_APABORT (1<<17)
  22. #define BT878_ARIPERR (1<<16)
  23. #define BT878_APPERR (1<<15)
  24. #define BT878_AFDSR (1<<14)
  25. #define BT878_AFTRGT (1<<13)
  26. #define BT878_AFBUS (1<<12)
  27. #define BT878_ARISCI (1<<11)
  28. #define BT878_AOFLOW (1<<3)
  29. #define BT878_AINT_MASK 0x104
  30. #define BT878_AGPIO_DMA_CTL 0x10c
  31. #define BT878_A_GAIN (0xf<<28)
  32. #define BT878_A_G2X (1<<27)
  33. #define BT878_A_PWRDN (1<<26)
  34. #define BT878_A_SEL (3<<24)
  35. #define BT878_DA_SCE (1<<23)
  36. #define BT878_DA_LRI (1<<22)
  37. #define BT878_DA_MLB (1<<21)
  38. #define BT878_DA_LRD (0x1f<<16)
  39. #define BT878_DA_DPM (1<<15)
  40. #define BT878_DA_SBR (1<<14)
  41. #define BT878_DA_ES2 (1<<13)
  42. #define BT878_DA_LMT (1<<12)
  43. #define BT878_DA_SDR (0xf<<8)
  44. #define BT878_DA_IOM (3<<6)
  45. #define BT878_DA_APP (1<<5)
  46. #define BT878_ACAP_EN (1<<4)
  47. #define BT878_PKTP (3<<2)
  48. #define BT878_RISC_EN (1<<1)
  49. #define BT878_FIFO_EN 1
  50. #define BT878_APACK_LEN 0x110
  51. #define BT878_AFP_LEN (0xff<<16)
  52. #define BT878_ALP_LEN 0xfff
  53. #define BT878_ARISC_START 0x114
  54. #define BT878_ARISC_PC 0x120
  55. /* BT878 FUNCTION 0 REGISTERS */
  56. #define BT878_GPIO_DMA_CTL 0x10c
  57. /* Interrupt register */
  58. #define BT878_INT_STAT 0x100
  59. #define BT878_INT_MASK 0x104
  60. #define BT878_I2CRACK (1<<25)
  61. #define BT878_I2CDONE (1<<8)
  62. #define BT878_MAX 4
  63. #define BT878_RISC_SYNC_MASK (1 << 15)
  64. #define BTTV_BOARD_UNKNOWN 0x00
  65. #define BTTV_BOARD_PINNACLESAT 0x5e
  66. #define BTTV_BOARD_NEBULA_DIGITV 0x68
  67. #define BTTV_BOARD_PC_HDTV 0x70
  68. #define BTTV_BOARD_TWINHAN_DST 0x71
  69. #define BTTV_BOARD_AVDVBT_771 0x7b
  70. #define BTTV_BOARD_AVDVBT_761 0x7c
  71. #define BTTV_BOARD_DVICO_DVBT_LITE 0x80
  72. #define BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE 0x87
  73. extern int bt878_num;
  74. struct bt878 {
  75. struct mutex gpio_lock;
  76. unsigned int nr;
  77. unsigned int bttv_nr;
  78. struct i2c_adapter *adapter;
  79. struct pci_dev *dev;
  80. unsigned int id;
  81. unsigned int TS_Size;
  82. unsigned char revision;
  83. unsigned int irq;
  84. unsigned long bt878_adr;
  85. volatile void __iomem *bt878_mem; /* function 1 */
  86. volatile u32 finished_block;
  87. volatile u32 last_block;
  88. u32 block_count;
  89. u32 block_bytes;
  90. u32 line_bytes;
  91. u32 line_count;
  92. u32 buf_size;
  93. u8 *buf_cpu;
  94. dma_addr_t buf_dma;
  95. u32 risc_size;
  96. __le32 *risc_cpu;
  97. dma_addr_t risc_dma;
  98. u32 risc_pos;
  99. struct tasklet_struct tasklet;
  100. int shutdown;
  101. };
  102. extern struct bt878 bt878[BT878_MAX];
  103. void bt878_start(struct bt878 *bt, u32 controlreg, u32 op_sync_orin,
  104. u32 irq_err_ignore);
  105. void bt878_stop(struct bt878 *bt);
  106. #define bmtwrite(dat,adr) writel((dat), (adr))
  107. #define bmtread(adr) readl(adr)
  108. #endif