1/******************************************************************************
2 *
3 * Module Name: bn.h
4 *   $Revision: 1.1.1.1 $
5 *
6 *****************************************************************************/
7
8/*
9 *  Copyright (C) 2000, 2001 Andrew Grover
10 *
11 *  This program is free software; you can redistribute it and/or modify
12 *  it under the terms of the GNU General Public License as published by
13 *  the Free Software Foundation; either version 2 of the License, or
14 *  (at your option) any later version.
15 *
16 *  This program is distributed in the hope that it will be useful,
17 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
18 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 *  GNU General Public License for more details.
20 *
21 *  You should have received a copy of the GNU General Public License
22 *  along with this program; if not, write to the Free Software
23 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
24 */
25
26
27#ifndef __BN_H__
28#define __BN_H__
29
30#include <actypes.h>
31#include <acexcep.h>
32#include <bm.h>
33
34
35/*****************************************************************************
36 *                            Types & Other Defines
37 *****************************************************************************/
38
39/*
40 * Notifications:
41 * ---------------------
42 */
43#define BN_NOTIFY_STATUS_CHANGE	((BM_NOTIFY) 0x80)
44
45
46/*
47 * Types:
48 * ------
49 */
50#define BN_TYPE_POWER_BUTTON	0x01
51#define BN_TYPE_POWER_BUTTON_FIXED 0x02
52#define BN_TYPE_SLEEP_BUTTON	0x03
53#define BN_TYPE_SLEEP_BUTTON_FIXED 0x04
54#define BN_TYPE_LID_SWITCH	0x05
55
56
57/*
58 * Hardware IDs:
59 * -------------
60 * TBD: Power and Sleep button HIDs also exist in <bm.h>.  Should all
61 *      HIDs (ACPI well-known devices) exist in one place (e.g.
62 *      acpi_hid.h)?
63 */
64#define BN_HID_POWER_BUTTON	"PNP0C0C"
65#define BN_HID_SLEEP_BUTTON	"PNP0C0E"
66#define BN_HID_LID_SWITCH	"PNP0C0D"
67
68
69/*
70 * Device Context:
71 * ---------------
72 */
73typedef struct
74{
75	BM_HANDLE		device_handle;
76	acpi_handle		acpi_handle;
77	u32			type;
78} BN_CONTEXT;
79
80
81/******************************************************************************
82 *                              Function Prototypes
83 *****************************************************************************/
84
85acpi_status
86bn_initialize (void);
87
88acpi_status
89bn_terminate (void);
90
91acpi_status
92bn_notify_fixed (
93	void			*context);
94
95acpi_status
96bn_notify (
97	u32			notify_type,
98	u32			device,
99	void			**context);
100
101acpi_status
102bn_request(
103	BM_REQUEST		*request_info,
104	void			*context);
105
106/* Button OSL */
107
108acpi_status
109bn_osl_add_device (
110	BN_CONTEXT		*button);
111
112acpi_status
113bn_osl_remove_device (
114	BN_CONTEXT		*button);
115
116acpi_status
117bn_osl_generate_event (
118	u32			event,
119	BN_CONTEXT		*button);
120
121
122#endif	/* __BN_H__ */
123