linux-hwmon.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Tim Harvey <tharvey@gateworks.com>,
	Rob Herring <robh+dt@kernel.org>,
	Jean Delvare <jdelvare@suse.com>
Cc: Lee Jones <lee.jones@linaro.org>,
	Robert Jones <rjones@gateworks.com>,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-hwmon@vger.kernel.org
Subject: Re: [PATCH 2/2] hwmon: (gsc): add 16bit pre-scaled voltage mode
Date: Thu, 11 Jun 2020 06:47:58 -0700	[thread overview]
Message-ID: <5ec904cf-d950-6214-e0b3-65b229402ba1@roeck-us.net> (raw)
In-Reply-To: <1591714640-10332-3-git-send-email-tharvey@gateworks.com>

On 6/9/20 7:57 AM, Tim Harvey wrote:
> add a 16-bit pre-scaled voltage mode to adc and clarify that existing
> pre-scaled mode is 24bit.
> 
> Signed-off-by: Tim Harvey <tharvey@gateworks.com>

For my reference:

Reviewed-by: Guenter Roeck <linux@roeck-us.net>

We'll have to wait for DT approval.

Guenter

> ---
>  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,
>  };
>  
> 


  reply	other threads:[~2020-06-11 13:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-09 14:57 [PATCH 0/2] add 16bit pre-scaled adc mode to Gateworks GSC hwmon Tim Harvey
2020-06-09 14:57 ` [PATCH 1/2] dt-bindings: mfd: gateworks-gsc: add 16bit pre-scaled voltage mode Tim Harvey
2020-06-17 21:47   ` Rob Herring
2020-06-18  7:39   ` Lee Jones
2020-06-09 14:57 ` [PATCH 2/2] hwmon: (gsc): " Tim Harvey
2020-06-11 13:47   ` Guenter Roeck [this message]
2020-06-23 14:09   ` Guenter Roeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5ec904cf-d950-6214-e0b3-65b229402ba1@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=devicetree@vger.kernel.org \
    --cc=jdelvare@suse.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjones@gateworks.com \
    --cc=robh+dt@kernel.org \
    --cc=tharvey@gateworks.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).