From patchwork Fri Oct 14 10:06:05 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 9376359 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 2FBE66075E for ; Fri, 14 Oct 2016 10:08:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1DF872A5F7 for ; Fri, 14 Oct 2016 10:08:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0F4CB2A5FB; Fri, 14 Oct 2016 10:08:42 +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 5FD0F2A5F7 for ; Fri, 14 Oct 2016 10:08:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752511AbcJNKIk (ORCPT ); Fri, 14 Oct 2016 06:08:40 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:35252 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750846AbcJNKIk (ORCPT ); Fri, 14 Oct 2016 06:08:40 -0400 Received: by mail-pf0-f194.google.com with SMTP id s8so6950034pfj.2; Fri, 14 Oct 2016 03:08:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=l9kf78Gfo2pcu8HZ55lpAwwwjeaNqVe+C0URfEYfidY=; b=byN94WI8/l8Ok/iX4c9vAJgXSCA7QkCCkrnxQs3mj/9R1PWHhs7JKToT7ecxacRJI8 ZEEoDfecGO6p6zJE8aLzjMXNT5JkiJ1cG6xihd+XhFGdy8kXulaoKgDi/ebgCiH2HMTP ryYmPCQKONmb+KN71FsrcLIoMuRSG5djirmSuYEnqMG4O83bjqQYbRoFsDm6ikI6JxFb fzWjRSdtTJ7wmmfqn3/PJTZwY9MUSGuaW1XQzcYds8ArM86h28ePGv91dbihKvmHQTV8 kPkJ2I49Hk+xZ8d4M4j3Dgc/49tbroOuDSEXEIOy9CSxHhpDbZvHX97nJ8VbixaYinah 85Bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=l9kf78Gfo2pcu8HZ55lpAwwwjeaNqVe+C0URfEYfidY=; b=CcQhTbTJWrxXun0a45VzEnhhkaFwj9qXF78jUXzxVcVMb6RO1Qz0F8a6TduxmB0KVn SnT2PqkkJTV/JILzEwCSoBg8zxTdfr0niOMbnwQbiQQl4Y4A5OSzqGKf4HZ0qJZnk9/6 KPsF7yE4P7IqoyIxOX9dhkBedCgSWyHgyH4sXyI8vDLchDtulvUBkNK1s5dzC3Vby4Cd 8VO2nZ3hHFGNZVClQ9VQKg3SHxdAA0vGiBPNFlF6ep9et3JUXOjJzgrm6c3w9vQK3IZb aYpgWyuC+I6wbiC/wgNRn1DX0I6zbZ9PtUD80F/it2OCNFpPXG+AqagD3IE4UczVTVqs xy7A== X-Gm-Message-State: AA6/9RkvSYXQYzRvZp0ovx16zV4jLfaCOi15Ziuby7zMzEOfWerJvdI8GlYdvek9UPQxEA== X-Received: by 10.99.51.15 with SMTP id z15mr14198145pgz.41.1476439719320; Fri, 14 Oct 2016 03:08:39 -0700 (PDT) Received: from aurora.jms.id.au ([2403:480:11:8000:19cb:2e3b:1576:c186]) by smtp.gmail.com with ESMTPSA id ah5sm26148460pad.30.2016.10.14.03.08.35 (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 14 Oct 2016 03:08:38 -0700 (PDT) Received: by aurora.jms.id.au (sSMTP sendmail emulation); Fri, 14 Oct 2016 20:38:29 +1030 From: Joel Stanley To: linux@roeck-us.net, jdelvare@suse.com Cc: Yi Li , linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] hwmon: (adm1275) Enable adm1278 VOUT sampling Date: Fri, 14 Oct 2016 20:36:05 +1030 Message-Id: <20161014100605.23887-1-joel@jms.id.au> X-Mailer: git-send-email 2.9.3 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 From: Yi Li The adm1278 can optionally monitor the VOUT pin. This functionality 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 --- Guenter, I'm not sure if this is a valid thing to do in the probe function. If not, can you suggest an alternative method for enabling this? drivers/hwmon/pmbus/adm1275.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/hwmon/pmbus/adm1275.c b/drivers/hwmon/pmbus/adm1275.c index 3baa4f4a8c5e..7d1f5f7891cc 100644 --- a/drivers/hwmon/pmbus/adm1275.c +++ b/drivers/hwmon/pmbus/adm1275.c @@ -500,6 +500,19 @@ static int adm1275_probe(struct i2c_client *client, tindex = 3; info->func[0] |= PMBUS_HAVE_PIN | PMBUS_HAVE_STATUS_INPUT; + + /* By default when reset VOUT is not enabled */ + if (!(config & ADM1278_VOUT_EN)) { + config |= ADM1278_VOUT_EN; + ret = i2c_smbus_write_byte_data(client, + ADM1275_PMON_CONFIG, + config); + if (ret < 0) { + dev_warn(&client->dev, + "Failed to enable VOUT monitoring\n"); + } + } + if (config & ADM1278_TEMP1_EN) info->func[0] |= PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP;