[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <30a363e5-5691-e008-e1e5-55936fa3cd92@redhat.com>
Date: Fri, 20 Sep 2019 09:24:08 +0200
From: Hans de Goede <hdegoede@...hat.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Ayman Bagabas <ayman.bagabas@...il.com>
Cc: Darren Hart <dvhart@...radead.org>,
Andy Shevchenko <andy@...radead.org>,
Mauro Carvalho Chehab <mchehab+samsung@...nel.org>,
Sinan Kaya <okaya@...nel.org>,
"Rafael J. Wysocki" <rafael.j.wysocki@...el.com>,
Takashi Iwai <tiwai@...e.de>,
Stuart Hayes <stuart.w.hayes@...il.com>,
Matan Ziv-Av <matan@...alib.org>,
"Enrico Weigelt, metux IT consult" <info@...ux.net>,
Peng Hao <peng.hao2@....com.cn>,
Krzysztof Kozlowski <krzk@...nel.org>,
Mattias Jacobsson <2pi@....nu>,
platform-driver-x86@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 2/6] platform/x86: huawei-wmi: Add quirks and module
parameters
Hi,
On 20-09-2019 08:08, Greg Kroah-Hartman wrote:
> On Thu, Sep 19, 2019 at 08:39:07PM -0400, Ayman Bagabas wrote:
>> Introduce quirks and module parameters. 3 quirks are added:
>> 1. Fixes reporting brightness keys twice since it's already handled by
>> acpi-video.
>> 2. Some models need a short delay when setting battery thresholds to
>> prevent a race condition when two processes read/write. (will be used later)
>> 3. Matebook X (2017) handles micmute led through the "legacy" interface
>> which is not currently implemented. Use ACPI EC method to control
>> this led. (will be used later)
>>
>> 2 module parameters are added to enable this short delay and/or report
>> brightness keys through this driver.
>
> module parameters are a pain to manage and handle over time. Is there
> any way you can "automatically" figure this out, or use a sysfs file
> instead?
The patch also adds dmi matches to set the quirks, so the module params
are there to override those and/or to easily test which are the right options
with new modules. The normal / expected use-case for everything to be set
automatically based on the DMI table.
With that said, the module-params should really always override the dmi values,
so I would like to suggest to make the module-params int-s instead of bool-s
and to do something like this:
static int battery_reset = -1;
static int report_brightness = -1;
quirks = &quirk_unknown;
dmi_check_system(huawei_quirks);
/* If set the module options override the vale from the DMI table */
if (battery_reset != -1)
quirks->battery_reset = battery_reset;
if (report_brightness != -1)
quirks->report_brightness = report_brightness;
Regards,
Hans
Powered by blists - more mailing lists