18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * mediabay.h: definitions for using the media bay
48c2ecf20Sopenharmony_ci * on PowerBook 3400 and similar computers.
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci * Copyright (C) 1997 Paul Mackerras.
78c2ecf20Sopenharmony_ci */
88c2ecf20Sopenharmony_ci#ifndef _PPC_MEDIABAY_H
98c2ecf20Sopenharmony_ci#define _PPC_MEDIABAY_H
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci#ifdef __KERNEL__
128c2ecf20Sopenharmony_ci
138c2ecf20Sopenharmony_ci#define MB_FD		0	/* media bay contains floppy drive (automatic eject ?) */
148c2ecf20Sopenharmony_ci#define MB_FD1		1	/* media bay contains floppy drive (manual eject ?) */
158c2ecf20Sopenharmony_ci#define MB_SOUND	2	/* sound device ? */
168c2ecf20Sopenharmony_ci#define MB_CD		3	/* media bay contains ATA drive such as CD or ZIP */
178c2ecf20Sopenharmony_ci#define MB_PCI		5	/* media bay contains a PCI device */
188c2ecf20Sopenharmony_ci#define MB_POWER	6	/* media bay contains a Power device (???) */
198c2ecf20Sopenharmony_ci#define MB_NO		7	/* media bay contains nothing */
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_cistruct macio_dev;
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_ci#ifdef CONFIG_PMAC_MEDIABAY
248c2ecf20Sopenharmony_ci
258c2ecf20Sopenharmony_ci/* Check the content type of the bay, returns MB_NO if the bay is still
268c2ecf20Sopenharmony_ci * transitionning
278c2ecf20Sopenharmony_ci */
288c2ecf20Sopenharmony_ciextern int check_media_bay(struct macio_dev *bay);
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci/* The ATA driver uses the calls below to temporarily hold on the
318c2ecf20Sopenharmony_ci * media bay callbacks while initializing the interface
328c2ecf20Sopenharmony_ci */
338c2ecf20Sopenharmony_ciextern void lock_media_bay(struct macio_dev *bay);
348c2ecf20Sopenharmony_ciextern void unlock_media_bay(struct macio_dev *bay);
358c2ecf20Sopenharmony_ci
368c2ecf20Sopenharmony_ci#else
378c2ecf20Sopenharmony_ci
388c2ecf20Sopenharmony_cistatic inline int check_media_bay(struct macio_dev *bay)
398c2ecf20Sopenharmony_ci{
408c2ecf20Sopenharmony_ci	return MB_NO;
418c2ecf20Sopenharmony_ci}
428c2ecf20Sopenharmony_ci
438c2ecf20Sopenharmony_cistatic inline void lock_media_bay(struct macio_dev *bay) { }
448c2ecf20Sopenharmony_cistatic inline void unlock_media_bay(struct macio_dev *bay) { }
458c2ecf20Sopenharmony_ci
468c2ecf20Sopenharmony_ci#endif
478c2ecf20Sopenharmony_ci
488c2ecf20Sopenharmony_ci#endif /* __KERNEL__ */
498c2ecf20Sopenharmony_ci#endif /* _PPC_MEDIABAY_H */
50