From patchwork Thu Feb 9 15:06:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guenter Roeck X-Patchwork-Id: 9565269 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A320560236 for ; Thu, 9 Feb 2017 17:32:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9213828541 for ; Thu, 9 Feb 2017 17:32:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 84D5528542; Thu, 9 Feb 2017 17:32:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0F86E284F9 for ; Thu, 9 Feb 2017 17:32:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932093AbdBIRb6 (ORCPT ); Thu, 9 Feb 2017 12:31:58 -0500 Received: from bh-25.webhostbox.net ([208.91.199.152]:33987 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752249AbdBIRb1 (ORCPT ); Thu, 9 Feb 2017 12:31:27 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=roeck-us.net; s=default; h=Message-Id:Date:Subject:Cc:To:From; bh=AeAYvGmtkn8mUUHFShyZG2Z7pjb4tnbBFze57PjZIg0=; b=0frNAdTOkkgbgJxXY8VaV1HBBc vq0WXEl0JjCsFcwNLyCsaaW3KRQhQ+MQnA3sx7DGhB3H5BYDFOpugH7w83UQbfaMwHT5y6NCZ3NZQ //TS/AxRR795xN07g1Op2MKsix6ZcgMAg60hwfqKa+/y//Fk+A5LLvwt+UCoQgRdjCHRmQNPbo/Js GFssUf2aN/Gy8T/iofyAxMcrrMOnousjFkgb80Yd37NCCHjOo38duym3fLVZSZHmM0sZmHHOOV6Kx cNqzQNOc1xOoNXDxJzdM7BtGGgmHL5WOR0KxoVzbTjEFbMXpan1SXmb6Ecf9V1RjqVqsarRjy4AnB Ntrc9GfA==; Received: from 108-223-40-66.lightspeed.sntcca.sbcglobal.net ([108.223.40.66]:59132 helo=localhost) by bh-25.webhostbox.net with esmtpa (Exim 4.86_1) (envelope-from ) id 1cbqIb-003z26-8O; Thu, 09 Feb 2017 15:06:17 +0000 From: Guenter Roeck To: Hardware Monitoring Cc: Jean Delvare , Guenter Roeck Subject: [PATCH 1/7] hwmon: (it87) Add feature flag indicating that VIN3 is connected to 5V Date: Thu, 9 Feb 2017 07:06:09 -0800 Message-Id: <1486652775-3926-1-git-send-email-linux@roeck-us.net> X-Mailer: git-send-email 2.7.4 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-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On IT8622E and IT8628E, VIN3 is expected to be connected to +5V. Add feature flag and reflect in input label. Signed-off-by: Guenter Roeck --- drivers/hwmon/it87.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/hwmon/it87.c b/drivers/hwmon/it87.c index ef4e0527bd21..3bfa866cc82f 100644 --- a/drivers/hwmon/it87.c +++ b/drivers/hwmon/it87.c @@ -296,6 +296,7 @@ struct it87_devices { #define FEAT_SIX_PWM BIT(14) /* Chip supports 6 pwm chn */ #define FEAT_PWM_FREQ2 BIT(15) /* Separate pwm freq 2 */ #define FEAT_SIX_TEMP BIT(16) /* Up to 6 temp sensors */ +#define FEAT_VIN3_5V BIT(17) /* VIN3 connected to +5V */ static const struct it87_devices it87_devices[] = { [it87] = { @@ -433,7 +434,7 @@ static const struct it87_devices it87_devices[] = { .features = FEAT_NEWER_AUTOPWM | FEAT_12MV_ADC | FEAT_16BIT_FANS | FEAT_TEMP_OFFSET | FEAT_TEMP_PECI | FEAT_SIX_FANS | FEAT_IN7_INTERNAL | FEAT_SIX_PWM | FEAT_PWM_FREQ2 - | FEAT_SIX_TEMP, + | FEAT_SIX_TEMP | FEAT_VIN3_5V, .peci_mask = 0x07, }, [it8628] = { @@ -442,7 +443,7 @@ static const struct it87_devices it87_devices[] = { .features = FEAT_NEWER_AUTOPWM | FEAT_12MV_ADC | FEAT_16BIT_FANS | FEAT_TEMP_OFFSET | FEAT_TEMP_PECI | FEAT_SIX_FANS | FEAT_IN7_INTERNAL | FEAT_SIX_PWM | FEAT_PWM_FREQ2 - | FEAT_SIX_TEMP, + | FEAT_SIX_TEMP | FEAT_VIN3_5V, .peci_mask = 0x07, }, }; @@ -468,6 +469,7 @@ static const struct it87_devices it87_devices[] = { #define has_six_pwm(data) ((data)->features & FEAT_SIX_PWM) #define has_pwm_freq2(data) ((data)->features & FEAT_PWM_FREQ2) #define has_six_temp(data) ((data)->features & FEAT_SIX_TEMP) +#define has_vin3_5v(data) ((data)->features & FEAT_VIN3_5V) struct it87_sio_data { enum chips type; @@ -1926,7 +1928,9 @@ static ssize_t show_label(struct device *dev, struct device_attribute *attr, int nr = to_sensor_dev_attr(attr)->index; const char *label; - if (has_12mv_adc(data) || has_10_9mv_adc(data)) + if (has_vin3_5v(data) && nr == 0) + label = labels[0]; + else if (has_12mv_adc(data) || has_10_9mv_adc(data)) label = labels_it8721[nr]; else label = labels[nr];