Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 75672
b: refs/heads/master
c: 81b4e1f
h: refs/heads/master
v: v3
  • Loading branch information
Len Brown committed Jan 24, 2008
1 parent b0c41d8 commit c59dfca
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 66 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3645ca8359328ea4c75bce4af54ad24028381f30
refs/heads/master: 81b4e1f6269cea345f17d3aa349ec9beb31a8cd3
2 changes: 1 addition & 1 deletion trunk/drivers/acpi/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ int acpi_bus_set_power(acpi_handle handle, int state)
* Get device's current power state
*/
acpi_bus_get_power(device->handle, &device->power.state);
if ((state == device->power.state) && !device->flags.force_power_state) {
if (state == device->power.state) {
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device is already at D%d\n",
state));
return 0;
Expand Down
26 changes: 8 additions & 18 deletions trunk/drivers/acpi/ec.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
*/

/* Uncomment next line to get verbose print outs*/
/* #define DEBUG */

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
Expand All @@ -50,6 +47,9 @@
#undef PREFIX
#define PREFIX "ACPI: EC: "

/* Uncomment next line to get verbose print outs*/
/* #define DEBUG */

/* EC status register */
#define ACPI_EC_FLAG_OBF 0x01 /* Output buffer full */
#define ACPI_EC_FLAG_IBF 0x02 /* Input buffer full */
Expand Down Expand Up @@ -82,7 +82,6 @@ enum {
EC_FLAGS_ADDRESS, /* Address is being written */
EC_FLAGS_NO_WDATA_GPE, /* Don't expect WDATA GPE event */
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);
Expand Down Expand Up @@ -139,26 +138,26 @@ static struct acpi_ec {
static inline u8 acpi_ec_read_status(struct acpi_ec *ec)
{
u8 x = inb(ec->command_addr);
pr_debug(PREFIX "---> status = 0x%2.2x\n", x);
pr_debug(PREFIX "---> status = 0x%2x\n", x);
return x;
}

static inline u8 acpi_ec_read_data(struct acpi_ec *ec)
{
u8 x = inb(ec->data_addr);
pr_debug(PREFIX "---> data = 0x%2.2x\n", x);
pr_debug(PREFIX "---> data = 0x%2x\n", x);
return inb(ec->data_addr);
}

static inline void acpi_ec_write_cmd(struct acpi_ec *ec, u8 command)
{
pr_debug(PREFIX "<--- command = 0x%2.2x\n", command);
pr_debug(PREFIX "<--- command = 0x%2x\n", command);
outb(command, ec->command_addr);
}

static inline void acpi_ec_write_data(struct acpi_ec *ec, u8 data)
{
pr_debug(PREFIX "<--- data = 0x%2.2x\n", data);
pr_debug(PREFIX "<--- data = 0x%2x\n", data);
outb(data, ec->data_addr);
}

Expand All @@ -180,10 +179,6 @@ 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)
{
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) &&
test_bit(EC_FLAGS_NO_ADDRESS_GPE, &ec->flags)))
force_poll = 1;
Expand All @@ -197,12 +192,7 @@ static int acpi_ec_wait(struct acpi_ec *ec, enum ec_event event, int force_poll)
goto end;
clear_bit(EC_FLAGS_WAIT_GPE, &ec->flags);
if (acpi_ec_check_status(ec, event)) {
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)) {
if (test_bit(EC_FLAGS_ADDRESS, &ec->flags)) {
/* miss address GPE, don't expect it anymore */
pr_info(PREFIX "missing address confirmation, "
"don't expect it any longer.\n");
Expand Down
40 changes: 0 additions & 40 deletions trunk/drivers/acpi/fan.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ MODULE_LICENSE("GPL");

static int acpi_fan_add(struct acpi_device *device);
static int acpi_fan_remove(struct acpi_device *device, int type);
static int acpi_fan_suspend(struct acpi_device *device, pm_message_t state);
static int acpi_fan_resume(struct acpi_device *device);

static const struct acpi_device_id fan_device_ids[] = {
{"PNP0C0B", 0},
Expand All @@ -63,8 +61,6 @@ static struct acpi_driver acpi_fan_driver = {
.ops = {
.add = acpi_fan_add,
.remove = acpi_fan_remove,
.suspend = acpi_fan_suspend,
.resume = acpi_fan_resume,
},
};

Expand Down Expand Up @@ -195,10 +191,6 @@ static int acpi_fan_add(struct acpi_device *device)
goto end;
}

device->flags.force_power_state = 1;
acpi_bus_set_power(device->handle, state);
device->flags.force_power_state = 0;

result = acpi_fan_add_fs(device);
if (result)
goto end;
Expand All @@ -224,38 +216,6 @@ static int acpi_fan_remove(struct acpi_device *device, int type)
return 0;
}

static int acpi_fan_suspend(struct acpi_device *device, pm_message_t state)
{
if (!device)
return -EINVAL;

acpi_bus_set_power(device->handle, ACPI_STATE_D0);

return AE_OK;
}

static int acpi_fan_resume(struct acpi_device *device)
{
int result = 0;
int power_state = 0;

if (!device)
return -EINVAL;

result = acpi_bus_get_power(device->handle, &power_state);
if (result) {
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
"Error reading fan power state\n"));
return result;
}

device->flags.force_power_state = 1;
acpi_bus_set_power(device->handle, power_state);
device->flags.force_power_state = 0;

return result;
}

static int __init acpi_fan_init(void)
{
int result = 0;
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/acpi/processor_throttling.c
Original file line number Diff line number Diff line change
Expand Up @@ -775,12 +775,12 @@ int acpi_processor_get_throttling_info(struct acpi_processor *pr)
acpi_processor_get_throttling_states(pr) ||
acpi_processor_get_platform_limit(pr))
{
if (acpi_processor_get_fadt_info(pr))
return 0;
pr->throttling.acpi_processor_get_throttling =
&acpi_processor_get_throttling_fadt;
pr->throttling.acpi_processor_set_throttling =
&acpi_processor_set_throttling_fadt;
if (acpi_processor_get_fadt_info(pr))
return 0;
} else {
pr->throttling.acpi_processor_get_throttling =
&acpi_processor_get_throttling_ptc;
Expand Down
2 changes: 0 additions & 2 deletions trunk/drivers/firmware/dmi-id.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,6 @@ static struct device *dmi_dev;
if (dmi_get_system_info(_field)) \
sys_dmi_attributes[i++] = &sys_dmi_##_name##_attr.dev_attr.attr;

extern int dmi_available;

/* In a separate function to keep gcc 3.2 happy - do NOT merge this in
dmi_id_init! */
static void __init dmi_id_init_attr_table(void)
Expand Down
3 changes: 1 addition & 2 deletions trunk/include/acpi/acpi_bus.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,7 @@ struct acpi_device_flags {
u32 power_manageable:1;
u32 performance_manageable:1;
u32 wake_capable:1; /* Wakeup(_PRW) supported? */
u32 force_power_state:1;
u32 reserved:19;
u32 reserved:20;
};

/* File System */
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/linux/dmi.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ extern const struct dmi_device * dmi_find_device(int type, const char *name,
extern void dmi_scan_machine(void);
extern int dmi_get_year(int field);
extern int dmi_name_in_vendors(const char *str);
extern int dmi_available;

#else

Expand All @@ -87,6 +88,7 @@ static inline const struct dmi_device * dmi_find_device(int type, const char *na
const struct dmi_device *from) { return NULL; }
static inline int dmi_get_year(int year) { return 0; }
static inline int dmi_name_in_vendors(const char *s) { return 0; }
#define dmi_available 0

#endif

Expand Down

0 comments on commit c59dfca

Please sign in to comment.