From patchwork Thu Jan 26 19:40:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Armin Wolf X-Patchwork-Id: 48875 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp452451wrn; Thu, 26 Jan 2023 11:42:35 -0800 (PST) X-Google-Smtp-Source: AK7set9Q9eb+lyGPSL8HntqtKJt93+Nk5bGqCEguXk/ib5bDgFAL93NBAdDqVAY79PAJ67SNbS70 X-Received: by 2002:a05:6a21:3a8d:b0:bb:baa9:ad88 with SMTP id zv13-20020a056a213a8d00b000bbbaa9ad88mr8120864pzb.44.1674762154828; Thu, 26 Jan 2023 11:42:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674762154; cv=none; d=google.com; s=arc-20160816; b=Y37n8HaGgg0RZuapG0TLHYU9m9amMu687udEp9RyNFhG053x0PkDIl+qEMqJfRwgIj G76yK9QlpwCh3liI/w8ZsB3FNkrdYAi8Y5ocDPZT1a0Hj31/hdN0Pk1o74Z7OWntz1Dl yGVoRb1+4zjJiPu1fw4d1HwkOpc5w9TC4GrVZp5xKCddCxP/swkIMYGtXOD30S8FHJb2 b3Tm88jPIs6oLq29EwLEo2xaMcbO9xPOyVgCHkuCak5e++e3R8WTawM2LjybxXOAR+Rn ZISToCkK0wtCWPpcPz2XDq/TzlbRrD8rWaGZcoltVE0lPY/RioTa0n/LPsBaPMhRvT1X mLdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:ui-outboundreport:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=xkozjD46LDhevsQ3LKkvtfA8TOfGLn1ChQiqgMIt/0k=; b=zuHt4MMuUeatqFYmoDU/Do1rFRZiY5/fUxDd6s9hoCPUF8YvUykBG1GmQheVVnWd0j J+bjKTXYRLNgJCNDvX4xlkAUfWcgvXtLxyM30Hc61/VZCW6uSDqE2RxPyTO/a+3YQEBa +HvY7ngiP7iNY15q9thp6ZafzM8P6yepuiZCA1CKQjL1n/QI9kQuwzNv8bfTxUhsFwUA iT3q5CJvVs3XPzxHDfp8lFGT7FEsFvXNhHHI4s9sR46CrrW46m3vRVAZaflDLfJU94RC oZBjcQpl/7B03H38itoHazlg1rQQAwpgeaJdGHfJirxeLH6xuqeANnQCXvoaLTA90kQg g70w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=sUV2O9si; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmx.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m23-20020a637117000000b004c7883728c4si1999943pgc.324.2023.01.26.11.42.22; Thu, 26 Jan 2023 11:42:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=sUV2O9si; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmx.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232511AbjAZTky (ORCPT + 99 others); Thu, 26 Jan 2023 14:40:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232186AbjAZTkw (ORCPT ); Thu, 26 Jan 2023 14:40:52 -0500 Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35B982D51; Thu, 26 Jan 2023 11:40:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1674762030; bh=2TL7aTm8N/AzcTDSZC7SmNVqKjGX/jFf0Ms82bCmlQ4=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:In-Reply-To:References; b=sUV2O9sisppQ5XXA8g+mZZ+Cx2PgWPgOWrxSu2SQI4nWrDhc0ydAmK76YZWWKYRXb RDS5bvpH+5QIT6/KNzsqFUyYvlNNLufUbRI9rJoOORmrDHZW1fe7Kg8agFe878wEs8 m7ERRrPSYYzysTJlG4Zy2G9TOZyE6LtLWD5rqUVSzArbkJGf7aK/QvWfji+VY3OfEw ZKEY9GXTlVWEWieVpPNxB8Bs2+4ux/MjyEhbuwurEZfRwtJeQKSFrcsbpXA/oRt7o1 Q1bckiTyEXAjyDDzCaDscKwkUkT2vMZXGXf5qK63bJzrtaJFHK2pNFuwnbhZdYV2rP HeCp51hkYs8DQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from esprimo-mx.users.agdsn.de ([141.30.226.129]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1M42nY-1pL86o0Wpc-0001Gb; Thu, 26 Jan 2023 20:40:30 +0100 From: Armin Wolf To: hdegoede@redhat.com, markgross@kernel.org Cc: jdelvare@suse.com, linux@roeck-us.net, platform-driver-x86@vger.kernel.org, linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/5] platform/x86: dell-ddv: Add support for interface version 3 Date: Thu, 26 Jan 2023 20:40:17 +0100 Message-Id: <20230126194021.381092-2-W_Armin@gmx.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230126194021.381092-1-W_Armin@gmx.de> References: <20230126194021.381092-1-W_Armin@gmx.de> MIME-Version: 1.0 X-Provags-ID: V03:K1:Cv+dN4fSwbR9l2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quTByA//rE oSMXnNd8nLrp3wIC42RXw74nZSvyAY2Jip4WPkkfgHjCFRRLXCjcf2f6wGq5RG25JYctznq0b eNVYv73KPCoaX9lVbhds3jQzkiekoetviqWOMasHLgjmarCXxSVMxPCM8QtTtSFujBcmi/7nt ZHwmOKT4dF4Cs8gWE5Va1DrjosA= X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756115401127707697?= X-GMAIL-MSGID: =?utf-8?q?1756115401127707697?= While trying to solve a bugreport on bugzilla, i learned that some devices (for example the Dell XPS 17 9710) provide a more recent DDV WMI interface (version 3). Since the new interface version just adds an additional method, no code changes are necessary apart from whitelisting the version. Signed-off-by: Armin Wolf --- drivers/platform/x86/dell/dell-wmi-ddv.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.30.2 diff --git a/drivers/platform/x86/dell/dell-wmi-ddv.c b/drivers/platform/x86/dell/dell-wmi-ddv.c index 2bb449845d14..9cb6ae42dbdc 100644 --- a/drivers/platform/x86/dell/dell-wmi-ddv.c +++ b/drivers/platform/x86/dell/dell-wmi-ddv.c @@ -26,7 +26,8 @@ #define DRIVER_NAME "dell-wmi-ddv" -#define DELL_DDV_SUPPORTED_INTERFACE 2 +#define DELL_DDV_SUPPORTED_VERSION_MIN 2 +#define DELL_DDV_SUPPORTED_VERSION_MAX 3 #define DELL_DDV_GUID "8A42EA14-4F2A-FD45-6422-0087F7A7E608" #define DELL_EPPID_LENGTH 20 @@ -49,6 +50,7 @@ enum dell_ddv_method { DELL_DDV_BATTERY_RAW_ANALYTICS_START = 0x0E, DELL_DDV_BATTERY_RAW_ANALYTICS = 0x0F, DELL_DDV_BATTERY_DESIGN_VOLTAGE = 0x10, + DELL_DDV_BATTERY_RAW_ANALYTICS_A_BLOCK = 0x11, /* version 3 */ DELL_DDV_INTERFACE_VERSION = 0x12, @@ -340,7 +342,7 @@ static int dell_wmi_ddv_probe(struct wmi_device *wdev, const void *context) return ret; dev_dbg(&wdev->dev, "WMI interface version: %d\n", version); - if (version != DELL_DDV_SUPPORTED_INTERFACE) + if (version < DELL_DDV_SUPPORTED_VERSION_MIN || version > DELL_DDV_SUPPORTED_VERSION_MAX) return -ENODEV; data = devm_kzalloc(&wdev->dev, sizeof(*data), GFP_KERNEL);