{"id":809976,"url":"http://patchwork.ozlabs.org/api/patches/809976/?format=json","web_url":"http://patchwork.ozlabs.org/project/openbmc/patch/20170905072828.8749-4-andrew@aj.id.au/","project":{"id":56,"url":"http://patchwork.ozlabs.org/api/projects/56/?format=json","name":"OpenBMC development","link_name":"openbmc","list_id":"openbmc.lists.ozlabs.org","list_email":"openbmc@lists.ozlabs.org","web_url":"http://github.com/openbmc/","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20170905072828.8749-4-andrew@aj.id.au>","list_archive_url":null,"date":"2017-09-05T07:28:28","name":"[3/3] pmbus: max31785: Add handler for set_page() and PMBUS_CLEAR_FAULTS virt pages","commit_ref":null,"pull_url":null,"state":"not-applicable","archived":true,"hash":"95b4215485465ed9c562c5444592b19d573c31ab","submitter":{"id":68332,"url":"http://patchwork.ozlabs.org/api/people/68332/?format=json","name":"Andrew Jeffery","email":"andrew@aj.id.au"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/openbmc/patch/20170905072828.8749-4-andrew@aj.id.au/mbox/","series":[{"id":1500,"url":"http://patchwork.ozlabs.org/api/series/1500/?format=json","web_url":"http://patchwork.ozlabs.org/project/openbmc/list/?series=1500","date":"2017-09-05T07:28:25","name":"pmbus: Fix error propagation for register check functions","version":1,"mbox":"http://patchwork.ozlabs.org/series/1500/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/809976/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/809976/checks/","tags":{},"related":[],"headers":{"Return-Path":"<openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>","X-Original-To":["incoming@patchwork.ozlabs.org","openbmc@lists.ozlabs.org"],"Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","openbmc@lists.ozlabs.org"],"Received":["from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xmdfb1M0Kz9sPk\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue,  5 Sep 2017 17:30:31 +1000 (AEST)","from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xmdfZ75jTzDrKh\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue,  5 Sep 2017 17:30:30 +1000 (AEST)","from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com\n\t[66.111.4.25])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xmdd458d6zDrFs\n\tfor <openbmc@lists.ozlabs.org>; Tue,  5 Sep 2017 17:29:12 +1000 (AEST)","from compute4.internal (compute4.nyi.internal [10.202.2.44])\n\tby mailout.nyi.internal (Postfix) with ESMTP id 77C1B20C18;\n\tTue,  5 Sep 2017 03:29:10 -0400 (EDT)","from frontend1 ([10.202.2.160])\n\tby compute4.internal (MEProxy); Tue, 05 Sep 2017 03:29:10 -0400","from keelia.au.ibm.com (bh02i525f01.au.ibm.com [202.81.18.30])\n\tby mail.messagingengine.com (Postfix) with ESMTPA id 93A257FA75;\n\tTue,  5 Sep 2017 03:29:08 -0400 (EDT)"],"Authentication-Results":["ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=aj.id.au header.i=@aj.id.au header.b=\"eyGXz9yr\";\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=messagingengine.com\n\theader.i=@messagingengine.com header.b=\"ptUV5+Vm\"; \n\tdkim-atps=neutral","lists.ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=aj.id.au header.i=@aj.id.au header.b=\"eyGXz9yr\";\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=messagingengine.com\n\theader.i=@messagingengine.com header.b=\"ptUV5+Vm\"; \n\tdkim-atps=neutral","ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=aj.id.au\n\t(client-ip=66.111.4.25; helo=out1-smtp.messagingengine.com;\n\tenvelope-from=andrew@aj.id.au; receiver=<UNKNOWN>)","lists.ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=aj.id.au header.i=@aj.id.au header.b=\"eyGXz9yr\";\n\tdkim=pass (2048-bit key;\n\tunprotected) header.d=messagingengine.com\n\theader.i=@messagingengine.com\n\theader.b=\"ptUV5+Vm\"; dkim-atps=neutral"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/relaxed; d=aj.id.au; h=cc\n\t:date:from:in-reply-to:message-id:references:subject:to\n\t:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s=fm1; bh=BNesVt\n\t2G9D+3l8VuC1v3kZh9NgjcyWWpcAGZyVGE1UQ=; b=eyGXz9yrvNN49CMvVa5099\n\toeSNLQyNYe0M5aKWv6HaCqiOYjpVVIkeWmVNiyKKFtrVXk5VSHnYPNLTM17yVKAG\n\tbHsLwSWuzIrJFtg2gtA4p9gN1A+7bnBv4bdwMkIZPRvExrJ7DSNqpbb1GGVpuKRg\n\tnPzTxepbWxEGlxcZ3FUcFUSwIDdmv6yhSNAjz+0oube6Zfs231Dx5RNBnwCN3N3I\n\tl2zV3FUG//Px84Vt9gn2+ip03Oh2SLIxvzyF410DrbnRcknP5qMRUyypip/MAhgn\n\tLu+7pge1b0pGuxLUor0un+UPNUeMmS+AAWEBF7RlARE2VKoz5GnQZhnZ8XS1jHHg\n\t==","v=1; a=rsa-sha256; c=relaxed/relaxed; d=\n\tmessagingengine.com; h=cc:date:from:in-reply-to:message-id\n\t:references:subject:to:x-me-sender:x-me-sender:x-sasl-enc\n\t:x-sasl-enc; s=fm1; bh=BNesVt2G9D+3l8VuC1v3kZh9NgjcyWWpcAGZyVGE1\n\tUQ=; b=ptUV5+VmNqM3myT/X0pfYddnBnBjSDcLe5Z0or9PqgGmaHOsDq0exrbJ0\n\t92cfPinNxJY28L7qK+6bQWa1ZUo/FIW7EEnFrUZGC8JXJGjYVUpjvytWyhracvLq\n\t1pAaacdB3esU38SKYcd3b2JAIATYVOZMIJe5eStYbXhQ0YInwGzb7fXyCwIo4Hwc\n\tioZTSd0PKUbcwjqCe78ajCKW8/cK5bHotnHtFCnpeBWYU/o6thhoY1R5v4E7eP9U\n\tR9q5kmEfIfPUvD3bcPBCIU1TFFjEMBjAdF1AaGTMcBmdtO0uUkbG37r7RaWVwXlU\n\tFbWU68V9n4CyfYg/I2QjGa/zBoSQA=="],"X-ME-Sender":"<xms:RlKuWTb9pV7qSykp-D-07GDEjwCG6f3Pdnjnc8J2ZGImY-z9idpIKQ>","X-Sasl-enc":"cwJTC2ttSaqPk76f49t/+8MIXkpDtCrJr7FcUtj529Pd 1504596549","From":"Andrew Jeffery <andrew@aj.id.au>","To":"openbmc@lists.ozlabs.org","Subject":"[PATCH 3/3] pmbus: max31785: Add handler for set_page() and\n\tPMBUS_CLEAR_FAULTS virt pages","Date":"Tue,  5 Sep 2017 17:28:28 +1000","Message-Id":"<20170905072828.8749-4-andrew@aj.id.au>","X-Mailer":"git-send-email 2.11.0","In-Reply-To":"<20170905072828.8749-1-andrew@aj.id.au>","References":"<20170905072828.8749-1-andrew@aj.id.au>","X-BeenThere":"openbmc@lists.ozlabs.org","X-Mailman-Version":"2.1.23","Precedence":"list","List-Id":"Development list for OpenBMC <openbmc.lists.ozlabs.org>","List-Unsubscribe":"<https://lists.ozlabs.org/options/openbmc>,\n\t<mailto:openbmc-request@lists.ozlabs.org?subject=unsubscribe>","List-Archive":"<http://lists.ozlabs.org/pipermail/openbmc/>","List-Post":"<mailto:openbmc@lists.ozlabs.org>","List-Help":"<mailto:openbmc-request@lists.ozlabs.org?subject=help>","List-Subscribe":"<https://lists.ozlabs.org/listinfo/openbmc>,\n\t<mailto:openbmc-request@lists.ozlabs.org?subject=subscribe>","Cc":"Andrew Jeffery <andrew@aj.id.au>","Errors-To":"openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org","Sender":"\"openbmc\"\n\t<openbmc-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org>"},"content":"The max31785 uses the concept of 'virtual pages' to manage dual tach\nfan inputs. These pages don't exist in hardware by definition, so don't\nsend spurious PAGE or CLEAR_FAULTS commands to the device for these\npages.\n\nSigned-off-by: Andrew Jeffery <andrew@aj.id.au>\n---\n drivers/hwmon/pmbus/max31785.c | 13 +++++++++++++\n 1 file changed, 13 insertions(+)","diff":"diff --git a/drivers/hwmon/pmbus/max31785.c b/drivers/hwmon/pmbus/max31785.c\nindex 6a0d289ad346..a1e5f24c9744 100644\n--- a/drivers/hwmon/pmbus/max31785.c\n+++ b/drivers/hwmon/pmbus/max31785.c\n@@ -117,11 +117,23 @@ static int max31785_read_byte_data(struct i2c_client *client, int page,\n \treturn -ENODATA;\n }\n \n+static int max31785_set_page(struct i2c_client *client, int page)\n+{\n+\treturn (page < MAX31785_NR_PAGES) ? -ENODATA : 0;\n+}\n+\n static int max31785_write_byte(struct i2c_client *client, int page, u8 value)\n {\n \tif (page < MAX31785_NR_PAGES)\n \t\treturn -ENODATA;\n \n+\tswitch (value) {\n+\tcase PMBUS_CLEAR_FAULTS:\n+\t\treturn 0;\n+\tdefault:\n+\t\tbreak;\n+\t}\n+\n \treturn -ENOTSUPP;\n }\n \n@@ -604,6 +616,7 @@ static int max31785_of_tmp_config(struct i2c_client *client,\n static const struct pmbus_driver_info max31785_info = {\n \t.pages = MAX31785_NR_PAGES,\n \n+\t.set_page = max31785_set_page,\n \t.write_word_data = max31785_write_word_data,\n \t.read_byte_data = max31785_read_byte_data,\n \t.read_word_data = max31785_read_word_data,\n","prefixes":["3/3"]}