Skip to content

Commit a6becfb

Browse files
committed
Merge branches 'acpi-drivers', 'acpi-pm', 'acpi-ec' and 'acpi-video'
* acpi-drivers: ACPI / GED: make evged.c explicitly non-modular ACPI / amba: Remove CLK_IS_ROOT ACPI / APD: Remove CLK_IS_ROOT ACPI: implement Generic Event Device * acpi-pm: ACPI / PM: Introduce efi poweroff for HW-full platforms without _S5 * acpi-ec: ACPI 2.0 / AML: Improve module level execution by moving the If/Else/While execution to per-table basis ACPI 2.0 / ECDT: Enable correct ECDT initialization order ACPI 2.0 / ECDT: Remove early namespace reference from EC ACPI 2.0 / ECDT: Split EC_FLAGS_HANDLERS_INSTALLED * acpi-video: ACPI / video: mark acpi_video_get_levels() inline Thermal / ACPI / video: add INT3406 thermal driver ACPI/video: export acpi_video_get_levels video / backlight: remove the backlight_device_registered API video / backlight: add two APIs for drivers to use
5 parents 407aa3f + 437014b + 1373718 + 3d4b7ae + e4f35c1 commit a6becfb

File tree

19 files changed

+675
-232
lines changed

19 files changed

+675
-232
lines changed

arch/x86/platform/efi/quirks.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,5 +373,5 @@ bool efi_reboot_required(void)
373373

374374
bool efi_poweroff_required(void)
375375
{
376-
return !!acpi_gbl_reduced_hardware;
376+
return acpi_gbl_reduced_hardware || acpi_no_s5;
377377
}

drivers/acpi/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ acpi-$(CONFIG_ARM_AMBA) += acpi_amba.o
4747
acpi-y += int340x_thermal.o
4848
acpi-y += power.o
4949
acpi-y += event.o
50+
acpi-$(CONFIG_ACPI_REDUCED_HARDWARE_ONLY) += evged.o
5051
acpi-y += sysfs.o
5152
acpi-y += property.o
5253
acpi-$(CONFIG_X86) += acpi_cmos_rtc.o

drivers/acpi/acpi_amba.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@ static void amba_register_dummy_clk(void)
3535
if (amba_dummy_clk)
3636
return;
3737

38-
amba_dummy_clk = clk_register_fixed_rate(NULL, "apb_pclk", NULL,
39-
CLK_IS_ROOT, 0);
38+
amba_dummy_clk = clk_register_fixed_rate(NULL, "apb_pclk", NULL, 0, 0);
4039
clk_register_clkdev(amba_dummy_clk, "apb_pclk", NULL);
4140
}
4241

drivers/acpi/acpi_apd.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ static int acpi_apd_setup(struct apd_private_data *pdata)
6262
if (dev_desc->fixed_clk_rate) {
6363
clk = clk_register_fixed_rate(&pdata->adev->dev,
6464
dev_name(&pdata->adev->dev),
65-
NULL, CLK_IS_ROOT,
66-
dev_desc->fixed_clk_rate);
65+
NULL, 0, dev_desc->fixed_clk_rate);
6766
clk_register_clkdev(clk, NULL, dev_name(&pdata->adev->dev));
6867
pdata->clk = clk;
6968
}

drivers/acpi/acpi_video.c

Lines changed: 45 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -191,19 +191,6 @@ struct acpi_video_device_cap {
191191
u8 _DDC:1; /* Return the EDID for this device */
192192
};
193193

194-
struct acpi_video_brightness_flags {
195-
u8 _BCL_no_ac_battery_levels:1; /* no AC/Battery levels in _BCL */
196-
u8 _BCL_reversed:1; /* _BCL package is in a reversed order */
197-
u8 _BQC_use_index:1; /* _BQC returns an index value */
198-
};
199-
200-
struct acpi_video_device_brightness {
201-
int curr;
202-
int count;
203-
int *levels;
204-
struct acpi_video_brightness_flags flags;
205-
};
206-
207194
struct acpi_video_device {
208195
unsigned long device_id;
209196
struct acpi_video_device_flags flags;
@@ -325,7 +312,7 @@ static const struct thermal_cooling_device_ops video_cooling_ops = {
325312
*/
326313

327314
static int
328-
acpi_video_device_lcd_query_levels(struct acpi_video_device *device,
315+
acpi_video_device_lcd_query_levels(acpi_handle handle,
329316
union acpi_object **levels)
330317
{
331318
int status;
@@ -335,7 +322,7 @@ acpi_video_device_lcd_query_levels(struct acpi_video_device *device,
335322

336323
*levels = NULL;
337324

338-
status = acpi_evaluate_object(device->dev->handle, "_BCL", NULL, &buffer);
325+
status = acpi_evaluate_object(handle, "_BCL", NULL, &buffer);
339326
if (!ACPI_SUCCESS(status))
340327
return status;
341328
obj = (union acpi_object *)buffer.pointer;
@@ -766,36 +753,28 @@ static int acpi_video_bqc_quirk(struct acpi_video_device *device,
766753
return 0;
767754
}
768755

769-
770-
/*
771-
* Arg:
772-
* device : video output device (LCD, CRT, ..)
773-
*
774-
* Return Value:
775-
* Maximum brightness level
776-
*
777-
* Allocate and initialize device->brightness.
778-
*/
779-
780-
static int
781-
acpi_video_init_brightness(struct acpi_video_device *device)
756+
int acpi_video_get_levels(struct acpi_device *device,
757+
struct acpi_video_device_brightness **dev_br)
782758
{
783759
union acpi_object *obj = NULL;
784760
int i, max_level = 0, count = 0, level_ac_battery = 0;
785-
unsigned long long level, level_old;
786761
union acpi_object *o;
787762
struct acpi_video_device_brightness *br = NULL;
788-
int result = -EINVAL;
763+
int result = 0;
789764
u32 value;
790765

791-
if (!ACPI_SUCCESS(acpi_video_device_lcd_query_levels(device, &obj))) {
766+
if (!ACPI_SUCCESS(acpi_video_device_lcd_query_levels(device->handle,
767+
&obj))) {
792768
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Could not query available "
793769
"LCD brightness level\n"));
770+
result = -ENODEV;
794771
goto out;
795772
}
796773

797-
if (obj->package.count < 2)
774+
if (obj->package.count < 2) {
775+
result = -EINVAL;
798776
goto out;
777+
}
799778

800779
br = kzalloc(sizeof(*br), GFP_KERNEL);
801780
if (!br) {
@@ -861,6 +840,38 @@ acpi_video_init_brightness(struct acpi_video_device *device)
861840
"Found unordered _BCL package"));
862841

863842
br->count = count;
843+
*dev_br = br;
844+
845+
out:
846+
kfree(obj);
847+
return result;
848+
out_free:
849+
kfree(br);
850+
goto out;
851+
}
852+
EXPORT_SYMBOL(acpi_video_get_levels);
853+
854+
/*
855+
* Arg:
856+
* device : video output device (LCD, CRT, ..)
857+
*
858+
* Return Value:
859+
* Maximum brightness level
860+
*
861+
* Allocate and initialize device->brightness.
862+
*/
863+
864+
static int
865+
acpi_video_init_brightness(struct acpi_video_device *device)
866+
{
867+
int i, max_level = 0;
868+
unsigned long long level, level_old;
869+
struct acpi_video_device_brightness *br = NULL;
870+
int result = -EINVAL;
871+
872+
result = acpi_video_get_levels(device->dev, &br);
873+
if (result)
874+
return result;
864875
device->brightness = br;
865876

866877
/* _BQC uses INDEX while _BCL uses VALUE in some laptops */
@@ -903,17 +914,13 @@ acpi_video_init_brightness(struct acpi_video_device *device)
903914
goto out_free_levels;
904915

905916
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
906-
"found %d brightness levels\n", count - 2));
907-
kfree(obj);
908-
return result;
917+
"found %d brightness levels\n", br->count - 2));
918+
return 0;
909919

910920
out_free_levels:
911921
kfree(br->levels);
912-
out_free:
913922
kfree(br);
914-
out:
915923
device->brightness = NULL;
916-
kfree(obj);
917924
return result;
918925
}
919926

drivers/acpi/bus.c

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -925,11 +925,13 @@ void __init acpi_early_init(void)
925925
goto error0;
926926
}
927927

928-
status = acpi_load_tables();
929-
if (ACPI_FAILURE(status)) {
930-
printk(KERN_ERR PREFIX
931-
"Unable to load the System Description Tables\n");
932-
goto error0;
928+
if (acpi_gbl_group_module_level_code) {
929+
status = acpi_load_tables();
930+
if (ACPI_FAILURE(status)) {
931+
printk(KERN_ERR PREFIX
932+
"Unable to load the System Description Tables\n");
933+
goto error0;
934+
}
933935
}
934936

935937
#ifdef CONFIG_X86
@@ -995,24 +997,33 @@ static int __init acpi_bus_init(void)
995997

996998
acpi_os_initialize1();
997999

998-
status = acpi_enable_subsystem(ACPI_NO_ACPI_ENABLE);
999-
if (ACPI_FAILURE(status)) {
1000-
printk(KERN_ERR PREFIX
1001-
"Unable to start the ACPI Interpreter\n");
1002-
goto error1;
1003-
}
1004-
10051000
/*
10061001
* ACPI 2.0 requires the EC driver to be loaded and work before
1007-
* the EC device is found in the namespace (i.e. before acpi_initialize_objects()
1008-
* is called).
1002+
* the EC device is found in the namespace (i.e. before
1003+
* acpi_load_tables() is called).
10091004
*
10101005
* This is accomplished by looking for the ECDT table, and getting
10111006
* the EC parameters out of that.
10121007
*/
10131008
status = acpi_ec_ecdt_probe();
10141009
/* Ignore result. Not having an ECDT is not fatal. */
10151010

1011+
if (!acpi_gbl_group_module_level_code) {
1012+
status = acpi_load_tables();
1013+
if (ACPI_FAILURE(status)) {
1014+
printk(KERN_ERR PREFIX
1015+
"Unable to load the System Description Tables\n");
1016+
goto error1;
1017+
}
1018+
}
1019+
1020+
status = acpi_enable_subsystem(ACPI_NO_ACPI_ENABLE);
1021+
if (ACPI_FAILURE(status)) {
1022+
printk(KERN_ERR PREFIX
1023+
"Unable to start the ACPI Interpreter\n");
1024+
goto error1;
1025+
}
1026+
10161027
status = acpi_initialize_objects(ACPI_FULL_INITIALIZATION);
10171028
if (ACPI_FAILURE(status)) {
10181029
printk(KERN_ERR PREFIX "Unable to initialize ACPI objects\n");

0 commit comments

Comments
 (0)