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
nexedi
linux
Commits
fff251f6
Commit
fff251f6
authored
Apr 05, 2009
by
Len Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge branches 'bugzilla-12461' and 'bugzilla-9998' into release
parents
3b4dadf0
a5032bfd
34ff4dbc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
8 deletions
+22
-8
drivers/acpi/ec.c
drivers/acpi/ec.c
+22
-8
No files found.
drivers/acpi/ec.c
View file @
fff251f6
...
@@ -67,7 +67,7 @@ enum ec_command {
...
@@ -67,7 +67,7 @@ enum ec_command {
#define ACPI_EC_DELAY 500
/* Wait 500ms max. during EC ops */
#define ACPI_EC_DELAY 500
/* Wait 500ms max. during EC ops */
#define ACPI_EC_UDELAY_GLK 1000
/* Wait 1ms max. to get global lock */
#define ACPI_EC_UDELAY_GLK 1000
/* Wait 1ms max. to get global lock */
#define ACPI_EC_
UDELAY 100
/* Wait 100us before polling EC again
*/
#define ACPI_EC_
CDELAY 10
/* Wait 10us before polling EC
*/
#define ACPI_EC_STORM_THRESHOLD 8
/* number of false interrupts
#define ACPI_EC_STORM_THRESHOLD 8
/* number of false interrupts
per one transaction */
per one transaction */
...
@@ -236,13 +236,23 @@ static int ec_check_sci(struct acpi_ec *ec, u8 state)
...
@@ -236,13 +236,23 @@ static int ec_check_sci(struct acpi_ec *ec, u8 state)
return
0
;
return
0
;
}
}
static
void
ec_delay
(
void
)
{
/* EC in MSI notebooks don't tolerate delays other than 550 usec */
if
(
EC_FLAGS_MSI
)
udelay
(
ACPI_EC_DELAY
);
else
/* Use shortest sleep available */
msleep
(
1
);
}
static
int
ec_poll
(
struct
acpi_ec
*
ec
)
static
int
ec_poll
(
struct
acpi_ec
*
ec
)
{
{
unsigned
long
delay
=
jiffies
+
msecs_to_jiffies
(
ACPI_EC_DELAY
);
unsigned
long
delay
=
jiffies
+
msecs_to_jiffies
(
ACPI_EC_DELAY
);
udelay
(
ACPI_EC_
U
DELAY
);
udelay
(
ACPI_EC_
C
DELAY
);
while
(
time_before
(
jiffies
,
delay
))
{
while
(
time_before
(
jiffies
,
delay
))
{
gpe_transaction
(
ec
,
acpi_ec_read_status
(
ec
));
gpe_transaction
(
ec
,
acpi_ec_read_status
(
ec
));
udelay
(
ACPI_EC_UDELAY
);
ec_delay
(
);
if
(
ec_transaction_done
(
ec
))
if
(
ec_transaction_done
(
ec
))
return
0
;
return
0
;
}
}
...
@@ -755,6 +765,10 @@ ec_parse_device(acpi_handle handle, u32 Level, void *context, void **retval)
...
@@ -755,6 +765,10 @@ ec_parse_device(acpi_handle handle, u32 Level, void *context, void **retval)
unsigned
long
long
tmp
=
0
;
unsigned
long
long
tmp
=
0
;
struct
acpi_ec
*
ec
=
context
;
struct
acpi_ec
*
ec
=
context
;
/* clear addr values, ec_parse_io_ports depend on it */
ec
->
command_addr
=
ec
->
data_addr
=
0
;
status
=
acpi_walk_resources
(
handle
,
METHOD_NAME__CRS
,
status
=
acpi_walk_resources
(
handle
,
METHOD_NAME__CRS
,
ec_parse_io_ports
,
ec
);
ec_parse_io_ports
,
ec
);
if
(
ACPI_FAILURE
(
status
))
if
(
ACPI_FAILURE
(
status
))
...
@@ -804,11 +818,11 @@ static int acpi_ec_add(struct acpi_device *device)
...
@@ -804,11 +818,11 @@ static int acpi_ec_add(struct acpi_device *device)
ec
=
make_acpi_ec
();
ec
=
make_acpi_ec
();
if
(
!
ec
)
if
(
!
ec
)
return
-
ENOMEM
;
return
-
ENOMEM
;
if
(
ec_parse_device
(
device
->
handle
,
0
,
ec
,
NULL
)
!=
}
AE_CTRL_TERMINATE
)
{
if
(
ec_parse_device
(
device
->
handle
,
0
,
ec
,
NULL
)
!=
AE_CTRL_TERMINATE
)
{
kfree
(
ec
);
kfree
(
ec
);
return
-
EINVAL
;
return
-
EINVAL
;
}
}
}
ec
->
handle
=
device
->
handle
;
ec
->
handle
=
device
->
handle
;
...
@@ -986,12 +1000,12 @@ int __init acpi_ec_ecdt_probe(void)
...
@@ -986,12 +1000,12 @@ int __init acpi_ec_ecdt_probe(void)
boot_ec
->
handle
=
ACPI_ROOT_OBJECT
;
boot_ec
->
handle
=
ACPI_ROOT_OBJECT
;
acpi_get_handle
(
ACPI_ROOT_OBJECT
,
ecdt_ptr
->
id
,
&
boot_ec
->
handle
);
acpi_get_handle
(
ACPI_ROOT_OBJECT
,
ecdt_ptr
->
id
,
&
boot_ec
->
handle
);
/* Don't trust ECDT, which comes from ASUSTek */
/* Don't trust ECDT, which comes from ASUSTek */
if
(
!
dmi_name_in_vendors
(
"ASUS"
))
if
(
!
dmi_name_in_vendors
(
"ASUS"
)
&&
EC_FLAGS_MSI
==
0
)
goto
install
;
goto
install
;
saved_ec
=
kmalloc
(
sizeof
(
struct
acpi_ec
),
GFP_KERNEL
);
saved_ec
=
kmalloc
(
sizeof
(
struct
acpi_ec
),
GFP_KERNEL
);
if
(
!
saved_ec
)
if
(
!
saved_ec
)
return
-
ENOMEM
;
return
-
ENOMEM
;
memcpy
(
saved_ec
,
boot_ec
,
sizeof
(
*
saved
_ec
));
memcpy
(
saved_ec
,
boot_ec
,
sizeof
(
struct
acpi
_ec
));
/* fall through */
/* fall through */
}
}
/* This workaround is needed only on some broken machines,
/* This workaround is needed only on some broken machines,
...
...
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