[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20161119205454.GA14249@roeck-us.net>
Date: Sat, 19 Nov 2016 12:54:54 -0800
From: Guenter Roeck <linux@...ck-us.net>
To: Michael Walle <michael@...le.cc>
Cc: linux-hwmon@...r.kernel.org, Jean Delvare <jdelvare@...e.com>,
linux-kernel@...r.kernel.org
Subject: Re: [RFC,2/2] hwmon: adt7411: add min, max and alarm attributes
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@...le.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;
> }
> }
Powered by blists - more mailing lists