Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp4809389ybp; Mon, 14 Oct 2019 10:20:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqxpJRtAYdWPeIyBtAHhQHQ1f660v8g4VlrzAtSDuSfVwGvA+EdqdqGfUNNGEq3xzYnKTh/e X-Received: by 2002:a17:906:fcac:: with SMTP id qw12mr29340326ejb.31.1571073631166; Mon, 14 Oct 2019 10:20:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571073631; cv=none; d=google.com; s=arc-20160816; b=LYfelZa7KUDpuGlSyAppS7VRkT+1/tCyDVvX3PjlwnYghMw/6I4ttpQ2hrgMzhaAgm 5tR52t5ZzxaTh48oaqNf6WoJkeLdQa2LPHxespOFC2wXlo0WNFmhavMNxn8fqAnPQXx0 47KMJCsdxgp3WsA8ChsOt8EgERsdqpvPwzSqxyThRAdzl9V0xSgetz7NDTPjA7ojbrd+ YB9212zJB1EVfyV3HyWK1ZOqtr9GTx3Ry7H3JibbL0GflhVHOQyci/WWRpFZy/ycjKhp 8HDZ5pQXeClTbiPXzbu3+UxiMLZ21XuhYTtYrH8kJc/2eQ39jPUdVsGKDd3AHZJqPePo O9BA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=5GXUIHUmmSaGP6umCaH3FsW19aJglMMf3j2gfW5lS68=; b=lGKCwnIK0YIPLD7mykF1Ed8pFI3p+pGRPKPz8SZEvmcMKl3d+jxQpPYTOnw1v6593A gFK1Pqm5sBEn6uGzlNTozFJ9OV9fI8Wbez+Ru1+DfnBD/xxwxc/ePAon5wPa5Gdu63ET Fr/9O5NhOVtNuzgNfc5Pf+6TAcl973+G0ASAEZKZrDEy6KB54e+y9J+hxH01N1u6E15Q u6HmKZ2SoWW6PadkL6rDWxut4dDz3O48zZplW+ZJIOapHE7DWsGCwGBYgDF+ujnekFLP c9wApLt2hfSiZ1r9+3xCE+HIrrEPrmQ7BgiFoNb9pLuE7weWFbwcBDxrNywpd89LluTH fw4A== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ni.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x3si12278331eda.285.2019.10.14.10.20.07; Mon, 14 Oct 2019 10:20:31 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=ni.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388374AbfJNRQr (ORCPT + 99 others); Mon, 14 Oct 2019 13:16:47 -0400 Received: from mx0a-00010702.pphosted.com ([148.163.156.75]:2260 "EHLO mx0b-00010702.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731347AbfJNRQr (ORCPT ); Mon, 14 Oct 2019 13:16:47 -0400 X-Greylist: delayed 11570 seconds by postgrey-1.27 at vger.kernel.org; Mon, 14 Oct 2019 13:16:46 EDT Received: from pps.filterd (m0098780.ppops.net [127.0.0.1]) by mx0a-00010702.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x9EE1WFt031570; Mon, 14 Oct 2019 09:03:11 -0500 Received: from ni.com (skprod2.natinst.com [130.164.80.23]) by mx0a-00010702.pphosted.com with ESMTP id 2vkcbvdp52-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 14 Oct 2019 09:03:11 -0500 Received: from us-aus-exch2.ni.corp.natinst.com (us-aus-exch2.ni.corp.natinst.com [130.164.68.12]) by us-aus-skprod2.natinst.com (8.16.0.27/8.16.0.27) with ESMTPS id x9EE3AXu024287 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 14 Oct 2019 09:03:10 -0500 Received: from us-aus-exhub2.ni.corp.natinst.com (130.164.68.32) by us-aus-exch2.ni.corp.natinst.com (130.164.68.12) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 14 Oct 2019 09:03:10 -0500 Received: from senary.amer.corp.natinst.com (130.164.49.7) by us-aus-exhub2.ni.corp.natinst.com (130.164.68.32) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Mon, 14 Oct 2019 09:03:10 -0500 From: Kyle Roeschley To: Jean Delvare , Guenter Roeck CC: , Subject: [PATCH] hwmon: (tmp421) Allow reading at 2Hz instead of 0.5Hz Date: Mon, 14 Oct 2019 09:03:10 -0500 Message-ID: <20191014140310.7438-1-kyle.roeschley@ni.com> X-Mailer: git-send-email 2.23.0.rc1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,1.0.8 definitions=2019-10-14_08:2019-10-11,2019-10-14 signatures=0 X-Proofpoint-Spam-Reason: safe Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Our driver configures the device to read at 2Hz, but then only allows the user to read cached temp values at up to 0.5Hz. Let's allow users to read as quickly as we do. Signed-off-by: Kyle Roeschley --- drivers/hwmon/tmp421.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/hwmon/tmp421.c b/drivers/hwmon/tmp421.c index a94e35cff3e5..83a4fab151d2 100644 --- a/drivers/hwmon/tmp421.c +++ b/drivers/hwmon/tmp421.c @@ -127,7 +127,8 @@ static struct tmp421_data *tmp421_update_device(struct device *dev) mutex_lock(&data->update_lock); - if (time_after(jiffies, data->last_updated + 2 * HZ) || !data->valid) { + if (time_after(jiffies, data->last_updated + (HZ / 2)) || + !data->valid) { data->config = i2c_smbus_read_byte_data(client, TMP421_CONFIG_REG_1); -- 2.23.0.rc1