Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp61808rwb; Sun, 25 Sep 2022 15:28:13 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7WOJDcEagVB9oTQI2yYijuiS5H3Ew7LRiLKmI+5qB7jRA5t3buXrdU1fJs9mPzjOzlATkh X-Received: by 2002:a17:902:8e84:b0:178:57e4:805b with SMTP id bg4-20020a1709028e8400b0017857e4805bmr19020603plb.144.1664144892789; Sun, 25 Sep 2022 15:28:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664144892; cv=none; d=google.com; s=arc-20160816; b=1JrjCxGfeBou9iU2yCnn57mbJ43isIn7a7LqrT2TqF4AD5s5ExFSMwNr0VgQcwkTSs TdS0BgUZ6RDmdoedGg1jBYYb/LKdQOzay10gt333Q46XWYnlcWIMqXA9WfUvDTtS/AD9 qnk/OyK9ayOGbgMKMaNMFZSGMKTykkoLenY3zWQ4MrC/UaiNor3XrvzbCQNCzUyqkiVa jHGPa3ZCX+fbMzIIo2JXtv5jD4mN22oRwouVREzbt232dEMJmuLUlk6+aZCbiBi0pHeM rFKQ+/mlC8HHRT3rwwS8nzoaD5N9+gdnxe+fdlCNtSSMwf6P1rvdx1T4fBXsH0A9pdka NWLw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=55QOZ/Sosj9iz7tF65g2uHc/YtzXw/1I5tJ5UeOj3pc=; b=ZVLlSjod9qERlOoP21JVRXdGVpMX+FWLSbixHevn72sB3XG4PUA94iHYoZRz+dWKZx Bk3UXJ53r/2dtpaxF+J+SCAwWRH8KtgLWn4pCQkNZR68TiG4UwDVr2Y1P/ETk3SPi3uj B8znH7Jjfm+F/ZI/Uu3dPGbeGg8aQTfceQPnIPoeC3Yl8+w2T7ASBVoJjjMo1hlKmN09 owu7O+ipidGRqGfx4UNGCxGzY1A8SzxTteIhz8Jj1yXQOd2o12MCLnCRPXp4iz1MWyMI KHZhL8dgg6ttAv5LDutiSzuDVmne7o9FUeZ/E4ahpvd+1UXOIBGxhsEzsFAePBuRvyHl tCzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bewilderbeest.net header.s=thorn header.b=cSWhvHJl; 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=bewilderbeest.net Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o9-20020a170902bcc900b0017849a1dadfsi9654619pls.107.2022.09.25.15.27.56; Sun, 25 Sep 2022 15:28:12 -0700 (PDT) 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=@bewilderbeest.net header.s=thorn header.b=cSWhvHJl; 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=bewilderbeest.net Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232971AbiIYWLH (ORCPT + 99 others); Sun, 25 Sep 2022 18:11:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232675AbiIYWKw (ORCPT ); Sun, 25 Sep 2022 18:10:52 -0400 Received: from thorn.bewilderbeest.net (thorn.bewilderbeest.net [71.19.156.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78C91140E9; Sun, 25 Sep 2022 15:10:50 -0700 (PDT) Received: from hatter.bewilderbeest.net (97-113-250-99.tukw.qwest.net [97.113.250.99]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: zev) by thorn.bewilderbeest.net (Postfix) with ESMTPSA id C6BA81AE; Sun, 25 Sep 2022 15:04:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bewilderbeest.net; s=thorn; t=1664143472; bh=55QOZ/Sosj9iz7tF65g2uHc/YtzXw/1I5tJ5UeOj3pc=; h=From:To:Cc:Subject:Date:From; b=cSWhvHJldr4rpvt9/S6OgfH9CPdFlIJJHSLURXJwwyN49c6BreR4p3QHUWte2rDDK uMYzBIUoTECVbMuNfgHPDnmTQtY9uy4/kNyJzL7/0BfJuBtrzYOqjNTZ+TcjLU+tWb o8WmdMwUQLSljh9mDZ1WiodBhcdpDig+RPHZ6ZyQ= From: Zev Weiss To: Mark Brown , Liam Girdwood , Rob Herring , Krzysztof Kozlowski , devicetree@vger.kernel.org Cc: Zev Weiss , linux-kernel@vger.kernel.org, Naresh Solanki , Patrick Rudolph , Laxman Dewangan , Mike Rapoport , openbmc@lists.ozlabs.org Subject: [PATCH 0/3] regulator: Add DT support for regulator-output connectors Date: Sun, 25 Sep 2022 15:03:16 -0700 Message-Id: <20220925220319.12572-1-zev@bewilderbeest.net> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS 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 Hello, This series is another attempt at implementing support for userspace-controlled regulator-supplied power outputs. This is an important feature for some kinds of BMC (baseboard management controller) systems where the BMC provides an operator with manual control of a set of DC power outputs. As in a broadly similar patchset that was recently almost merged [0], this takes the approach of providing support by extending the existing userspace-consumer regulator driver. A couple questions about the userspace-consumer driver came up along the way, however. First, how (if at all) is it currently being used? It appears the last in-tree use of it was removed a bit over two years ago in commit 9d3239147d6d ("ARM: pxa: remove Compulab pxa2xx boards"). Aside from just adding DT support I've made a couple small tweaks to the driver in patch 3 that I hope are compatible with any current usage, but without any extant examples to look at it's kind of hard to say. Second, how critical is its support for controlling multiple regulators? (i.e. its use of regulator_bulk_data and friends instead of a single struct regulator.) As far as I can see every in-tree use of it that's ever existed has used num_supplies = 1. If it's not important to retain, patch 1 of this series could be supplanted by one that instead simplifies the driver slightly by removing that functionality. The DT binding added in patch 2 is very similar to one I posted in a previous patchset that had an R-B from Rob [1], but has had some minor rewording and gained one new (optional) property. Laxman, Naresh, Patrick -- please let me know if there are any aspects of this implementation that would be incompatible with your needs. Thanks, Zev [0] https://lore.kernel.org/all/20220707081826.953449-4-Naresh.Solanki@9elements.com/ [1] https://lore.kernel.org/linux-kernel/20220505232557.10936-2-zev@bewilderbeest.net/ Zev Weiss (3): regulator: devres: Add devm_regulator_bulk_get_exclusive() dt-bindings: regulator: Add regulator-output binding regulator: userspace-consumer: Handle regulator-output DT nodes .../bindings/regulator/regulator-output.yaml | 47 +++++++++++++ drivers/regulator/core.c | 42 +++++++----- drivers/regulator/devres.c | 66 ++++++++++++++----- drivers/regulator/internal.h | 2 + drivers/regulator/userspace-consumer.c | 43 ++++++++++-- include/linux/regulator/consumer.h | 2 + include/linux/regulator/userspace-consumer.h | 1 + 7 files changed, 162 insertions(+), 41 deletions(-) create mode 100644 Documentation/devicetree/bindings/regulator/regulator-output.yaml -- 2.37.3