public inbox for linux-hwmon@vger.kernel.org
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Michael Walle <michael@walle.cc>
Cc: linux-hwmon@vger.kernel.org, Jean Delvare <jdelvare@suse.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC,2/2] hwmon: adt7411: add min, max and alarm attributes
Date: Sat, 19 Nov 2016 12:54:54 -0800	[thread overview]
Message-ID: <20161119205454.GA14249@roeck-us.net> (raw)
In-Reply-To: <1476438215-6654-2-git-send-email-michael@walle.cc>

On Fri, Oct 14, 2016 at 11:43:35AM +0200, Michael Walle wrote:
> This patch adds support for the min, max and alarm attributes of the
> voltage and temperature channels. Additionally, the temp2_fault attribute
> is supported which indicates a fault of the external temperature diode.
> 
> Signed-off-by: Michael Walle <michael@walle.cc>
> ---
>  drivers/hwmon/adt7411.c | 306 ++++++++++++++++++++++++++++++++++++++++++------
>  1 file changed, 271 insertions(+), 35 deletions(-)
> 
> diff --git a/drivers/hwmon/adt7411.c b/drivers/hwmon/adt7411.c
> index 2f44cdc..c6351b8 100644
> --- a/drivers/hwmon/adt7411.c
> +++ b/drivers/hwmon/adt7411.c
[ ... ]
>  static int adt7411_read_in_vdd(struct device *dev, u32 attr, long *val)
>  {
>  	struct adt7411_data *data = dev_get_drvdata(dev);
> @@ -179,32 +242,40 @@ static int adt7411_read_in_vdd(struct device *dev, u32 attr, long *val)
>  			return ret;
>  		*val = ret * 7000 / 1024;
>  		return 0;
> +	case hwmon_in_min:
> +		ret = i2c_smbus_read_byte_data(client, ADT7411_REG_VDD_LOW);
> +		if (ret < 0)
> +			return ret;
> +		*val = ret * 7000 / 256;
> +		return 0;
> +	case hwmon_in_max:
> +		ret = i2c_smbus_read_byte_data(client, ADT7411_REG_VDD_HIGH);
> +		if (ret < 0)
> +			return ret;
> +		*val = ret * 7000 / 256;

		return 0;

> +	case hwmon_in_alarm:
> +		return adt7411_read_in_alarm(dev, 0, val);
>  	default:
>  		return -EOPNOTSUPP;
>  	}
>  }

  parent reply	other threads:[~2016-11-19 20:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-14  9:43 [RFC PATCH 1/2] hwmon: adt7411: update to new hwmon registration API Michael Walle
2016-10-14  9:43 ` [RFC PATCH 2/2] hwmon: adt7411: add min, max and alarm attributes Michael Walle
2016-11-19 18:05   ` [RFC,2/2] " Guenter Roeck
2016-11-21 16:53     ` Michael Walle
2016-11-21 20:35       ` Guenter Roeck
2016-11-19 20:54   ` Guenter Roeck [this message]
2016-11-19 21:01   ` Guenter Roeck
2016-11-10 13:04 ` [RFC PATCH 1/2] hwmon: adt7411: update to new hwmon registration API Michael Walle
2016-11-10 15:46   ` Guenter Roeck
2016-11-19 17:31 ` [RFC,1/2] " 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=20161119205454.GA14249@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael@walle.cc \
    /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