Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
0f23a6b0
Commit
0f23a6b0
authored
Jan 23, 2008
by
Len Brown
Browse files
Options
Browse Files
Download
Plain Diff
Pull bugzilla-8459 into release branch
parents
7456337d
d772b3b3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
8 deletions
+18
-8
drivers/acpi/ec.c
drivers/acpi/ec.c
+18
-8
No files found.
drivers/acpi/ec.c
View file @
0f23a6b0
...
@@ -26,6 +26,9 @@
...
@@ -26,6 +26,9 @@
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/
*/
/* Uncomment next line to get verbose print outs*/
/* #define DEBUG */
#include <linux/kernel.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/init.h>
...
@@ -47,9 +50,6 @@
...
@@ -47,9 +50,6 @@
#undef PREFIX
#undef PREFIX
#define PREFIX "ACPI: EC: "
#define PREFIX "ACPI: EC: "
/* Uncomment next line to get verbose print outs*/
/* #define DEBUG */
/* EC status register */
/* EC status register */
#define ACPI_EC_FLAG_OBF 0x01
/* Output buffer full */
#define ACPI_EC_FLAG_OBF 0x01
/* Output buffer full */
#define ACPI_EC_FLAG_IBF 0x02
/* Input buffer full */
#define ACPI_EC_FLAG_IBF 0x02
/* Input buffer full */
...
@@ -82,6 +82,7 @@ enum {
...
@@ -82,6 +82,7 @@ enum {
EC_FLAGS_ADDRESS
,
/* Address is being written */
EC_FLAGS_ADDRESS
,
/* Address is being written */
EC_FLAGS_NO_WDATA_GPE
,
/* Don't expect WDATA GPE event */
EC_FLAGS_NO_WDATA_GPE
,
/* Don't expect WDATA GPE event */
EC_FLAGS_WDATA
,
/* Data is being written */
EC_FLAGS_WDATA
,
/* Data is being written */
EC_FLAGS_NO_OBF1_GPE
,
/* Don't expect GPE before read */
};
};
static
int
acpi_ec_remove
(
struct
acpi_device
*
device
,
int
type
);
static
int
acpi_ec_remove
(
struct
acpi_device
*
device
,
int
type
);
...
@@ -138,26 +139,26 @@ static struct acpi_ec {
...
@@ -138,26 +139,26 @@ static struct acpi_ec {
static
inline
u8
acpi_ec_read_status
(
struct
acpi_ec
*
ec
)
static
inline
u8
acpi_ec_read_status
(
struct
acpi_ec
*
ec
)
{
{
u8
x
=
inb
(
ec
->
command_addr
);
u8
x
=
inb
(
ec
->
command_addr
);
pr_debug
(
PREFIX
"---> status = 0x%2x
\n
"
,
x
);
pr_debug
(
PREFIX
"---> status = 0x%2
.2
x
\n
"
,
x
);
return
x
;
return
x
;
}
}
static
inline
u8
acpi_ec_read_data
(
struct
acpi_ec
*
ec
)
static
inline
u8
acpi_ec_read_data
(
struct
acpi_ec
*
ec
)
{
{
u8
x
=
inb
(
ec
->
data_addr
);
u8
x
=
inb
(
ec
->
data_addr
);
pr_debug
(
PREFIX
"---> data = 0x%2x
\n
"
,
x
);
pr_debug
(
PREFIX
"---> data = 0x%2
.2
x
\n
"
,
x
);
return
inb
(
ec
->
data_addr
);
return
inb
(
ec
->
data_addr
);
}
}
static
inline
void
acpi_ec_write_cmd
(
struct
acpi_ec
*
ec
,
u8
command
)
static
inline
void
acpi_ec_write_cmd
(
struct
acpi_ec
*
ec
,
u8
command
)
{
{
pr_debug
(
PREFIX
"<--- command = 0x%2x
\n
"
,
command
);
pr_debug
(
PREFIX
"<--- command = 0x%2
.2
x
\n
"
,
command
);
outb
(
command
,
ec
->
command_addr
);
outb
(
command
,
ec
->
command_addr
);
}
}
static
inline
void
acpi_ec_write_data
(
struct
acpi_ec
*
ec
,
u8
data
)
static
inline
void
acpi_ec_write_data
(
struct
acpi_ec
*
ec
,
u8
data
)
{
{
pr_debug
(
PREFIX
"<--- data = 0x%2x
\n
"
,
data
);
pr_debug
(
PREFIX
"<--- data = 0x%2
.2
x
\n
"
,
data
);
outb
(
data
,
ec
->
data_addr
);
outb
(
data
,
ec
->
data_addr
);
}
}
...
@@ -179,6 +180,10 @@ static inline int acpi_ec_check_status(struct acpi_ec *ec, enum ec_event event)
...
@@ -179,6 +180,10 @@ static inline int acpi_ec_check_status(struct acpi_ec *ec, enum ec_event event)
static
int
acpi_ec_wait
(
struct
acpi_ec
*
ec
,
enum
ec_event
event
,
int
force_poll
)
static
int
acpi_ec_wait
(
struct
acpi_ec
*
ec
,
enum
ec_event
event
,
int
force_poll
)
{
{
int
ret
=
0
;
int
ret
=
0
;
if
(
unlikely
(
event
==
ACPI_EC_EVENT_OBF_1
&&
test_bit
(
EC_FLAGS_NO_OBF1_GPE
,
&
ec
->
flags
)))
force_poll
=
1
;
if
(
unlikely
(
test_bit
(
EC_FLAGS_ADDRESS
,
&
ec
->
flags
)
&&
if
(
unlikely
(
test_bit
(
EC_FLAGS_ADDRESS
,
&
ec
->
flags
)
&&
test_bit
(
EC_FLAGS_NO_ADDRESS_GPE
,
&
ec
->
flags
)))
test_bit
(
EC_FLAGS_NO_ADDRESS_GPE
,
&
ec
->
flags
)))
force_poll
=
1
;
force_poll
=
1
;
...
@@ -192,7 +197,12 @@ static int acpi_ec_wait(struct acpi_ec *ec, enum ec_event event, int force_poll)
...
@@ -192,7 +197,12 @@ static int acpi_ec_wait(struct acpi_ec *ec, enum ec_event event, int force_poll)
goto
end
;
goto
end
;
clear_bit
(
EC_FLAGS_WAIT_GPE
,
&
ec
->
flags
);
clear_bit
(
EC_FLAGS_WAIT_GPE
,
&
ec
->
flags
);
if
(
acpi_ec_check_status
(
ec
,
event
))
{
if
(
acpi_ec_check_status
(
ec
,
event
))
{
if
(
test_bit
(
EC_FLAGS_ADDRESS
,
&
ec
->
flags
))
{
if
(
event
==
ACPI_EC_EVENT_OBF_1
)
{
/* miss OBF_1 GPE, don't expect it */
pr_info
(
PREFIX
"missing OBF confirmation, "
"don't expect it any longer.
\n
"
);
set_bit
(
EC_FLAGS_NO_OBF1_GPE
,
&
ec
->
flags
);
}
else
if
(
test_bit
(
EC_FLAGS_ADDRESS
,
&
ec
->
flags
))
{
/* miss address GPE, don't expect it anymore */
/* miss address GPE, don't expect it anymore */
pr_info
(
PREFIX
"missing address confirmation, "
pr_info
(
PREFIX
"missing address confirmation, "
"don't expect it any longer.
\n
"
);
"don't expect it any longer.
\n
"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment