Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp551317rdg; Thu, 12 Oct 2023 13:24:55 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHshqDXD1NElmm4hDUZbonzlrPAoDfKUcAwnFueFRytO9WlHhrTLr4D8ZRQ+2tKm54FRF5k X-Received: by 2002:a05:6a00:1592:b0:68f:cf6f:e212 with SMTP id u18-20020a056a00159200b0068fcf6fe212mr24779134pfk.20.1697142295183; Thu, 12 Oct 2023 13:24:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697142295; cv=none; d=google.com; s=arc-20160816; b=M9QpYNyXcwPm6GZTL9c/Bl5i3aVk93Nkw+M/Pg9SrfJAt8gVibydXLuzQprNt0+E+7 GsMdvVZjw72Cn816TFMDT1BqnaywLCxapjXOcJHjgCPMrGxbOKp3Df6WfCQKZEkhibRr Btc4gdt46eiEb1zvGVduSHJr22Gmy6EEmt1urPp+mbydrvx+/LVf8WwTsgIBudukMOFo 7Oc+58nPhphmkP8IRIDrPItRk3TSIUFgiJv5tXtMMwP3tjJ1tMy00soqtb+kIthbTius RGvYsbmKOQkwkpQPW/dMEfXEpzS1hS77s1dL/n1J5gXIEiOg/caJ96Ka/lKToFbZp4C7 CT6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:date:to:cc:from:subject:references :in-reply-to:content-transfer-encoding:mime-version:message-id :dkim-signature; bh=83xweDvryRXfxdxvgGcPg+FECWvkmQpfwSlOgtmN0mI=; fh=4DTDp4dhOpPZMHhcQ5OVSkSXKC3IgLpnoet50AkPszk=; b=ThWI6Utnphc3VHvAmLdtA08zHgtIezNV1HfHnZ0SxdlCkH0rozJtgiH7kl39a0fspQ aSHfxLXhPKZcpZOuzwOVxy4U/zq611jwaFvDSR2y9Xmgc3RLknqVUqXwmiRH69rOZPRx qEZFKJSPn1YshhgixIMBMw8sReSOMX7XTI6hxs0V1RH777UU6G+LK3ygNZ2J197DW/Ht ZzGHvtWniUXtGPlDqEVt7HX2lNmcGBL9CpfCGH9caOJZmFUWBBt6eDZMhhNdnnXWVdbJ Ghs8564BBzl/NMZ3DSmRCNQbF2LVi7InuPTlUM/d4eoZPw8ZMmVTb7J+076if6LX2ojn NPWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=g0OQJ9K4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id a21-20020a630b55000000b005578c6a7672si3069271pgl.90.2023.10.12.13.24.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 13:24:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=g0OQJ9K4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 4F03482E7506; Thu, 12 Oct 2023 13:24:54 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442760AbjJLUYt (ORCPT + 99 others); Thu, 12 Oct 2023 16:24:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1442679AbjJLUYs (ORCPT ); Thu, 12 Oct 2023 16:24:48 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4634ECF; Thu, 12 Oct 2023 13:24:45 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D34CAC433C7; Thu, 12 Oct 2023 20:24:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697142284; bh=2MF86sytX4fTZh0mQJESXVz65SbrM4mAf50g6EPGAGE=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=g0OQJ9K4UECZWSfUIe4ERxixLwb2xg8590fKPYaqH/6dL3LcSejut5Z633jLleNGT Xq0gL5XPBf1GODOb4nZEkRFykpDAcRUdMh0vRqMqntw8djf48L9xEr+KDEhYd47ee2 NnQmEaDZ19xHh7vVSxZlNwcqzyP4X4oSxEsxschiglljNmuA78asTgl3JL74Lx0PBH g55M00+m/GdiDQBGWhF2vaIHFYd/paULQ+UzhL1SFwp7yiapiRsq6GdZzcLshZ+l98 a5GRlKJUVg5G6E5EeEmbY6EsmbwINBXcpd34Dv4XHWaiwkrjmOsRxpdhR8mKsL8D6M TdNtxsp/Aiscw== Message-ID: <9888cc31bca1e1e148e3a0e4be4a0b5d.sboyd@kernel.org> Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20231011090028.1706653-3-quic_imrashai@quicinc.com> References: <20231011090028.1706653-1-quic_imrashai@quicinc.com> <20231011090028.1706653-3-quic_imrashai@quicinc.com> Subject: Re: [PATCH V2 2/4] clk: qcom: branch: Add mem ops support for branch2 clocks From: Stephen Boyd Cc: Taniya Das , Imran Shaik , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Ajit Pandey , Jagadeesh Kona To: Andy Gross , Bjorn Andersson , Conor Dooley , Imran Shaik , Konrad Dybcio , Krzysztof Kozlowski , Michael Turquette , Rob Herring Date: Thu, 12 Oct 2023 13:24:42 -0700 User-Agent: alot/0.10 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 12 Oct 2023 13:24:54 -0700 (PDT) Quoting Imran Shaik (2023-10-11 02:00:26) > diff --git a/drivers/clk/qcom/clk-branch.c b/drivers/clk/qcom/clk-branch.c > index fc4735f74f0f..9ac8d04b425a 100644 > --- a/drivers/clk/qcom/clk-branch.c > +++ b/drivers/clk/qcom/clk-branch.c > @@ -134,6 +135,42 @@ static void clk_branch2_disable(struct clk_hw *hw) > clk_branch_toggle(hw, false, clk_branch2_check_halt); > } > =20 > +static int clk_branch2_mem_enable(struct clk_hw *hw) > +{ > + struct clk_mem_branch *mem_br =3D to_clk_mem_branch(hw); > + const char *name =3D clk_hw_get_name(&mem_br->branch.clkr.hw); > + u32 val; > + int timeout =3D 200, ret; const int timeout? > + > + regmap_update_bits(mem_br->branch.clkr.regmap, mem_br->mem_enable= _reg, > + mem_br->mem_enable_ack_bit, mem_br->mem_enable_ac= k_bit); > + > + ret =3D regmap_read_poll_timeout(mem_br->branch.clkr.regmap, mem_= br->mem_ack_reg, > + val, val & mem_br->mem_enable_ack_bit, 0, timeout= ); The 'mem_br->branch' is used a few times so please make another local variable for that called 'branch'. > + if (ret) { > + WARN(1, "%s mem enable failed", name); Needs a newline on the message string. > + return ret; > + } > + > + return clk_branch2_enable(hw); > +} > + > +static void clk_branch2_mem_disable(struct clk_hw *hw) > +{ > + struct clk_mem_branch *mem_br =3D to_clk_mem_branch(hw); > + > + regmap_update_bits(mem_br->branch.clkr.regmap, mem_br->mem_enable= _reg, > + mem_br->mem_enable_ack_bi= t, 0); Please add a newline here. > + return clk_branch2_disable(hw); > +} > +