All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pradeep Subrahmanion <subrahmanion.pradeep@gmail.com>
To: joeyli <jlee@suse.com>
Cc: Matthew Garrett <mjg@redhat.com>,
	rpurdie@rpsys.net, FlorianSchandinat@gmx.de,
	akpm@linux-foundation.org, linux-fbdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Added backlight driver for Acer Aspire 4736
Date: Wed, 21 Mar 2012 00:25:10 +0530	[thread overview]
Message-ID: <1332269710.3921.31.camel@debian.Gayathri> (raw)
In-Reply-To: <1332241764.10557.329.camel@linux-s257.site>


> >From 5da43d2ee6c87dcf17fda34f0b50fe11b04a16bf Mon Sep 17 00:00:00 2001
> From: "Lee, Chun-Yi" <jlee@suse.com>
> Date: Tue, 20 Mar 2012 19:00:58 +0800
> Subject: [PATCH] acer-wmi: add quirk table for video backlight vendor mode
> 
> There have some acer laptop have broken _BCM implemenation, the AML
> code wrote value to EC register but firmware didn't change brighenss.
> 
> Fortunately, the brightness control works on those machines with
> vendor mode. So, add quirk table for video backlight vendor mode
> and unregister acpi video interface on those machines.
> 
> Tested on Acer TravelMate 4750
> 
> Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
> ---
>  drivers/platform/x86/Kconfig    |    4 ++++
>  drivers/platform/x86/acer-wmi.c |   38 +++++++++++++++++++++++++++++++++++---
>  2 files changed, 39 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
> index 15dbd8c..fe3a494 100644
> --- a/drivers/platform/x86/Kconfig
> +++ b/drivers/platform/x86/Kconfig
> @@ -26,6 +26,10 @@ config ACER_WMI
>  	depends on RFKILL || RFKILL = n
>  	depends on ACPI_WMI
>  	select INPUT_SPARSEKMAP
> +	# Acer WMI 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 ACPI_VIDEO if ACPI
>  	---help---
>  	  This is a driver for newer Acer (and Wistron) laptops. It adds
>  	  wireless radio and bluetooth control, and on some laptops,
> diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
> index 1e5290b..984a7b5 100644
> --- a/drivers/platform/x86/acer-wmi.c
> +++ b/drivers/platform/x86/acer-wmi.c
> @@ -43,6 +43,7 @@
>  #include <linux/input/sparse-keymap.h>
>  
>  #include <acpi/acpi_drivers.h>
> +#include <acpi/video.h>
>  
>  MODULE_AUTHOR("Carlos Corbacho");
>  MODULE_DESCRIPTION("Acer Laptop WMI Extras Driver");
> @@ -478,6 +479,33 @@ static struct dmi_system_id acer_quirks[] = {
>  	{}
>  };
>  
> +static int video_set_backlight_video_vendor(const struct dmi_system_id *d)
> +{
> +	interface->capability &= ~ACER_CAP_BRIGHTNESS;
> +	pr_info("Brightness must be controlled by generic video driver\n");
> +	return 0;
> +}
> +
> +static const struct dmi_system_id video_vendor_dmi_table[] = {
> +	{
> +		.callback = video_set_backlight_video_vendor,
> +		.ident = "Acer Aspire 4736",
> +		.matches = {
> +			DMI_MATCH(DMI_BOARD_VENDOR, "Acer"),
> +			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 4736"),
> +		},
> +	},
> +	{
> +		.callback = video_set_backlight_video_vendor,
> +		.ident = "Acer TravelMate 4750",
> +		.matches = {
> +			DMI_MATCH(DMI_BOARD_VENDOR, "Acer"),
> +			DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 4750"),
> +		},
> +	},
> +	{}
> +};
> +
>  /* Find which quirks are needed for a particular vendor/ model pair */
>  static void find_quirks(void)
>  {
> @@ -1981,9 +2009,13 @@ static int __init acer_wmi_init(void)
>  	set_quirks();
>  
>  	if (acpi_video_backlight_support()) {
> -		interface->capability &= ~ACER_CAP_BRIGHTNESS;
> -		pr_info("Brightness must be controlled by "
> -		       "generic video driver\n");
> +		if (dmi_check_system(video_vendor_dmi_table)) {
> +			acpi_video_unregister();
> +		} else {
> +			interface->capability &= ~ACER_CAP_BRIGHTNESS;
> +			pr_info("Brightness must be controlled by "
> +				"acpi video driver\n");
> +		}
>  	}
>  
>  	if (wmi_has_guid(WMID_GUID3)) {

I tried out applied your patch . Boot message shows , 

[11.220410] acer_wmi: Brightness must be controlled by generic video
driver

Now 'acpi_video0' and 'intel_backlight' are present
inside /sys/class/backlight .Hot key works like earlier ( ie problem
after maximum level still exists).
I tried following commands , 

echo 5 > /sys/class/backlight/acpi_video0/brightness 
echo 5 > /sys/class/backlight/intel_backlight/brightness

But it doesn't make any change . 

In my case  , 'acpi_backlight = vendor' does not make any difference since the hot key control 

already starts working with 'acpi_osi=Linux' option.

cat /proc/cmdline gives , 

BOOT_IMAGE=/boot/vmlinuz-3.3.0+
root=UUID=f0197a59-c067-4fd8-ad90-c4d721816077 ro acpi_osi=Linux 


Thanks , 

Pradeep Subrahmanion


WARNING: multiple messages have this Message-ID (diff)
From: Pradeep Subrahmanion <subrahmanion.pradeep@gmail.com>
To: joeyli <jlee@suse.com>
Cc: Matthew Garrett <mjg@redhat.com>,
	rpurdie@rpsys.net, FlorianSchandinat@gmx.de,
	akpm@linux-foundation.org, linux-fbdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Added backlight driver for Acer Aspire 4736
Date: Tue, 20 Mar 2012 18:55:51 +0000	[thread overview]
Message-ID: <1332269710.3921.31.camel@debian.Gayathri> (raw)
In-Reply-To: <1332241764.10557.329.camel@linux-s257.site>


> >From 5da43d2ee6c87dcf17fda34f0b50fe11b04a16bf Mon Sep 17 00:00:00 2001
> From: "Lee, Chun-Yi" <jlee@suse.com>
> Date: Tue, 20 Mar 2012 19:00:58 +0800
> Subject: [PATCH] acer-wmi: add quirk table for video backlight vendor mode
> 
> There have some acer laptop have broken _BCM implemenation, the AML
> code wrote value to EC register but firmware didn't change brighenss.
> 
> Fortunately, the brightness control works on those machines with
> vendor mode. So, add quirk table for video backlight vendor mode
> and unregister acpi video interface on those machines.
> 
> Tested on Acer TravelMate 4750
> 
> Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
> ---
>  drivers/platform/x86/Kconfig    |    4 ++++
>  drivers/platform/x86/acer-wmi.c |   38 +++++++++++++++++++++++++++++++++++---
>  2 files changed, 39 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
> index 15dbd8c..fe3a494 100644
> --- a/drivers/platform/x86/Kconfig
> +++ b/drivers/platform/x86/Kconfig
> @@ -26,6 +26,10 @@ config ACER_WMI
>  	depends on RFKILL || RFKILL = n
>  	depends on ACPI_WMI
>  	select INPUT_SPARSEKMAP
> +	# Acer WMI 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 ACPI_VIDEO if ACPI
>  	---help---
>  	  This is a driver for newer Acer (and Wistron) laptops. It adds
>  	  wireless radio and bluetooth control, and on some laptops,
> diff --git a/drivers/platform/x86/acer-wmi.c b/drivers/platform/x86/acer-wmi.c
> index 1e5290b..984a7b5 100644
> --- a/drivers/platform/x86/acer-wmi.c
> +++ b/drivers/platform/x86/acer-wmi.c
> @@ -43,6 +43,7 @@
>  #include <linux/input/sparse-keymap.h>
>  
>  #include <acpi/acpi_drivers.h>
> +#include <acpi/video.h>
>  
>  MODULE_AUTHOR("Carlos Corbacho");
>  MODULE_DESCRIPTION("Acer Laptop WMI Extras Driver");
> @@ -478,6 +479,33 @@ static struct dmi_system_id acer_quirks[] = {
>  	{}
>  };
>  
> +static int video_set_backlight_video_vendor(const struct dmi_system_id *d)
> +{
> +	interface->capability &= ~ACER_CAP_BRIGHTNESS;
> +	pr_info("Brightness must be controlled by generic video driver\n");
> +	return 0;
> +}
> +
> +static const struct dmi_system_id video_vendor_dmi_table[] = {
> +	{
> +		.callback = video_set_backlight_video_vendor,
> +		.ident = "Acer Aspire 4736",
> +		.matches = {
> +			DMI_MATCH(DMI_BOARD_VENDOR, "Acer"),
> +			DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 4736"),
> +		},
> +	},
> +	{
> +		.callback = video_set_backlight_video_vendor,
> +		.ident = "Acer TravelMate 4750",
> +		.matches = {
> +			DMI_MATCH(DMI_BOARD_VENDOR, "Acer"),
> +			DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 4750"),
> +		},
> +	},
> +	{}
> +};
> +
>  /* Find which quirks are needed for a particular vendor/ model pair */
>  static void find_quirks(void)
>  {
> @@ -1981,9 +2009,13 @@ static int __init acer_wmi_init(void)
>  	set_quirks();
>  
>  	if (acpi_video_backlight_support()) {
> -		interface->capability &= ~ACER_CAP_BRIGHTNESS;
> -		pr_info("Brightness must be controlled by "
> -		       "generic video driver\n");
> +		if (dmi_check_system(video_vendor_dmi_table)) {
> +			acpi_video_unregister();
> +		} else {
> +			interface->capability &= ~ACER_CAP_BRIGHTNESS;
> +			pr_info("Brightness must be controlled by "
> +				"acpi video driver\n");
> +		}
>  	}
>  
>  	if (wmi_has_guid(WMID_GUID3)) {

I tried out applied your patch . Boot message shows , 

[11.220410] acer_wmi: Brightness must be controlled by generic video
driver

Now 'acpi_video0' and 'intel_backlight' are present
inside /sys/class/backlight .Hot key works like earlier ( ie problem
after maximum level still exists).
I tried following commands , 

echo 5 > /sys/class/backlight/acpi_video0/brightness 
echo 5 > /sys/class/backlight/intel_backlight/brightness

But it doesn't make any change . 

In my case  , 'acpi_backlight = vendor' does not make any difference since the hot key control 

already starts working with 'acpi_osi=Linux' option.

cat /proc/cmdline gives , 

BOOT_IMAGE=/boot/vmlinuz-3.3.0+
root=UUIDð197a59-c067-4fd8-ad90-c4d721816077 ro acpi_osi=Linux 


Thanks , 

Pradeep Subrahmanion


  reply	other threads:[~2012-03-20 18:54 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CABNxG=CU+bOWUauLYfcS2vtFqKvXA-9axgokNoYz+KuU1Mzztw@mail.gmail.com>
2012-03-11 19:42 ` [PATCH] Added backlight driver for Acer Aspire 4736 Florian Tobias Schandinat
2012-03-11 19:42   ` Florian Tobias Schandinat
2012-03-12 17:36   ` Pradeep Subrahmanion
2012-03-13  3:12     ` Pradeep Subrahmanion
2012-03-12 17:51     ` Matthew Garrett
2012-03-13 12:09       ` Pradeep Subrahmanion
2012-03-13 12:47         ` Matthew Garrett
2012-03-13 13:29           ` Pradeep Subrahmanion
2012-03-13 13:41             ` Pradeep Subrahmanion
     [not found]           ` <CABNxG=Dqg26EHmC3vibf3-SjVhby1qgQfMniQObUeh9eJ6SwEw@mail.gmail.com>
2012-03-13 13:34             ` Matthew Garrett
2012-03-13 15:49               ` Pradeep Subrahmanion
2012-03-14  1:24                 ` Pradeep Subrahmanion
2012-03-13 23:12                 ` joeyli
2012-03-13 23:12                   ` joeyli
2012-03-14  2:43                   ` Pradeep Subrahmanion
2012-03-14  2:55                     ` Pradeep Subrahmanion
2012-03-14  5:51                     ` joeyli
2012-03-14  5:51                       ` joeyli
2012-03-14  6:17                       ` Pradeep Subrahmanion
2012-03-14  6:29                         ` Pradeep Subrahmanion
2012-03-15  8:05                         ` joeyli
2012-03-15  8:05                           ` joeyli
2012-03-18  5:10                           ` Pradeep Subrahmanion
2012-03-18  5:22                             ` Pradeep Subrahmanion
2012-03-19  2:01                             ` joeyli
2012-03-19  2:01                               ` joeyli
2012-03-19 11:33                               ` Pradeep Subrahmanion
2012-03-19 11:45                                 ` Pradeep Subrahmanion
2012-03-20  3:55                                 ` joeyli
2012-03-20  3:55                                   ` joeyli
2012-03-20 11:09                               ` joeyli
2012-03-20 11:09                                 ` joeyli
2012-03-20 18:55                                 ` Pradeep Subrahmanion [this message]
2012-03-20 18:55                                   ` Pradeep Subrahmanion
2012-03-21  3:00                                   ` joeyli
2012-03-21  3:00                                     ` joeyli
2012-03-21 19:09                                     ` Pradeep Subrahmanion
2012-03-21 19:21                                       ` Pradeep Subrahmanion
2012-03-22  1:33                                       ` joeyli
2012-03-22  1:33                                         ` joeyli
2012-03-22  2:33                                         ` Pradeep Subrahmanion
2012-03-22  2:45                                           ` Pradeep Subrahmanion
2012-03-22  3:25                                           ` joeyli
2012-03-22  3:25                                             ` joeyli
2012-03-22  3:32                                             ` Pradeep Subrahmanion
2012-03-22  3:44                                               ` Pradeep Subrahmanion
2012-03-22  3:54                                               ` joeyli
2012-03-22  3:54                                                 ` joeyli
2012-03-22  5:56                                                 ` Pradeep Subrahmanion
2012-03-22  5:57                                                   ` Pradeep Subrahmanion
2012-03-22  9:34                                                   ` joeyli
2012-03-22  9:34                                                     ` joeyli
2012-03-22 16:17                                                     ` Pradeep Subrahmanion
2012-03-22 16:29                                                       ` Pradeep Subrahmanion
2012-03-23  3:36                                     ` Pradeep Subrahmanion
2012-03-23  3:48                                       ` Pradeep Subrahmanion
2012-03-23  4:25                                       ` joeyli
2012-03-23  4:25                                         ` joeyli
2012-03-18  5:12                           ` Pradeep Subrahmanion
2012-03-18  5:24                             ` Pradeep Subrahmanion
2012-03-12 23:07     ` Joe Perches
2012-03-12 23:07       ` Joe Perches
2012-03-12 17:40   ` Pradeep Subrahmanion
2012-03-13  3:16     ` Pradeep Subrahmanion
2012-03-13  3:10   ` joeyli
2012-03-13  3:10     ` joeyli
2012-03-13 13:12     ` Pradeep Subrahmanion
2012-03-13  4:35       ` joeyli
2012-03-13  4:35         ` joeyli

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=1332269710.3921.31.camel@debian.Gayathri \
    --to=subrahmanion.pradeep@gmail.com \
    --cc=FlorianSchandinat@gmx.de \
    --cc=akpm@linux-foundation.org \
    --cc=jlee@suse.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjg@redhat.com \
    --cc=rpurdie@rpsys.net \
    /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.