xref: /linux/arch/powerpc/include/asm/mediabay.h (revision 498495dba268b20e8eadd7fe93c140c68b6cc9d2)
1*b2441318SGreg Kroah-Hartman /* SPDX-License-Identifier: GPL-2.0 */
2b8b572e1SStephen Rothwell /*
3b8b572e1SStephen Rothwell  * mediabay.h: definitions for using the media bay
4b8b572e1SStephen Rothwell  * on PowerBook 3400 and similar computers.
5b8b572e1SStephen Rothwell  *
6b8b572e1SStephen Rothwell  * Copyright (C) 1997 Paul Mackerras.
7b8b572e1SStephen Rothwell  */
8b8b572e1SStephen Rothwell #ifndef _PPC_MEDIABAY_H
9b8b572e1SStephen Rothwell #define _PPC_MEDIABAY_H
10b8b572e1SStephen Rothwell 
11b8b572e1SStephen Rothwell #ifdef __KERNEL__
12b8b572e1SStephen Rothwell 
13b8b572e1SStephen Rothwell #define MB_FD		0	/* media bay contains floppy drive (automatic eject ?) */
14b8b572e1SStephen Rothwell #define MB_FD1		1	/* media bay contains floppy drive (manual eject ?) */
15b8b572e1SStephen Rothwell #define MB_SOUND	2	/* sound device ? */
16b8b572e1SStephen Rothwell #define MB_CD		3	/* media bay contains ATA drive such as CD or ZIP */
17b8b572e1SStephen Rothwell #define MB_PCI		5	/* media bay contains a PCI device */
18b8b572e1SStephen Rothwell #define MB_POWER	6	/* media bay contains a Power device (???) */
19b8b572e1SStephen Rothwell #define MB_NO		7	/* media bay contains nothing */
20b8b572e1SStephen Rothwell 
21d58b0c39SBenjamin Herrenschmidt struct macio_dev;
22b8b572e1SStephen Rothwell 
23d58b0c39SBenjamin Herrenschmidt #ifdef CONFIG_PMAC_MEDIABAY
24b8b572e1SStephen Rothwell 
25d58b0c39SBenjamin Herrenschmidt /* Check the content type of the bay, returns MB_NO if the bay is still
26d58b0c39SBenjamin Herrenschmidt  * transitionning
27d58b0c39SBenjamin Herrenschmidt  */
28d58b0c39SBenjamin Herrenschmidt extern int check_media_bay(struct macio_dev *bay);
29b8b572e1SStephen Rothwell 
30d58b0c39SBenjamin Herrenschmidt /* The ATA driver uses the calls below to temporarily hold on the
31d58b0c39SBenjamin Herrenschmidt  * media bay callbacks while initializing the interface
32d58b0c39SBenjamin Herrenschmidt  */
33d58b0c39SBenjamin Herrenschmidt extern void lock_media_bay(struct macio_dev *bay);
34d58b0c39SBenjamin Herrenschmidt extern void unlock_media_bay(struct macio_dev *bay);
35b8b572e1SStephen Rothwell 
36b8b572e1SStephen Rothwell #else
37b8b572e1SStephen Rothwell 
check_media_bay(struct macio_dev * bay)38d58b0c39SBenjamin Herrenschmidt static inline int check_media_bay(struct macio_dev *bay)
39b8b572e1SStephen Rothwell {
40d58b0c39SBenjamin Herrenschmidt 	return MB_NO;
41b8b572e1SStephen Rothwell }
42b8b572e1SStephen Rothwell 
lock_media_bay(struct macio_dev * bay)43d58b0c39SBenjamin Herrenschmidt static inline void lock_media_bay(struct macio_dev *bay) { }
unlock_media_bay(struct macio_dev * bay)44d58b0c39SBenjamin Herrenschmidt static inline void unlock_media_bay(struct macio_dev *bay) { }
45d58b0c39SBenjamin Herrenschmidt 
46b8b572e1SStephen Rothwell #endif
47b8b572e1SStephen Rothwell 
48b8b572e1SStephen Rothwell #endif /* __KERNEL__ */
49b8b572e1SStephen Rothwell #endif /* _PPC_MEDIABAY_H */
50