Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp320606ybg; Wed, 10 Jun 2020 01:29:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYvGNOD/6yfOsiF0AJ+ViqGp5WBIPis4kAkiWMakGNdglQxuEqM4kHApceS1TD3qaZGfCf X-Received: by 2002:a17:906:8492:: with SMTP id m18mr2272581ejx.168.1591777793901; Wed, 10 Jun 2020 01:29:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591777793; cv=none; d=google.com; s=arc-20160816; b=wzhGryImUJpmMgmZk1pfcZd59aiQCQkONChI5cEsInT446kyG2SRK13iBzMKFj45qX HcQZoCSb8oViPxruiSMIkhsV/dVZIqAmf5rgiJiXjh1Ak6MFlX4Line2rDL+p6p5H2e6 PuTL9pVLbehT+BlSu8fNDH8hpK0Xoq5ftGjLE7sbGW55HkxwUCZ9HPqwDXcVMflWhoki 5r9YbehBUyXUP3D9xhwIZSOcr6hmV+NSNxNNuKmDpeOaCpN7A/+C4kmTfeUSkSSctS+5 y8zDwIdLBfhOhC/p8n/Jka3BxJXzlAf0zeG9hL5lJM3wTv/iSHZZ8O4WWPXwMMYpywXZ j5Ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature; bh=EeIfeMtC6ZVKYeciuWjHUrT7P8TMj/nqx7gXpKs4XCw=; b=Wsy1hVhJeB/Ul4oau3mamxkO+uohChURYzhu1iTAW/iU7t33WovZkEM467hLyo0oJ1 bVzxiuKygV4frBwcl0JzdXVr25USvu3AzSNFQ1pEWwleH0lX4ol8y6TSHnivN/d/ck2T ohkm0wr7gs+UBt5ZxzeISqWbMC0iSI0bvvWW5ffhHN/6DWXYKuRF1iV4v9bQHFcE375m mBCNmJHHLcuZo+qGLZOrRut5xxULl2E9WEjEy2KpD7BO049+w6CW/6FOW/iZ28/S7lfA aR5eQGeKLsNv5kjy3lJn2kbpBGZKiZec0us5SMk4DtH160z9z9RgJBQWyT30a9+1W3eD +yuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gV025CDP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d7si11843551edt.176.2020.06.10.01.29.29; Wed, 10 Jun 2020 01:29:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=gV025CDP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726763AbgFJI0V (ORCPT + 99 others); Wed, 10 Jun 2020 04:26:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35526 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726512AbgFJI0U (ORCPT ); Wed, 10 Jun 2020 04:26:20 -0400 Received: from mail-pf1-x441.google.com (mail-pf1-x441.google.com [IPv6:2607:f8b0:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8367BC03E96B; Wed, 10 Jun 2020 01:26:19 -0700 (PDT) Received: by mail-pf1-x441.google.com with SMTP id j1so797679pfe.4; Wed, 10 Jun 2020 01:26:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=EeIfeMtC6ZVKYeciuWjHUrT7P8TMj/nqx7gXpKs4XCw=; b=gV025CDPRGRjF9olznMwB9I8BVSSZyFb6nZT9v8dhM3lR9EOk99EmbUOrOVBIJkU1k XJApj6a9uHsHCS8WuNg9nf8+3fRndJp2++HkXAnOMNh7IslSSunzMND27SdnLZ04HADf U4J/FgsvkwskI1E/y4QYWhRM1A7EMeBz6tohFNhyjL0ZowQG/Lxyx8A3R3tUueuKdkEe tFC/RQt/vozPGE7s8VeSllKn/BHZXvB9lxuRwD+gSlYOlaONDWioa0AiGRoHBHMMKiyj tlLhrr8U3RGcpAaO5qwhlP8RPhiDoLAGib6NyhKfj3Xu7X8LD1UBYgGJO1yWo2wlRB5P kDcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=EeIfeMtC6ZVKYeciuWjHUrT7P8TMj/nqx7gXpKs4XCw=; b=YEPIaji7G0ouNDQ6tewjykMgDYycVJOVZ6OLzTqGZjbTOpDhiYON+atmulgF4Ono/d /6AkRMQiDKfZp3zz5/ImZgc8T7FxNP5ajLXosBLxK6OG+Apxkl1Bo07QHSNr/Bi+H6Gc AUe9zVA1vE0whIWvCxT9nGuEjAHdy4tPWW+baNeFWbR8muJXPrfHqMjU75zYX2MCxhoh ARVo2KTCBVM7ilmrSCIn/b0XoBivIVhCj+aoRXHogoT2Bx08WN4ybhd67nMiLR+SWTO7 lJ6z41v/NnKF5Oiu3kEnhZ+vaXhA0lptKiwF2G6uwbzw7g58b3534ifqaD5Wg2KX14DS HvVw== X-Gm-Message-State: AOAM5314v8iwkppSOeoFhsvKY9aVIJDm38Ay5lgo90Np6apVOoTvsAMD FemHbtG2gXdpLnd4oKueldI= X-Received: by 2002:a63:ce14:: with SMTP id y20mr1710922pgf.186.1591777579132; Wed, 10 Jun 2020 01:26:19 -0700 (PDT) Received: from cnn ([2402:3a80:407:e743:cd72:839f:5826:c552]) by smtp.gmail.com with ESMTPSA id c9sm12172754pfp.100.2020.06.10.01.26.14 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Jun 2020 01:26:18 -0700 (PDT) Date: Wed, 10 Jun 2020 13:56:11 +0530 From: Manikandan Elumalai To: Guenter Roeck , Jean Delvare , linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org Cc: saipsdasari@fb.com, patrickw3@fb.com, vijaykhemka@fb.com, linux-aspeed@lists.ozlabs.org, openbmc@lists.ozlabs.org, manikandan.e@hcl.com Subject: [PATCH v4] hwmon:(adm1275) Enable adm1278 ADM1278_TEMP1_EN Message-ID: <20200610082611.GA14266@cnn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The adm1278 temp attribute need it for openbmc platform . This feature not enabled by default, so PMON_CONFIG needs to enable it. v4: --- changes in conditional check to enable vout & temp1 by default. v3: ---- fix invalid signed-off. removed checkpath warnings. write ADM1278_TEMP1_EN and ADM1278_VOUT_EN conf in single line operation. v2: ---- add Signed-off-by. removed ADM1278_TEMP1_EN check. Signed-off-by: Manikandan Elumalai --- drivers/hwmon/pmbus/adm1275.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/drivers/hwmon/pmbus/adm1275.c b/drivers/hwmon/pmbus/adm1275.c index 5caa37fb..d4e1925 100644 --- a/drivers/hwmon/pmbus/adm1275.c +++ b/drivers/hwmon/pmbus/adm1275.c @@ -666,11 +666,12 @@ static int adm1275_probe(struct i2c_client *client, tindex = 3; info->func[0] |= PMBUS_HAVE_PIN | PMBUS_HAVE_STATUS_INPUT | - PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT; + PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT | + PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP; - /* Enable VOUT if not enabled (it is disabled by default) */ - if (!(config & ADM1278_VOUT_EN)) { - config |= ADM1278_VOUT_EN; + /* Enable VOUT & TEMP1 if not enabled (disabled by default) */ + if (config & (ADM1278_VOUT_EN | ADM1278_TEMP1_EN) != ADM1278_VOUT_EN | ADM1278_TEMP1_EN) { + config |= ADM1278_VOUT_EN | ADM1278_TEMP1_EN; ret = i2c_smbus_write_byte_data(client, ADM1275_PMON_CONFIG, config); @@ -681,9 +682,6 @@ static int adm1275_probe(struct i2c_client *client, } } - 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; break; -- 2.7.4