Received: by 10.192.165.148 with SMTP id m20csp4086115imm; Tue, 8 May 2018 02:41:12 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqeHSljwvytOpL/mjB47TNEj0eEhGypf19rboUdejLAY5SIOqdxPy/Qi7DJ+oFe+YyDcBrq X-Received: by 2002:a63:2a89:: with SMTP id q131-v6mr31994088pgq.379.1525772472918; Tue, 08 May 2018 02:41:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525772472; cv=none; d=google.com; s=arc-20160816; b=a/nOFPpy1rCZuZxC3/QpzMYoQOWFnjvK82QiCl2EgkZqWtIwHbCNDB4aCpwXt6HrTq gpxQriq0JL4CxayQO+vzb/JYHIyxJh/UUxLiR6K63XI1Gpt9yLDXzpCsWwGf31thHO5H qvBiLOes1h7aEL+08zZfEWufbHCpenbgA0yVFMMucNZDkXmXKOgK6/JvVVVGBLR6iwQN PLFUfAUqcvOIpL3vEyS0rBnks4cZS2gZ6lFw7G64DSA3QcCmHRfAJ9wHSd89u2Rq4aEi /ehTUzvcrNCZEx4E3n50MmkfzYfqvir/GoIBjkHRzbzQ5R5UemBx4ZXjFU+A3upi9ykr bJ3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=0ZGdspDLHhPxAuWryLKniB35zER57Q111An0q+sGuME=; b=FVai4kCb2/vGxcz51iWN6lSn0LMha0B9YQu/sIWoQpB4J6ieF1U99UY/VpwuwTzSSN jhiAzqzzADKpMVnoKlHchKCRRSzj9/OMnzpjsbZ/BfogOQXiX+TseypltNiCIcO5CD7M aDm7z2M7l/WIzNYFVvgyCizzOFC6u8nlVGM31lBtHbe8z37k7i/sACKwldlxsKmXDn+f jEXVgMN4wpWSFmYu2D811qc+RtwaxEqq7kBMliGakZ+DoskWqAr6P0PkCkWZa8TWGydF gm7invMPzue3HjPtPxKWN3NjIdge8THAuHTiuJZJj4T3uBgoVSbLZpfV+AVcxcCKmdwm olxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qv2Pd9lc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t18-v6si11424139plr.240.2018.05.08.02.40.58; Tue, 08 May 2018 02:41:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qv2Pd9lc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754912AbeEHJjv (ORCPT + 99 others); Tue, 8 May 2018 05:39:51 -0400 Received: from mail-pl0-f65.google.com ([209.85.160.65]:39978 "EHLO mail-pl0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754405AbeEHJjt (ORCPT ); Tue, 8 May 2018 05:39:49 -0400 Received: by mail-pl0-f65.google.com with SMTP id t22-v6so1900869plo.7; Tue, 08 May 2018 02:39:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=0ZGdspDLHhPxAuWryLKniB35zER57Q111An0q+sGuME=; b=qv2Pd9lcN7QOeJlql4ZZTh8vpMkLkqxjxcbBgElHz/rqbQpUSMtZ/3NA0iC2V2VfPd iapEqCNLMAvUti2zFZsXyC6GHXpJQfVIb9POeJFOlcySeByYPnf/jx7xWVjQdxRd6w1Y 183N3RFx/WTaAMfQPnU2pP+cGBGjnFBG/hpv0xJCbzQtX7W94gtZhl94jFqyH3BEUQ1K XoUxRik6sYjsc0TOt9B6dT44s7F2eQcXclIb97LRsYIa3kBD6K9b/db3MdwXjU62n9hQ AZKznzbu8lv9EBHeVeAUY+0fl6AlSg/7H2wZ5HfaRJjLk6YB/s/9PJDZDAsSrBaRdf+o oQcQ== 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=0ZGdspDLHhPxAuWryLKniB35zER57Q111An0q+sGuME=; b=ui/eAIVevDVqIxiO4AopupWugc3/840KmNPTCJatz+yFB83A6mJe8jNPqboQSYZVJ+ vec552nlCHAFEz7kWnRxmanCWtDkB8bTn32qDbvWH1+0phtWnqINhQBLQImBgwCLgCW9 mD0jY9kTJDORJcPrtcu6mq9fyrpIE40YYezFKWg9XO2d8C9hE8yTiWJ8U+bU8m1qW5oR qfohRuAh90FOpa7gVVLHGQnmdnwBWWbCVwg+CnmX3RgOdjFadQiL6OSICkr4HIywezdF R+8rYoMyLFAvXq7CKD7NCCZ4lVbDhdF9FUugHAICiznjT6nTQ0irAoihli0co5zEttQJ lW/w== X-Gm-Message-State: ALQs6tBfpxn0vV1Q/sCK1xWSa2k5T2ZF5i6gxVNjBhNKZ11SwTiFUrnI EK9S31CUh7ZUE321acfbr1A= X-Received: by 2002:a17:902:7685:: with SMTP id m5-v6mr9460751pll.340.1525772388708; Tue, 08 May 2018 02:39:48 -0700 (PDT) Received: from localhost (45.62.100.246.16clouds.com. [45.62.100.246]) by smtp.gmail.com with ESMTPSA id u9sm49163851pfj.10.2018.05.08.02.39.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 May 2018 02:39:47 -0700 (PDT) From: Lei YU To: Jean Delvare , Guenter Roeck , Joel Stanley , Andrew Jeffery , linux-hwmon@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org Cc: Lei YU Subject: [PATCH] hwmon: (aspeed-pwm-tacho) Use 24MHz clock Date: Tue, 8 May 2018 17:39:27 +0800 Message-Id: <1525772367-20627-1-git-send-email-mine260309@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The clock source for aspeed pwm is set to 24MHz, so use the hard-coded clock frequency instead of the one in device tree. Otherwise, in case of the clock specified in device tree is not 24MHz, the fan speed will be incorrect. Signed-off-by: Lei YU --- drivers/hwmon/aspeed-pwm-tacho.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/hwmon/aspeed-pwm-tacho.c b/drivers/hwmon/aspeed-pwm-tacho.c index 693a3d5..e83b8df 100644 --- a/drivers/hwmon/aspeed-pwm-tacho.c +++ b/drivers/hwmon/aspeed-pwm-tacho.c @@ -922,7 +922,6 @@ static int aspeed_pwm_tacho_probe(struct platform_device *pdev) void __iomem *regs; struct resource *res; struct device *hwmon; - struct clk *clk; int ret; np = dev->of_node; @@ -956,12 +955,10 @@ static int aspeed_pwm_tacho_probe(struct platform_device *pdev) regmap_write(priv->regmap, ASPEED_PTCR_TACH_SOURCE, 0); regmap_write(priv->regmap, ASPEED_PTCR_TACH_SOURCE_EXT, 0); - clk = devm_clk_get(dev, NULL); - if (IS_ERR(clk)) - return -ENODEV; - priv->clk_freq = clk_get_rate(clk); aspeed_set_clock_enable(priv->regmap, true); + // The clock source is set to 24MHz aspeed_set_clock_source(priv->regmap, 0); + priv->clk_freq = 24000000; aspeed_create_type(priv); -- 2.7.4