\hypertarget{acpi__button_8c_source}{}\doxysection{acpi\+\_\+button.\+c}
\label{acpi__button_8c_source}\index{dev/acpica/acpi\_button.c@{dev/acpica/acpi\_button.c}}
\mbox{\hyperlink{acpi__button_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00001}00001 \textcolor{comment}{/*-\/}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00002}00002 \textcolor{comment}{ * Copyright (c) 2000 Mitsaru IWASAKI <iwasaki@jp.freebsd.org>}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00003}00003 \textcolor{comment}{ * Copyright (c) 2000 Michael Smith <msmith@freebsd.org>}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00004}00004 \textcolor{comment}{ * Copyright (c) 2000 BSDi}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00005}00005 \textcolor{comment}{ * All rights reserved.}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00006}00006 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00007}00007 \textcolor{comment}{ * Redistribution and use in source and binary forms, with or without}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00008}00008 \textcolor{comment}{ * modification, are permitted provided that the following conditions}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00009}00009 \textcolor{comment}{ * are met:}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00010}00010 \textcolor{comment}{ * 1. Redistributions of source code must retain the above copyright}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00011}00011 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer.}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00012}00012 \textcolor{comment}{ * 2. Redistributions in binary form must reproduce the above copyright}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00013}00013 \textcolor{comment}{ *    notice, this list of conditions and the following disclaimer in the}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00014}00014 \textcolor{comment}{ *    documentation and/or other materials provided with the distribution.}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00015}00015 \textcolor{comment}{ *}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00016}00016 \textcolor{comment}{ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00017}00017 \textcolor{comment}{ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00018}00018 \textcolor{comment}{ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00019}00019 \textcolor{comment}{ * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00020}00020 \textcolor{comment}{ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00021}00021 \textcolor{comment}{ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00022}00022 \textcolor{comment}{ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00023}00023 \textcolor{comment}{ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00024}00024 \textcolor{comment}{ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00025}00025 \textcolor{comment}{ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00026}00026 \textcolor{comment}{ * SUCH DAMAGE.}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00027}00027 \textcolor{comment}{ */}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00028}00028 }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00029}00029 \textcolor{preprocessor}{\#include <sys/cdefs.h>}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00030}\mbox{\hyperlink{acpi__button_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{00030}} \mbox{\hyperlink{acpi__button_8c_a8c3ef283470a68cd30afe9b8a72cb60f}{\_\_FBSDID}}(\textcolor{stringliteral}{"{}\$FreeBSD\$"{}});}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00031}00031 }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00032}00032 \textcolor{preprocessor}{\#include "{}opt\_acpi.h"{}}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00033}00033 \textcolor{preprocessor}{\#include "{}opt\_evdev.h"{}}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00034}00034 \textcolor{preprocessor}{\#include <sys/param.h>}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00035}00035 \textcolor{preprocessor}{\#include <sys/kernel.h>}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00036}00036 \textcolor{preprocessor}{\#include <sys/module.h>}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00037}00037 \textcolor{preprocessor}{\#include <sys/bus.h>}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00038}00038 }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00039}00039 \textcolor{preprocessor}{\#include <contrib/dev/acpica/include/acpi.h>}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00040}00040 \textcolor{preprocessor}{\#include <contrib/dev/acpica/include/accommon.h>}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00041}00041 }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00042}00042 \textcolor{preprocessor}{\#include <\mbox{\hyperlink{acpivar_8h}{dev/acpica/acpivar.h}}>}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00043}00043 }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00044}00044 \textcolor{preprocessor}{\#ifdef EVDEV\_SUPPORT}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00045}00045 \textcolor{preprocessor}{\#include <dev/evdev/input.h>}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00046}00046 \textcolor{preprocessor}{\#include <dev/evdev/evdev.h>}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00047}00047 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00048}00048 }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00049}00049 \textcolor{comment}{/* Hooks for the ACPI CA debugging infrastructure */}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00050}\mbox{\hyperlink{acpi__button_8c_ac76d546e6c738c61838d855c815bfbcc}{00050}} \textcolor{preprocessor}{\#define \_COMPONENT      ACPI\_BUTTON}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00051}00051 ACPI\_MODULE\_NAME(\textcolor{stringliteral}{"{}BUTTON"{}})}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00052}00052 }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00053}\mbox{\hyperlink{structacpi__button__softc}{00053}} struct \mbox{\hyperlink{structacpi__button__softc}{acpi\_button\_softc}} \{}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00054}\mbox{\hyperlink{structacpi__button__softc_a0242cd1c7002e5bb945921548a372fa0}{00054}}     device\_t    \mbox{\hyperlink{structacpi__button__softc_a0242cd1c7002e5bb945921548a372fa0}{button\_dev}};}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00055}\mbox{\hyperlink{structacpi__button__softc_a2890636a7ec9af8b7901b64561a0f94f}{00055}}     ACPI\_HANDLE \mbox{\hyperlink{structacpi__button__softc_a2890636a7ec9af8b7901b64561a0f94f}{button\_handle}};}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00056}\mbox{\hyperlink{structacpi__button__softc_a59351850667be2c19f77e7bc84e2de9c}{00056}}     boolean\_t   \mbox{\hyperlink{structacpi__button__softc_a59351850667be2c19f77e7bc84e2de9c}{button\_type}};}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00057}\mbox{\hyperlink{acpi__button_8c_af4e00151aea6bb1131e1631ce2300366}{00057}} \textcolor{preprocessor}{\#define         ACPI\_POWER\_BUTTON       0}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00058}\mbox{\hyperlink{acpi__button_8c_a31df40a76e93fe84e07b5134ddf89b45}{00058}} \textcolor{preprocessor}{\#define         ACPI\_SLEEP\_BUTTON       1}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00059}\mbox{\hyperlink{structacpi__button__softc_af7171d0452c26a38399c2e68ea6a3237}{00059}}     boolean\_t   \mbox{\hyperlink{structacpi__button__softc_af7171d0452c26a38399c2e68ea6a3237}{fixed}};}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00060}00060 \textcolor{preprocessor}{\#ifdef EVDEV\_SUPPORT}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00061}00061     \textcolor{keyword}{struct }evdev\_dev *button\_evdev;}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00062}00062 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00063}00063 \};}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00064}00064 }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00065}\mbox{\hyperlink{acpi__button_8c_a99b5aa95c0c62df9370419d773d8319c}{00065}} \textcolor{preprocessor}{\#define         ACPI\_NOTIFY\_BUTTON\_PRESSED\_FOR\_SLEEP    0x80}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00066}\mbox{\hyperlink{acpi__button_8c_a507a572a8f604c4eddf175ddc4a8bc3d}{00066}} \textcolor{preprocessor}{\#define         ACPI\_NOTIFY\_BUTTON\_PRESSED\_FOR\_WAKEUP   0x02}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00067}00067 }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00068}00068 \textcolor{keyword}{static} \textcolor{keywordtype}{int}      \mbox{\hyperlink{acpi__button_8c_a62cdb49d2930d0cb1cfc5c6cb84501ea}{acpi\_button\_probe}}(device\_t \mbox{\hyperlink{acpi__bus__if_8m_a5b84348f4a546955afe3156099e597f4}{dev}});}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00069}00069 \textcolor{keyword}{static} \textcolor{keywordtype}{int}      \mbox{\hyperlink{acpi__button_8c_a1b931a6fe687c362f93a10fd5ba7d898}{acpi\_button\_attach}}(device\_t \mbox{\hyperlink{acpi__bus__if_8m_a5b84348f4a546955afe3156099e597f4}{dev}});}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00070}00070 \textcolor{keyword}{static} \textcolor{keywordtype}{int}      \mbox{\hyperlink{acpi__button_8c_ad6f11858579e3694d0ea1c7b86c95621}{acpi\_button\_suspend}}(device\_t \mbox{\hyperlink{acpi__bus__if_8m_a5b84348f4a546955afe3156099e597f4}{dev}});}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00071}00071 \textcolor{keyword}{static} \textcolor{keywordtype}{int}      \mbox{\hyperlink{acpi__button_8c_a6d656441ef8acba525b7d5adbc6c9e71}{acpi\_button\_resume}}(device\_t \mbox{\hyperlink{acpi__bus__if_8m_a5b84348f4a546955afe3156099e597f4}{dev}});}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00072}00072 \textcolor{keyword}{static} \textcolor{keywordtype}{void}     \mbox{\hyperlink{acpi__button_8c_a487f5adad97bdaafc6a68ce1621e0ffe}{acpi\_button\_notify\_handler}}(ACPI\_HANDLE h, UINT32 notify,}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00073}00073                                            \textcolor{keywordtype}{void} *context);}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00074}00074 \textcolor{keyword}{static} ACPI\_STATUS}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00075}00075                 \mbox{\hyperlink{acpi__button_8c_ab098e02802bd3d996c06c5246cc9c5d7}{acpi\_button\_fixed\_handler}}(\textcolor{keywordtype}{void} *context);}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00076}00076 \textcolor{keyword}{static} \textcolor{keywordtype}{void}     \mbox{\hyperlink{acpi__button_8c_af3503ccd6dd04d076f7b8f50f627af20}{acpi\_button\_notify\_sleep}}(\textcolor{keywordtype}{void} *\mbox{\hyperlink{acpi__if_8m_a9ce2ec4812a92cb6ab39f6e81e9173a9}{arg}});}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00077}00077 \textcolor{keyword}{static} \textcolor{keywordtype}{void}     \mbox{\hyperlink{acpi__button_8c_acbcb021f51cfb0630e4bfcf50159302e}{acpi\_button\_notify\_wakeup}}(\textcolor{keywordtype}{void} *\mbox{\hyperlink{acpi__if_8m_a9ce2ec4812a92cb6ab39f6e81e9173a9}{arg}});}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00078}00078 }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00079}\mbox{\hyperlink{acpi__button_8c_ac91cce34d82b8f1a1d6571bdf5c52138}{00079}} \textcolor{keyword}{static} \textcolor{keywordtype}{char} *\mbox{\hyperlink{acpi__button_8c_ac91cce34d82b8f1a1d6571bdf5c52138}{btn\_ids}}[] = \{}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00080}00080     \textcolor{stringliteral}{"{}PNP0C0C"{}}, \textcolor{stringliteral}{"{}ACPI\_FPB"{}}, \textcolor{stringliteral}{"{}PNP0C0E"{}}, \textcolor{stringliteral}{"{}ACPI\_FSB"{}},}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00081}00081     NULL}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00082}00082 \};}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00083}00083 }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00084}\mbox{\hyperlink{acpi__button_8c_a7c29d2791cfc51d46dfa735ed03f0340}{00084}} \textcolor{keyword}{static} device\_method\_t \mbox{\hyperlink{acpi__button_8c_a7c29d2791cfc51d46dfa735ed03f0340}{acpi\_button\_methods}}[] = \{}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00085}00085     \textcolor{comment}{/* Device interface */}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00086}00086     DEVMETHOD(device\_probe,     \mbox{\hyperlink{acpi__button_8c_a62cdb49d2930d0cb1cfc5c6cb84501ea}{acpi\_button\_probe}}),}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00087}00087     DEVMETHOD(device\_attach,    \mbox{\hyperlink{acpi__button_8c_a1b931a6fe687c362f93a10fd5ba7d898}{acpi\_button\_attach}}),}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00088}00088     DEVMETHOD(device\_suspend,   \mbox{\hyperlink{acpi__button_8c_ad6f11858579e3694d0ea1c7b86c95621}{acpi\_button\_suspend}}),}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00089}00089     DEVMETHOD(device\_shutdown,  \mbox{\hyperlink{acpi__button_8c_ad6f11858579e3694d0ea1c7b86c95621}{acpi\_button\_suspend}}),}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00090}00090     DEVMETHOD(device\_resume,    \mbox{\hyperlink{acpi__button_8c_a6d656441ef8acba525b7d5adbc6c9e71}{acpi\_button\_resume}}),}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00091}00091     DEVMETHOD\_END}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00092}00092 \};}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00093}00093 }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00094}\mbox{\hyperlink{acpi__button_8c_ac683bd88fae60d22f779ffe371af93a8}{00094}} \textcolor{keyword}{static} driver\_t \mbox{\hyperlink{acpi__button_8c_ac683bd88fae60d22f779ffe371af93a8}{acpi\_button\_driver}} = \{}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00095}00095     \textcolor{stringliteral}{"{}acpi\_button"{}},}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00096}00096     \mbox{\hyperlink{acpi__button_8c_a7c29d2791cfc51d46dfa735ed03f0340}{acpi\_button\_methods}},}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00097}00097     \textcolor{keyword}{sizeof}(\textcolor{keyword}{struct }\mbox{\hyperlink{structacpi__button__softc}{acpi\_button\_softc}}),}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00098}00098 \};}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00099}00099 }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00100}\mbox{\hyperlink{acpi__button_8c_a0b951fef56f93beea8cf16ffac3993eb}{00100}} \textcolor{keyword}{static} devclass\_t \mbox{\hyperlink{acpi__button_8c_a0b951fef56f93beea8cf16ffac3993eb}{acpi\_button\_devclass}};}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00101}\mbox{\hyperlink{acpi__button_8c_af3b1a40db418c0eb6226c7591559e477}{00101}} \mbox{\hyperlink{acpi__button_8c_af3b1a40db418c0eb6226c7591559e477}{DRIVER\_MODULE}}(acpi\_button, \mbox{\hyperlink{acpi__if_8m_a5d0db714ee9e465e6cab2260587a6062}{acpi}}, \mbox{\hyperlink{acpi__button_8c_ac683bd88fae60d22f779ffe371af93a8}{acpi\_button\_driver}}, \mbox{\hyperlink{acpi__button_8c_a0b951fef56f93beea8cf16ffac3993eb}{acpi\_button\_devclass}},}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00102}00102               0, 0);}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00103}\mbox{\hyperlink{acpi__button_8c_acea58f9d40e9f34499de535e569c47fa}{00103}} \mbox{\hyperlink{acpi__button_8c_acea58f9d40e9f34499de535e569c47fa}{MODULE\_DEPEND}}(acpi\_button, \mbox{\hyperlink{acpi__if_8m_a5d0db714ee9e465e6cab2260587a6062}{acpi}}, 1, 1, 1);}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00104}00104 }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00105}00105 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00106}\mbox{\hyperlink{acpi__button_8c_a62cdb49d2930d0cb1cfc5c6cb84501ea}{00106}} \mbox{\hyperlink{acpi__button_8c_a62cdb49d2930d0cb1cfc5c6cb84501ea}{acpi\_button\_probe}}(device\_t \mbox{\hyperlink{acpi__bus__if_8m_a5b84348f4a546955afe3156099e597f4}{dev}})}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00107}00107 \{}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00108}00108     \textcolor{keyword}{struct }\mbox{\hyperlink{structacpi__button__softc}{acpi\_button\_softc}} *sc;}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00109}00109     \textcolor{keywordtype}{char} *str; }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00110}00110     \textcolor{keywordtype}{int} rv;}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00111}00111 }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00112}00112     \textcolor{keywordflow}{if} (\mbox{\hyperlink{acpi_8c_a1713faa3d6beef1dd28bdb59dd901f30}{acpi\_disabled}}(\textcolor{stringliteral}{"{}button"{}}))}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00113}00113         \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00114}00114     rv = ACPI\_ID\_PROBE(device\_get\_parent(\mbox{\hyperlink{acpi__bus__if_8m_a5b84348f4a546955afe3156099e597f4}{dev}}), \mbox{\hyperlink{acpi__bus__if_8m_a5b84348f4a546955afe3156099e597f4}{dev}}, \mbox{\hyperlink{acpi__button_8c_ac91cce34d82b8f1a1d6571bdf5c52138}{btn\_ids}}, \&str);}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00115}00115     \textcolor{keywordflow}{if} (rv > 0)}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00116}00116         \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00117}00117     }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00118}00118     sc = device\_get\_softc(\mbox{\hyperlink{acpi__bus__if_8m_a5b84348f4a546955afe3156099e597f4}{dev}});}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00119}00119     \textcolor{keywordflow}{if} (strcmp(str, \textcolor{stringliteral}{"{}PNP0C0C"{}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00120}00120         device\_set\_desc(\mbox{\hyperlink{acpi__bus__if_8m_a5b84348f4a546955afe3156099e597f4}{dev}}, \textcolor{stringliteral}{"{}Power Button"{}});}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00121}00121         sc-\/>\mbox{\hyperlink{structacpi__button__softc_a59351850667be2c19f77e7bc84e2de9c}{button\_type}} = \mbox{\hyperlink{acpi__button_8c_af4e00151aea6bb1131e1631ce2300366}{ACPI\_POWER\_BUTTON}};}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00122}00122     \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (strcmp(str, \textcolor{stringliteral}{"{}ACPI\_FPB"{}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00123}00123         device\_set\_desc(\mbox{\hyperlink{acpi__bus__if_8m_a5b84348f4a546955afe3156099e597f4}{dev}}, \textcolor{stringliteral}{"{}Power Button (fixed)"{}});}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00124}00124         sc-\/>\mbox{\hyperlink{structacpi__button__softc_a59351850667be2c19f77e7bc84e2de9c}{button\_type}} = \mbox{\hyperlink{acpi__button_8c_af4e00151aea6bb1131e1631ce2300366}{ACPI\_POWER\_BUTTON}};}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00125}00125         sc-\/>\mbox{\hyperlink{structacpi__button__softc_af7171d0452c26a38399c2e68ea6a3237}{fixed}} = 1;}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00126}00126     \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (strcmp(str, \textcolor{stringliteral}{"{}PNP0C0E"{}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00127}00127         device\_set\_desc(\mbox{\hyperlink{acpi__bus__if_8m_a5b84348f4a546955afe3156099e597f4}{dev}}, \textcolor{stringliteral}{"{}Sleep Button"{}});}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00128}00128         sc-\/>\mbox{\hyperlink{structacpi__button__softc_a59351850667be2c19f77e7bc84e2de9c}{button\_type}} = \mbox{\hyperlink{acpi__button_8c_a31df40a76e93fe84e07b5134ddf89b45}{ACPI\_SLEEP\_BUTTON}};}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00129}00129     \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (strcmp(str, \textcolor{stringliteral}{"{}ACPI\_FSB"{}}) == 0) \{}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00130}00130         device\_set\_desc(\mbox{\hyperlink{acpi__bus__if_8m_a5b84348f4a546955afe3156099e597f4}{dev}}, \textcolor{stringliteral}{"{}Sleep Button (fixed)"{}});}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00131}00131         sc-\/>\mbox{\hyperlink{structacpi__button__softc_a59351850667be2c19f77e7bc84e2de9c}{button\_type}} = \mbox{\hyperlink{acpi__button_8c_a31df40a76e93fe84e07b5134ddf89b45}{ACPI\_SLEEP\_BUTTON}};}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00132}00132         sc-\/>\mbox{\hyperlink{structacpi__button__softc_af7171d0452c26a38399c2e68ea6a3237}{fixed}} = 1;}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00133}00133     \}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00134}00134 }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00135}00135     \textcolor{keywordflow}{return} (rv);}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00136}00136 \}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00137}00137 }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00138}00138 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00139}\mbox{\hyperlink{acpi__button_8c_a1b931a6fe687c362f93a10fd5ba7d898}{00139}} \mbox{\hyperlink{acpi__button_8c_a1b931a6fe687c362f93a10fd5ba7d898}{acpi\_button\_attach}}(device\_t \mbox{\hyperlink{acpi__bus__if_8m_a5b84348f4a546955afe3156099e597f4}{dev}})}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00140}00140 \{}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00141}00141     \textcolor{keyword}{struct }\mbox{\hyperlink{structacpi__prw__data}{acpi\_prw\_data}}   prw;}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00142}00142     \textcolor{keyword}{struct }\mbox{\hyperlink{structacpi__button__softc}{acpi\_button\_softc}}   *sc;}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00143}00143     ACPI\_STATUS                 status;}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00144}00144     \textcolor{keywordtype}{int} event;}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00145}00145 }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00146}00146     ACPI\_FUNCTION\_TRACE((\textcolor{keywordtype}{char} *)(uintptr\_t)\_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00147}00147 }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00148}00148     sc = device\_get\_softc(\mbox{\hyperlink{acpi__bus__if_8m_a5b84348f4a546955afe3156099e597f4}{dev}});}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00149}00149     sc-\/>\mbox{\hyperlink{structacpi__button__softc_a0242cd1c7002e5bb945921548a372fa0}{button\_dev}} = \mbox{\hyperlink{acpi__bus__if_8m_a5b84348f4a546955afe3156099e597f4}{dev}};}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00150}00150     sc-\/>\mbox{\hyperlink{structacpi__button__softc_a2890636a7ec9af8b7901b64561a0f94f}{button\_handle}} = acpi\_get\_handle(\mbox{\hyperlink{acpi__bus__if_8m_a5b84348f4a546955afe3156099e597f4}{dev}});}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00151}00151     \textcolor{keyword}{event} = (sc-\/>\mbox{\hyperlink{structacpi__button__softc_a59351850667be2c19f77e7bc84e2de9c}{button\_type}} == \mbox{\hyperlink{acpi__button_8c_a31df40a76e93fe84e07b5134ddf89b45}{ACPI\_SLEEP\_BUTTON}}) ?}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00152}00152             ACPI\_EVENT\_SLEEP\_BUTTON : ACPI\_EVENT\_POWER\_BUTTON;}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00153}00153 }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00154}00154 \textcolor{preprocessor}{\#ifdef EVDEV\_SUPPORT}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00155}00155     sc-\/>button\_evdev = evdev\_alloc();}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00156}00156     evdev\_set\_name(sc-\/>button\_evdev, device\_get\_desc(\mbox{\hyperlink{acpi__bus__if_8m_a5b84348f4a546955afe3156099e597f4}{dev}}));}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00157}00157     evdev\_set\_phys(sc-\/>button\_evdev, device\_get\_nameunit(\mbox{\hyperlink{acpi__bus__if_8m_a5b84348f4a546955afe3156099e597f4}{dev}}));}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00158}00158     evdev\_set\_id(sc-\/>button\_evdev, BUS\_HOST, 0, 0, 1);}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00159}00159     evdev\_support\_event(sc-\/>button\_evdev, EV\_SYN);}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00160}00160     evdev\_support\_event(sc-\/>button\_evdev, EV\_KEY);}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00161}00161     evdev\_support\_key(sc-\/>button\_evdev,}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00162}00162         (sc-\/>\mbox{\hyperlink{structacpi__button__softc_a59351850667be2c19f77e7bc84e2de9c}{button\_type}} == \mbox{\hyperlink{acpi__button_8c_a31df40a76e93fe84e07b5134ddf89b45}{ACPI\_SLEEP\_BUTTON}}) ? KEY\_SLEEP : KEY\_POWER);}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00163}00163 }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00164}00164     \textcolor{keywordflow}{if} (evdev\_register(sc-\/>button\_evdev))}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00165}00165         \textcolor{keywordflow}{return} (ENXIO);}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00166}00166 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00167}00167 }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00168}00168     \textcolor{comment}{/* }}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00169}00169 \textcolor{comment}{     * Install the new handler.  We could remove any fixed handlers added}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00170}00170 \textcolor{comment}{     * from the FADT once we have a duplicate from the AML but some systems}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00171}00171 \textcolor{comment}{     * only return events on one or the other so we have to keep both.}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00172}00172 \textcolor{comment}{     */}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00173}00173     \textcolor{keywordflow}{if} (sc-\/>\mbox{\hyperlink{structacpi__button__softc_af7171d0452c26a38399c2e68ea6a3237}{fixed}}) \{}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00174}00174         AcpiClearEvent(event);}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00175}00175         status = AcpiInstallFixedEventHandler(event,}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00176}00176                         \mbox{\hyperlink{acpi__button_8c_ab098e02802bd3d996c06c5246cc9c5d7}{acpi\_button\_fixed\_handler}}, sc);}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00177}00177     \} \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00178}00178         \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00179}00179 \textcolor{comment}{         * If a system does not get lid events, it may make sense to change}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00180}00180 \textcolor{comment}{         * the type to ACPI\_ALL\_NOTIFY.  Some systems generate both a wake}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00181}00181 \textcolor{comment}{         * and runtime notify in that case though.}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00182}00182 \textcolor{comment}{         */}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00183}00183         status = AcpiInstallNotifyHandler(sc-\/>\mbox{\hyperlink{structacpi__button__softc_a2890636a7ec9af8b7901b64561a0f94f}{button\_handle}},}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00184}00184                         ACPI\_DEVICE\_NOTIFY, \mbox{\hyperlink{acpi__button_8c_a487f5adad97bdaafc6a68ce1621e0ffe}{acpi\_button\_notify\_handler}}, sc);}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00185}00185     \}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00186}00186     \textcolor{keywordflow}{if} (ACPI\_FAILURE(status)) \{}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00187}00187         device\_printf(sc-\/>\mbox{\hyperlink{structacpi__button__softc_a0242cd1c7002e5bb945921548a372fa0}{button\_dev}}, \textcolor{stringliteral}{"{}couldn't install notify handler -\/ \%s\(\backslash\)n"{}},}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00188}00188                       AcpiFormatException(status));}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00189}00189         return\_VALUE (ENXIO);}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00190}00190     \}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00191}00191 }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00192}00192     \textcolor{comment}{/* Enable the GPE for wake/runtime. */}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00193}00193     \mbox{\hyperlink{acpi_8c_aac9a5222024295e2a2d099126f274b26}{acpi\_wake\_set\_enable}}(\mbox{\hyperlink{acpi__bus__if_8m_a5b84348f4a546955afe3156099e597f4}{dev}}, 1);}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00194}00194     \textcolor{keywordflow}{if} (\mbox{\hyperlink{acpi_8c_aaa72e653e4ea02709b2770776a4517c2}{acpi\_parse\_prw}}(sc-\/>\mbox{\hyperlink{structacpi__button__softc_a2890636a7ec9af8b7901b64561a0f94f}{button\_handle}}, \&prw) == 0)}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00195}00195         AcpiEnableGpe(prw.\mbox{\hyperlink{structacpi__prw__data_a677ced6d60c8e25988afcc80cb2656f1}{gpe\_handle}}, prw.\mbox{\hyperlink{structacpi__prw__data_a3578e15a54787e3cb6a1ef7a747f6f13}{gpe\_bit}});}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00196}00196 }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00197}00197     return\_VALUE (0);}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00198}00198 \}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00199}00199 }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00200}00200 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00201}\mbox{\hyperlink{acpi__button_8c_ad6f11858579e3694d0ea1c7b86c95621}{00201}} \mbox{\hyperlink{acpi__button_8c_ad6f11858579e3694d0ea1c7b86c95621}{acpi\_button\_suspend}}(device\_t \mbox{\hyperlink{acpi__bus__if_8m_a5b84348f4a546955afe3156099e597f4}{dev}})}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00202}00202 \{}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00203}00203     \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00204}00204 \}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00205}00205 }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00206}00206 \textcolor{keyword}{static} \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00207}\mbox{\hyperlink{acpi__button_8c_a6d656441ef8acba525b7d5adbc6c9e71}{00207}} \mbox{\hyperlink{acpi__button_8c_a6d656441ef8acba525b7d5adbc6c9e71}{acpi\_button\_resume}}(device\_t \mbox{\hyperlink{acpi__bus__if_8m_a5b84348f4a546955afe3156099e597f4}{dev}})}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00208}00208 \{}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00209}00209     \textcolor{keywordflow}{return} (0);}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00210}00210 \}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00211}00211 }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00212}00212 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00213}\mbox{\hyperlink{acpi__button_8c_af3503ccd6dd04d076f7b8f50f627af20}{00213}} \mbox{\hyperlink{acpi__button_8c_af3503ccd6dd04d076f7b8f50f627af20}{acpi\_button\_notify\_sleep}}(\textcolor{keywordtype}{void} *\mbox{\hyperlink{acpi__if_8m_a9ce2ec4812a92cb6ab39f6e81e9173a9}{arg}})}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00214}00214 \{}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00215}00215     \textcolor{keyword}{struct }\mbox{\hyperlink{structacpi__button__softc}{acpi\_button\_softc}}   *sc;}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00216}00216     \textcolor{keyword}{struct }\mbox{\hyperlink{structacpi__softc}{acpi\_softc}}         *acpi\_sc;}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00217}00217 }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00218}00218     ACPI\_FUNCTION\_TRACE((\textcolor{keywordtype}{char} *)(uintptr\_t)\_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00219}00219 }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00220}00220     sc = (\textcolor{keyword}{struct }\mbox{\hyperlink{structacpi__button__softc}{acpi\_button\_softc}} *)\mbox{\hyperlink{acpi__if_8m_a9ce2ec4812a92cb6ab39f6e81e9173a9}{arg}};}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00221}00221     acpi\_sc = \mbox{\hyperlink{acpivar_8h_a089f3e499f9f37b4b702fa96a6bca97c}{acpi\_device\_get\_parent\_softc}}(sc-\/>\mbox{\hyperlink{structacpi__button__softc_a0242cd1c7002e5bb945921548a372fa0}{button\_dev}});}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00222}00222     \textcolor{keywordflow}{if} (acpi\_sc == NULL)}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00223}00223         return\_VOID;}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00224}00224 }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00225}00225     \mbox{\hyperlink{acpi_8c_a618ff13b6ecf28dba4cee0829006de86}{acpi\_UserNotify}}(\textcolor{stringliteral}{"{}Button"{}}, sc-\/>\mbox{\hyperlink{structacpi__button__softc_a2890636a7ec9af8b7901b64561a0f94f}{button\_handle}}, sc-\/>\mbox{\hyperlink{structacpi__button__softc_a59351850667be2c19f77e7bc84e2de9c}{button\_type}});}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00226}00226 }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00227}00227     \textcolor{keywordflow}{switch} (sc-\/>\mbox{\hyperlink{structacpi__button__softc_a59351850667be2c19f77e7bc84e2de9c}{button\_type}}) \{}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00228}00228     \textcolor{keywordflow}{case} \mbox{\hyperlink{acpi__button_8c_af4e00151aea6bb1131e1631ce2300366}{ACPI\_POWER\_BUTTON}}:}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00229}00229         \mbox{\hyperlink{acpivar_8h_abc8518069380334353a11c61577e5196}{ACPI\_VPRINT}}(sc-\/>\mbox{\hyperlink{structacpi__button__softc_a0242cd1c7002e5bb945921548a372fa0}{button\_dev}}, acpi\_sc, \textcolor{stringliteral}{"{}power button pressed\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00230}00230         \mbox{\hyperlink{acpi_8c_a2e703212e2b57082b50ab4565c234eb0}{acpi\_event\_power\_button\_sleep}}(acpi\_sc);}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00231}00231         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00232}00232     \textcolor{keywordflow}{case} \mbox{\hyperlink{acpi__button_8c_a31df40a76e93fe84e07b5134ddf89b45}{ACPI\_SLEEP\_BUTTON}}:}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00233}00233         \mbox{\hyperlink{acpivar_8h_abc8518069380334353a11c61577e5196}{ACPI\_VPRINT}}(sc-\/>\mbox{\hyperlink{structacpi__button__softc_a0242cd1c7002e5bb945921548a372fa0}{button\_dev}}, acpi\_sc, \textcolor{stringliteral}{"{}sleep button pressed\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00234}00234         \mbox{\hyperlink{acpi_8c_a60f0555c45d47a4ffb30459fb01eb4ab}{acpi\_event\_sleep\_button\_sleep}}(acpi\_sc);}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00235}00235         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00236}00236     \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00237}00237         \textcolor{keywordflow}{break};          \textcolor{comment}{/* unknown button type */}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00238}00238     \}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00239}00239 \}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00240}00240 }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00241}00241 \textcolor{keyword}{static} \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00242}\mbox{\hyperlink{acpi__button_8c_acbcb021f51cfb0630e4bfcf50159302e}{00242}} \mbox{\hyperlink{acpi__button_8c_acbcb021f51cfb0630e4bfcf50159302e}{acpi\_button\_notify\_wakeup}}(\textcolor{keywordtype}{void} *\mbox{\hyperlink{acpi__if_8m_a9ce2ec4812a92cb6ab39f6e81e9173a9}{arg}})}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00243}00243 \{}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00244}00244     \textcolor{keyword}{struct }\mbox{\hyperlink{structacpi__button__softc}{acpi\_button\_softc}}   *sc;}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00245}00245     \textcolor{keyword}{struct }\mbox{\hyperlink{structacpi__softc}{acpi\_softc}}         *acpi\_sc;}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00246}00246 }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00247}00247     ACPI\_FUNCTION\_TRACE((\textcolor{keywordtype}{char} *)(uintptr\_t)\_\_func\_\_);}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00248}00248 }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00249}00249     sc = (\textcolor{keyword}{struct }\mbox{\hyperlink{structacpi__button__softc}{acpi\_button\_softc}} *)\mbox{\hyperlink{acpi__if_8m_a9ce2ec4812a92cb6ab39f6e81e9173a9}{arg}};}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00250}00250     acpi\_sc = \mbox{\hyperlink{acpivar_8h_a089f3e499f9f37b4b702fa96a6bca97c}{acpi\_device\_get\_parent\_softc}}(sc-\/>\mbox{\hyperlink{structacpi__button__softc_a0242cd1c7002e5bb945921548a372fa0}{button\_dev}});}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00251}00251     \textcolor{keywordflow}{if} (acpi\_sc == NULL)}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00252}00252         return\_VOID;}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00253}00253 }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00254}00254     \mbox{\hyperlink{acpi_8c_a618ff13b6ecf28dba4cee0829006de86}{acpi\_UserNotify}}(\textcolor{stringliteral}{"{}Button"{}}, sc-\/>\mbox{\hyperlink{structacpi__button__softc_a2890636a7ec9af8b7901b64561a0f94f}{button\_handle}}, sc-\/>\mbox{\hyperlink{structacpi__button__softc_a59351850667be2c19f77e7bc84e2de9c}{button\_type}});}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00255}00255 }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00256}00256     \textcolor{keywordflow}{switch} (sc-\/>\mbox{\hyperlink{structacpi__button__softc_a59351850667be2c19f77e7bc84e2de9c}{button\_type}}) \{}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00257}00257     \textcolor{keywordflow}{case} \mbox{\hyperlink{acpi__button_8c_af4e00151aea6bb1131e1631ce2300366}{ACPI\_POWER\_BUTTON}}:}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00258}00258         \mbox{\hyperlink{acpivar_8h_abc8518069380334353a11c61577e5196}{ACPI\_VPRINT}}(sc-\/>\mbox{\hyperlink{structacpi__button__softc_a0242cd1c7002e5bb945921548a372fa0}{button\_dev}}, acpi\_sc, \textcolor{stringliteral}{"{}wakeup by power button\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00259}00259         \mbox{\hyperlink{acpi_8c_a6968d8640d02ba83cf7e9b9dc0196113}{acpi\_event\_power\_button\_wake}}(acpi\_sc);}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00260}00260         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00261}00261     \textcolor{keywordflow}{case} \mbox{\hyperlink{acpi__button_8c_a31df40a76e93fe84e07b5134ddf89b45}{ACPI\_SLEEP\_BUTTON}}:}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00262}00262         \mbox{\hyperlink{acpivar_8h_abc8518069380334353a11c61577e5196}{ACPI\_VPRINT}}(sc-\/>\mbox{\hyperlink{structacpi__button__softc_a0242cd1c7002e5bb945921548a372fa0}{button\_dev}}, acpi\_sc, \textcolor{stringliteral}{"{}wakeup by sleep button\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00263}00263         \mbox{\hyperlink{acpi_8c_ae25ad86bb29dde8854fbfda5826b22fe}{acpi\_event\_sleep\_button\_wake}}(acpi\_sc);}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00264}00264         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00265}00265     \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00266}00266         \textcolor{keywordflow}{break};          \textcolor{comment}{/* unknown button type */}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00267}00267     \}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00268}00268 \}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00269}00269 }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00270}00270 \textcolor{keyword}{static} \textcolor{keywordtype}{void} }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00271}\mbox{\hyperlink{acpi__button_8c_a487f5adad97bdaafc6a68ce1621e0ffe}{00271}} \mbox{\hyperlink{acpi__button_8c_a487f5adad97bdaafc6a68ce1621e0ffe}{acpi\_button\_notify\_handler}}(ACPI\_HANDLE h, UINT32 notify, \textcolor{keywordtype}{void} *context)}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00272}00272 \{}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00273}00273     \textcolor{keyword}{struct }\mbox{\hyperlink{structacpi__button__softc}{acpi\_button\_softc}}   *sc;}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00274}00274 \textcolor{preprocessor}{\#ifdef EVDEV\_SUPPORT}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00275}00275     uint16\_t key;}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00276}00276 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00277}00277 }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00278}00278     ACPI\_FUNCTION\_TRACE\_U32((\textcolor{keywordtype}{char} *)(uintptr\_t)\_\_func\_\_, notify);}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00279}00279 }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00280}00280     sc = (\textcolor{keyword}{struct }\mbox{\hyperlink{structacpi__button__softc}{acpi\_button\_softc}} *)context;}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00281}00281     \textcolor{keywordflow}{switch} (notify) \{}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00282}00282     \textcolor{keywordflow}{case} \mbox{\hyperlink{acpi__button_8c_a99b5aa95c0c62df9370419d773d8319c}{ACPI\_NOTIFY\_BUTTON\_PRESSED\_FOR\_SLEEP}}:}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00283}00283         \mbox{\hyperlink{OsdSchedule_8c_aec8eed6c25c50029d4f24176fc4a0351}{AcpiOsExecute}}(OSL\_NOTIFY\_HANDLER, \mbox{\hyperlink{acpi__button_8c_af3503ccd6dd04d076f7b8f50f627af20}{acpi\_button\_notify\_sleep}}, sc);}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00284}00284         \textcolor{keywordflow}{break};   }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00285}00285     \textcolor{keywordflow}{case} \mbox{\hyperlink{acpi__button_8c_a507a572a8f604c4eddf175ddc4a8bc3d}{ACPI\_NOTIFY\_BUTTON\_PRESSED\_FOR\_WAKEUP}}:}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00286}00286         \mbox{\hyperlink{OsdSchedule_8c_aec8eed6c25c50029d4f24176fc4a0351}{AcpiOsExecute}}(OSL\_NOTIFY\_HANDLER, \mbox{\hyperlink{acpi__button_8c_acbcb021f51cfb0630e4bfcf50159302e}{acpi\_button\_notify\_wakeup}}, sc);}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00287}00287         \textcolor{keywordflow}{break};   }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00288}00288     \textcolor{keywordflow}{default}:}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00289}00289         device\_printf(sc-\/>\mbox{\hyperlink{structacpi__button__softc_a0242cd1c7002e5bb945921548a372fa0}{button\_dev}}, \textcolor{stringliteral}{"{}unknown notify \%\#x\(\backslash\)n"{}}, notify);}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00290}00290         \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00291}00291     \}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00292}00292 }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00293}00293 \textcolor{preprocessor}{\#ifdef EVDEV\_SUPPORT}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00294}00294     key = (sc-\/>\mbox{\hyperlink{structacpi__button__softc_a59351850667be2c19f77e7bc84e2de9c}{button\_type}} == \mbox{\hyperlink{acpi__button_8c_a31df40a76e93fe84e07b5134ddf89b45}{ACPI\_SLEEP\_BUTTON}}) ? KEY\_SLEEP : KEY\_POWER;}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00295}00295     evdev\_push\_key(sc-\/>button\_evdev, key, 1);}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00296}00296     evdev\_sync(sc-\/>button\_evdev);}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00297}00297     evdev\_push\_key(sc-\/>button\_evdev, key, 0);}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00298}00298     evdev\_sync(sc-\/>button\_evdev);}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00299}00299 \textcolor{preprocessor}{\#endif}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00300}00300 \}}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00301}00301 }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00302}00302 \textcolor{keyword}{static} ACPI\_STATUS }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00303}\mbox{\hyperlink{acpi__button_8c_ab098e02802bd3d996c06c5246cc9c5d7}{00303}} \mbox{\hyperlink{acpi__button_8c_ab098e02802bd3d996c06c5246cc9c5d7}{acpi\_button\_fixed\_handler}}(\textcolor{keywordtype}{void} *context)}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00304}00304 \{}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00305}00305     \textcolor{keyword}{struct }\mbox{\hyperlink{structacpi__button__softc}{acpi\_button\_softc}}   *sc = (\textcolor{keyword}{struct }\mbox{\hyperlink{structacpi__button__softc}{acpi\_button\_softc}} *)context;}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00306}00306 }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00307}00307     ACPI\_FUNCTION\_TRACE\_PTR((\textcolor{keywordtype}{char} *)(uintptr\_t)\_\_func\_\_, context);}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00308}00308 }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00309}00309     \textcolor{keywordflow}{if} (context == NULL)}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00310}00310         return\_ACPI\_STATUS (AE\_BAD\_PARAMETER);}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00311}00311 }
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00312}00312     \mbox{\hyperlink{acpi__button_8c_a487f5adad97bdaafc6a68ce1621e0ffe}{acpi\_button\_notify\_handler}}(sc-\/>\mbox{\hyperlink{structacpi__button__softc_a2890636a7ec9af8b7901b64561a0f94f}{button\_handle}},}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00313}00313                                \mbox{\hyperlink{acpi__button_8c_a99b5aa95c0c62df9370419d773d8319c}{ACPI\_NOTIFY\_BUTTON\_PRESSED\_FOR\_SLEEP}}, sc);}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00314}00314     return\_ACPI\_STATUS (AE\_OK);}
\DoxyCodeLine{\Hypertarget{acpi__button_8c_source_l00315}00315 \}}

\end{DoxyCode}
