From patchwork Sat Apr 29 11:52:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Crawford X-Patchwork-Id: 13226999 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4C431C77B60 for ; Sat, 29 Apr 2023 11:52:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229658AbjD2Lwj (ORCPT ); Sat, 29 Apr 2023 07:52:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229458AbjD2Lwh (ORCPT ); Sat, 29 Apr 2023 07:52:37 -0400 Received: from ipmail03.adl6.internode.on.net (ipmail03.adl6.internode.on.net [150.101.137.143]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8ED991FC0 for ; Sat, 29 Apr 2023 04:52:36 -0700 (PDT) IronPort-SDR: 644d04fe_tNoqGhUZiFDVF5hcL3wc0lbeUyHpwGQUl9NFgvVvl0GYmbJ Bgt3mW1Tq3dEMnkLnQz/nU68VjORH1iyn8Ald1A== X-SMTP-MATCH: 0 X-IPAS-Result: A2AYAgBQBE1kjPQc8jxaHAEBAQEBAQcBARIBAQQEAQFJgUaCLoJPtWUPAQ8BAUQEAQGFBgKFQCY4EwECBAEBAQEDAgMBAQEBAQEDAQEGAQEBAQEBBgQUAQEBAUBFhWgNhgQCAQMnCwENAQE3AQ8ZOFcGARKCfoJdsTgzgQGCCAEBBoJkmmqBXgmBQYwOgRaDN3pCP4FOhA9viwaXNIEzdIEnP2+BBAIJAhFrgRAIaIFzQAINZAsLbYFEgxQEAhRCDBRdAmsbBggVARgDBwcCAWkDCQMHBUlAAwsYDRY6ESw1FB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bZbUMXYrnJQ6LI2Bx5E8dQuhJl1dccp+/agMI37QSAuy1ReKNUq1XMFHfN7OzmOVF O1sIZhpeyml9SPTsA0eO7EAE4V0kNEt+tAGXLHhfkwCkrmHqwtWoIDizTf/iEArUudRv54Ec K2JTA27E0uUmXdwsE3OppMdOmOHPP81VDel1+WxqOg0B5YPtd93Sn4L05y2gSSxEBBm9Beqr g/8d/fo7+h9+79NwaroMIt+XjuRF/2idd614DiSsstPZ+zhKc3hlR0YgXi5MhV0PYk+YcVWl 7OMgdvzhEjU4bQ9Vk6CqZzQBptiuMG4bNdKO/3OMUhqoCqmc+3v6isl5GqXB8FoktRcx8//X Cq+SpK6WuA0Uudn5k9+SnZhATMCLZ/of4Hijy+ZhNadOCg3iADoAouuyi70UDt9aCQNBazbN ib1nPSfvvZjs4VGAU4/NcFMWpNXDgfqZvo7SofXqzKdM2iPh2GCsJvEkT4Ly2nCKluAIfbAz aP1fDrMXzXsh/iQ1/BciZJ4gTMPBnUkgeUQQFMUy+Qrtx+EVlw5PcYvGrRYLKENniLLgcSyI HmHaWY5EizyUAhVaRi2spypQg6bAfdIIdvjYCAg+0SPcSqtGYecG/1b+zx952ttMC7WpA19x QryJlWrVvRp/qxUeA== IronPort-HdrOrdr: A9a23:CzjfyaDyLM5DucvlHel255DYdb4zR+YMi2TDt3oadfWaSK2lfq eV7Y0mPX2dslsssRQb9exoV5PwIk80maQb3WBVB8bHYOCEghrPEGgd1/qB/9SIIUSXndK1l5 0QFJSWY+eRMbEVt6jHCIbUKadZ/DD+ytHMuQ7H9QYQceh1UdAc0+6nMHfhLqWmLDM2f6YEKA == X-Talos-CUID: 9a23:Q+G0WmOl0ShBz+5DBAg592BTC58ZSlLmnUXaOXWyGUhWV+jA X-Talos-MUID: 9a23:4iMZPAQnOg/I6USpRXTcliE7Bv1v2p2VJ1JOmooWkfinGAlJbmI= X-IronPort-Anti-Spam-Filtered: true Received: from 60-242-28-244.static.tpgi.com.au (HELO bits.crawford.emu.id.au) ([60.242.28.244]) by ipmail03.adl6.internode.on.net with ESMTP; 29 Apr 2023 21:22:31 +0930 Received: from agc.crawford.emu.id.au (agc.crawford.emu.id.au [IPv6:fdd2:7aad:d478:1:0:0:cb10:cc07]) (authenticated bits=0) by bits.crawford.emu.id.au (8.17.1/8.17.1) with ESMTPSA id 33TBq71H3093879 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NO); Sat, 29 Apr 2023 21:52:27 +1000 Authentication-Results: bits.crawford.emu.id.au; arc=none smtp.remote-ip=fdd2:7aad:d478:1::cb10:cc07 DKIM-Filter: OpenDKIM Filter v2.11.0 bits.crawford.emu.id.au 33TBq71H3093879 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=crawford.emu.id.au; s=s1; t=1682769147; bh=bSojTUSDDl0fjBG1iY8i0/SwL7mKh3cuXl3AY8oloXQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EAMeuFKc1Gn/R1qVgkkjW4LLdG+0/RRx4SQaa2Cz+3Uz60aSv7wjj7RLeCyBmbFaC xJ4hZ4N/UDgX6uKIkiWkedx1ekQe8hCI8w+7a7UIXDwX3hByPe2iPp1YcfMiQq4mxd 5xpemTtTIAK+T1mWipjE1ApdU/rDJCpKxEw2urp+NWZoEKlxKb94tpk4tn+8IXQgx9 mgfcpVbt9rzy1rl+TSPJ5OfNexcKjUJsCA89ywXgPWqWXMJB2O0y+/GlDbo8D5LZcK KptYCc1L/tnsx8MI6SdQvRkOO5RJ4gGHO4RnbGqxsab6FDOFfBC4ptUh11lmHI4pAv xVM09wuRAbnrQ== From: Frank Crawford To: Jean Delvare , Guenter Roeck Cc: linux-hwmon@vger.kernel.org, Frank Crawford Subject: [PATCH v1 2/3] hwmon: (it87) Add controls for chips with only 4 PWMs Date: Sat, 29 Apr 2023 21:52:04 +1000 Message-Id: <20230429115205.1547251-3-frank@crawford.emu.id.au> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230429115205.1547251-1-frank@crawford.emu.id.au> References: <20230429115205.1547251-1-frank@crawford.emu.id.au> MIME-Version: 1.0 X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.4 (bits.crawford.emu.id.au [IPv6:fdd2:7aad:d478:1:0:0:cb10:cc01]); Sat, 29 Apr 2023 21:52:27 +1000 (AEST) X-Virus-Scanned: clamav-milter 0.103.8 at bits.crawford.emu.id.au X-Virus-Status: Clean Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org Add feature and support for chips with only 4 PWMs. Signed-off-by: Frank Crawford --- drivers/hwmon/it87.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c index bd9a24942e70..d5482c6ed18f 100644 --- a/drivers/hwmon/it87.c +++ b/drivers/hwmon/it87.c @@ -318,6 +318,7 @@ struct it87_devices { */ #define FEAT_CONF_NOEXIT BIT(19) /* Chip should not exit conf mode */ #define FEAT_FOUR_FANS BIT(20) /* Supports four fans */ +#define FEAT_FOUR_PWM BIT(21) /* Supports four fan controls */ static const struct it87_devices it87_devices[] = { [it87] = { @@ -518,8 +519,11 @@ static const struct it87_devices it87_devices[] = { #define has_vid(data) ((data)->features & FEAT_VID) #define has_in7_internal(data) ((data)->features & FEAT_IN7_INTERNAL) #define has_avcc3(data) ((data)->features & FEAT_AVCC3) -#define has_five_pwm(data) ((data)->features & (FEAT_FIVE_PWM \ - | FEAT_SIX_PWM)) +#define has_four_pwm(data) ((data)->features & (FEAT_FOUR_PWM | \ + FEAT_FIVE_PWM | \ + FEAT_SIX_PWM)) +#define has_five_pwm(data) ((data)->features & (FEAT_FIVE_PWM | \ + FEAT_SIX_PWM)) #define has_six_pwm(data) ((data)->features & FEAT_SIX_PWM) #define has_pwm_freq2(data) ((data)->features & FEAT_PWM_FREQ2) #define has_six_temp(data) ((data)->features & FEAT_SIX_TEMP) @@ -2734,8 +2738,10 @@ static int __init it87_find(int sioaddr, unsigned short *address, else sio_data->skip_in |= BIT(9); - if (!has_five_pwm(config)) + if (!has_four_pwm(config)) sio_data->skip_pwm |= BIT(3) | BIT(4) | BIT(5); + else if (!has_five_pwm(config)) + sio_data->skip_pwm |= BIT(4) | BIT(5); else if (!has_six_pwm(config)) sio_data->skip_pwm |= BIT(5);