From patchwork Thu Feb 9 15:06:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 9565355 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4134A60236 for ; Thu, 9 Feb 2017 19:05:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3262A28542 for ; Thu, 9 Feb 2017 19:05:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2597828548; Thu, 9 Feb 2017 19:05:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B3EA328542 for ; Thu, 9 Feb 2017 19:05:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752471AbdBITFd (ORCPT ); Thu, 9 Feb 2017 14:05:33 -0500 Received: from bh-25.webhostbox.net ([208.91.199.152]:52122 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752301AbdBITFc (ORCPT ); Thu, 9 Feb 2017 14:05:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=roeck-us.net; s=default; h=References:In-Reply-To:Message-Id:Date:Subject: Cc:To:From; bh=JqN81lyzXJm8BRbpq8EZSGFJgZzhnBKIovajaqwSNTk=; b=S0mIztsUbqWDAm +agvm/v0AI5iV7oyx+ocTGZTnmTkMARk9u+klQeMn0pJQQV5F/zvloxBasa+5qWabH6QaDOKXBNZa 63joU8a8fKuw8m/M0LPCfU23lInY7ioEqex72i0FWv80+tyP6heNW2BRapfzdakl/iAMQ87nFwFow 6WAUZfX6bysep7dCinijGPoLHtsjahUR9eKwLdkokHGCY4cH5pEZAXwhYHP+Ggxroa2c2m3WVYZbm dAVEvvSiVU4qivZsUHdLslDj1ut4jNgvB0s9QY6fBH5JyPcpGEa7I+8B9KI88pf5WlniK8cg95QQh glnykey/3KxJAOPoAo4Q==; Received: from 108-223-40-66.lightspeed.sntcca.sbcglobal.net ([108.223.40.66]:59144 helo=localhost) by bh-25.webhostbox.net with esmtpa (Exim 4.86_1) (envelope-from ) id 1cbqIf-003zDh-4t; Thu, 09 Feb 2017 15:06:21 +0000 From: Guenter Roeck To: Hardware Monitoring Cc: Jean Delvare , Guenter Roeck Subject: [PATCH 5/7] hwmon: (it87) Fix pwm4 detection for IT8620 and IT8628 Date: Thu, 9 Feb 2017 07:06:13 -0800 Message-Id: <1486652775-3926-5-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1486652775-3926-1-git-send-email-linux@roeck-us.net> References: <1486652775-3926-1-git-send-email-linux@roeck-us.net> X-Authenticated_sender: guenter@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: guenter@roeck-us.net X-Authenticated-Sender: bh-25.webhostbox.net: guenter@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP pwm4 is enabled if bit 2 of GPIO control register 4 is disabled, not when it is enabled. Since the check is for the skip condition, it is reversed. This applies to both IT8620 and IT8628. Fixes: 36c4d98a7883d ("hwmon: (it87) Add support for all pwm channels ...") Signed-off-by: Guenter Roeck --- drivers/hwmon/it87.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c index 85918d8a747a..4f3fabcd470d 100644 --- a/drivers/hwmon/it87.c +++ b/drivers/hwmon/it87.c @@ -2614,7 +2614,7 @@ static int __init it87_find(int sioaddr, unsigned short *address, /* Check for pwm4 */ reg = superio_inb(sioaddr, IT87_SIO_GPIO4_REG); - if (!(reg & BIT(2))) + if (reg & BIT(2)) sio_data->skip_pwm |= BIT(3); /* Check for pwm2, fan2 */