Annotation of margi2/l64014.h, revision 1.1.1.1

1.1       cvs         1: /* 
                      2:     l64014.h
                      3: 
                      4:     Copyright (C) Marcus Metzler for convergence integrated media.
                      5: 
                      6:     This program is free software; you can redistribute it and/or modify
                      7:     it under the terms of the GNU General Public License as published by
                      8:     the Free Software Foundation; either version 2 of the License, or
                      9:     (at your option) any later version.
                     10: 
                     11:     This program is distributed in the hope that it will be useful,
                     12:     but WITHOUT ANY WARRANTY; without even the implied warranty of
                     13:     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
                     14:     GNU General Public License for more details.
                     15: 
                     16:     You should have received a copy of the GNU General Public License
                     17:     along with this program; if not, write to the Free Software
                     18:     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
                     19: */
                     20: 
                     21: #ifndef L64014_h
                     22: #define L64014_h
                     23: 
                     24: #include <linux/kernel.h>
                     25: #include <linux/config.h>
                     26: #include <linux/pci.h>
                     27: 
                     28: 
                     29: #define DIO_CONTROL_INDEX          0x00
                     30: #define DIO_CONTROL_DATA           0x02
                     31: #define DIO_LSI_STATUS             0x04
                     32: #define DIO_LSI_CHANNEL_DATA       0x04
                     33: #define DIO_LSI_INDEX_LOW          0x08
                     34: #define DIO_LSI_DATA               0x0A
                     35: #define DIO_LSI_INDEX_HIGH         0x0C
                     36: 
                     37: #define LSI_READY                  0x08
                     38: #define LSI_WAIT                   0x04
                     39: #define LSI_ARQ                    0x02
                     40: #define LSI_VRQ                    0x01
                     41: 
                     42: #define IIO_ID                     0x00
                     43: #define IIO_MODE                   0x01
                     44: #define IIO_IRQ_CONTROL            0x02
                     45: #define IIO_IRQ_STATUS             0x03
                     46: #define IIO_LSI_CONTROL            0x06
                     47: #define IIO_OSC_AUD                0x08
                     48: #define IIO_VIDEO_CONTROL0         0x09
                     49: #define IIO_VIDEO_CONTROL1         0x0A
                     50: #define IIO_VIDEO_LOOKUP           0x0B
                     51: #define IIO_EEPROM_CONTROL         0x0C
                     52: #define IIO_VIDEO_HOR_DELAY        0x0D
                     53: #define IIO_VIDEO_HOR_ACTIVE       0x0E
                     54: #define IIO_VIDEO_HOR_HIGH         0x0F
                     55: #define IIO_GPIO_CONTROL           0x10
                     56: #define IIO_GPIO_PINS              0x11
                     57: #define IIO_CSS_COMMAND            0x12
                     58: #define IIO_CSS_STATUS             0x13
                     59: #define IIO_CSS_KEY                0x14
                     60: 
                     61: #define SCL                        0x02
                     62: #define SDA                        0x04
                     63: 
                     64: #define CS_CONTROL0                0x00
                     65: #define CS_CONTROL1                0x01
                     66: #define CS_CONTROL2                0x02
                     67: #define CS_DAC                     0x04
                     68: #define CS_STATUS                  0x07
                     69: #define CS_BKG_COL                 0x08
                     70: #define CS_GPIO_CTRL               0x09
                     71: #define CS_GPIO_DATA               0x0A
                     72: #define CS_C_AMP                   0x0D
                     73: #define CS_Y_AMP                   0x0E
                     74: #define CS_I2C_ADR                 0x0F
                     75: #define CS_SC_AMP                  0x10
                     76: #define CS_SC_SYNTH0               0x11
                     77: #define CS_SC_SYNTH1               0x12
                     78: #define CS_SC_SYNTH2               0x13
                     79: #define CS_SC_SYNTH3               0x14
                     80: #define CS_HUE_LSB                 0x15
                     81: #define CS_HUE_MSB                 0x16
                     82: #define CS_CC_EN                   0x18
                     83: #define CS_CC_21_1                 0x19
                     84: #define CS_CC_21_2                 0x1A
                     85: #define CS_CC_284_1                0x1B
                     86: #define CS_CC_284_2                0x1C
                     87: #define CS_INT_EN                  0x3B
                     88: #define CS_INT_CLR                 0x3C
                     89: #define CS_ID_REG                  0x3D
                     90: 
                     91: 
                     92: #define   CSS_COMMAND             0x12
                     93: #define   CSS_STATUS              0x13
                     94: #define   CSS_KEY                 0x14
                     95: 
                     96: #define   L14_CSS_NONE            0x00
                     97: #define   L14_CSS_PASSTHRU        0x01
                     98: #define   L14_CSS_DESCRAM         0x05
                     99: #define   L14_CSS_GEN_CH          0x08
                    100: #define   L14_CSS_RD_CH           0x09
                    101: #define   L14_CSS_WR_CH           0x0a
                    102: #define   L14_CSS_WR_DRVREF       0x0b
                    103: #define   L14_CSS_DRVAUTH         0x0c
                    104: #define   L14_CSS_DECAUTH         0x0d
                    105: #define   L14_CSS_DISCKEY         0x0e
                    106: #define   L14_CSS_TITLEKEY        0x0f
                    107: #define   L14_CSS_CMD_START       0x10
                    108: 
                    109: #define   L14_CSS_BUSY            0x01
                    110: #define   L14_CSS_SUCCESS         0x02
                    111: 
                    112: #define DSVC                       0x40
                    113: #define RR                         0x20
                    114: #define DR                         0x01
                    115: #define AF1                        0x20
                    116: #define AF0                        0x10
                    117: #define SLEEP                      0x08
                    118: #define AFS2                       0x04
                    119: #define AFS1                       0x02
                    120: #define AFS0                       0x01
                    121: 
                    122: #define IRQ_EN                     0x04
                    123: #define IRQ_MSK                    0x08
                    124: #define IRQ_POL                    0x10
                    125: #define DEC_EN                     0x20
                    126: #define DEC_INT                    0x10
                    127: #define VSYNC_EN                   0x80
                    128: #define VSYNC_INT                  0x40
                    129: 
                    130: #define VMS_NOSY                   0x00
                    131: #define VMS_NTSC                   0x01
                    132: #define VMS_PAL                    0x02
                    133: #define VMS_PAL24                  0x03
                    134: 
                    135: #define AUDIO_PAUSE 0
                    136: #define AUDIO_PLAY 1
                    137: #define AUDIO_FAST 2
                    138: #define AUDIO_SLOW 3
                    139: 
                    140: 
                    141: #define RegisterReadByte(card,where) read_indexed_register(&(card->link),(where))
                    142: #define RegisterWriteByte(card,where,what) write_indexed_register(&(card->link),where,what)
                    143: #define RegisterMaskByte(card,where,mask,bits) RegisterWriteByte(card,where,(RegisterReadByte(card,where)&~(mask))|(bits))
                    144: #define RegisterSetByte(card,where,bits) RegisterWriteByte(card,where,RegisterReadByte(card,where)|(bits))
                    145: #define RegisterDelByte(card,where,mask) RegisterWriteByte(card,where,RegisterReadByte(card,where)&~(mask))
                    146: 
                    147: #define RegisterReadWord(card,where) (\
                    148:   (u16)RegisterReadByte(card,where)|\
                    149:   ((u16)RegisterReadByte(card,(where)+1)<<8))
                    150: #define RegisterWriteWord(card,where,what) {\
                    151:   RegisterWriteByte(card,where,(what) & 0xFF);\
                    152:   RegisterWriteByte(card,(where)+1,((what)>>8) & 0xFF);}
                    153: 
                    154: // 3-byte-wide (medium word, 24 Bit) access to the card's registers, LSB first
                    155: #define RegisterReadMWord(card,where) (\
                    156:   (u32)RegisterReadByte(card,where)|\
                    157:   ((u32)RegisterReadByte(card,(where)+1)<<8)|\
                    158:   ((u32)RegisterReadByte(card,(where)+2)<<16))
                    159: #define RegisterWriteMWord(card,where,what) {\
                    160:   RegisterWriteByte(card,where,(what) & 0xFF);\
                    161:   RegisterWriteByte(card,(where)+1,((what)>>8) & 0xFF);\
                    162:   RegisterWriteByte(card,(where)+2,((what)>>16) & 0xFF);}
                    163: 
                    164: // double-word-wide access to the card's registers, LSB first
                    165: //#define RegisterReadDWord(card,where) le32_to_cpu(readl(card->addr+(where)))
                    166: //#define RegisterWriteDWord(card,where,what) writel(cpu_to_le32(what),card->addr+(where))
                    167: #define RegisterReadDWord(card,where) (\
                    168:   (u32)RegisterReadByte(card,where)|\
                    169:   ((u32)RegisterReadByte(card,(where)+1)<<8)|\
                    170:   ((u32)RegisterReadByte(card,(where)+2)<<16)|\
                    171:   ((u32)RegisterReadByte(card,(where)+3)<<24))
                    172: #define RegisterWriteDWord(card,where,what) {\
                    173:   RegisterWriteByte(card,where,(what) & 0xFF);\
                    174:   RegisterWriteByte(card,(where)+1,((what)>>8) & 0xFF);\
                    175:   RegisterWriteByte(card,(where)+2,((what)>>16) & 0xFF);\
                    176:   RegisterWriteByte(card,(where)+3,((what)>>24) & 0xFF);}
                    177: 
                    178: #endif

LinuxTV legacy CVS <linuxtv.org/cvs>