X86 platform drivers
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Ayman Bagabas <ayman.bagabas@gmail.com>
Cc: Darren Hart <dvhart@infradead.org>,
	Andy Shevchenko <andy@infradead.org>,
	Mauro Carvalho Chehab <mchehab+samsung@kernel.org>,
	Sinan Kaya <okaya@kernel.org>,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Takashi Iwai <tiwai@suse.de>,
	Stuart Hayes <stuart.w.hayes@gmail.com>,
	Matan Ziv-Av <matan@svgalib.org>,
	"Enrico Weigelt, metux IT consult" <info@metux.net>,
	Peng Hao <peng.hao2@zte.com.cn>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Mattias Jacobsson <2pi@mok.nu>,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 2/6] platform/x86: huawei-wmi: Add quirks and module parameters
Date: Fri, 20 Sep 2019 09:24:08 +0200	[thread overview]
Message-ID: <30a363e5-5691-e008-e1e5-55936fa3cd92@redhat.com> (raw)
In-Reply-To: <20190920060812.GB473898@kroah.com>

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

  reply	other threads:[~2019-09-20  7:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-20  0:39 [PATCH v3 0/6] platform/x86: Huawei WMI laptop extras driver Ayman Bagabas
2019-09-20  0:39 ` [PATCH v3 1/6] platform/x86: huawei-wmi: Move to platform driver Ayman Bagabas
2019-09-20  0:39 ` [PATCH v3 2/6] platform/x86: huawei-wmi: Add quirks and module parameters Ayman Bagabas
2019-09-20  6:08   ` Greg Kroah-Hartman
2019-09-20  7:24     ` Hans de Goede [this message]
2019-09-20  7:29       ` Takashi Iwai
2019-09-20  7:35         ` Hans de Goede
2019-09-20  0:39 ` [PATCH v3 3/6] platform/x86: huawei-wmi: Implement huawei wmi management Ayman Bagabas
2019-09-20  0:39 ` [PATCH v3 4/6] platform/x86: huawei-wmi: Add battery charging thresholds Ayman Bagabas
2019-09-20  0:39 ` [PATCH v3 5/6] platform/x86: huawei-wmi: Add fn-lock support Ayman Bagabas
2019-09-20  0:39 ` [PATCH v3 6/6] platform/x86: huawei-wmi: Add debugfs support Ayman Bagabas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=30a363e5-5691-e008-e1e5-55936fa3cd92@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=2pi@mok.nu \
    --cc=andy@infradead.org \
    --cc=ayman.bagabas@gmail.com \
    --cc=dvhart@infradead.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=info@metux.net \
    --cc=krzk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matan@svgalib.org \
    --cc=mchehab+samsung@kernel.org \
    --cc=okaya@kernel.org \
    --cc=peng.hao2@zte.com.cn \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=stuart.w.hayes@gmail.com \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox