1 /*
2  *   libdi - CD Audio Device Interface Library
3  *
4  *   Copyright (C) 1993-2004  Ti Kan
5  *   E-mail: xmcd@amb.org
6  *
7  *   This program is free software; you can redistribute it and/or modify
8  *   it under the terms of the GNU General Public License as published by
9  *   the Free Software Foundation; either version 2 of the License, or
10  *   (at your option) any later version.
11  *
12  *   This program is distributed in the hope that it will be useful,
13  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *   GNU General Public License for more details.
16  *
17  *   You should have received a copy of the GNU General Public License
18  *   along with this program; if not, write to the Free Software
19  *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20  */
21 
22 /*
23  *   Toshiba vendor-unique support
24  *
25  *   The name "Toshiba" is a trademark of Toshiba Corporation, and is
26  *   used here for identification purposes only.
27  */
28 #ifndef __VU_TOSH_H__
29 #define __VU_TOSH_H__
30 
31 #ifdef VENDOR_TOSHIBA
32 
33 #ifndef lint
34 static char *_vu_tosh_h_ident_ = "@(#)vu_tosh.h	6.19 03/12/12";
35 #endif
36 
37 
38 /* Toshiba vendor-unique commands */
39 #define OP_VT_AUDSRCH		0xc0	/* Toshiba audio track search */
40 #define OP_VT_AUDPLAY		0xc1	/* Toshiba play audio */
41 #define OP_VT_STILL		0xc2	/* Toshiba still */
42 #define OP_VT_SETSTOP		0xc3	/* Toshiba set stop time */
43 #define OP_VT_EJECT		0xc4	/* Toshiba caddy eject */
44 #define OP_VT_RDSUBQ		0xc6	/* Toshiba read status */
45 #define OP_VT_RDINFO		0xc7	/* Toshiba read disk info */
46 #define OP_VT_RDMODE		0xc8	/* Toshiba read CDROM mode */
47 
48 
49 /* Toshiba audio status codes */
50 #define TAUD_PLAYING		0x00
51 #define TAUD_PAUSED		0x01
52 #define TAUD_SRCH_PAUSED	0x02
53 #define TAUD_OTHER		0x03
54 
55 
56 /* Return data lengths */
57 #define SZ_VT_RDSUBQ		10	/* Toshiba read sub-code Q data size */
58 #define SZ_VT_RDINFO		4	/* Toshiba read disc info data size */
59 #define SZ_VT_RDMODE		1	/* Toshiba read cdrom mode data size */
60 
61 
62 /* Toshiba read sub-code Q command data */
63 typedef struct tsubq_data {
64 	unsigned int	audio_status:8;	/* audio status */
65 #if _BYTE_ORDER_ == _L_ENDIAN_
66 	unsigned int	preemph:1;	/* preemphasis */
67 	unsigned int	copyallow:1;	/* digital copy allow */
68 	unsigned int	trktype:1;	/* 0=audio 1=data */
69 	unsigned int	audioch:1;	/* 0=2ch 1=4ch */
70 	unsigned int	reserved:4;	/* reserved */
71 #else	/* _BYTE_ORDER_ == _B_ENDIAN_ */
72 	unsigned int	reserved:4;	/* reserved */
73 	unsigned int	audioch:1;	/* 0=2ch 1=4ch */
74 	unsigned int	trktype:1;	/* 0=audio 1=data */
75 	unsigned int	copyallow:1;	/* digital copy allow */
76 	unsigned int	preemph:1;	/* preemphasis */
77 #endif	/* _BYTE_ORDER_ */
78 	unsigned int	trkno:8;	/* track number (BCD) */
79 	unsigned int	idxno:8;	/* index number (BCD) */
80 
81 	byte_t		rel_min;	/* trk relative minutes (BCD) */
82 	byte_t		rel_sec;	/* trk relative seconds (BCD) */
83 	byte_t		rel_frame;	/* trk relative frame (BCD) */
84 	byte_t		abs_min;	/* absolute minutes (BCD) */
85 
86 	byte_t		abs_sec;	/* absolute seconds (BCD) */
87 	byte_t		abs_frame;	/* absolute frame (BCD) */
88 	byte_t		pad1[2];	/* pad for alignment */
89 } tsubq_data_t;
90 
91 
92 /* Toshiba read disc information command data */
93 typedef struct tinfo_00 {		/* track information */
94 	byte_t		first_trk;	/* first track (BCD) */
95 	byte_t		last_trk;	/* last track (BCD) */
96 	byte_t		reserved[2];	/* reserved */
97 } tinfo_00_t;
98 
99 typedef struct tinfo_01 {		/* lead-out track starting time */
100 	byte_t		min;		/* minutes (BCD) */
101 	byte_t		sec;		/* seconds (BCD) */
102 	byte_t		frame;		/* frame (BCD) */
103 	byte_t		reserved;	/* reserved */
104 } tinfo_01_t;
105 
106 typedef struct tinfo_02 {		/* specified track starting time */
107 	byte_t		min;		/* minutes (BCD) */
108 	byte_t		sec;		/* seconds (BCD) */
109 	byte_t		frame;		/* frame (BCD) */
110 	byte_t		reserved;	/* reserved */
111 } tinfo_02_t;
112 
113 
114 /* Public function prototypes */
115 extern bool_t	tosh_playaudio(byte_t, sword32_t, sword32_t, msf_t *, msf_t *,
116 			byte_t, byte_t);
117 extern bool_t	tosh_pause_resume(bool_t);
118 extern bool_t	tosh_get_playstatus(cdstat_t *);
119 extern bool_t	tosh_get_toc(curstat_t *);
120 extern bool_t	tosh_mute(bool_t);
121 extern bool_t	tosh_eject(void);
122 extern void	tosh_init(void);
123 
124 #else
125 
126 #define tosh_init	NULL
127 
128 #endif	/* VENDOR_TOSHIBA */
129 
130 #endif	/* __VU_TOSH_H__ */
131 
132