Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 223157
b: refs/heads/master
c: 6cc5615
h: refs/heads/master
i:
  223155: 3acc23f
v: v3
  • Loading branch information
Len Brown committed Dec 11, 2010
1 parent 81faf88 commit a5a82f0
Show file tree
Hide file tree
Showing 13 changed files with 89 additions and 60 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: 12d3206466d2074ef0684aaf7759ae01a0a92560
refs/heads/master: 6cc5615f7c4decd7b6c4da9317d0e0b5fbdf7290
46 changes: 29 additions & 17 deletions trunk/drivers/acpi/ac.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,24 +100,7 @@ static const struct file_operations acpi_ac_fops = {
.release = single_release,
};
#endif
static int get_ac_property(struct power_supply *psy,
enum power_supply_property psp,
union power_supply_propval *val)
{
struct acpi_ac *ac = to_acpi_ac(psy);
switch (psp) {
case POWER_SUPPLY_PROP_ONLINE:
val->intval = ac->state;
break;
default:
return -EINVAL;
}
return 0;
}

static enum power_supply_property ac_props[] = {
POWER_SUPPLY_PROP_ONLINE,
};
/* --------------------------------------------------------------------------
AC Adapter Management
-------------------------------------------------------------------------- */
Expand All @@ -140,6 +123,35 @@ static int acpi_ac_get_state(struct acpi_ac *ac)
return 0;
}

/* --------------------------------------------------------------------------
sysfs I/F
-------------------------------------------------------------------------- */
static int get_ac_property(struct power_supply *psy,
enum power_supply_property psp,
union power_supply_propval *val)
{
struct acpi_ac *ac = to_acpi_ac(psy);

if (!ac)
return -ENODEV;

if (acpi_ac_get_state(ac))
return -ENODEV;

switch (psp) {
case POWER_SUPPLY_PROP_ONLINE:
val->intval = ac->state;
break;
default:
return -EINVAL;
}
return 0;
}

static enum power_supply_property ac_props[] = {
POWER_SUPPLY_PROP_ONLINE,
};

#ifdef CONFIG_ACPI_PROCFS_POWER
/* --------------------------------------------------------------------------
FS Interface (/proc)
Expand Down
34 changes: 17 additions & 17 deletions trunk/drivers/acpi/apei/erst.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ static struct erst_erange {
* It is used to provide exclusive accessing for ERST Error Log
* Address Range too.
*/
static DEFINE_SPINLOCK(erst_lock);
static DEFINE_RAW_SPINLOCK(erst_lock);

static inline int erst_errno(int command_status)
{
Expand Down Expand Up @@ -421,9 +421,9 @@ ssize_t erst_get_record_count(void)
if (erst_disable)
return -ENODEV;

spin_lock_irqsave(&erst_lock, flags);
raw_spin_lock_irqsave(&erst_lock, flags);
count = __erst_get_record_count();
spin_unlock_irqrestore(&erst_lock, flags);
raw_spin_unlock_irqrestore(&erst_lock, flags);

return count;
}
Expand Down Expand Up @@ -456,9 +456,9 @@ int erst_get_next_record_id(u64 *record_id)
if (erst_disable)
return -ENODEV;

spin_lock_irqsave(&erst_lock, flags);
raw_spin_lock_irqsave(&erst_lock, flags);
rc = __erst_get_next_record_id(record_id);
spin_unlock_irqrestore(&erst_lock, flags);
raw_spin_unlock_irqrestore(&erst_lock, flags);

return rc;
}
Expand Down Expand Up @@ -624,25 +624,25 @@ int erst_write(const struct cper_record_header *record)
return -EINVAL;

if (erst_erange.attr & ERST_RANGE_NVRAM) {
if (!spin_trylock_irqsave(&erst_lock, flags))
if (!raw_spin_trylock_irqsave(&erst_lock, flags))
return -EBUSY;
rc = __erst_write_to_nvram(record);
spin_unlock_irqrestore(&erst_lock, flags);
raw_spin_unlock_irqrestore(&erst_lock, flags);
return rc;
}

if (record->record_length > erst_erange.size)
return -EINVAL;

if (!spin_trylock_irqsave(&erst_lock, flags))
if (!raw_spin_trylock_irqsave(&erst_lock, flags))
return -EBUSY;
memcpy(erst_erange.vaddr, record, record->record_length);
rcd_erange = erst_erange.vaddr;
/* signature for serialization system */
memcpy(&rcd_erange->persistence_information, "ER", 2);

rc = __erst_write_to_storage(0);
spin_unlock_irqrestore(&erst_lock, flags);
raw_spin_unlock_irqrestore(&erst_lock, flags);

return rc;
}
Expand Down Expand Up @@ -696,9 +696,9 @@ ssize_t erst_read(u64 record_id, struct cper_record_header *record,
if (erst_disable)
return -ENODEV;

spin_lock_irqsave(&erst_lock, flags);
raw_spin_lock_irqsave(&erst_lock, flags);
len = __erst_read(record_id, record, buflen);
spin_unlock_irqrestore(&erst_lock, flags);
raw_spin_unlock_irqrestore(&erst_lock, flags);
return len;
}
EXPORT_SYMBOL_GPL(erst_read);
Expand All @@ -719,20 +719,20 @@ ssize_t erst_read_next(struct cper_record_header *record, size_t buflen)
if (erst_disable)
return -ENODEV;

spin_lock_irqsave(&erst_lock, flags);
raw_spin_lock_irqsave(&erst_lock, flags);
rc = __erst_get_next_record_id(&record_id);
if (rc) {
spin_unlock_irqrestore(&erst_lock, flags);
raw_spin_unlock_irqrestore(&erst_lock, flags);
return rc;
}
/* no more record */
if (record_id == APEI_ERST_INVALID_RECORD_ID) {
spin_unlock_irqrestore(&erst_lock, flags);
raw_spin_unlock_irqrestore(&erst_lock, flags);
return 0;
}

len = __erst_read(record_id, record, buflen);
spin_unlock_irqrestore(&erst_lock, flags);
raw_spin_unlock_irqrestore(&erst_lock, flags);

return len;
}
Expand All @@ -746,12 +746,12 @@ int erst_clear(u64 record_id)
if (erst_disable)
return -ENODEV;

spin_lock_irqsave(&erst_lock, flags);
raw_spin_lock_irqsave(&erst_lock, flags);
if (erst_erange.attr & ERST_RANGE_NVRAM)
rc = __erst_clear_from_nvram(record_id);
else
rc = __erst_clear_from_storage(record_id);
spin_unlock_irqrestore(&erst_lock, flags);
raw_spin_unlock_irqrestore(&erst_lock, flags);

return rc;
}
Expand Down
10 changes: 5 additions & 5 deletions trunk/drivers/acpi/apei/hest.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ EXPORT_SYMBOL_GPL(hest_disable);

/* HEST table parsing */

static struct acpi_table_hest *hest_tab;
static struct acpi_table_hest *__read_mostly hest_tab;

static int hest_esrc_len_tab[ACPI_HEST_TYPE_RESERVED] = {
static const int hest_esrc_len_tab[ACPI_HEST_TYPE_RESERVED] = {
[ACPI_HEST_TYPE_IA32_CHECK] = -1, /* need further calculation */
[ACPI_HEST_TYPE_IA32_CORRECTED_CHECK] = -1,
[ACPI_HEST_TYPE_IA32_NMI] = sizeof(struct acpi_hest_ia_nmi),
Expand Down Expand Up @@ -126,7 +126,7 @@ struct ghes_arr {
unsigned int count;
};

static int hest_parse_ghes_count(struct acpi_hest_header *hest_hdr, void *data)
static int __init hest_parse_ghes_count(struct acpi_hest_header *hest_hdr, void *data)
{
int *count = data;

Expand All @@ -135,7 +135,7 @@ static int hest_parse_ghes_count(struct acpi_hest_header *hest_hdr, void *data)
return 0;
}

static int hest_parse_ghes(struct acpi_hest_header *hest_hdr, void *data)
static int __init hest_parse_ghes(struct acpi_hest_header *hest_hdr, void *data)
{
struct platform_device *ghes_dev;
struct ghes_arr *ghes_arr = data;
Expand Down Expand Up @@ -165,7 +165,7 @@ static int hest_parse_ghes(struct acpi_hest_header *hest_hdr, void *data)
return rc;
}

static int hest_ghes_dev_register(unsigned int ghes_count)
static int __init hest_ghes_dev_register(unsigned int ghes_count)
{
int rc, i;
struct ghes_arr ghes_arr;
Expand Down
5 changes: 5 additions & 0 deletions trunk/drivers/acpi/battery.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,8 @@ struct acpi_battery {
unsigned long flags;
};

static int acpi_battery_update(struct acpi_battery *battery);

#define to_acpi_battery(x) container_of(x, struct acpi_battery, bat);

inline int acpi_battery_present(struct acpi_battery *battery)
Expand Down Expand Up @@ -184,6 +186,9 @@ static int acpi_battery_get_property(struct power_supply *psy,
int ret = 0;
struct acpi_battery *battery = to_acpi_battery(psy);

if (acpi_battery_update(battery))
return -ENODEV;

if (acpi_battery_present(battery)) {
/* run battery update only if it is present */
acpi_battery_get_state(battery);
Expand Down
3 changes: 3 additions & 0 deletions trunk/drivers/acpi/ec.c
Original file line number Diff line number Diff line change
Expand Up @@ -934,6 +934,9 @@ static struct dmi_system_id __initdata ec_dmi_table[] = {
ec_flag_msi, "MSI hardware", {
DMI_MATCH(DMI_CHASSIS_VENDOR, "MICRO-Star")}, NULL},
{
ec_flag_msi, "MSI hardware", {
DMI_MATCH(DMI_CHASSIS_VENDOR, "MICRO-STAR")}, NULL},
{
ec_validate_ecdt, "ASUS hardware", {
DMI_MATCH(DMI_BIOS_VENDOR, "ASUS") }, NULL},
{},
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/acpi/osl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1571,7 +1571,7 @@ acpi_status __init acpi_os_initialize(void)
return AE_OK;
}

acpi_status acpi_os_initialize1(void)
acpi_status __init acpi_os_initialize1(void)
{
kacpid_wq = create_workqueue("kacpid");
kacpi_notify_wq = create_workqueue("kacpi_notify");
Expand Down
12 changes: 6 additions & 6 deletions trunk/drivers/acpi/power.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,13 @@ static int acpi_power_on(acpi_handle handle)
resource->name));
} else {
result = __acpi_power_on(resource);
if (result)
resource->ref_count--;
}

mutex_unlock(&resource->resource_lock);

return 0;
return result;
}

static int acpi_power_off_device(acpi_handle handle)
Expand Down Expand Up @@ -465,10 +467,12 @@ int acpi_power_transition(struct acpi_device *device, int state)
struct acpi_handle_list *tl = NULL; /* Target Resources */
int i = 0;


if (!device || (state < ACPI_STATE_D0) || (state > ACPI_STATE_D3))
return -EINVAL;

if (device->power.state == state)
return 0;

if ((device->power.state < ACPI_STATE_D0)
|| (device->power.state > ACPI_STATE_D3))
return -ENODEV;
Expand All @@ -488,10 +492,6 @@ int acpi_power_transition(struct acpi_device *device, int state)
goto end;
}

if (device->power.state == state) {
goto end;
}

/*
* Then we dereference all power resources used in the current list.
*/
Expand Down
9 changes: 0 additions & 9 deletions trunk/drivers/acpi/processor_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,15 +156,6 @@ static int cpufreq_set_cur_state(unsigned int cpu, int state)
return 0;
}

static int acpi_thermal_cpufreq_increase(unsigned int cpu)
{
return -ENODEV;
}
static int acpi_thermal_cpufreq_decrease(unsigned int cpu)
{
return -ENODEV;
}

#endif

int acpi_processor_get_limit_info(struct acpi_processor *pr)
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/acpi/sleep.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@

static u8 sleep_states[ACPI_S_STATE_COUNT];

static u32 acpi_target_sleep_state = ACPI_STATE_S0;

static void acpi_sleep_tts_switch(u32 acpi_state)
{
union acpi_object in_arg = { ACPI_TYPE_INTEGER };
Expand Down Expand Up @@ -81,6 +79,8 @@ static int acpi_sleep_prepare(u32 acpi_state)
}

#ifdef CONFIG_ACPI_SLEEP
static u32 acpi_target_sleep_state = ACPI_STATE_S0;

/*
* The ACPI specification wants us to save NVS memory regions during hibernation
* and to restore them during the subsequent resume. Windows does that also for
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/pnp/pnpacpi/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ struct pnp_protocol pnpacpi_protocol = {
};
EXPORT_SYMBOL(pnpacpi_protocol);

static char *pnpacpi_get_id(struct acpi_device *device)
static char *__init pnpacpi_get_id(struct acpi_device *device)
{
struct acpi_hardware_id *id;

Expand Down
5 changes: 4 additions & 1 deletion trunk/include/acpi/video.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#ifndef __ACPI_VIDEO_H
#define __ACPI_VIDEO_H

#include <linux/errno.h> /* for ENODEV */

struct acpi_device;

#define ACPI_VIDEO_DISPLAY_CRT 1
#define ACPI_VIDEO_DISPLAY_TV 2
#define ACPI_VIDEO_DISPLAY_DVI 3
Expand All @@ -26,4 +30,3 @@ static inline int acpi_video_get_edid(struct acpi_device *device, int type,
#endif

#endif

15 changes: 15 additions & 0 deletions trunk/include/linux/video_output.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#ifndef _LINUX_VIDEO_OUTPUT_H
#define _LINUX_VIDEO_OUTPUT_H
#include <linux/device.h>
#include <linux/err.h>
struct output_device;
struct output_properties {
int (*set_state)(struct output_device *);
Expand All @@ -34,9 +35,23 @@ struct output_device {
struct device dev;
};
#define to_output_device(obj) container_of(obj, struct output_device, dev)
#if defined(CONFIG_VIDEO_OUTPUT_CONTROL) || defined(CONFIG_VIDEO_OUTPUT_CONTROL_MODULE)
struct output_device *video_output_register(const char *name,
struct device *dev,
void *devdata,
struct output_properties *op);
void video_output_unregister(struct output_device *dev);
#else
static struct output_device *video_output_register(const char *name,
struct device *dev,
void *devdata,
struct output_properties *op)
{
return ERR_PTR(-ENODEV);
}
static void video_output_unregister(struct output_device *dev)
{
return;
}
#endif
#endif

0 comments on commit a5a82f0

Please sign in to comment.