Hi,
Fekete Zoltán wrote:
As nobody could help me, finally I successfully patched the kernel to
handle the brightness buttons on my Dell laptop.
I used the pmf system to notify the driver about the key events.
Please find the patch attached.
Some drawbacks in which I need help to improve:
* I had to add a new field into struct device in sys/device.h. The new
field has a name dv_payload.
I couldn't find a better solution to save the original drm_device
structure for the new callbacks,
however I think there should be one;
* In both callback functions in intel_panel.c I had to break the
connector's loop after the 1st
iteration. Otherwise the system simply crashes. I have to find out
why is that.
So, plase read the patch, try it out.
I could try only on my Dell Latitude E6220, which uses the PCH line.
With this patch it works as expected.
Other chips may not work.
I have recently tried a kernel from the netbsd-9 branch on my Dell
Latitude E5540. The brightness controls and turning the display off when
the lid is closed does not work, which is a regression compared to netbsd-8.
I am able to switch between two levels of brightness with the Zoltán's
patch and I can see the values corresponding to the added 0x50 and 0x48:
+ {WMI_DELLA_PMF, 0x0010, 0x0050, PMFE_DISPLAY_BRIGHTNESS_DOWN},
+ {WMI_DELLA_PMF, 0x0010, 0x0048, PMFE_DISPLAY_BRIGHTNESS_UP},
being printed to console with kernel compiled with defined WMI_DEBUG
when I press the corresponding keyboard keys (under the patched kernel).
Is there something I can do to help fixing this regression in -current
and -9?
Thanks,
r.