Re: [hid-sony] sony_controller_battery led triggers not working

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Apr 17, 2016 at 1:40 PM, Frank Praznik <frank.praznik@xxxxxxxxx> wrote:
>
>> On Apr 17, 2016, at 10:27, Lauri Kasanen <cand@xxxxxxx> wrote:
>>
>> Hi,
>>
>> The battery triggers aren't working for some reason, trying to write
>> them comes back with -EINVAL. I'm on somewhat old kernel, 3.17, but the
>> relevant parts haven't changed from the commit Frank made in 2014
>> adding the MAC address to the name.
>>
>> # cat trigger
>> none timer heartbeat backlight [default-on]
>> sony_controller_battery_00:26:5c:31:a2:c8-charging-or-full
>> sony_controller_battery_00:26:5c:31:a2:c8-charging
>> sony_controller_battery_00:26:5c:31:a2:c8-full
>> sony_controller_battery_00:26:5c:31:a2:c8-charging-blink-full-solid
>>
>> # echo sony_controller_battery_00:26:5c:31:a2:c8-charging-blink-full-solid > trigger
>> bash: echo: write error: Invalid argument
>>
>> The shorter triggers do work. Is it something caused by the long name,
>> or the colons? Do they work for others?
>>
>> My controller is the Gasia one:
>> sony 0003:054C:0268.0005: input: USB HID v1.11 Joystick [Gasia Co.,Ltd
>> PS(R) Gamepad] on usb-0000:00:12.2-2.3/input0
>>
>> - Lauri
>
> Hi Lauri,
>
> Those trigger names are automatically created by the battery subsystem.  The problem is that in leds.h TRIG_NAME_MAX is only 50 characters and these trigger names are exceeding that by quite a bit, so they are being truncated when passed to the function led_trigger_store() in led_triggers.c.
>
> Either the battery names must be shortened significantly or the max allowed trigger name length has to be increased.  A 50 character limit does seem a bit low when a suffix such as "charging-blink-full-solid” can use half of the character budget by itself.
>
> Regards,
> Frank

It looks like there was a commit to the LED system last month that
should fix this bug.

https://git.kernel.org/cgit/linux/kernel/git/j.anaszewski/linux-leds.git/commit/?h=devel&id=9e91f65984796c94cd05faba5885c86e349f2aa5
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media Devel]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Linux Wireless Networking]     [Linux Omap]

  Powered by Linux