From patchwork Sat Jun 24 15:39:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Patrick Leis X-Patchwork-Id: 9807799 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 910B660382 for ; Sat, 24 Jun 2017 15:39:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 81292283C5 for ; Sat, 24 Jun 2017 15:39:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 74258286FB; Sat, 24 Jun 2017 15:39:39 +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_ADSP_CUSTOM_MED, 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 15A43283C5 for ; Sat, 24 Jun 2017 15:39:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751347AbdFXPji (ORCPT ); Sat, 24 Jun 2017 11:39:38 -0400 Received: from mail-pf0-f170.google.com ([209.85.192.170]:32904 "EHLO mail-pf0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751336AbdFXPji (ORCPT ); Sat, 24 Jun 2017 11:39:38 -0400 Received: by mail-pf0-f170.google.com with SMTP id e7so36113417pfk.0 for ; Sat, 24 Jun 2017 08:39:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=v0JmW7enq/9lw03W79feJZOxabazNH0VLpTwCp8D8Vs=; b=n4u51ozbM21i6zoyRMe0qY4mf9TGJ5kOhk8dAxsaCdO0J11mewzPIC5LEa5Ii6H3Uf k7K2VF49Ev5WLLAcc1QMC2/tb897qZGd7/macExygFBsPhjgJUa/3d5wnln4Us924TJ+ p4yLXaSNI80nRx6CRuZ01KFLM6Z5N9ZVfEjCkzXwj8fNAH390x1+CdJxJanpZ8STBQoZ oWDIH/R6JEv/dwa3+P5rusXlsCb7iOL/YCoC2j/BlOLWELUH1RKipT3C1VOI2KBkBUAs 79CzmKtmVbxJSAt0UGevXNFlfCdZS+Itl1XVWCr26tVQiRNIjdTq8SpfOaAvBCo15Fv4 gLEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=v0JmW7enq/9lw03W79feJZOxabazNH0VLpTwCp8D8Vs=; b=otPm+TWQtF6GSSX3W/k19okmxBilReZ3mKqZL++fdXgl8QtkVP+HaAMOZprEXTReIW /fa7Q+dcAoF8FWevyZKdICU5ybDGImUUj8+dwd4pQlMS8ZubKT1eoe028V6pakACifDI hOdUXkMkaKT7SQMasVZl1wQ6ymE3ZqN7JdmGkFhnTcF43B6IpjXiUeTiiRam+Xt39tkr FODLqK0BdZkJiFgh6sc/9Dr0NagOq1OwK8Tx60uXnGCkSW8A3gB+EyHRNQN9ER7dQ0zP T+IMsQuaalGYIS5jCzsjXzh/9VLBKdOFW3e7CCCI5SX9sLSgPnnkI5nmNrwLqMcRZGSF 3qbQ== X-Gm-Message-State: AKS2vOw/MRDVBIQwELxBCEqfYb6x1DhaPHUXJwOQHFbRqB9kc09odgnt MuXJUNPWrOQt/RGz X-Received: by 10.98.99.132 with SMTP id x126mr13812941pfb.152.1498318777415; Sat, 24 Jun 2017 08:39:37 -0700 (PDT) Received: from venture.svl.corp.google.com ([100.123.242.104]) by smtp.gmail.com with ESMTPSA id j6sm17613451pgc.1.2017.06.24.08.39.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 24 Jun 2017 08:39:36 -0700 (PDT) From: Patrick Venture To: venture@google.com, joel@jms.id.au, linux@roeck-us.net Cc: linux-hwmon@vger.kernel.org, emilyshaffer@google.com, peterh@google.com Subject: [PATCH 1/2 v4] hwmon: (aspeed-pwm-tacho) reduce fan_tach period Date: Sat, 24 Jun 2017 08:39:32 -0700 Message-Id: <20170624153932.8895-1-venture@google.com> X-Mailer: git-send-email 2.13.1.611.g7e3b11ae1-goog 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 Reduce the fan_tach period such that the fan controller uses a shorter period to measure the rpm. The original period of 0x1000 was chosen as a conversative value from the reference implementation. Through experimentation on the quanta-q71l board, I was able to drive the number down which ultimately reduced the time the controller would use to determine the fan_tach. This value was recently tested and accepted downstream on the IBM Zaius board which uses the ast2500. Future work: It may be worthwhile as this is a tunable parameter to the system, to allow overriding it through the device tree. Testing: Tested on an ast2400 sitting on a quanta-q71l and ast2500 on power9. Signed-off-by: Patrick Venture --- v4: Added explanation for value. v3: Added missing change log v2: Updated commit message language --- drivers/hwmon/aspeed-pwm-tacho.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwmon/aspeed-pwm-tacho.c b/drivers/hwmon/aspeed-pwm-tacho.c index 86e2ea8287a7..b2ab5612d8a4 100644 --- a/drivers/hwmon/aspeed-pwm-tacho.c +++ b/drivers/hwmon/aspeed-pwm-tacho.c @@ -160,7 +160,7 @@ * 11: reserved. */ #define M_TACH_MODE 0x02 /* 10b */ -#define M_TACH_UNIT 0x1000 +#define M_TACH_UNIT 0x00c0 #define INIT_FAN_CTRL 0xFF struct aspeed_pwm_tacho_data {