* add p cc
[mascara-docs.git] / i386 / linux / linux-2.3.21 / include / asm-ppc / feature.h
blob07b10e8bc66ca215069169adc7f36debab7b6d53
1 /*
2 * Definitions for accessing the Feature Control Register (FCR)
3 * on Power Macintoshes and similar machines. The FCR lets us
4 * enable/disable, reset, and power up/down various peripherals.
6 * This file is subject to the terms and conditions of the GNU General Public
7 * License. See the file "COPYING" in the main directory of this archive
8 * for more details.
10 * Copyright (C) 1998 Paul Mackerras.
12 #ifndef __ASM_PPC_FEATURE_H
13 #define __ASM_PPC_FEATURE_H
16 * The FCR bits for particular features vary somewhat between
17 * different machines. So we abstract a list of features here
18 * and let the feature_* routines map them to the actual bits.
20 enum system_feature {
21 FEATURE_null,
22 FEATURE_Serial_reset,
23 FEATURE_Serial_enable,
24 FEATURE_Serial_IO_A,
25 FEATURE_Serial_IO_B,
26 FEATURE_SWIM3_enable,
27 FEATURE_MESH_enable,
28 FEATURE_IDE_enable,
29 FEATURE_VIA_enable,
30 FEATURE_CD_power,
31 FEATURE_Mediabay_reset,
32 FEATURE_Mediabay_enable,
33 FEATURE_Mediabay_PCI_enable,
34 FEATURE_Mediabay_IDE_enable,
35 FEATURE_Mediabay_floppy_enable,
36 FEATURE_BMac_reset,
37 FEATURE_BMac_IO_enable,
38 FEATURE_Modem_Reset,
39 FEATURE_IDE_DiskPower,
40 FEATURE_IDE_Reset,
41 FEATURE_last,
44 /* Note about the device parameter: Each device gives it's own entry. If NULL,
45 the feature function will just do nothing and return -EINVAL.
46 The feature management will walk up the device tree until in reaches a recognized
47 chip for which features can be changed and it will then apply the necessary
48 features to that chip. If it's not found, -ENODEV is returned.
49 Note also that feature_test/set/clear are interrupt-safe provided that they are
50 called _after_ feature_init() is completed.
53 /* Test whether a particular feature is enabled. May return -ENODEV*/
54 extern int feature_test(struct device_node* device, enum system_feature f);
56 /* Set a particular feature. Returns 0 or -ENODEV */
57 extern int feature_set(struct device_node* device, enum system_feature f);
59 /* Clear a particular feature */
60 extern int feature_clear(struct device_node* device, enum system_feature f);
62 /* Initialize feature stuff */
63 extern void feature_init(void);
66 #endif /* __ASM_PPC_FEATURE_H */