All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: "Hans de Goede" <hdegoede@redhat.com>,
	"Jani Nikula" <jani.nikula@linux.intel.com>,
	"Ville Syrjälä" <ville.syrjala@linux.intel.com>,
	"Rafael J . Wysocki" <rjw@rjwysocki.net>,
	"Len Brown" <lenb@kernel.org>
Cc: Takashi Iwai <tiwai@suse.de>,
	linux-acpi@vger.kernel.org,
	intel-gfx <intel-gfx@lists.freedesktop.org>,
	Robert Moore <robert.moore@intel.com>
Subject: Re: [PATCH v8 1/2] ACPI / bus: Introduce a list of ids for "always present" devices
Date: Fri, 21 Apr 2017 14:38:33 +0300	[thread overview]
Message-ID: <1492774713.24567.117.camel@linux.intel.com> (raw)
In-Reply-To: <20170421104741.17185-1-hdegoede@redhat.com>

On Fri, 2017-04-21 at 12:47 +0200, Hans de Goede wrote:
> Several Bay / Cherry Trail devices (all of which ship with Windows 10)
> hide
> the LPSS PWM controller in ACPI, typically the _STA method looks like
> this:
> 
>     Method (_STA, 0, NotSerialized)  // _STA: Status
>     {
>         If (OSID == One)
>         {
>             Return (Zero)
>         }
> 
>         Return (0x0F)
>     }
> 
> Where OSID is some dark magic seen in all Cherry Trail ACPI tables
> making
> the machine behave differently depending on which OS it *thinks* it is
> booting, this gets set in a number of ways which we cannot control, on
> some newer machines it simple hardcoded to "One" aka win10.
> 
> This causes the PWM controller to get hidden, which means Linux cannot
> control the backlight level on cht based tablets / laptops.
> 
> Since loading the driver for this does no harm (the only in kernel
> user
> of it is the i915 driver, which will only uses it when it needs it),
> this
> commit makes acpi_bus_get_status() always set status to
> ACPI_STA_DEFAULT
> for the LPSS PWM device, fixing the lack of backlight control.
> 

>  drivers/acpi/Makefile        |  1 +
>  drivers/acpi/bus.c           |  5 +++
>  drivers/acpi/x86/x86_utils.c | 85
> ++++++++++++++++++++++++++++++++++++++++++++

Perhaps .../x86/utils.c ?

>  include/acpi/acpi_bus.h      |  9 +++++

> diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
> index 34fbe02..784bda6 100644
> --- a/drivers/acpi/bus.c
> +++ b/drivers/acpi/bus.c
> @@ -114,6 +114,11 @@ int acpi_bus_get_status(struct acpi_device
> *device)
>  	acpi_status status;
>  	unsigned long long sta;
>  
> +	if (acpi_device_always_present(device)) {
> +		acpi_set_device_status(device, ACPI_STA_DEFAULT);
> +		return 0;
> +	}
> +
>  	status = acpi_bus_get_status_handle(device->handle, &sta);
>  	if (ACPI_FAILURE(status))
>  		return -ENODEV;
> 

> +#define ICPU(model)	{ X86_VENDOR_INTEL, 6, model,
> X86_FEATURE_ANY, }
> +

> +#define ENTRY(hid, uid, cpu_models) {				

cpu_models -> cpu_model ?

Or I missed that it's an array?

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2017-04-21 11:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-21 10:47 [PATCH v8 1/2] ACPI / bus: Introduce a list of ids for "always present" devices Hans de Goede
2017-04-21 10:47 ` [PATCH v8 2/2] ACPI / bus: Add INT0002 to list of always-present devices Hans de Goede
2017-04-21 11:38 ` Andy Shevchenko [this message]
2017-04-21 11:43   ` [PATCH v8 1/2] ACPI / bus: Introduce a list of ids for "always present" devices Hans de Goede
2017-04-26 21:59     ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1492774713.24567.117.camel@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=hdegoede@redhat.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    --cc=robert.moore@intel.com \
    --cc=tiwai@suse.de \
    --cc=ville.syrjala@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.