Re: [PATCH] platform/x86: Add Steam Deck driver

From: Hans de Goede
Date: Thu Feb 17 2022 - 11:28:50 EST


Hi,

On 2/13/22 00:30, Andrey Smirnov wrote:

<snip>

>>> +static struct attribute *steamdeck_attributes[] = {
>>> + &dev_attr_target_cpu_temp.attr,
>>> + &dev_attr_gain.attr,
>>> + &dev_attr_ramp_rate.attr,
>>> + &dev_attr_hysteresis.attr,
>>> + &dev_attr_maximum_battery_charge_rate.attr,
>>> + &dev_attr_recalculate.attr,
>>> + &dev_attr_power_cycle_display.attr,
>>> +
>>> + &dev_attr_led_brightness.attr,
>>
>> Have you considered using a led class device instead? I think that should
>> work even without the ability to query the brightness.
>>
>
> Not very seriously. Will take another look.
>
>>
>>> + &dev_attr_content_adaptive_brightness.attr,
>>> + &dev_attr_gamma_set.attr,
>>> + &dev_attr_display_brightness.attr,
>>
>> Have you considered using a backlight class device?
>>
>
> Ditto.

Note that for both of these I would go a bit further then
"have you considered?". Since you are implementing standardized
userspace APIs here you *must* use the shared subsystem code
for registering a LED resp backlight class device here so that
everything is guaranteed to behave as expected by userspace.

Regards,

Hans