Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2304276rwd; Fri, 9 Jun 2023 09:16:37 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ60EVD3Ws7PXMpCIUNwwdGEzVqQxBkp5f16EX56PmyUtVUYgc7mojqs9xZ1oLw1kMcpLXwn X-Received: by 2002:a05:6a20:258f:b0:10b:855b:a39f with SMTP id k15-20020a056a20258f00b0010b855ba39fmr2107027pzd.44.1686327396550; Fri, 09 Jun 2023 09:16:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686327396; cv=none; d=google.com; s=arc-20160816; b=OOZBqRPoDDEBnWmnaODtddgTRqrBQDlurYEa/muvCPVCm6fBqA3dQkSBljhbZpuIW6 u3+ZTBF96vlqxrBbkNQd1iNbluU9cUkIhH/m+knig3joVdf3TavP9mkRwP/nKmxq3BtB 4rrwEPjlQ1IsIcDleTVccMbVZ63GDVK34//zQqmE7NOnHa8ina7dyqctIY5LDEr6WYns nDE9SuYIKrwtfM0If4+3XAfEeaJkgI1o0ffEh9c00pZ3rHDYcKJUunx2a+IJNWioJUTM 8Npde33VUWCUmmHR4bDOkWbgpSaO/jl6BkEl0DzDnVt57Br1EoHYKK1vqegakgWYjOs5 i0eA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=6hhjlaPJt9Rh9oiVq+wu7k3IhysJvu9O3kd8WNmmUzI=; b=I7lQvW4unUbyFEiE+skm6C/Bsk7YIArLO2VS5HbeVwOQoftRPaBRYKS0740qa1vtn/ UKvKLIUQWHdzpD7VAhoahWw7rPMrfg9TNUV9v+Oa7TG5HDvpAS4lGKWt2abIi2GAFxGk 3AjigBrAxqTUVx5GDwSHQbKpvCEg1RmDuhq0HfrSG/h8Goa4wh7C8aLdSeShBrlC+mPH tdYX5CUDuldP54U7MHplmDYevguiAWlnOt/CI0nC39VMUQwE8MytdJOIP2C4cqpwOsgs 9QHZCdOC+DdFnzRwsjgQJAYXYi2QIZx8AtuG9g5b4ntR85tJZJotvBdWrpZyp9iPIQnI Ff8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=M4be1us2; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m9-20020a654389000000b0053f24deef14si2662395pgp.319.2023.06.09.09.16.20; Fri, 09 Jun 2023 09:16:36 -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=@kernel.org header.s=k20201202 header.b=M4be1us2; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241970AbjFIP4P (ORCPT + 99 others); Fri, 9 Jun 2023 11:56:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238095AbjFIP4M (ORCPT ); Fri, 9 Jun 2023 11:56:12 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F1B903589; Fri, 9 Jun 2023 08:56:10 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8912465983; Fri, 9 Jun 2023 15:56:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 71B6BC4339B; Fri, 9 Jun 2023 15:56:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686326169; bh=lmii+YJHW/Bw7Ht4zJ7k+kVHnXkIAIs1YZPvgbtm5Vg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=M4be1us2J7XeI1Rc8ukeNLGkR9Gg0eOph7dL53plXqRfgFWKS1TquNmnP8Fn5j7pb Y7spCK6IzRyBnBySUIIBU1MBAyMq7BQqapLeKfY3XPPxXKADQUKv2YtyCsgd90ere1 HG0MeQN+l9nYBSwxjSuRouQd+oUhIy34z4cRvkjleCOO0Qiml2d0YEWBB09WNiJKyx aJda8E9GG++9v9XJXw1ZRqm7uoL8Su3sFDjSbKxKHOg8pReNMb6nng1QUoL7EFCxDd kRoctvtBY3Ftf4vFVb1yatYlzPgoC0LTBFoEUFhtjnTZBeMzAM5feolCqVHFW5FS8a /qE7JEQpY2Mlw== Date: Fri, 9 Jun 2023 16:56:05 +0100 From: Conor Dooley To: Chen-Yu Tsai Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Mark Brown , Liam Girdwood , Matthias Brugger , AngeloGioacchino Del Regno , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/9] regulator: mt6358: Merge VCN33_* regulators Message-ID: <20230609-unpaved-propeller-b361fba89913@spud> References: <20230609083009.2822259-1-wenst@chromium.org> <20230609083009.2822259-4-wenst@chromium.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="T+MxQ7SbKoVjteRl" Content-Disposition: inline In-Reply-To: <20230609083009.2822259-4-wenst@chromium.org> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 --T+MxQ7SbKoVjteRl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jun 09, 2023 at 04:30:00PM +0800, Chen-Yu Tsai wrote: > The VCN33_BT and VCN33_WIFI regulators are actually the same regulator, > having the same voltage setting and output pin. There are simply two > enable bits that are ORed together to enable the regulator. >=20 > Having two regulators representing the same output pin is misleading > from a design matching standpoint, and also error-prone in driver > implementations. If consumers try to set different voltages on either > regulator, the one set later would override the one set before. There > are ways around this, such as chaining them together and having the > downstream one act as a switch. But given there's only one output pin, > such a workaround doesn't match reality. >=20 > Remove the VCN33_WIFI regulator. During the probe phase, have the driver > sync the enable status of VCN33_WIFI to VCN33_BT. Also drop the suffix > so that the regulator name matches the pin name in the datasheet. >=20 > Signed-off-by: Chen-Yu Tsai > --- > drivers/regulator/mt6358-regulator.c | 65 +++++++++++++++++----- > include/linux/regulator/mt6358-regulator.h | 6 +- > 2 files changed, 52 insertions(+), 19 deletions(-) >=20 > diff --git a/drivers/regulator/mt6358-regulator.c b/drivers/regulator/mt6= 358-regulator.c > index c9e16bd092f6..faf6b0757019 100644 > --- a/drivers/regulator/mt6358-regulator.c > +++ b/drivers/regulator/mt6358-regulator.c > @@ -277,7 +277,7 @@ static const unsigned int vcama_voltages[] =3D { > 2800000, 2900000, 3000000, > }; > =20 > -static const unsigned int vcn33_bt_wifi_voltages[] =3D { > +static const unsigned int vcn33_voltages[] =3D { > 3300000, 3400000, 3500000, > }; > =20 > @@ -321,7 +321,7 @@ static const u32 vcama_idx[] =3D { > 0, 7, 9, 10, 11, 12, > }; > =20 > -static const u32 vcn33_bt_wifi_idx[] =3D { > +static const u32 vcn33_idx[] =3D { > 1, 2, 3, > }; > =20 > @@ -566,12 +566,8 @@ static struct mt6358_regulator_info mt6358_regulator= s[] =3D { > MT6358_LDO_VCAMA1_CON0, 0, MT6358_VCAMA1_ANA_CON0, 0xf00), > MT6358_LDO("ldo_vemc", VEMC, vmch_vemc_voltages, vmch_vemc_idx, > MT6358_LDO_VEMC_CON0, 0, MT6358_VEMC_ANA_CON0, 0x700), > - MT6358_LDO("ldo_vcn33_bt", VCN33_BT, vcn33_bt_wifi_voltages, > - vcn33_bt_wifi_idx, MT6358_LDO_VCN33_CON0_0, > - 0, MT6358_VCN33_ANA_CON0, 0x300), > - MT6358_LDO("ldo_vcn33_wifi", VCN33_WIFI, vcn33_bt_wifi_voltages, > - vcn33_bt_wifi_idx, MT6358_LDO_VCN33_CON0_1, > - 0, MT6358_VCN33_ANA_CON0, 0x300), > + MT6358_LDO("ldo_vcn33", VCN33, vcn33_voltages, vcn33_idx, > + MT6358_LDO_VCN33_CON0_0, 0, MT6358_VCN33_ANA_CON0, 0x300), Excuse me if I am being daft here, but could you explain how this change is compatible with existing devicetrees? Thanks, Conor. --T+MxQ7SbKoVjteRl Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZINLlAAKCRB4tDGHoIJi 0hc0APoD4n3DH6dCcYO0STxD8ItqnpeAbuJrfOHQaaItXKlm7gD9HgNapaxBYCau 9GrvWUDp8b42402vX7pth4xpW08aIgw= =TL4I -----END PGP SIGNATURE----- --T+MxQ7SbKoVjteRl--