Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp1229254pxb; Sun, 11 Apr 2021 11:55:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCxclzsQPgVXZDgb5DkKwOL7PpRTDkbLjIlbWW1v4H2Hm8choIV+9QU/RJLCOuaVftiJuF X-Received: by 2002:aa7:82cc:0:b029:213:db69:18d9 with SMTP id f12-20020aa782cc0000b0290213db6918d9mr21996243pfn.36.1618167357499; Sun, 11 Apr 2021 11:55:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618167357; cv=none; d=google.com; s=arc-20160816; b=SY4XHNnFKc+TmS2VBbftAEWUd40OxJr/EOX7w1wPsaab0a2tUrLWjXVLVzE6ciiAdq fuHN1qfbHJSOhCVtvYUa605FMKeBxWvmF3xrppwxKAnnmsW3tHkLQkWgOVMiWewPH0vS la9lLUEgwjTPSJ9CbamMHLDJFg56+zGcK/I0rfDYwYFX28fsy8PhYx8rQBvF3OS4HEPv 8TROdMV+dShphjp7tKGKUImNya2EkTlY+eryeo+4f1+WZ0g6SL/usOzls9q/emnfXmLg IGoUoDFMbOqjJ/M3PMGDmbtusq7rAJQ43+ibzux/9VC+BSn8UEKeTdEGK/qxmdt9p7Es 5iAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:reply-to:cc:from:to :dkim-signature:date; bh=O557wZuOyutkhxm660QDAP3vInKWKsr1zK3DiKxgzvM=; b=dXGTQ+1kHpKqUsghMOQazLW7VfwoY3lVoafIN8wyF29plIGKac364+xwqVvtOCok+D L8QxFlyS0YH/GmGAdf8bkO4fqVRMv6j11EKIYsn9I62oYQiLOV0OyDe4Z9FTQlD71bJm BHPW+zthkSFEGjwM0vzBBQw1W7Ob/EYi0rA/XXmvyBMtUU4gLDdgVmaD07lY4yDK2Jr5 dI+JwrG/03CKEAJpED5L9xf63Z63Qu0PV6o7R4t4RLnFKusqkS2cUqDBrl5f43QZlgPO K1tcjKFAz8grYWabI5Y3+CmsNAgCDDRG76DQG2LlslZCllDaPfIyX0Tqzv9w7YA+vXOO R+/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail header.b=VU8RmlnG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y4si10806597plh.113.2021.04.11.11.55.45; Sun, 11 Apr 2021 11:55:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail header.b=VU8RmlnG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231405AbhDKOFe (ORCPT + 99 others); Sun, 11 Apr 2021 10:05:34 -0400 Received: from mail-40131.protonmail.ch ([185.70.40.131]:12603 "EHLO mail-40131.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235455AbhDKOFd (ORCPT ); Sun, 11 Apr 2021 10:05:33 -0400 Date: Sun, 11 Apr 2021 14:05:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1618149915; bh=O557wZuOyutkhxm660QDAP3vInKWKsr1zK3DiKxgzvM=; h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From; b=VU8RmlnGNDL9W4WNoI00O6ldYu/tpBzPi7yZwEAY0rbNi+bb3gyZNdXshS0rk7Ft2 rTFAedhg6ZDENScaQJTd9/cv2L0RYrdWVaPZRdbTL5YRbfFSxoawhDI8scpmW/C/Yh ecwpHHAktZd0VltqoGvJLEmT9+a/0PZZFapf/1cc= To: =?utf-8?Q?Thomas_Wei=C3=9Fschuh?= From: =?utf-8?Q?Barnab=C3=A1s_P=C5=91cze?= Cc: "platform-driver-x86@vger.kernel.org" , Mark Gross , Hans de Goede , "linux-kernel@vger.kernel.org" , Jean Delvare , Guenter Roeck , "linux-hwmon@vger.kernel.org" , Matthew Garrett Reply-To: =?utf-8?Q?Barnab=C3=A1s_P=C5=91cze?= Subject: Re: [PATCH v4] platform/x86: add Gigabyte WMI temperature driver Message-ID: In-Reply-To: <20210410181856.144988-1-linux@weissschuh.net> References: <6a096978-67ad-6def-6ed0-9ad38a460e95@redhat.com> <20210410181856.144988-1-linux@weissschuh.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi 2021. =C3=A1prilis 10., szombat 20:18 keltez=C3=A9ssel, Thomas Wei=C3=9Fsch= uh =C3=ADrta: > [...] > diff --git a/drivers/platform/x86/gigabyte-wmi.c b/drivers/platform/x86/g= igabyte-wmi.c > new file mode 100644 > index 000000000000..c17e51fcf000 > --- /dev/null > +++ b/drivers/platform/x86/gigabyte-wmi.c > @@ -0,0 +1,195 @@ > +// SPDX-License-Identifier: GPL-2.0-or-later > +/* > + * Copyright (C) 2021 Thomas Wei=C3=9Fschuh > + */ > +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt > + > +#include > +#include > +#include > +#include > +#include > + > +#define GIGABYTE_WMI_GUID=09"DEADBEEF-2001-0000-00A0-C90629100000" > +#define NUM_TEMPERATURE_SENSORS=096 > + > +static bool force_load; > +module_param(force_load, bool, 0444); > +MODULE_PARM_DESC(force_load, "Force loading on unknown platform"); > + > +static u8 usable_sensors_mask; > + > +enum gigabyte_wmi_commandtype { > +=09GIGABYTE_WMI_BUILD_DATE_QUERY =3D 0x1, > +=09GIGABYTE_WMI_MAINBOARD_TYPE_QUERY =3D 0x2, > +=09GIGABYTE_WMI_FIRMWARE_VERSION_QUERY =3D 0x4, > +=09GIGABYTE_WMI_MAINBOARD_NAME_QUERY =3D 0x5, > +=09GIGABYTE_WMI_TEMPERATURE_QUERY =3D 0x125, > +}; > + > +struct gigabyte_wmi_args { > +=09u32 arg1; > +}; > + > +static int gigabyte_wmi_perform_query(struct wmi_device *wdev, > +=09=09=09=09 enum gigabyte_wmi_commandtype command, > +=09=09=09=09 struct gigabyte_wmi_args *args, struct acpi_buffer *ou= t) > +{ > +=09const struct acpi_buffer in =3D { > +=09=09.length =3D sizeof(*args), > +=09=09.pointer =3D args, > +=09}; > + > +=09acpi_status ret =3D wmidev_evaluate_method(wdev, 0x0, command, &in, o= ut); > + > +=09if ACPI_FAILURE(ret) Please use `if (...)`. > +=09=09return -EIO; > + > +=09return 0; > +} > [...] > +static struct wmi_driver gigabyte_wmi_driver =3D { > +=09.driver =3D { > +=09=09.name =3D "gigabyte-wmi", > +=09}, > +=09.id_table =3D gigabyte_wmi_id_table, > +=09.probe =3D gigabyte_wmi_probe, > +}; > +module_wmi_driver(gigabyte_wmi_driver); > + > +MODULE_DEVICE_TABLE(wmi, gigabyte_wmi_id_table); > +MODULE_AUTHOR("Thomas Wei=C3=9Fschuh "); > +MODULE_DESCRIPTION("Gigabyte WMI temperature Driver"); ^ It's a minor thing, but I think a lowercase 'd' would be better. > +MODULE_LICENSE("GPL"); > > base-commit: 144c79ef33536b4ecb4951e07dbc1f2b7fa99d32 > -- > 2.31.1 Regards, Barnab=C3=A1s P=C5=91cze