ACPI / video: add function to support unregister backlight interface

In some situations the whole ACPI/video driver is unregistered by
a platform driver that just wants to remove the backlight control
interface provided by ACPI/video.  However, this causes the other
functionality of ACPI/video to be lost too, like the transfer of
ACPI events to the input layer.

To address this shortcoming, add a new function,
find_video_unregister_backlight(), that will allow "downstream"
drivers to request ACPI/video to unregister its backlight interface
from all ACPI video device objects.  Then, other functionality of
ACPI/video may still be there just without the backlight support.

[rjw: Changelog]
References: https://bugzilla.kernel.org/show_bug.cgi?id=35622
Tested-by: Andrzej Krentosz <endrjux@gmail.com>
Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ACPICA: expose OSI version

Expose acpi_gbl_osi_data so that drivers can check the value of the
last successfull _OSI call.  The definitions for OSI versions are
moved to actypes.h so that other components can access them.

Based on a patch from Matthew Garrett which in turn was based on
an earlier patch from Seth Forshee.

[rjw: Changelog]
Signed-off-by: Aaron Lu <aaron.lu@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
ACPI / power: add missing newline to debug messages

There are few places in power.c where debug messages have no newline
at the end.  Reading such debug messages from dmesg is not fun, so
fix this by adding the missing newlines.

Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: All <stable@vger.kernel.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Merge branch 'acpi-fixes-next' into linux-next

* acpi-fixes-next:
  ACPI / power: add missing newline to debug messages
ACPI / OSL: add a wrapper function to return OSI version

Drivers may need to make policy decisions based on the OS that the
firmware believes it's interacting with.  ACPI firmware will make a
series of _OSI calls, starting from the oldest OS version they
support and ending with the most recent one.

Add a function in the ACPI OSL layer to return the OS version from
the last successful _OSI call so that drivers can check what the
firmware is expecting.

Based on a patch from Matthew Garrett which in turn was based
on a patch from Seth Forshee.

[rjw: Changelog]
Signed-off-by: Aaron Lu <aaron.lu@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
i915: Don't provide ACPI backlight interface if firmware expects Windows 8

Windows 8 leaves backlight control up to individual graphics drivers
rather than making ACPI calls itself.  There's plenty of evidence to
suggest that the Intel driver for Windows doesn't use the ACPI
interface, including the fact that it's broken on a bunch of machines
when the OS claims to support Windows 8.  The simplest thing to do
appears to be to disable the ACPI backlight interface on these
systems.

Tested-by: Lee, Chun-Yi <jlee@suse.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Merge branch 'linux-next' into bleeding-edge

* linux-next:
  ACPI / power: add missing newline to debug messages
Merge branch 'acpi-backlight-next' into bleeding-edge

* acpi-backlight-next:
  i915: Don't provide ACPI backlight interface if firmware expects Windows 8
  ACPI / OSL: add a wrapper function to return OSI version
  ACPICA: expose OSI version
  ACPI / video: add function to support unregister backlight interface