Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp4613060rwb; Wed, 17 Aug 2022 03:12:22 -0700 (PDT) X-Google-Smtp-Source: AA6agR5o+LseSBTorZk0M/zAyf/ZAYkpnxdLrCAY0NbOQG684pFhi4bvBXkU/PJmM630cczbbuos X-Received: by 2002:a05:6402:194e:b0:442:c81c:ca25 with SMTP id f14-20020a056402194e00b00442c81cca25mr23165846edz.137.1660731141470; Wed, 17 Aug 2022 03:12:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660731141; cv=none; d=google.com; s=arc-20160816; b=MSqrpA5mqdQOwwf9sSrnYq5kYMlK0mcQtYtjIyur5PLT1vXl57bESJxHBrQ5rEl9jB WOfddNSb0/FqrnLKm3GpNti2bzCCjNYNBXeD1Z6IBGIIbWns0fC/Tsx6LG6CvXqGH5BX 2YDA9a00L5619AtuUFMM0+2LXC6OM6NXJrs1Ub8DZUc9blGmSUoV8qXbrnBLg35RW5S9 X2dvqX/AfOFwX9wYNkE54kRHGcpDt71y0kF44IH12d/MsG1i8Hn86ScX7x8N3BBJCiEB hFvQlEf+nTdGzuAcG9Ft3pEBYI+R/NFr8xS8DwzM91FL6MFJamt2LlcjRSatw0ZXDpYE G+BA== 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:from; bh=S6LkOC3dYVHko/3pyC7J8guSh5c/6L7bDslpXVl10Jo=; b=irFLaJZr4mj3q9P8EygqtmcjJqz43Tch+LddkLAx2o0Lf6sm7MkBKbksIR8PGSteTJ vk1bpXynQtaZJitRq8hO5KARIUHHJBMTB7noSxgsYwxCTh6gGZcaBtyRhes1qeL06ywh j6P+7x8cf+VXXKRdTWrI53StTw6R/tBiWzvhw1hXK4bVKP5mVDJQsW55O5jP3aW+CyzB 7lCg+CL9eJ5DMK+eZVTmoDUInQBdpdb/XazfHHDjK3IJIlxe7GfcuaRVXECyYo/KuA5h TIeZ6cck5JnXF8nDpt0rwrucgW8Dnj7kof4P0ZTv+jExBlpguuHF/lCfLiHYS/OxCvBI fWdA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=sntech.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qb40-20020a1709077ea800b00731745a7f19si1209705ejc.271.2022.08.17.03.11.55; Wed, 17 Aug 2022 03:12:21 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=sntech.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235254AbiHQKBo convert rfc822-to-8bit (ORCPT + 99 others); Wed, 17 Aug 2022 06:01:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232543AbiHQKBl (ORCPT ); Wed, 17 Aug 2022 06:01:41 -0400 Received: from gloria.sntech.de (gloria.sntech.de [185.11.138.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEB457C32F; Wed, 17 Aug 2022 03:01:38 -0700 (PDT) Received: from ip5b412258.dynamic.kabel-deutschland.de ([91.65.34.88] helo=diego.localnet) by gloria.sntech.de with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1oOFrW-0001ZB-2Q; Wed, 17 Aug 2022 12:01:22 +0200 From: Heiko =?ISO-8859-1?Q?St=FCbner?= To: Samuel Holland Cc: Liam Girdwood , Mark Brown , Chen-Yu Tsai , Jernej Skrabec , Krzysztof Kozlowski , Rob Herring , linux-arm-kernel@lists.infradead.org, Maxime Ripard , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev Subject: Re: [PATCH v3 2/4] regulator: sun20i: Add support for Allwinner D1 LDOs Date: Wed, 17 Aug 2022 12:01:21 +0200 Message-ID: <5212752.LvFx2qVVIh@diego> In-Reply-To: <1c172085-9586-b612-8600-776e8a394f12@sholland.org> References: <20220815043436.20170-1-samuel@sholland.org> <37742446.J2Yia2DhmK@diego> <1c172085-9586-b612-8600-776e8a394f12@sholland.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT Content-Type: text/plain; charset="iso-8859-1" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS, T_SCC_BODY_TEXT_LINE,T_SPF_HELO_TEMPERROR 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 Am Mittwoch, 17. August 2022, 10:28:40 CEST schrieb Samuel Holland: > On 8/15/22 12:00 PM, Heiko St?bner wrote: > > Am Montag, 15. August 2022, 06:34:33 CEST schrieb Samuel Holland: > >> D1 contains two pairs of LDOs. Since they have similar bindings, and > >> they always exist together, put them in a single driver. > >> > >> The analog LDOs are relatively boring, with a single linear range. Their > >> one quirk is that a bandgap reference must be calibrated for them to > >> produce the correct voltage. > >> > >> The system LDOs have the complication that their voltage step is not an > >> integer, so a custom .list_voltage is needed to get the rounding right. > >> > >> Signed-off-by: Samuel Holland > >> --- > >> > >> Changes in v3: > >> - Adjust control flow in sun20i_regulator_get_regmap() for clarity > >> > >> Changes in v2: > >> - Use decimal numbers for .n_voltages instead of field widths > >> - Get the regmap from the parent device instead of a property/phandle > >> > >> drivers/regulator/Kconfig | 8 + > >> drivers/regulator/Makefile | 1 + > >> drivers/regulator/sun20i-regulator.c | 232 +++++++++++++++++++++++++++ > >> 3 files changed, 241 insertions(+) > >> create mode 100644 drivers/regulator/sun20i-regulator.c > >> > >> diff --git a/drivers/regulator/Kconfig b/drivers/regulator/Kconfig > >> index 23e3e4a35cc9..0c5727173fa0 100644 > >> --- a/drivers/regulator/Kconfig > >> +++ b/drivers/regulator/Kconfig > >> @@ -1262,6 +1262,14 @@ config REGULATOR_STW481X_VMMC > >> This driver supports the internal VMMC regulator in the STw481x > >> PMIC chips. > >> > >> +config REGULATOR_SUN20I > >> + tristate "Allwinner D1 internal LDOs" > >> + depends on ARCH_SUNXI || COMPILE_TEST > >> + depends on MFD_SYSCON && NVMEM > >> + default ARCH_SUNXI > >> + help > >> + This driver supports the internal LDOs in the Allwinner D1 SoC. > >> + > >> config REGULATOR_SY7636A > >> tristate "Silergy SY7636A voltage regulator" > >> help > >> diff --git a/drivers/regulator/Makefile b/drivers/regulator/Makefile > >> index fa49bb6cc544..5dff112eb015 100644 > >> --- a/drivers/regulator/Makefile > >> +++ b/drivers/regulator/Makefile > >> @@ -148,6 +148,7 @@ obj-$(CONFIG_REGULATOR_STM32_VREFBUF) += stm32-vrefbuf.o > >> obj-$(CONFIG_REGULATOR_STM32_PWR) += stm32-pwr.o > >> obj-$(CONFIG_REGULATOR_STPMIC1) += stpmic1_regulator.o > >> obj-$(CONFIG_REGULATOR_STW481X_VMMC) += stw481x-vmmc.o > >> +obj-$(CONFIG_REGULATOR_SUN20I) += sun20i-regulator.o > >> obj-$(CONFIG_REGULATOR_SY7636A) += sy7636a-regulator.o > >> obj-$(CONFIG_REGULATOR_SY8106A) += sy8106a-regulator.o > >> obj-$(CONFIG_REGULATOR_SY8824X) += sy8824x.o > >> diff --git a/drivers/regulator/sun20i-regulator.c b/drivers/regulator/sun20i-regulator.c > >> new file mode 100644 > >> index 000000000000..46f3927d7d10 > >> --- /dev/null > >> +++ b/drivers/regulator/sun20i-regulator.c > >> @@ -0,0 +1,232 @@ > >> +// SPDX-License-Identifier: GPL-2.0-only > >> +// > >> +// Copyright (c) 2021-2022 Samuel Holland > >> +// > > > > nit: shouldn't the comment look like > > /* > > * Copyright (c) 2021-2022 Samuel Holland > > */ > > I have had multiple requests from maintainers to use the former style because it > is more visually consistent. `git grep '^// Copy' drivers sound` returns over > 1500 hits. But it doesn't really matter to me. ok ... I guess that is something that's changing then :-) I just looked into some drivers and the coding-style rst document, but I guess it's the maintainer's call how this should look.