Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a6becfba authored by Rafael J. Wysocki's avatar Rafael J. Wysocki
Browse files

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -373,5 +373,5 @@ bool efi_reboot_required(void)

bool efi_poweroff_required(void)
{
	return !!acpi_gbl_reduced_hardware;
	return acpi_gbl_reduced_hardware || acpi_no_s5;
}
+1 −0
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ acpi-$(CONFIG_ARM_AMBA) += acpi_amba.o
acpi-y				+= int340x_thermal.o
acpi-y				+= power.o
acpi-y				+= event.o
acpi-$(CONFIG_ACPI_REDUCED_HARDWARE_ONLY) += evged.o
acpi-y				+= sysfs.o
acpi-y				+= property.o
acpi-$(CONFIG_X86)		+= acpi_cmos_rtc.o
+1 −2
Original line number Diff line number Diff line
@@ -35,8 +35,7 @@ static void amba_register_dummy_clk(void)
	if (amba_dummy_clk)
		return;

	amba_dummy_clk = clk_register_fixed_rate(NULL, "apb_pclk", NULL,
						CLK_IS_ROOT, 0);
	amba_dummy_clk = clk_register_fixed_rate(NULL, "apb_pclk", NULL, 0, 0);
	clk_register_clkdev(amba_dummy_clk, "apb_pclk", NULL);
}

+1 −2
Original line number Diff line number Diff line
@@ -62,8 +62,7 @@ static int acpi_apd_setup(struct apd_private_data *pdata)
	if (dev_desc->fixed_clk_rate) {
		clk = clk_register_fixed_rate(&pdata->adev->dev,
					dev_name(&pdata->adev->dev),
					NULL, CLK_IS_ROOT,
					dev_desc->fixed_clk_rate);
					NULL, 0, dev_desc->fixed_clk_rate);
		clk_register_clkdev(clk, NULL, dev_name(&pdata->adev->dev));
		pdata->clk = clk;
	}
+45 −38
Original line number Diff line number Diff line
@@ -191,19 +191,6 @@ struct acpi_video_device_cap {
	u8 _DDC:1;		/* Return the EDID for this device */
};

struct acpi_video_brightness_flags {
	u8 _BCL_no_ac_battery_levels:1;	/* no AC/Battery levels in _BCL */
	u8 _BCL_reversed:1;		/* _BCL package is in a reversed order */
	u8 _BQC_use_index:1;		/* _BQC returns an index value */
};

struct acpi_video_device_brightness {
	int curr;
	int count;
	int *levels;
	struct acpi_video_brightness_flags flags;
};

struct acpi_video_device {
	unsigned long device_id;
	struct acpi_video_device_flags flags;
@@ -325,7 +312,7 @@ static const struct thermal_cooling_device_ops video_cooling_ops = {
 */

static int
acpi_video_device_lcd_query_levels(struct acpi_video_device *device,
acpi_video_device_lcd_query_levels(acpi_handle handle,
				   union acpi_object **levels)
{
	int status;
@@ -335,7 +322,7 @@ acpi_video_device_lcd_query_levels(struct acpi_video_device *device,

	*levels = NULL;

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


/*
 *  Arg:
 *	device	: video output device (LCD, CRT, ..)
 *
 *  Return Value:
 *	Maximum brightness level
 *
 *  Allocate and initialize device->brightness.
 */

static int
acpi_video_init_brightness(struct acpi_video_device *device)
int acpi_video_get_levels(struct acpi_device *device,
			  struct acpi_video_device_brightness **dev_br)
{
	union acpi_object *obj = NULL;
	int i, max_level = 0, count = 0, level_ac_battery = 0;
	unsigned long long level, level_old;
	union acpi_object *o;
	struct acpi_video_device_brightness *br = NULL;
	int result = -EINVAL;
	int result = 0;
	u32 value;

	if (!ACPI_SUCCESS(acpi_video_device_lcd_query_levels(device, &obj))) {
	if (!ACPI_SUCCESS(acpi_video_device_lcd_query_levels(device->handle,
								&obj))) {
		ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Could not query available "
						"LCD brightness level\n"));
		result = -ENODEV;
		goto out;
	}

	if (obj->package.count < 2)
	if (obj->package.count < 2) {
		result = -EINVAL;
		goto out;
	}

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

	br->count = count;
	*dev_br = br;

out:
	kfree(obj);
	return result;
out_free:
	kfree(br);
	goto out;
}
EXPORT_SYMBOL(acpi_video_get_levels);

/*
 *  Arg:
 *	device	: video output device (LCD, CRT, ..)
 *
 *  Return Value:
 *	Maximum brightness level
 *
 *  Allocate and initialize device->brightness.
 */

static int
acpi_video_init_brightness(struct acpi_video_device *device)
{
	int i, max_level = 0;
	unsigned long long level, level_old;
	struct acpi_video_device_brightness *br = NULL;
	int result = -EINVAL;

	result = acpi_video_get_levels(device->dev, &br);
	if (result)
		return result;
	device->brightness = br;

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

	ACPI_DEBUG_PRINT((ACPI_DB_INFO,
			  "found %d brightness levels\n", count - 2));
	kfree(obj);
	return result;
			  "found %d brightness levels\n", br->count - 2));
	return 0;

out_free_levels:
	kfree(br->levels);
out_free:
	kfree(br);
out:
	device->brightness = NULL;
	kfree(obj);
	return result;
}

Loading