Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp709334ybg; Tue, 9 Jun 2020 10:49:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyYrGnJQ038pA0Na1ML/89jEQhyBHhbd12RX8lpO+prt3F6ckwwPyqP/rMuS+WwVPxxUd3P X-Received: by 2002:a05:6402:549:: with SMTP id i9mr28131279edx.159.1591724940569; Tue, 09 Jun 2020 10:49:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591724940; cv=none; d=google.com; s=arc-20160816; b=yKsYhjz2zDQ6InxzoFe1O+fKLREwp7VZNtBTGassotup9YIw37XEfgWtD1wZpl0qb6 kJb23FLdFvCKiZXEeBsSGgUqGAuYTVu9vOTFyC900JhKTVR0WKSFPdcvyCmrP/MqFKoK nGBOOcelAefngwEdnrm3YqD4T8OlVfQdbkmhV8mlPX/g9HYJMrCbrZ+2drrVr1BD0Xd8 UtXc4NaqqsPSwCdVyZWtYMszKEoiFPldcgRmys9XG+1i4TT5Hme4x2F7aKOLeKfikBpp h86VO2anXNpf4ur6aq6fx2s5nqnc4nMsAXeTXDLlwjWQlEltuip1cSvYjOzB9QkeIqlP P4cA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=yi/dZhnpba0wW2ljjZV/YZTW/tRXK0iOTrMLhSEoubI=; b=0btOgkQKNJAjkN/1YJuBCi5SwvvpSNmCek37Ag7cnPvYLqOMuLrSVqS796ikchVWy5 dyDGqVHmXDWbuU9VgS52LPz1SGdEEsLbKBPJEKETjmOWiVyThDFf6hCvzKZW/As3odr0 +b3lVxEtYfjBYlkO7CCQWKyuBhf/6g0NWrkSX0gClycEyy0npkzKaJ3/mysH9tkM8zDo oEqD6g5LeMszX5LszUazKfByYzfEeTMVXIEnyeORAm2hz+Htexi1mefw7wmE6yAIhq7z neeIMj+vIrxVt8E5zM4NsluIREzQPDO7LlUytc6N/W7u/arDP2MRWanfj35pynRO59Mo U+9w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b10si5275020edw.184.2020.06.09.10.48.37; Tue, 09 Jun 2020 10:49:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730688AbgFIO5e (ORCPT + 99 others); Tue, 9 Jun 2020 10:57:34 -0400 Received: from lists.gateworks.com ([108.161.130.12]:54523 "EHLO lists.gateworks.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730110AbgFIO53 (ORCPT ); Tue, 9 Jun 2020 10:57:29 -0400 Received: from 068-189-091-139.biz.spectrum.com ([68.189.91.139] helo=tharvey.pdc.gateworks.com) by lists.gateworks.com with esmtp (Exim 4.82) (envelope-from ) id 1jifjx-0002Dv-Ge; Tue, 09 Jun 2020 15:00:37 +0000 From: Tim Harvey To: Rob Herring , Jean Delvare , Guenter Roeck Cc: Lee Jones , Robert Jones , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, Tim Harvey Subject: [PATCH 2/2] hwmon: (gsc): add 16bit pre-scaled voltage mode Date: Tue, 9 Jun 2020 07:57:20 -0700 Message-Id: <1591714640-10332-3-git-send-email-tharvey@gateworks.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1591714640-10332-1-git-send-email-tharvey@gateworks.com> References: <1591714640-10332-1-git-send-email-tharvey@gateworks.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org add a 16-bit pre-scaled voltage mode to adc and clarify that existing pre-scaled mode is 24bit. Signed-off-by: Tim Harvey --- drivers/hwmon/gsc-hwmon.c | 8 +++++--- include/linux/platform_data/gsc_hwmon.h | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/hwmon/gsc-hwmon.c b/drivers/hwmon/gsc-hwmon.c index 2137bc6..3dfe2ca 100644 --- a/drivers/hwmon/gsc-hwmon.c +++ b/drivers/hwmon/gsc-hwmon.c @@ -159,7 +159,7 @@ gsc_hwmon_read(struct device *dev, enum hwmon_sensor_types type, u32 attr, return -EOPNOTSUPP; } - sz = (ch->mode == mode_voltage) ? 3 : 2; + sz = (ch->mode == mode_voltage_24bit) ? 3 : 2; ret = regmap_bulk_read(hwmon->regmap, ch->reg, buf, sz); if (ret) return ret; @@ -186,7 +186,8 @@ gsc_hwmon_read(struct device *dev, enum hwmon_sensor_types type, u32 attr, /* adjust by uV offset */ tmp += ch->mvoffset; break; - case mode_voltage: + case mode_voltage_24bit: + case mode_voltage_16bit: /* no adjustment needed */ break; } @@ -336,7 +337,8 @@ static int gsc_hwmon_probe(struct platform_device *pdev) HWMON_T_LABEL; i_temp++; break; - case mode_voltage: + case mode_voltage_24bit: + case mode_voltage_16bit: case mode_voltage_raw: if (i_in == GSC_HWMON_MAX_IN_CH) { dev_err(gsc->dev, "too many input channels\n"); diff --git a/include/linux/platform_data/gsc_hwmon.h b/include/linux/platform_data/gsc_hwmon.h index ec1611a..37a8f554d 100644 --- a/include/linux/platform_data/gsc_hwmon.h +++ b/include/linux/platform_data/gsc_hwmon.h @@ -4,8 +4,9 @@ enum gsc_hwmon_mode { mode_temperature, - mode_voltage, + mode_voltage_24bit, mode_voltage_raw, + mode_voltage_16bit, mode_max, }; -- 2.7.4