From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938576AbcJQRUo (ORCPT ); Mon, 17 Oct 2016 13:20:44 -0400 Received: from bh-25.webhostbox.net ([208.91.199.152]:60802 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936596AbcJQRUd (ORCPT ); Mon, 17 Oct 2016 13:20:33 -0400 Date: Mon, 17 Oct 2016 10:20:30 -0700 From: Guenter Roeck To: Joel Stanley Cc: jdelvare@suse.com, Yi Li , linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] hwmon: (adm1275) Enable adm1278 VOUT sampling Message-ID: <20161017172030.GA19820@roeck-us.net> References: <20161017080853.7627-1-joel@jms.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161017080853.7627-1-joel@jms.id.au> User-Agent: Mutt/1.5.23 (2014-03-12) X-Authenticated_sender: guenter@roeck-us.net X-OutGoing-Spam-Status: No, score=-1.0 X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bh-25.webhostbox.net X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - roeck-us.net X-Get-Message-Sender-Via: bh-25.webhostbox.net: authenticated_id: guenter@roeck-us.net X-Authenticated-Sender: bh-25.webhostbox.net: guenter@roeck-us.net X-Source: X-Source-Args: X-Source-Dir: Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 17, 2016 at 06:38:53PM +1030, Joel Stanley wrote: > From: Yi Li > > The adm1278 can optionally monitor the VOUT pin. This functioanltiy is > not enabled at reset, so PMON_CONFIG needs to be modified in order to > enable it. > > Signed-off-by: Yi Li > Signed-off-by: Joel Stanley Applied to -next, after s/functioanltiy/functionality/ Thanks, Guenter > --- > v2: > Return an error when unable to enable VOUT monitoring as suggestd by Guenter > > drivers/hwmon/pmbus/adm1275.c | 20 ++++++++++++++++---- > 1 file changed, 16 insertions(+), 4 deletions(-) > > diff --git a/drivers/hwmon/pmbus/adm1275.c b/drivers/hwmon/pmbus/adm1275.c > index 3baa4f4a8c5e..9940849351a1 100644 > --- a/drivers/hwmon/pmbus/adm1275.c > +++ b/drivers/hwmon/pmbus/adm1275.c > @@ -499,15 +499,27 @@ static int adm1275_probe(struct i2c_client *client, > pindex = 2; > tindex = 3; > > - info->func[0] |= PMBUS_HAVE_PIN | PMBUS_HAVE_STATUS_INPUT; > + info->func[0] |= PMBUS_HAVE_PIN | PMBUS_HAVE_STATUS_INPUT | > + PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT; > + > + /* By default when reset VOUT is not enabled */ I also rephrased the comment a bit to make it easier to understand. > + if (!(config & ADM1278_VOUT_EN)) { > + config |= ADM1278_VOUT_EN; > + ret = i2c_smbus_write_byte_data(client, > + ADM1275_PMON_CONFIG, > + config); > + if (ret < 0) { > + dev_err(&client->dev, > + "Failed to enable VOUT monitoring\n"); > + return -ENODEV; > + } > + } > + > if (config & ADM1278_TEMP1_EN) > info->func[0] |= > PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP; > if (config & ADM1278_VIN_EN) > info->func[0] |= PMBUS_HAVE_VIN; > - if (config & ADM1278_VOUT_EN) > - info->func[0] |= > - PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT; > break; > case adm1293: > case adm1294: > -- > 2.9.3 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-hwmon" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html