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
751516f0
Commit
751516f0
authored
May 29, 2011
by
Len Brown
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'ec-cleanup' into release
Conflicts: drivers/platform/x86/compal-laptop.c
parents
6288cf1e
08b53f0e
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
22 deletions
+15
-22
drivers/acpi/ec.c
drivers/acpi/ec.c
+1
-7
drivers/platform/x86/compal-laptop.c
drivers/platform/x86/compal-laptop.c
+7
-7
drivers/platform/x86/msi-laptop.c
drivers/platform/x86/msi-laptop.c
+6
-6
include/linux/acpi.h
include/linux/acpi.h
+1
-2
No files found.
drivers/acpi/ec.c
View file @
751516f0
...
@@ -69,7 +69,6 @@ enum ec_command {
...
@@ -69,7 +69,6 @@ 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_CDELAY 10
/* Wait 10us before polling EC */
#define ACPI_EC_MSI_UDELAY 550
/* Wait 550us for MSI EC */
#define ACPI_EC_MSI_UDELAY 550
/* Wait 550us for MSI EC */
#define ACPI_EC_STORM_THRESHOLD 8
/* number of false interrupts
#define ACPI_EC_STORM_THRESHOLD 8
/* number of false interrupts
...
@@ -433,8 +432,7 @@ EXPORT_SYMBOL(ec_write);
...
@@ -433,8 +432,7 @@ EXPORT_SYMBOL(ec_write);
int
ec_transaction
(
u8
command
,
int
ec_transaction
(
u8
command
,
const
u8
*
wdata
,
unsigned
wdata_len
,
const
u8
*
wdata
,
unsigned
wdata_len
,
u8
*
rdata
,
unsigned
rdata_len
,
u8
*
rdata
,
unsigned
rdata_len
)
int
force_poll
)
{
{
struct
transaction
t
=
{.
command
=
command
,
struct
transaction
t
=
{.
command
=
command
,
.
wdata
=
wdata
,
.
rdata
=
rdata
,
.
wdata
=
wdata
,
.
rdata
=
rdata
,
...
@@ -592,8 +590,6 @@ static void acpi_ec_gpe_query(void *ec_cxt)
...
@@ -592,8 +590,6 @@ static void acpi_ec_gpe_query(void *ec_cxt)
mutex_unlock
(
&
ec
->
lock
);
mutex_unlock
(
&
ec
->
lock
);
}
}
static
void
acpi_ec_gpe_query
(
void
*
ec_cxt
);
static
int
ec_check_sci
(
struct
acpi_ec
*
ec
,
u8
state
)
static
int
ec_check_sci
(
struct
acpi_ec
*
ec
,
u8
state
)
{
{
if
(
state
&
ACPI_EC_FLAG_SCI
)
{
if
(
state
&
ACPI_EC_FLAG_SCI
)
{
...
@@ -808,8 +804,6 @@ static int acpi_ec_add(struct acpi_device *device)
...
@@ -808,8 +804,6 @@ static int acpi_ec_add(struct acpi_device *device)
return
-
EINVAL
;
return
-
EINVAL
;
}
}
ec
->
handle
=
device
->
handle
;
/* Find and register all query methods */
/* Find and register all query methods */
acpi_walk_namespace
(
ACPI_TYPE_METHOD
,
ec
->
handle
,
1
,
acpi_walk_namespace
(
ACPI_TYPE_METHOD
,
ec
->
handle
,
1
,
acpi_ec_register_query_methods
,
NULL
,
ec
,
NULL
);
acpi_ec_register_query_methods
,
NULL
,
ec
,
NULL
);
...
...
drivers/platform/x86/compal-laptop.c
View file @
751516f0
...
@@ -200,8 +200,8 @@ static bool extra_features;
...
@@ -200,8 +200,8 @@ static bool extra_features;
* watching the output of address 0x4F (do an ec_transaction writing 0x33
* watching the output of address 0x4F (do an ec_transaction writing 0x33
* into 0x4F and read a few bytes from the output, like so:
* into 0x4F and read a few bytes from the output, like so:
* u8 writeData = 0x33;
* u8 writeData = 0x33;
* ec_transaction(0x4F, &writeData, 1, buffer, 32
, 0
);
* ec_transaction(0x4F, &writeData, 1, buffer, 32);
* That address is label
l
ed "fan1 table information" in the service manual.
* That address is labeled "fan1 table information" in the service manual.
* It should be clear which value in 'buffer' changes). This seems to be
* It should be clear which value in 'buffer' changes). This seems to be
* related to fan speed. It isn't a proper 'realtime' fan speed value
* related to fan speed. It isn't a proper 'realtime' fan speed value
* though, because physically stopping or speeding up the fan doesn't
* though, because physically stopping or speeding up the fan doesn't
...
@@ -286,7 +286,7 @@ static int get_backlight_level(void)
...
@@ -286,7 +286,7 @@ static int get_backlight_level(void)
static
void
set_backlight_state
(
bool
on
)
static
void
set_backlight_state
(
bool
on
)
{
{
u8
data
=
on
?
BACKLIGHT_STATE_ON_DATA
:
BACKLIGHT_STATE_OFF_DATA
;
u8
data
=
on
?
BACKLIGHT_STATE_ON_DATA
:
BACKLIGHT_STATE_OFF_DATA
;
ec_transaction
(
BACKLIGHT_STATE_ADDR
,
&
data
,
1
,
NULL
,
0
,
0
);
ec_transaction
(
BACKLIGHT_STATE_ADDR
,
&
data
,
1
,
NULL
,
0
);
}
}
...
@@ -294,24 +294,24 @@ static void set_backlight_state(bool on)
...
@@ -294,24 +294,24 @@ static void set_backlight_state(bool on)
static
void
pwm_enable_control
(
void
)
static
void
pwm_enable_control
(
void
)
{
{
unsigned
char
writeData
=
PWM_ENABLE_DATA
;
unsigned
char
writeData
=
PWM_ENABLE_DATA
;
ec_transaction
(
PWM_ENABLE_ADDR
,
&
writeData
,
1
,
NULL
,
0
,
0
);
ec_transaction
(
PWM_ENABLE_ADDR
,
&
writeData
,
1
,
NULL
,
0
);
}
}
static
void
pwm_disable_control
(
void
)
static
void
pwm_disable_control
(
void
)
{
{
unsigned
char
writeData
=
PWM_DISABLE_DATA
;
unsigned
char
writeData
=
PWM_DISABLE_DATA
;
ec_transaction
(
PWM_DISABLE_ADDR
,
&
writeData
,
1
,
NULL
,
0
,
0
);
ec_transaction
(
PWM_DISABLE_ADDR
,
&
writeData
,
1
,
NULL
,
0
);
}
}
static
void
set_pwm
(
int
pwm
)
static
void
set_pwm
(
int
pwm
)
{
{
ec_transaction
(
PWM_ADDRESS
,
&
pwm_lookup_table
[
pwm
],
1
,
NULL
,
0
,
0
);
ec_transaction
(
PWM_ADDRESS
,
&
pwm_lookup_table
[
pwm
],
1
,
NULL
,
0
);
}
}
static
int
get_fan_rpm
(
void
)
static
int
get_fan_rpm
(
void
)
{
{
u8
value
,
data
=
FAN_DATA
;
u8
value
,
data
=
FAN_DATA
;
ec_transaction
(
FAN_ADDRESS
,
&
data
,
1
,
&
value
,
1
,
0
);
ec_transaction
(
FAN_ADDRESS
,
&
data
,
1
,
&
value
,
1
);
return
100
*
(
int
)
value
;
return
100
*
(
int
)
value
;
}
}
...
...
drivers/platform/x86/msi-laptop.c
View file @
751516f0
...
@@ -135,7 +135,7 @@ static int set_lcd_level(int level)
...
@@ -135,7 +135,7 @@ static int set_lcd_level(int level)
buf
[
1
]
=
(
u8
)
(
level
*
31
);
buf
[
1
]
=
(
u8
)
(
level
*
31
);
return
ec_transaction
(
MSI_EC_COMMAND_LCD_LEVEL
,
buf
,
sizeof
(
buf
),
return
ec_transaction
(
MSI_EC_COMMAND_LCD_LEVEL
,
buf
,
sizeof
(
buf
),
NULL
,
0
,
1
);
NULL
,
0
);
}
}
static
int
get_lcd_level
(
void
)
static
int
get_lcd_level
(
void
)
...
@@ -144,7 +144,7 @@ static int get_lcd_level(void)
...
@@ -144,7 +144,7 @@ static int get_lcd_level(void)
int
result
;
int
result
;
result
=
ec_transaction
(
MSI_EC_COMMAND_LCD_LEVEL
,
&
wdata
,
1
,
result
=
ec_transaction
(
MSI_EC_COMMAND_LCD_LEVEL
,
&
wdata
,
1
,
&
rdata
,
1
,
1
);
&
rdata
,
1
);
if
(
result
<
0
)
if
(
result
<
0
)
return
result
;
return
result
;
...
@@ -157,7 +157,7 @@ static int get_auto_brightness(void)
...
@@ -157,7 +157,7 @@ static int get_auto_brightness(void)
int
result
;
int
result
;
result
=
ec_transaction
(
MSI_EC_COMMAND_LCD_LEVEL
,
&
wdata
,
1
,
result
=
ec_transaction
(
MSI_EC_COMMAND_LCD_LEVEL
,
&
wdata
,
1
,
&
rdata
,
1
,
1
);
&
rdata
,
1
);
if
(
result
<
0
)
if
(
result
<
0
)
return
result
;
return
result
;
...
@@ -172,7 +172,7 @@ static int set_auto_brightness(int enable)
...
@@ -172,7 +172,7 @@ static int set_auto_brightness(int enable)
wdata
[
0
]
=
4
;
wdata
[
0
]
=
4
;
result
=
ec_transaction
(
MSI_EC_COMMAND_LCD_LEVEL
,
wdata
,
1
,
result
=
ec_transaction
(
MSI_EC_COMMAND_LCD_LEVEL
,
wdata
,
1
,
&
rdata
,
1
,
1
);
&
rdata
,
1
);
if
(
result
<
0
)
if
(
result
<
0
)
return
result
;
return
result
;
...
@@ -180,7 +180,7 @@ static int set_auto_brightness(int enable)
...
@@ -180,7 +180,7 @@ static int set_auto_brightness(int enable)
wdata
[
1
]
=
(
rdata
&
0xF7
)
|
(
enable
?
8
:
0
);
wdata
[
1
]
=
(
rdata
&
0xF7
)
|
(
enable
?
8
:
0
);
return
ec_transaction
(
MSI_EC_COMMAND_LCD_LEVEL
,
wdata
,
2
,
return
ec_transaction
(
MSI_EC_COMMAND_LCD_LEVEL
,
wdata
,
2
,
NULL
,
0
,
1
);
NULL
,
0
);
}
}
static
ssize_t
set_device_state
(
const
char
*
buf
,
size_t
count
,
u8
mask
)
static
ssize_t
set_device_state
(
const
char
*
buf
,
size_t
count
,
u8
mask
)
...
@@ -217,7 +217,7 @@ static int get_wireless_state(int *wlan, int *bluetooth)
...
@@ -217,7 +217,7 @@ static int get_wireless_state(int *wlan, int *bluetooth)
u8
wdata
=
0
,
rdata
;
u8
wdata
=
0
,
rdata
;
int
result
;
int
result
;
result
=
ec_transaction
(
MSI_EC_COMMAND_WIRELESS
,
&
wdata
,
1
,
&
rdata
,
1
,
1
);
result
=
ec_transaction
(
MSI_EC_COMMAND_WIRELESS
,
&
wdata
,
1
,
&
rdata
,
1
);
if
(
result
<
0
)
if
(
result
<
0
)
return
-
1
;
return
-
1
;
...
...
include/linux/acpi.h
View file @
751516f0
...
@@ -150,8 +150,7 @@ extern int ec_read(u8 addr, u8 *val);
...
@@ -150,8 +150,7 @@ extern int ec_read(u8 addr, u8 *val);
extern
int
ec_write
(
u8
addr
,
u8
val
);
extern
int
ec_write
(
u8
addr
,
u8
val
);
extern
int
ec_transaction
(
u8
command
,
extern
int
ec_transaction
(
u8
command
,
const
u8
*
wdata
,
unsigned
wdata_len
,
const
u8
*
wdata
,
unsigned
wdata_len
,
u8
*
rdata
,
unsigned
rdata_len
,
u8
*
rdata
,
unsigned
rdata_len
);
int
force_poll
);
#if defined(CONFIG_ACPI_WMI) || defined(CONFIG_ACPI_WMI_MODULE)
#if defined(CONFIG_ACPI_WMI) || defined(CONFIG_ACPI_WMI_MODULE)
...
...
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