Re: [PATCH v3] toshiba_acpi: Support new keyboard backlight type

From: Azael Avalos
Date: Fri Sep 12 2014 - 16:55:37 EST


Hi Darren,

2014-09-12 14:48 GMT-06:00 Darren Hart <dvhart@xxxxxxxxxxxxx>:
> On Thu, Sep 11, 2014 at 09:22:25PM -0600, Azael Avalos wrote:
>> Newer Toshiba models now come with a new (and different) keyboard
>> backlight implementation with three modes of operation: TIMER,
>> ON and OFF, and the LED is controlled internally by the firmware.
>>
>> This patch adds support for that type of backlight, changing the
>> existing code to accomodate the new implementation.
>>
>> The timeout value range is now 1-60 seconds, and the accepted
>> modes are now: 1 (FN-Z), 2 (AUTO or TIMER), 8(ON) and 10 (OFF),
>> this adds two new entries keyboard_type and available_kbd_modes,
>
> ^ update for new naming
>
>> the first shows the keyboard type and the latter shows the
>> supported modes depending on the type.
>>
>> Signed-off-by: Azael Avalos <coproscefalo@xxxxxxxxx>
>> ---
>
> Note you can update your v2,v3 changes here after the ---
>
> See Documentation/SubmittingPatches L639,649
>
>> @@ -1293,12 +1420,34 @@ static ssize_t toshiba_kbd_bl_mode_show(struct device *dev,
>> char *buf)
>> {
>> struct toshiba_acpi_dev *toshiba = dev_get_drvdata(dev);
>> - u32 time;
>>
>> - if (toshiba_kbd_illum_status_get(toshiba, &time) < 0)
>> - return -EIO;
>> + if (toshiba == NULL)
>> + return -ENXIO;
>
> If this testing is necessary for this sysfs callback, it is needed for all of them. Looking at the code more closely, I think this is out of scope for this patch. The entire file assumes a valid toshiba_acpi_dev. If this is a problem, it needs a separate patch to address it. So, let's drop this change, update the commit log to match the new sysfs filenames, and this should be ready to go.

Ok, I'll leave this function as it is for this patch. I'll send an updated
(and hopefuly final) patch.

I have some "cleanup" changes comming, so that might be a good
place for them.

>
>
> --
> Darren Hart
> Intel Open Source Technology Center

Cheers
Azael


--
-- El mundo apesta y vosotros apestais tambien --
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/