Re: [hid-sony] sony_controller_battery led triggers not working
From: Frank Praznik <hidden>
Date: 2016-04-17 17:40:12
On Apr 17, 2016, at 10:27, Lauri Kasanen [off-list ref] 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