All of lore.kernel.org
 help / color / mirror / Atom feed
* Bad _BQC behaviour on Packard Bell Easynot BG-45
@ 2009-06-09 15:19 Vladimir 'phcoder' Serbinenko
  2009-06-10  2:24 ` Zhang Rui
  0 siblings, 1 reply; 4+ messages in thread
From: Vladimir 'phcoder' Serbinenko @ 2009-06-09 15:19 UTC (permalink / raw)
  To: linux-acpi

[-- Attachment #1: Type: text/plain, Size: 370 bytes --]

Hello. On the following model
	Manufacturer: Packard Bell BV
	Product Name: EasyNote_BG45-U-001CH
BQC returns a value between 0 and 15 but the brightness levels are
between 0 and 8. I could make a table of correspondance however I find
it too inflexible. So I propose the following patch which disables BQC
if it behaves badly

-- 
Regards
Vladimir 'phcoder' Serbinenko

[-- Attachment #2: bad_bqc.patch --]
[-- Type: text/x-patch, Size: 1084 bytes --]

diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 1bdfb37..1735c34 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -594,6 +594,7 @@ acpi_video_device_lcd_get_level_current(struct acpi_video_device *device,
 					unsigned long long *level)
 {
 	acpi_status status = AE_OK;
+	int i;
 
 	if (device->cap._BQC || device->cap._BCQ) {
 		char *buf = device->cap._BQC ? "_BQC" : "_BCQ";
@@ -609,8 +610,15 @@ acpi_video_device_lcd_get_level_current(struct acpi_video_device *device,
 
 			}
 			*level += bqc_offset_aml_bug_workaround;
-			device->brightness->curr = *level;
-			return 0;
+ 			for (i = 2; i < device->brightness->count; i++)
+ 			        if (device->brightness->levels[i] == *level) {
+ 				        device->brightness->curr = *level;
+ 			                return 0;
+ 			        }
+ 			/* BQC returned an invalid level. Stop using it.  */
+ 			ACPI_WARNING((AE_INFO, "%s returned an invalid level",
+ 				      buf));
+ 			device->cap._BQC = device->cap._BCQ = 0;
 		} else {
 			/* Fixme:
 			 * should we return an error or ignore this failure?

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: Bad _BQC behaviour on Packard Bell Easynot BG-45
  2009-06-09 15:19 Bad _BQC behaviour on Packard Bell Easynot BG-45 Vladimir 'phcoder' Serbinenko
@ 2009-06-10  2:24 ` Zhang Rui
  2009-07-31 13:16   ` Vladimir 'phcoder' Serbinenko
  0 siblings, 1 reply; 4+ messages in thread
From: Zhang Rui @ 2009-06-10  2:24 UTC (permalink / raw)
  To: Vladimir 'phcoder' Serbinenko; +Cc: linux-acpi

On Tue, 2009-06-09 at 23:19 +0800, Vladimir 'phcoder' Serbinenko wrote:
> Hello. On the following model
> 	Manufacturer: Packard Bell BV
> 	Product Name: EasyNote_BG45-U-001CH
> BQC returns a value between 0 and 15 but the brightness levels are
> between 0 and 8. I could make a table of correspondance however I find
> it too inflexible. So I propose the following patch which disables BQC
> if it behaves badly
> 
the patch seems good.
could you please send the acpidump of your laptop so that we can see if
there is any chance that we can enable the brightness control on this
laptop?

thanks,
rui


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Bad _BQC behaviour on Packard Bell Easynot BG-45
  2009-06-10  2:24 ` Zhang Rui
@ 2009-07-31 13:16   ` Vladimir 'phcoder' Serbinenko
  2009-08-03  0:51     ` Zhang Rui
  0 siblings, 1 reply; 4+ messages in thread
From: Vladimir 'phcoder' Serbinenko @ 2009-07-31 13:16 UTC (permalink / raw)
  To: Zhang Rui; +Cc: linux-acpi

On Wed, Jun 10, 2009 at 4:24 AM, Zhang Rui<rui.zhang@intel.com> wrote:
> On Tue, 2009-06-09 at 23:19 +0800, Vladimir 'phcoder' Serbinenko wrote:
>> Hello. On the following model
>>       Manufacturer: Packard Bell BV
>>       Product Name: EasyNote_BG45-U-001CH
>> BQC returns a value between 0 and 15 but the brightness levels are
>> between 0 and 8. I could make a table of correspondance however I find
>> it too inflexible. So I propose the following patch which disables BQC
>> if it behaves badly
>>
> the patch seems good.
> could you please send the acpidump of your laptop so that we can see if
> there is any chance that we can enable the brightness control on this
> laptop?
>
Is there any reason why this patch haven't been comitted?
> thanks,
> rui
>
>



-- 
Regards
Vladimir 'phcoder' Serbinenko

Personal git repository: http://repo.or.cz/w/grub2/phcoder.git
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Bad _BQC behaviour on Packard Bell Easynot BG-45
  2009-07-31 13:16   ` Vladimir 'phcoder' Serbinenko
@ 2009-08-03  0:51     ` Zhang Rui
  0 siblings, 0 replies; 4+ messages in thread
From: Zhang Rui @ 2009-08-03  0:51 UTC (permalink / raw)
  To: Vladimir 'phcoder' Serbinenko; +Cc: linux-acpi

On Fri, 2009-07-31 at 21:16 +0800, Vladimir 'phcoder' Serbinenko wrote:
> On Wed, Jun 10, 2009 at 4:24 AM, Zhang Rui<rui.zhang@intel.com> wrote:
> > On Tue, 2009-06-09 at 23:19 +0800, Vladimir 'phcoder' Serbinenko wrote:
> >> Hello. On the following model
> >>       Manufacturer: Packard Bell BV
> >>       Product Name: EasyNote_BG45-U-001CH
> >> BQC returns a value between 0 and 15 but the brightness levels are
> >> between 0 and 8. I could make a table of correspondance however I find
> >> it too inflexible. So I propose the following patch which disables BQC
> >> if it behaves badly
> >>
> > the patch seems good.
> > could you please send the acpidump of your laptop so that we can see if
> > there is any chance that we can enable the brightness control on this
> > laptop?
> >
> Is there any reason why this patch haven't been comitted?

well, len is on vacation.
he'll be back by this week. :)

> > thanks,
> > rui
> >
> >
> 
> 
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-08-03  0:51 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-06-09 15:19 Bad _BQC behaviour on Packard Bell Easynot BG-45 Vladimir 'phcoder' Serbinenko
2009-06-10  2:24 ` Zhang Rui
2009-07-31 13:16   ` Vladimir 'phcoder' Serbinenko
2009-08-03  0:51     ` Zhang Rui

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.