Skip to content

Commit

Permalink
Merge branches 'release', 'bugzilla-13032', 'bugzilla-13041+', 'bugzi…
Browse files Browse the repository at this point in the history
…lla-13121', 'bugzilla-13165', 'bugzilla-13243', 'bugzilla-13259', 'resume-sci-en-regression', 'thermal-regression', 'tsc-regression' and 'asus-2.6.30' into release
  • Loading branch information
Len Brown committed May 16, 2009
11 parents 7c7327d + 815ab0f + 5199176 + 5afc4ab + ecb4aed + 19bde77 + 4973b22 + 975b3c4 + 2932135 + a0bf284 + bd32005 commit 4e3507f
Show file tree
Hide file tree
Showing 11 changed files with 174 additions and 42 deletions.
27 changes: 15 additions & 12 deletions drivers/acpi/acpica/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,43 @@
ccflags-y := -Os
ccflags-$(CONFIG_ACPI_DEBUG) += -DACPI_DEBUG_OUTPUT

obj-y := dsfield.o dsmthdat.o dsopcode.o dswexec.o dswscope.o \
# use acpi.o to put all files here into acpi.o modparam namespace
obj-y += acpi.o

acpi-y := dsfield.o dsmthdat.o dsopcode.o dswexec.o dswscope.o \
dsmethod.o dsobject.o dsutils.o dswload.o dswstate.o \
dsinit.o

obj-y += evevent.o evregion.o evsci.o evxfevnt.o \
acpi-y += evevent.o evregion.o evsci.o evxfevnt.o \
evmisc.o evrgnini.o evxface.o evxfregn.o \
evgpe.o evgpeblk.o

obj-y += exconfig.o exfield.o exnames.o exoparg6.o exresolv.o exstorob.o\
acpi-y += exconfig.o exfield.o exnames.o exoparg6.o exresolv.o exstorob.o\
exconvrt.o exfldio.o exoparg1.o exprep.o exresop.o exsystem.o\
excreate.o exmisc.o exoparg2.o exregion.o exstore.o exutils.o \
exdump.o exmutex.o exoparg3.o exresnte.o exstoren.o

obj-y += hwacpi.o hwgpe.o hwregs.o hwsleep.o hwxface.o hwvalid.o
acpi-y += hwacpi.o hwgpe.o hwregs.o hwsleep.o hwxface.o hwvalid.o

obj-$(ACPI_FUTURE_USAGE) += hwtimer.o
acpi-$(ACPI_FUTURE_USAGE) += hwtimer.o

obj-y += nsaccess.o nsload.o nssearch.o nsxfeval.o \
acpi-y += nsaccess.o nsload.o nssearch.o nsxfeval.o \
nsalloc.o nseval.o nsnames.o nsutils.o nsxfname.o \
nsdump.o nsinit.o nsobject.o nswalk.o nsxfobj.o \
nsparse.o nspredef.o

obj-$(ACPI_FUTURE_USAGE) += nsdumpdv.o
acpi-$(ACPI_FUTURE_USAGE) += nsdumpdv.o

obj-y += psargs.o psparse.o psloop.o pstree.o pswalk.o \
acpi-y += psargs.o psparse.o psloop.o pstree.o pswalk.o \
psopcode.o psscope.o psutils.o psxface.o

obj-y += rsaddr.o rscreate.o rsinfo.o rsio.o rslist.o rsmisc.o rsxface.o \
acpi-y += rsaddr.o rscreate.o rsinfo.o rsio.o rslist.o rsmisc.o rsxface.o \
rscalc.o rsirq.o rsmemory.o rsutils.o

obj-$(ACPI_FUTURE_USAGE) += rsdump.o
acpi-$(ACPI_FUTURE_USAGE) += rsdump.o

obj-y += tbxface.o tbinstal.o tbutils.o tbfind.o tbfadt.o tbxfroot.o
acpi-y += tbxface.o tbinstal.o tbutils.o tbfind.o tbfadt.o tbxfroot.o

obj-y += utalloc.o utdebug.o uteval.o utinit.o utmisc.o utxface.o \
acpi-y += utalloc.o utdebug.o uteval.o utinit.o utmisc.o utxface.o \
utcopy.o utdelete.o utglobal.o utmath.o utobject.o \
utstate.o utmutex.o utobject.o utresrc.o utlock.o
7 changes: 6 additions & 1 deletion drivers/acpi/acpica/aclocal.h
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,12 @@ struct acpi_bit_register_info {

/* For control registers, both ignored and reserved bits must be preserved */

#define ACPI_PM1_CONTROL_IGNORED_BITS 0x0201 /* Bits 9, 0(SCI_EN) */
/*
* The ACPI spec says to ignore PM1_CTL.SCI_EN (bit 0)
* but we need to be able to write ACPI_BITREG_SCI_ENABLE directly
* as a BIOS workaround on some machines.
*/
#define ACPI_PM1_CONTROL_IGNORED_BITS 0x0200 /* Bits 9 */
#define ACPI_PM1_CONTROL_RESERVED_BITS 0xC1F8 /* Bits 14-15, 3-8 */
#define ACPI_PM1_CONTROL_PRESERVED_BITS \
(ACPI_PM1_CONTROL_IGNORED_BITS | ACPI_PM1_CONTROL_RESERVED_BITS)
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ int acpi_bus_set_power(acpi_handle handle, int state)
end:
if (result)
printk(KERN_WARNING PREFIX
"Transitioning device [%s] to D%d\n",
"Device [%s] failed to transition to D%d\n",
device->pnp.bus_id, state);
else {
device->power.state = state;
Expand Down
42 changes: 33 additions & 9 deletions drivers/acpi/processor_idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,21 +202,44 @@ static void acpi_state_timer_broadcast(struct acpi_processor *pr,
* Suspend / resume control
*/
static int acpi_idle_suspend;
static u32 saved_bm_rld;

static void acpi_idle_bm_rld_save(void)
{
acpi_read_bit_register(ACPI_BITREG_BUS_MASTER_RLD, &saved_bm_rld);
}
static void acpi_idle_bm_rld_restore(void)
{
u32 resumed_bm_rld;

acpi_read_bit_register(ACPI_BITREG_BUS_MASTER_RLD, &resumed_bm_rld);

if (resumed_bm_rld != saved_bm_rld)
acpi_write_bit_register(ACPI_BITREG_BUS_MASTER_RLD, saved_bm_rld);
}

int acpi_processor_suspend(struct acpi_device * device, pm_message_t state)
{
if (acpi_idle_suspend == 1)
return 0;

acpi_idle_bm_rld_save();
acpi_idle_suspend = 1;
return 0;
}

int acpi_processor_resume(struct acpi_device * device)
{
if (acpi_idle_suspend == 0)
return 0;

acpi_idle_bm_rld_restore();
acpi_idle_suspend = 0;
return 0;
}

#if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86)
static int tsc_halts_in_c(int state)
static void tsc_check_state(int state)
{
switch (boot_cpu_data.x86_vendor) {
case X86_VENDOR_AMD:
Expand All @@ -226,13 +249,17 @@ static int tsc_halts_in_c(int state)
* C/P/S0/S1 states when this bit is set.
*/
if (boot_cpu_has(X86_FEATURE_NONSTOP_TSC))
return 0;
return;

/*FALL THROUGH*/
default:
return state > ACPI_STATE_C1;
/* TSC could halt in idle, so notify users */
if (state > ACPI_STATE_C1)
mark_tsc_unstable("TSC halts in idle");
}
}
#else
static void tsc_check_state(int state) { return; }
#endif

static int acpi_processor_get_power_info_fadt(struct acpi_processor *pr)
Expand Down Expand Up @@ -578,14 +605,9 @@ static int acpi_processor_power_verify(struct acpi_processor *pr)

pr->power.timer_broadcast_on_state = INT_MAX;

for (i = 1; i < ACPI_PROCESSOR_MAX_POWER; i++) {
for (i = 1; i < ACPI_PROCESSOR_MAX_POWER && i <= max_cstate; i++) {
struct acpi_processor_cx *cx = &pr->power.states[i];

#if defined (CONFIG_GENERIC_TIME) && defined (CONFIG_X86)
/* TSC could halt in idle, so notify users */
if (tsc_halts_in_c(cx->type))
mark_tsc_unstable("TSC halts in idle");;
#endif
switch (cx->type) {
case ACPI_STATE_C1:
cx->valid = 1;
Expand All @@ -603,6 +625,8 @@ static int acpi_processor_power_verify(struct acpi_processor *pr)
acpi_timer_check_state(i, pr, cx);
break;
}
if (cx->valid)
tsc_check_state(cx->type);

if (cx->valid)
working++;
Expand Down
25 changes: 25 additions & 0 deletions drivers/acpi/processor_throttling.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@
#define _COMPONENT ACPI_PROCESSOR_COMPONENT
ACPI_MODULE_NAME("processor_throttling");

/* ignore_tpc:
* 0 -> acpi processor driver doesn't ignore _TPC values
* 1 -> acpi processor driver ignores _TPC values
*/
static int ignore_tpc;
module_param(ignore_tpc, int, 0644);
MODULE_PARM_DESC(ignore_tpc, "Disable broken BIOS _TPC throttling support");

struct throttling_tstate {
unsigned int cpu; /* cpu nr */
int target_state; /* target T-state */
Expand Down Expand Up @@ -283,13 +291,19 @@ static int acpi_processor_get_platform_limit(struct acpi_processor *pr)

if (!pr)
return -EINVAL;

if (ignore_tpc)
goto end;

status = acpi_evaluate_integer(pr->handle, "_TPC", NULL, &tpc);
if (ACPI_FAILURE(status)) {
if (status != AE_NOT_FOUND) {
ACPI_EXCEPTION((AE_INFO, status, "Evaluating _TPC"));
}
return -ENODEV;
}

end:
pr->throttling_platform_limit = (int)tpc;
return 0;
}
Expand All @@ -302,6 +316,9 @@ int acpi_processor_tstate_has_changed(struct acpi_processor *pr)
struct acpi_processor_limit *limit;
int target_state;

if (ignore_tpc)
return 0;

result = acpi_processor_get_platform_limit(pr);
if (result) {
/* Throttling Limit is unsupported */
Expand Down Expand Up @@ -821,6 +838,14 @@ static int acpi_processor_get_throttling_ptc(struct acpi_processor *pr)
ret = acpi_read_throttling_status(pr, &value);
if (ret >= 0) {
state = acpi_get_throttling_state(pr, value);
if (state == -1) {
ACPI_WARNING((AE_INFO,
"Invalid throttling state, reset\n"));
state = 0;
ret = acpi_processor_set_throttling(pr, state);
if (ret)
return ret;
}
pr->throttling.state = state;
}

Expand Down
38 changes: 38 additions & 0 deletions drivers/acpi/video.c
Original file line number Diff line number Diff line change
Expand Up @@ -538,6 +538,41 @@ acpi_video_device_lcd_set_level(struct acpi_video_device *device, int level)
return -EINVAL;
}

/*
* For some buggy _BQC methods, we need to add a constant value to
* the _BQC return value to get the actual current brightness level
*/

static int bqc_offset_aml_bug_workaround;
static int __init video_set_bqc_offset(const struct dmi_system_id *d)
{
bqc_offset_aml_bug_workaround = 9;
return 0;
}

static struct dmi_system_id video_dmi_table[] __initdata = {
/*
* Broken _BQC workaround http://bugzilla.kernel.org/show_bug.cgi?id=13121
*/
{
.callback = video_set_bqc_offset,
.ident = "Acer Aspire 5720",
.matches = {
DMI_MATCH(DMI_BOARD_VENDOR, "Acer"),
DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5720"),
},
},
{
.callback = video_set_bqc_offset,
.ident = "Acer Aspire 5710Z",
.matches = {
DMI_MATCH(DMI_BOARD_VENDOR, "Acer"),
DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5710Z"),
},
},
{}
};

static int
acpi_video_device_lcd_get_level_current(struct acpi_video_device *device,
unsigned long long *level)
Expand All @@ -557,6 +592,7 @@ acpi_video_device_lcd_get_level_current(struct acpi_video_device *device,
*level = device->brightness->levels[*level + 2];

}
*level += bqc_offset_aml_bug_workaround;
device->brightness->curr = *level;
return 0;
} else {
Expand Down Expand Up @@ -2290,6 +2326,8 @@ EXPORT_SYMBOL(acpi_video_register);

static int __init acpi_video_init(void)
{
dmi_check_system(video_dmi_table);

if (intel_opregion_present())
return 0;

Expand Down
6 changes: 6 additions & 0 deletions drivers/gpu/drm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ config DRM_I915
config DRM_I915_KMS
bool "Enable modesetting on intel by default"
depends on DRM_I915
# i915 KMS depends on ACPI_VIDEO when ACPI is enabled
# but for select to work, need to select ACPI_VIDEO's dependencies, ick
select VIDEO_OUTPUT_CONTROL if ACPI
select BACKLIGHT_CLASS_DEVICE if ACPI
select INPUT if ACPI
select ACPI_VIDEO if ACPI
help
Choose this option if you want kernel modesetting enabled by default,
and you have a new enough userspace to support this. Running old
Expand Down
6 changes: 3 additions & 3 deletions drivers/platform/x86/asus-laptop.c
Original file line number Diff line number Diff line change
Expand Up @@ -269,16 +269,16 @@ static struct key_entry asus_keymap[] = {
{KE_KEY, 0x34, KEY_SWITCHVIDEOMODE},
{KE_KEY, 0x40, KEY_PREVIOUSSONG},
{KE_KEY, 0x41, KEY_NEXTSONG},
{KE_KEY, 0x43, KEY_STOP},
{KE_KEY, 0x43, KEY_STOPCD},
{KE_KEY, 0x45, KEY_PLAYPAUSE},
{KE_KEY, 0x50, KEY_EMAIL},
{KE_KEY, 0x51, KEY_WWW},
{KE_KEY, 0x5C, BTN_EXTRA}, /* Performance */
{KE_KEY, 0x5C, KEY_SCREENLOCK}, /* Screenlock */
{KE_KEY, 0x5D, KEY_WLAN},
{KE_KEY, 0x61, KEY_SWITCHVIDEOMODE},
{KE_KEY, 0x6B, BTN_TOUCH}, /* Lock Mouse */
{KE_KEY, 0x82, KEY_CAMERA},
{KE_KEY, 0x8A, KEY_TV},
{KE_KEY, 0x8A, KEY_PROG1},
{KE_KEY, 0x95, KEY_MEDIA},
{KE_KEY, 0x99, KEY_PHONE},
{KE_END, 0},
Expand Down
Loading

0 comments on commit 4e3507f

Please sign in to comment.