* [hid-sony] sony_controller_battery led triggers not working
@ 2016-04-17 14:27 Lauri Kasanen
2016-04-17 17:40 ` Frank Praznik
0 siblings, 1 reply; 3+ messages in thread
From: Lauri Kasanen @ 2016-04-17 14:27 UTC (permalink / raw)
To: linux-input; +Cc: ao2, frank.praznik
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [hid-sony] sony_controller_battery led triggers not working
2016-04-17 14:27 [hid-sony] sony_controller_battery led triggers not working Lauri Kasanen
@ 2016-04-17 17:40 ` Frank Praznik
2016-04-18 15:46 ` Frank Praznik
0 siblings, 1 reply; 3+ messages in thread
From: Frank Praznik @ 2016-04-17 17:40 UTC (permalink / raw)
To: Lauri Kasanen; +Cc: linux-input, Antonio Ospite, frank.praznik
> On Apr 17, 2016, at 10:27, Lauri Kasanen <cand@gmx.com> 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--
To unsubscribe from this list: send the line "unsubscribe linux-input" 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] 3+ messages in thread
* Re: [hid-sony] sony_controller_battery led triggers not working
2016-04-17 17:40 ` Frank Praznik
@ 2016-04-18 15:46 ` Frank Praznik
0 siblings, 0 replies; 3+ messages in thread
From: Frank Praznik @ 2016-04-18 15:46 UTC (permalink / raw)
To: Lauri Kasanen; +Cc: open list:HID CORE LAYER, Antonio Ospite, Frank Praznik
On Sun, Apr 17, 2016 at 1:40 PM, Frank Praznik <frank.praznik@gmail.com> wrote:
>
>> On Apr 17, 2016, at 10:27, Lauri Kasanen <cand@gmx.com> 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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-04-18 15:46 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-17 14:27 [hid-sony] sony_controller_battery led triggers not working Lauri Kasanen
2016-04-17 17:40 ` Frank Praznik
2016-04-18 15:46 ` Frank Praznik
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.