Hi all,

[renaming the thread for LED related discussions]

Ping Cheng said the following on 09/28/2012 03:54 AM:
> On Thu, Sep 27, 2012 at 3:20 PM, Jason Gerecke<killert...@gmail.com>  wrote:
>> >  On Thu, Sep 27, 2012 at 1:56 PM, Ping Cheng<pingli...@gmail.com>  wrote:
>> >
>>> >>  BTW, this code from [1] does not fit what I understood
>>> >>
>>> >>  +        *  - First ring (group 0) uses LED 0
>>> >>  +        *  - Second ring (group 1) uses LED 1
>>> >>  +        *  - First touchstrip (group 2) uses LED 1
>>> >>  +        *  - Second touchstrip (group 3) uses LED 0
>>> >>
>>> >>  There are two cases, tablet has one set of expresskeys; and  tablet
>>> >>  has two sets of expresskeys.
>>> >>
>>> >>  If there is only one set of expresskeys, ring or touchstrip will and
>>> >>  can only use LED 0;
>>> >>  If there are two sets of expresskeys, the left set (i.e., your first
>>> >>  ring/touchstrip) uses LED 1; the right set, your second
>>> >>  ring/touchstrip, uses LED 0.
>>> >>
>>> >>  [1]https://bugzilla.gnome.org/attachment.cgi?id=214732&action=edit
>> >
>> >  Not to get off-topic, but do we want to consider revising this
>> >  interface to make it more logical? Having the "first" ring/strip being
>> >  controlled by the "second" LED control (and vice versa) rubs me the
>> >  wrong way. I'd consider it a bug, except that its the documented
>> >  behavior. I'm not sure it qualifies as a "grave error" that Dmitry
>> >  would allow to be changed, but it'd make more sense to fix it in the
>> >  kernel than to rely on libwacom to describe the quirk.
> I think we are not talking the same thing. Maybe I didn't make myself
> clear. Let me try it again.
>
> I meant the four lines should read something like:
>
>   +        *  - First ring (group 0) uses LED 1
>   +        *  - Second ring (group 1) uses LED 0
>   +        *  - First touchstrip (group 2) uses LED 1
>   +        *  - Second touchstrip (group 3) uses LED 0
>
> That is, no matter it is ring or touchstrip, the one in the first
> group should use LED 1, the one in the second group uses LED 0. The
> kernel driver is consistent in this sense.

No, unfortunately not on Cintiq, that's precisely the problem, see [3] 
below.

>   And this is for tablets
> with two sets of LEDs. If there is only one set of LEDs, such as
> Intuos 4 and 5, only LED 0 can be used.

What GNOME does right now, is to write to the following sysfs entries:

- First ring  => /sys/bus/usb/devices/.../wacom_led/status_led0_select
- Second ring => /sys/bus/usb/devices/.../wacom_led/status_led1_select
- First touchstrip  => 
/sys/bus/usb/devices/.../wacom_led/status_led2_select
- Second touchstrip => 
/sys/bus/usb/devices/.../wacom_led/status_led3_select

This is not what the kernel expects as there is no
status_led2_select/status_led3_select in the SysFS documentation for 
LED support [1] so LED support won't work in many cases

That's bug 676558 [2] and the initial fix was to use something like:

- First ring  => /sys/bus/usb/devices/.../wacom_led/status_led0_select
- Second ring => /sys/bus/usb/devices/.../wacom_led/status_led1_select
- First touchstrip  => 
/sys/bus/usb/devices/.../wacom_led/status_led0_select
- Second touchstrip => 
/sys/bus/usb/devices/.../wacom_led/status_led1_select

[That's what Ping said intially]

But trying to fix like that raised another issue, as touchstrips LED 
are inverted [3] on Cintiq, so what works in reality is:

- First ring  => /sys/bus/usb/devices/.../wacom_led/status_led0_select
- Second ring => /sys/bus/usb/devices/.../wacom_led/status_led1_select
- First touchstrip  => 
/sys/bus/usb/devices/.../wacom_led/status_led1_select
- Second touchstrip => 
/sys/bus/usb/devices/.../wacom_led/status_led0_select

But that patch was denied and the consensus reached was that such 
hardware implementation details should be hidden from userland apps

So we need to fix the kernel to get:

- First ring  => /sys/bus/usb/devices/.../wacom_led/status_led0_select
- Second ring => /sys/bus/usb/devices/.../wacom_led/status_led1_select
- First touchstrip  => 
/sys/bus/usb/devices/.../wacom_led/status_led0_select
- Second touchstrip => 
/sys/bus/usb/devices/.../wacom_led/status_led1_select

independently of the hardware.

Cheers,
Olivier.

-- 
[1]http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=blob;f=Documentation/ABI/testing/sysfs-driver-wacom;hb=HEAD
[2] https://bugzilla.gnome.org/show_bug.cgi?id=676558
[3] https://bugzilla.gnome.org/show_bug.cgi?id=676558#c6


------------------------------------------------------------------------------
Got visibility?
Most devs has no idea what their production app looks like.
Find out how fast your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219671;13503038;y?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________
Linuxwacom-devel mailing list
Linuxwacom-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel

Reply via email to