Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp319043pxm; Wed, 2 Mar 2022 16:16:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJyCehQ8sg3eyFfG4RHfMH7s9t6vbBCtKCB49jqYakHZCsWhx21W19eqlQsi5o+5gDvuRz3G X-Received: by 2002:a17:903:41c7:b0:151:a52c:c63b with SMTP id u7-20020a17090341c700b00151a52cc63bmr2465162ple.32.1646266588398; Wed, 02 Mar 2022 16:16:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646266588; cv=none; d=google.com; s=arc-20160816; b=kBPF3lVy0NtpdSOpGprHUGbOPB0vjwAUQApfv6hb+qmncSbKJXX795IuXf5FrVsjJx Lc+Mn3YgrReMg8FzvZNMmhB8fR4TTsIWmEg7tqV+i5LZrtyYD4aofPSXf5rOkNv/wGMb QTH8pque5fSt/fu/ofvG3M9Qnto2jnIy+SlIKzHrApgV5XtMaVWIIfSqEJRAeCTBI1Bq RlqGBBr4C2Lf5kIKyEF9QBltqiP3bDWXxePjxp6TavUF2nY+67rPCcdzvbVD8pqsaZFI JtXykSahtmmWRDzQKKUd3pB2YMa4SAJaUJGJzjAEmPp7tlsYpyJCWuLRxODV3NGLLVIA L1Sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:dkim-signature :from; bh=r3j4TfpwYZdoo5iNxbvs/pvrxDs+7O8OisHS1HfKjXU=; b=u4GlXsmwJFSf0wwCOTX9AJTxGJJ+jOWT26l1IpGo+4vTSxZJUsJaxXe8ksdgUvnnng 8+RyqvHikcVEQ2N+quhKg+lXLTgvLwj3xbazP9mbYrD9IV8JtGB2bi+gtd3IPOrbY/eX dYfo4SDAiY3IZYX0QuaI8vpQtz2gFiK/JRLl0M1Q6RtiabcXI/aveYxvrKq7izaHw0rf nKJ8hJzRyEN+xnP88Ma2jk3CVOaxxT6z0+k213GK0Tf03Ywve7Klpj4yl99LOPGsIGLn I4TZc9wAa1ew4fRj2BX+2J/zp9uHHChi9VYvisPFuQYcrv4Lo8/S4TSgpt0tJuQ7sWpN XQvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sylv.io header.s=MBO0001 header.b=HqcoqYvE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sylv.io Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id nl9-20020a17090b384900b001bccf96588csi7350500pjb.126.2022.03.02.16.16.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 16:16:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@sylv.io header.s=MBO0001 header.b=HqcoqYvE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sylv.io Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AA87F1D3D9B; Wed, 2 Mar 2022 15:30:41 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240680AbiCBJuj (ORCPT + 99 others); Wed, 2 Mar 2022 04:50:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58580 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240654AbiCBJuf (ORCPT ); Wed, 2 Mar 2022 04:50:35 -0500 Received: from mout-p-103.mailbox.org (mout-p-103.mailbox.org [80.241.56.161]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0C51BA74B; Wed, 2 Mar 2022 01:49:52 -0800 (PST) Received: from smtp102.mailbox.org (smtp102.mailbox.org [80.241.60.233]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-103.mailbox.org (Postfix) with ESMTPS id 4K7q8v0p8tz9sqx; Wed, 2 Mar 2022 10:49:51 +0100 (CET) From: Marcello Sylvester Bauer DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sylv.io; s=MBO0001; t=1646214589; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=r3j4TfpwYZdoo5iNxbvs/pvrxDs+7O8OisHS1HfKjXU=; b=HqcoqYvEdv/j2uDr7iypGcFvmD2e8aES2OGx6psjL29809Yydvt8EL2h/f1TsAwpWEX47k OEBTgiYGKV2bIJXgN7WgUvswlLH44KwWNPZwZeG80whDmiWVWu7POuYM6nKU/bYGycbVGW ml6TBJbu6y/hOGnKPMSlG47/b4voHCs8BnB2CQsj2YXThHmrgPc0OrJg//hJg5NIRG9qfs Lz4S12j7vxSuQyo7fE/FhxTMJaRpCb4m/AUiq3WydgxoDlqe/AI31a3o9oRq7gM6+Mm67m CgBqUhfh7RtmitWGmGTcS79nD6qqEhNZp5qAuFU0AXUb3Vo0tYNkSgpO1I4f/Q== To: Guenter Roeck , Jean Delvare Cc: linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, Patrick Rudolph , Marcello Sylvester Bauer Subject: [PATCH v4 3/3] hwmon (xdpe12284): Add regulator support Date: Wed, 2 Mar 2022 10:49:21 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add simple on/off regulator support for xdpe12284 and other pmbus parts supported by the xdpe12284 driver. Signed-off-by: Marcello Sylvester Bauer --- drivers/hwmon/pmbus/Kconfig | 6 ++++++ drivers/hwmon/pmbus/xdpe12284.c | 11 +++++++++++ 2 files changed, 17 insertions(+) diff --git a/drivers/hwmon/pmbus/Kconfig b/drivers/hwmon/pmbus/Kconfig index 6552467c588d..a2ea1d5a8765 100644 --- a/drivers/hwmon/pmbus/Kconfig +++ b/drivers/hwmon/pmbus/Kconfig @@ -417,6 +417,12 @@ config SENSORS_XDPE122 This driver can also be built as a module. If so, the module will be called xdpe12284. +config SENSORS_XDPE122_REGULATOR + bool "Regulator support for XDPE122 and compatibles" + depends on SENSORS_XDPE122 && REGULATOR + help + Uses the xdpe12284 or compatible as regulator. + config SENSORS_ZL6100 tristate "Intersil ZL6100 and compatibles" help diff --git a/drivers/hwmon/pmbus/xdpe12284.c b/drivers/hwmon/pmbus/xdpe12284.c index b979c88d2e87..18fffc5d749b 100644 --- a/drivers/hwmon/pmbus/xdpe12284.c +++ b/drivers/hwmon/pmbus/xdpe12284.c @@ -10,6 +10,8 @@ #include #include #include +#include + #include "pmbus.h" #define XDPE122_PROT_VR12_5MV 0x01 /* VR12.0 mode, 5-mV DAC */ @@ -122,6 +124,11 @@ static int xdpe122_identify(struct i2c_client *client, return 0; } +static const struct regulator_desc xdpe122_reg_desc[] = { + PMBUS_REGULATOR("vout", 0), + PMBUS_REGULATOR("vout", 1), +}; + static struct pmbus_driver_info xdpe122_info = { .pages = XDPE122_PAGE_NUM, .format[PSC_VOLTAGE_IN] = linear, @@ -138,6 +145,10 @@ static struct pmbus_driver_info xdpe122_info = { PMBUS_HAVE_TEMP | PMBUS_HAVE_STATUS_TEMP | PMBUS_HAVE_POUT | PMBUS_HAVE_PIN | PMBUS_HAVE_STATUS_INPUT, .identify = xdpe122_identify, +#if IS_ENABLED(CONFIG_SENSORS_XDPE122_REGULATOR) + .num_regulators = 2, + .reg_desc = xdpe122_reg_desc, +#endif }; static int xdpe122_probe(struct i2c_client *client) -- 2.35.1