Linux kernel & device driver programming

Cross-Referenced Linux and Device Driver Code

[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ]
Version: [ 2.6.11.8 ] [ 2.6.25 ] [ 2.6.25.8 ] [ 2.6.31.13 ] Architecture: [ i386 ]
  1 /*
  2     saa7146.h - definitions philips saa7146 based cards
  3     Copyright (C) 1999 Nathan Laredo (laredo@gnu.org)
  4 
  5     This program is free software; you can redistribute it and/or modify
  6     it under the terms of the GNU General Public License as published by
  7     the Free Software Foundation; either version 2 of the License, or
  8     (at your option) any later version.
  9 
 10     This program is distributed in the hope that it will be useful,
 11     but WITHOUT ANY WARRANTY; without even the implied warranty of
 12     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 13     GNU General Public License for more details.
 14 
 15     You should have received a copy of the GNU General Public License
 16     along with this program; if not, write to the Free Software
 17     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 18 */
 19 
 20 #ifndef __SAA7146__
 21 #define __SAA7146__
 22 
 23 #define SAA7146_VERSION_CODE 0x000101
 24 
 25 #include <linux/types.h>
 26 #include <linux/wait.h>
 27 
 28 #ifndef O_NONCAP
 29 #define O_NONCAP        O_TRUNC
 30 #endif
 31 
 32 #define MAX_GBUFFERS    2
 33 #define FBUF_SIZE       0x190000
 34 
 35 #ifdef __KERNEL__
 36 
 37 struct saa7146_window
 38 {
 39         int x, y;
 40         ushort width, height;
 41         ushort bpp, bpl;
 42         ushort swidth, sheight;
 43         short cropx, cropy;
 44         ushort cropwidth, cropheight;
 45         unsigned long vidadr;
 46         int color_fmt;
 47         ushort depth;
 48 };
 49 
 50 /*  Per-open data for handling multiple opens on one device */
 51 struct device_open
 52 {
 53         int          isopen;
 54         int          noncapturing;
 55         struct saa7146  *dev;
 56 };
 57 #define MAX_OPENS 3
 58 
 59 struct saa7146
 60 {
 61         struct video_device video_dev;
 62         struct video_picture picture;
 63         struct video_audio audio_dev;
 64         struct video_info vidinfo;
 65         int user;
 66         int cap;
 67         int capuser;
 68         int irqstate;           /* irq routine is state driven */
 69         int writemode;
 70         int playmode;
 71         unsigned int nr;
 72         unsigned long irq;          /* IRQ used by SAA7146 card */
 73         unsigned short id;
 74         unsigned char revision;
 75         unsigned char boardcfg[64];     /* 64 bytes of config from eeprom */
 76         unsigned long saa7146_adr;   /* bus address of IO mem from PCI BIOS */
 77         struct saa7146_window win;
 78         unsigned char __iomem *saa7146_mem; /* pointer to mapped IO memory */
 79         struct device_open open_data[MAX_OPENS];
 80 #define MAX_MARKS 16
 81         /* for a/v sync */
 82         int endmark[MAX_MARKS], endmarkhead, endmarktail;
 83         u32 *dmaRPS1, *pageRPS1, *dmaRPS2, *pageRPS2, *dmavid1, *dmavid2,
 84                 *dmavid3, *dmaa1in, *dmaa1out, *dmaa2in, *dmaa2out,
 85                 *pagedebi, *pagevid1, *pagevid2, *pagevid3, *pagea1in,
 86                 *pagea1out, *pagea2in, *pagea2out;
 87         wait_queue_head_t i2cq, debiq, audq, vidq;
 88         u8  *vidbuf, *audbuf, *osdbuf, *dmadebi;
 89         int audhead, vidhead, osdhead, audtail, vidtail, osdtail;
 90         spinlock_t lock;        /* the device lock */
 91 };
 92 #endif
 93 
 94 #ifdef _ALPHA_SAA7146
 95 #define saawrite(dat,adr)    writel((dat), saa->saa7146_adr+(adr))
 96 #define saaread(adr)         readl(saa->saa7146_adr+(adr))
 97 #else
 98 #define saawrite(dat,adr)    writel((dat), saa->saa7146_mem+(adr))
 99 #define saaread(adr)         readl(saa->saa7146_mem+(adr))
100 #endif
101 
102 #define saaand(dat,adr)      saawrite((dat) & saaread(adr), adr)
103 #define saaor(dat,adr)       saawrite((dat) | saaread(adr), adr)
104 #define saaaor(dat,mask,adr) saawrite((dat) | ((mask) & saaread(adr)), adr)
105 
106 /* bitmask of attached hardware found */
107 #define SAA7146_UNKNOWN         0x00000000
108 #define SAA7146_SAA7111         0x00000001
109 #define SAA7146_SAA7121         0x00000002
110 #define SAA7146_IBMMPEG         0x00000004
111 
112 #endif
113 
  This page was automatically generated by the LXR engine.