root/include/linux/sjcd.h

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

INCLUDED FROM


   1 /*
   2  * Definitions for a Sanyo CD-ROM interface
   3  *
   4  *   Copyright (C) 1995  Vadim V. Model
   5  *
   6  *   model@cecmow.enet.dec.com
   7  *   vadim@rbrf.msk.su
   8  *   vadim@ipsun.ras.ru
   9  *
  10  */
  11 
  12 #ifndef __SJCD_H__
  13 #define __SJCD_H__
  14 
  15 /*
  16  * Change this to set the I/O port address.
  17  */
  18 #define SJCD_BASE_ADDR      0x340
  19 
  20 /*
  21  * Change this to set the irq.
  22  */
  23 #define SJCD_INTR_NR        10
  24 
  25 /*
  26  * port access macros
  27  */
  28 #define SJCDPORT( x )       ( sjcd_port + ( x ) )
  29 
  30 /* status bits */
  31 
  32 #define SST_NOT_READY       0x10        /* no disk in the drive */
  33 #define SST_MEDIA_CHANGED   0x20        /* disk is changed */
  34 #define SST_DOOR_OPENED     0x40        /* door is open */
  35 
  36 /* flag bits */
  37 
  38 /* commands */
  39 
  40 #define SCMD_EJECT_TRAY     0xD0        /* eject tray if not locked */
  41 #define SCMD_LOCK_TRAY      0xD2        /* lock tray when in */
  42 #define SCMD_UNLOCK_TRAY    0xD4        /* unlock tray when in */
  43 #define SCMD_CLOSE_TRAY     0xD6        /* load tray in */
  44 
  45 #define SCMD_RESET          0xFA        /* soft reset */
  46 #define SCMD_GET_STATUS     0x80
  47 #define SCMD_GET_VERSION    0xCC
  48 
  49 #define SCMD_DATA_READ      0xA0
  50 #define SCMD_SEEK           0xA0
  51 #define SCMD_PLAY           0xA0
  52 
  53 #define SCMD_GET_QINFO      0xA8
  54 
  55 #define SCMD_SET_MODE       0xC4
  56 #define SCMD_MODE_PLAY      0xE0
  57 #define SCMD_MODE_COOKED    0xF8
  58 #define SCMD_MODE_RAW       0xF9
  59 #define SCMD_MODE_x20_BIT   0x20
  60 
  61 #define SCMD_SET_VOLUME     0xAE
  62 #define SCMD_PAUSE          0xE0
  63 #define SCMD_STOP           0xE0
  64 
  65 #define SCMD_GET_DISK_INFO  0xAA
  66 #define SCMD_GET_1_TRACK    0xA0    /* get the first track information */
  67 #define SCMD_GET_L_TRACK    0xA1    /* get the last track information */
  68 #define SCMD_GET_D_SIZE     0xA2    /* get the whole disk information */
  69 
  70 /*
  71  * borrowed from hd.c
  72  */
  73 #define S_READ_DATA( port, buf, nr )      insb( port, buf, nr )
  74 
  75 #define SJCD_MAX_TRACKS         100
  76 
  77 struct msf {
  78   unsigned char   min;
  79   unsigned char   sec;
  80   unsigned char   frame;
  81 };
  82 
  83 struct sjcd_hw_disk_info {
  84   unsigned char track_control;
  85   unsigned char track_no;
  86   unsigned char x, y, z;
  87   union {
  88     unsigned char track_no;
  89     struct msf track_msf;
  90   } un;
  91 };
  92 
  93 struct sjcd_hw_qinfo {
  94   unsigned char track_control;
  95   unsigned char track_no;
  96   unsigned char x;
  97   struct msf rel;
  98   struct msf abs;
  99 };
 100 
 101 struct sjcd_play_msf {
 102   struct msf  start;
 103   struct msf  end;
 104 };
 105 
 106 struct sjcd_disk_info {
 107   unsigned char   first;
 108   unsigned char   last;
 109   struct msf      disk_length;
 110   struct msf      first_track;
 111 };
 112 
 113 struct sjcd_toc {
 114   unsigned char   ctrl_addr;
 115   unsigned char   track;
 116   unsigned char   point_index;
 117   struct msf      track_time;
 118   struct msf      disk_time;
 119 };
 120 
 121 struct sjcd_stat {
 122   int ticks;
 123   int tticks[ 8 ];
 124   int idle_ticks;
 125   int start_ticks;
 126   int mode_ticks;
 127   int read_ticks;
 128   int data_ticks;
 129   int stop_ticks;
 130   int stopping_ticks;
 131 };
 132 
 133 #endif

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