root/include/linux/mcd.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


   1 /*
   2  * Definitions for a Mitsumi CD-ROM interface
   3  *
   4  *      Copyright (C) 1992  Martin Harriss
   5  *
   6  *      martin@bdsi.com
   7  *
   8  *  This program is free software; you can redistribute it and/or modify
   9  *  it under the terms of the GNU General Public License as published by
  10  *  the Free Software Foundation; either version 2 of the License, or
  11  *  (at your option) any later version.
  12  *
  13  *  This program is distributed in the hope that it will be useful,
  14  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  15  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  16  *  GNU General Public License for more details.
  17  *
  18  *  You should have received a copy of the GNU General Public License
  19  *  along with this program; if not, write to the Free Software
  20  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21  *
  22  */
  23 
  24 /* *** change this to set the I/O port address */
  25 #define MCDPORT(x)              (0x320 + (x))
  26 
  27 /* *** change this to set the interrupt number */
  28 #define MCD_INTR_NR             11
  29 
  30 
  31 
  32 
  33 
  34 /* status bits */
  35 
  36 #define MST_CMD_CHECK           0x01            /* command error */
  37 #define MST_BUSY                0x02            /* now playing */
  38 #define MST_READ_ERR            0x04            /* read error */
  39 #define MST_DSK_TYPE            0x08
  40 #define MST_SERVO_CHECK         0x10
  41 #define MST_DSK_CHG             0x20            /* disk removed or changed */
  42 #define MST_READY               0x40            /* disk in the drive */
  43 #define MST_DOOR_OPEN           0x80            /* door is open */
  44 
  45 /* flag bits */
  46 
  47 #define MFL_DATA                0x02            /* data available */
  48 #define MFL_STATUS              0x04            /* status available */
  49 
  50 /* commands */
  51 
  52 #define MCMD_GET_DISK_INFO      0x10            /* read info from disk */
  53 #define MCMD_GET_Q_CHANNEL      0x20            /* read info from q channel */
  54 #define MCMD_GET_STATUS         0x40
  55 #define MCMD_SET_MODE           0x50
  56 #define MCMD_SOFT_RESET         0x60
  57 #define MCMD_STOP               0x70            /* stop play */
  58 #define MCMD_CONFIG_DRIVE       0x90
  59 #define MCMD_SET_VOLUME         0xAE            /* set audio level */
  60 #define MCMD_PLAY_READ          0xC0            /* play or read data */
  61 #define MCMD_GET_VERSION        0xDC
  62 
  63 /* borrowed from hd.c */
  64 
  65 #define READ_DATA(port, buf, nr) \
  66 __asm__("cld;rep;insb": :"d" (port),"D" (buf),"c" (nr):"cx","di")
  67 
  68 #define SET_TIMER(func, jifs) \
  69         ((timer_table[MCD_TIMER].expires = jiffies + jifs), \
  70         (timer_table[MCD_TIMER].fn = func), \
  71         (timer_active |= 1<<MCD_TIMER))
  72 
  73 #define CLEAR_TIMER             timer_active &= ~(1<<MCD_TIMER)
  74 
  75 #define MAX_TRACKS              104
  76 
  77 struct msf {
  78         unsigned char   min;
  79         unsigned char   sec;
  80         unsigned char   frame;
  81 };
  82 
  83 struct mcd_Play_msf {
  84         struct msf      start;
  85         struct msf      end;
  86 };
  87 
  88 struct mcd_DiskInfo {
  89         unsigned char   first;
  90         unsigned char   last;
  91         struct msf      diskLength;
  92         struct msf      firstTrack;
  93 };
  94 
  95 struct mcd_Toc {
  96         unsigned char   ctrl_addr;
  97         unsigned char   track;
  98         unsigned char   pointIndex;
  99         struct msf      trackTime;
 100         struct msf      diskTime;
 101 };

/* [previous][next][first][last][top][bottom][index][help] */