Call for testers acpi_dell

Daniel Walter d.walter at 0x90.at
Sat Feb 13 11:21:06 UTC 2010


On Fri, 12 Feb 2010, Jung-uk Kim wrote:

> On Friday 12 February 2010 04:38 pm, Daniel Walter wrote:
>> On Fri, 12 Feb 2010, Jung-uk Kim wrote:
>>> On Friday 12 February 2010 03:12 pm, Daniel Walter wrote:
>>>> On Fri, 12 Feb 2010, Jung-uk Kim wrote:
>>>>> On Friday 12 February 2010 02:37 pm, Daniel Walter wrote:
>>>>>> On Fri, 12 Feb 2010, Jung-uk Kim wrote:
>>>>>>> On Friday 12 February 2010 01:33 pm, Daniel Walter wrote:
>>>>>>>> On Fri, 12 Feb 2010, Jung-uk Kim wrote:
>>>>>>>>> On Friday 12 February 2010 12:48 pm, Daniel Walter wrote:
>>>>>>>>>> Hi all,
>>>>>>>>>>
>>>>>>>>>> I've written a small kernel driver to support Dell Mini
>>>>>>>>>> 1011 (aka Dell Mini 10v) Brightness Controll Buttons.
>>>>>>>>>> Since I do not have any other Dell Notebooks, I'd like you
>>>>>>>>>> to test this module on other Dell Notebooks as well.
>>>>>>>>>>
>>>>>>>>>> This driver is in an early stage, but future releases will
>>>>>>>>>> also support the rfkill switch and CRT switch.
>>>>>>>>>>
>>>>>>>>>> Currently following features are implemented:
>>>>>>>>>> * Increase / Decrease Brightness
>>>>>>>>>> * Change brightness if AC is connected / disconnected
>>>>>>>>>>
>>>>>>>>>> TODO:
>>>>>>>>>> * Add CRT Support
>>>>>>>>>> * Add Sysctl to define brightness levels for eco and ac
>>>>>>>>>> powerprofile * Add Support for RF-Kill Switch
>>>>>>>>>>
>>>>>>>>>> Any suggestions are welcome
>>>>>>>>>
>>>>>>>>> I just quickly glanced at it but I failed see anything
>>>>>>>>> quite specific to Dell laptops except for "TODO: Add
>>>>>>>>> support for RF-Kill Switch". acpi_video(4) should be able
>>>>>>>>> to do what you want.  Am I missing something here?
>>>>>>>>>
>>>>>>>>> Jung-uk Kim
>>>>>>>>
>>>>>>>> hi,
>>>>>>>>
>>>>>>>> Yes it is possible to control the brightness using
>>>>>>>> acpi_video(4) via sysctl but there is no support for the
>>>>>>>> FN-Buttons. This module adds the support for those buttons.
>>>>>>>
>>>>>>> I see.  However, my point is the probe function does not seem
>>>>>>> specific to Dell laptops.  In fact, you are just checking
>>>>>>> _BCL transition, i.e., effectively it just makes a generic
>>>>>>> acpi_video notify handler for brightness change.
>>>>>>>
>>>>>>> Jung-uk Kim
>>>>>>
>>>>>> Oh, I've completly overlooked this one. Sorry for that, I
>>>>>> should replace the probing with a Dell specific probing
>>>>>> instead. Do you have any suggestions to this one ?
>>>>>
>>>>> It totally depends on DSDT of your laptop model and you will
>>>>> have to maintain the list of these ACPI handles, unfortunately.
>>>>> Please see acpi_asus.c for example.
>>>>>
>>>>> If you are interested in generic acpi_video(4) enhancement, you
>>>>> just need to extend acpi_video.c to get these notifications,
>>>>> i.e., 0x86 and 0x87.  FYI, acpi_video can only handle 0x80 and
>>>>> 0x81 events ATM. Please read ACPI specification Appendix B.
>>>>> Video Extensions, especially B.6 and B.7 are what you are
>>>>> looking for.
>>>>>
>>>>> Jung-uk Kim
>>>>
>>>> Hi I'll take a look at my DSDT again ...
>>>>
>>>> I've also will take a look at Appendix B of the current ACPI
>>>> spec to see if 0x86 and 0x87 are OEM or part of the standard. If
>>>> they are not completly out of spec I'll patch acpi_video(4) and
>>>> send it again to the list.
>>>
>>> 0x86/0x87 is part of the spec. and it should be handled by
>>> acpi_video IMHO.
>>>
>>> Jung-uk Kim
>>
>> hi,
>>
>> as you suggested I've written a patch for acpi_video(4) to support
>> the 0x86 and 0x87 notifications. the support for 0x85, 0x88, 0x89
>> (also specified in ACPI Standard Appendix B7) is not yet
>> implemented.
>>
>> Could anyone with a ACPI sending 0x86 and 0x87 test the patch ?
>>
>> thanks for the help and pointing my in the right direction.
>
> I just went ahead and committed a rewritten version. :-)
>
> Thanks!
>
> Jung-uk Kim

Hi,
I've quickly added support for 0x85 (Cycle Brightness) and 0x88 (Zero Brightness). Could you have a look at the patch? 
Would you mind MFC the acpi_video(4) ?

regards and thanks

Daniel Walter
-------------- next part --------------
--- acpi_video.c	2010-02-13 06:38:21.000000000 +0100
+++ acpi_video.c	2010-02-13 12:14:03.000000000 +0100
@@ -103,8 +103,10 @@
 /* events */
 #define VID_NOTIFY_SWITCHED	0x80
 #define VID_NOTIFY_REPROBE	0x81
+#define	VID_NOTIFY_CYC_BRN	0x85
 #define	VID_NOTIFY_INC_BRN	0x86
 #define	VID_NOTIFY_DEC_BRN	0x87
+#define	VID_NOTIFY_ZRO_BRN	0x88
 
 /* _DOS (Enable/Disable Output Switching) argument bits */
 #define DOS_SWITCH_MASK		3
@@ -651,6 +653,7 @@
 	}
 
 	switch (notify) {
+	case VID_NOTIFY_CYC_BRN:
 	case VID_NOTIFY_INC_BRN:
 	case VID_NOTIFY_DEC_BRN:
 		if (vo->vo_levels == NULL)
@@ -671,11 +674,19 @@
 					new_level = j;
 			}
 		}
+		if (notify == VID_NOTIFY_CYC_BRN && new_level == level)
+			new_level= vo->vo_levels[2];
 		if (new_level != level) {
 			vo_set_brightness(handle, new_level);
 			vo->vo_brightness = new_level;
 		}
 		break;
+	case VID_NOTIFY_ZRO_BRN:
+		if (acpi_video_vo_check_level(vo, 0) == 0) {
+			vo_set_brightness(handle, 0);
+			vo->vo_brightness = 0;
+		}
+		break;
 	default:
 		printf("unknown notify event 0x%x from %s\n",
 		    notify, acpi_name(handle));


More information about the freebsd-acpi mailing list