Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp3923543pxb; Mon, 21 Feb 2022 08:23:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJzabJO6/Ox1PjonTzw+ZzRo6bUKPm36IeKMvtFcf/QPmiARwL8m3JY8/eUVvmu17lfkHKqD X-Received: by 2002:a17:906:d205:b0:6d1:4446:d950 with SMTP id w5-20020a170906d20500b006d14446d950mr5656907ejz.702.1645460622388; Mon, 21 Feb 2022 08:23:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645460622; cv=none; d=google.com; s=arc-20160816; b=1JGSPYwwoESKhVhUZc4JHsnUIfTbXYMDsHphm+eHr5xSHdeT1vOHrkTu9/c4peTGgw tGPBt78fMaxSxEHestchSFjNhwSiSZmuxV+kz3+SvCLkf5qDqXuH39dF4r9N8Vtdhe1N 0PweJ75Xt4T6o3ddDUb+AqcNsyqAG3KyvHBokrFmKtakz3vPP76t7nS7fbzkSG+X+3gZ KMHz+XWUqUoqbN0oOjfJuNVeF94TyfTQ81aSqLkAtQV/fZ1N01MCCNwMvvOU62Q2XU3O 92U9pL6IUNVyQRqdrHc2nLe9rhREkOVXJz1LMTVIu/sYpX5FtPZwJxPXxFHXEDuIGAxG 4O/g== 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:date:cc:to:from:subject:message-id :dkim-signature; bh=Ts3xO7iS9U9SfAeEWkQWjBNYwpbAjQ3wgCVSJcLfnhQ=; b=t2Vw0A6loODfbZzAaX4P6yuiNNxXMjxJM3D/+M5kauAGgPRX/mnr3dxIn/nj2LCQwU W+fPZplE3xEUoI46lOVMFxgucaxqzCx+KRP4Gf+MCqrtE/qdxRq8TfKcD0XpdmAGC02A wpBnChT655YMZBfylOpYj7PaapUE1hB7/KaIS9WnhIcQw4hmMaJR9bAzWwXRKC2tzQG1 AJinMQJcSi9l/FTQDj7sSPa4wzx725kFnW+8rbAbd9uCEJ+HIHZGDbWO3NNb4U8ML/QW 484c8BUS3v37zQBUQcdmmM5/mDysEPSIOz/Q7EYTV7SzJqfWOQ0REU7+nGIcFjkwDU++ kmhw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sylv.io header.s=MBO0001 header.b=HSmc6rvw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l12si6833322edt.580.2022.02.21.08.23.16; Mon, 21 Feb 2022 08:23:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sylv.io header.s=MBO0001 header.b=HSmc6rvw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sylv.io Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1356080AbiBULTf (ORCPT + 99 others); Mon, 21 Feb 2022 06:19:35 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:48506 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355975AbiBULSH (ORCPT ); Mon, 21 Feb 2022 06:18:07 -0500 Received: from mout-p-103.mailbox.org (mout-p-103.mailbox.org [IPv6:2001:67c:2050::465:103]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9794E17045; Mon, 21 Feb 2022 02:59:50 -0800 (PST) Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (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 4K2K7m3q2Rz9sS0; Mon, 21 Feb 2022 11:59:48 +0100 (CET) X-Virus-Scanned: amavisd-new at heinlein-support.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sylv.io; s=MBO0001; t=1645441185; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Ts3xO7iS9U9SfAeEWkQWjBNYwpbAjQ3wgCVSJcLfnhQ=; b=HSmc6rvwGLpQ4EZI3D9DVz4jcziDhHphq7t7akXMXy4smHhyuNEEx+brdHvcx2MlptDWl+ a63wJ16hqlnnfg0EYqiCidaFEECvZ0RDVRGRXe81hvNe4aagXHwUUCXWnpKfDqj5w+Clt0 ZHLxiji++RYchOYzddkxYeT6AitdkFdaQhWuXvcvcgkqj/WpIQGytYn2RA2uqPpBpPnULh MJHX430LKadLGD0ditKPOGAwTxg8zfYZmjsrxe3ymKsSyrRwrz/ljTPSS8LC3fFPrDAXN5 vsfrx0J3ZRBHV9h9KmFCTJn9tDoAPbyzs1EW38JicQPZtPaQh0PpDevwy1D+wQ== Message-ID: Subject: Re: [PATCH v1 1/1] hwmon: (pmbus) Add regulator supply into macro From: sylv To: Guenter Roeck , Jean Delvare Cc: linux-kernel@vger.kernel.org, linux-hwmon@vger.kernel.org, Patrick Rudolph Date: Mon, 21 Feb 2022 11:59:41 +0100 In-Reply-To: References: <15b95695-6fbc-1916-ff39-abf13e989fc4@roeck-us.net> Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 On Thu, 2022-02-17 at 18:40 +0100, sylv wrote: > On Thu, 2022-02-17 at 09:36 -0800, Guenter Roeck wrote: > > On 2/17/22 02:23, Marcello Sylvester Bauer wrote: > > > Add optional regulator supply into PWBUS_REGULATOR macro. This > > > makes it > > > > The code doesn't look optional to me. What exactly is optional ? > > I mean, it is optional to add a supply. It should not cause errors if > you don't. I should probably reword this, too. > > > > > > possible to define a vin-supply in DT. Not defining a supply will > > > only > > > cause the following debug output: > > > > > > ``` > > > Looking up vin-supply property in node [...] failed > > > ``` > > > > > > Signed-off-by: Marcello Sylvester Bauer > > > --- > > >   drivers/hwmon/pmbus/pmbus.h | 1 + > > >   1 file changed, 1 insertion(+) > > > > > > diff --git a/drivers/hwmon/pmbus/pmbus.h > > > b/drivers/hwmon/pmbus/pmbus.h > > > index e0aa8aa46d8c..38f049d68d32 100644 > > > --- a/drivers/hwmon/pmbus/pmbus.h > > > +++ b/drivers/hwmon/pmbus/pmbus.h > > > @@ -464,6 +464,7 @@ extern const struct regulator_ops > > > pmbus_regulator_ops; > > >   #define PMBUS_REGULATOR(_name, _id)                           \ > > >         [_id] = {                                               \ > > >                 .name = (_name # _id),                          \ > > > +               .supply_name = "vin",                           \ > > >                 .id = (_id),                                    \ > > >                 .of_match = of_match_ptr(_name # _id),          \ > > >                 .regulators_node = of_match_ptr("regulators"),  \ > > > > That seems to be quite far reaching. How does this affect / change > > behavior > > of existing systems which so far did not expect supply_name to be > > set > > ? > > > > Guenter > My goal is to make it optional to define a supply regulator so that it is possible to regulate the incoming voltage regulator. IIUIC, it is required to set a supply_name to tell the regulator core which supply it should look up from DT. (see: of_get_regulator drivers/regulator/core.c:402) This should not cause a change of behavior even if no supply is defined. It would register a dummy regulator as supply instead. Am I right, or did I misunderstanding something? Thanks, Marcello