Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp6339334rwr; Tue, 9 May 2023 13:48:33 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7W4n84dDcaVB6iV52JsmEscAO62S9E0dDs78HLtd4qP/6UeZa4nMaujvusxPW4JMcAfwid X-Received: by 2002:a17:902:b405:b0:1a5:a1b:bbd8 with SMTP id x5-20020a170902b40500b001a50a1bbbd8mr14162735plr.45.1683665313105; Tue, 09 May 2023 13:48:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683665313; cv=none; d=google.com; s=arc-20160816; b=AruvZgrxVHv/7LG0APFOh4QHysiUEYMn2MAk/aRboDI8HxTqa8KfkVFf5pH+jecP2i CZo0wJiojNMuNpyiPATVOoXUKUeXGAAQMhgVHvexSTs5fhL3dnGEf6jEg0rZPRqQaRXn o9SLpiOwOjJLxm9kKUhBOC2anTOLrOoL8AMpOdLPQ0YYCSSMDzcVKPJcXz2ezEGAwG4p zckepVCyiyi6Wb/HiFb3LcEgAQaNk1fKG6OoZhxbIynhL0RHJAGm6Lq/L/DXZ10Bg84V hdn//92JAz//LJF8HM4xr1e+uYf8y3K/K4RJQ6iJHrGFRePdzfEIqVIV4w93WwpW88oY 6UMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=KP7rmZOvJCmCpfoX+ax0Qp6p7fblxM/RetTiw2ZGEU0=; b=mLy7YBiGbuSt6e96g2BRsfepVKoIzKfH09+dli35eIV/xGhYc0+Jns2ZQCHnGWDCdL eUCkjL084K/dwcA6/4fOpz+IWfIDPE6IMJuo7db6Wy62GtgwZAZHTTig4sryVk9e+DAu dnn/P3fbu8JwGhdX5Mjf82+lsll0fMH7h1iNq6aZ6X91XNXKZ41CJOfDGBeG/m0Tqtq2 jOWq9raSuWllqnsq0H9XlXUSJNTlu7ToJVD3Y/xgthmouO/kOZ+JlgkTeBXNep7gcmL4 mlGwZIG3q54iY5H29xx3dVFEZz81QTHlDmzxYO0jL6mz+Axebxlwr7bzu0dovAi3s59M 7oig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=zhDJ8rgk; 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=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u4-20020a17090341c400b001a96b39bb35si2502270ple.439.2023.05.09.13.48.20; Tue, 09 May 2023 13:48:33 -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=@linaro.org header.s=google header.b=zhDJ8rgk; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230119AbjEIUdn (ORCPT + 99 others); Tue, 9 May 2023 16:33:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229543AbjEIUdm (ORCPT ); Tue, 9 May 2023 16:33:42 -0400 Received: from mail-yw1-x112c.google.com (mail-yw1-x112c.google.com [IPv6:2607:f8b0:4864:20::112c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2832940E0 for ; Tue, 9 May 2023 13:33:40 -0700 (PDT) Received: by mail-yw1-x112c.google.com with SMTP id 00721157ae682-55a2cb9788dso93858267b3.2 for ; Tue, 09 May 2023 13:33:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1683664419; x=1686256419; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=KP7rmZOvJCmCpfoX+ax0Qp6p7fblxM/RetTiw2ZGEU0=; b=zhDJ8rgk00ZwGuAI3zgrRweoHBmO5cUTD9RRmc5hk+BThEdXbM8yUsUw75Qbr6YQ5T aZiGsapTpjFDhckEGQB/gUB1c7Uc9pzdThgULUKowYzcvvSY5fdUOngR8OGtOUpoeJuq pji77qHC/lWdgdiL3gykZtbP3iL+ZPqvcPLoLPxVwMxGxQneSJLdOMIEeiti9TVZi9JI 42wZpWXfXWiCOmJCBO+AH0dIKIQkp10n+M0UUSOEgnq4R+JtwvPVHi1vy+X1/oMX1Qsg pot3LPTWZNONTqkfeD+HUzrYc5cpWJmvsV5qjNtqrOgj06DcGCugfBv+tDAe5OHC5JkU GYiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683664419; x=1686256419; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=KP7rmZOvJCmCpfoX+ax0Qp6p7fblxM/RetTiw2ZGEU0=; b=MvdsGZO2f0+XABPFdKMDzmd/N2GTKmcONi83VZ20Bt31P8B03UVv3SJyCsV24ni3pf 8RBADhJrf62Z5YueOSZqVZAFppr6bNQXi4xTtJqvrX/f2O2Ze97sozSkNr/Dm96HstW1 R7Tz00iQxFlcGI5gOfibZ9knLHsvaTvql4REwxdoTWzBxPR8C8W7mEb8vY5tm4RL9efU lNCHzpG6YFJW/6MWHkrpZzHjdkc1Ht+Onrj7ZN90qdH5zt9TO96/wLqdn4i7vfz2xHXQ xtet7qyHDOfgdC1eseCJq0GAC/VIETsGq2oBP+Ve6B82K6UEZlXeUSiEF/B5++YhJ9OW DyKQ== X-Gm-Message-State: AC+VfDzuIPEVeE+3/nTSgpJtshSabFX0BI1FjGoL5/J2yNy4vzxVt4ar 3Tr4Q0hEVeKYVmH2Q3z8CJs+OCummcchUtVVzT+WOg== X-Received: by 2002:a25:6943:0:b0:b9d:853e:5cef with SMTP id e64-20020a256943000000b00b9d853e5cefmr19297675ybc.37.1683664419340; Tue, 09 May 2023 13:33:39 -0700 (PDT) MIME-Version: 1.0 References: <20230509172148.7627-1-quic_tdas@quicinc.com> <20230509172148.7627-3-quic_tdas@quicinc.com> In-Reply-To: <20230509172148.7627-3-quic_tdas@quicinc.com> From: Dmitry Baryshkov Date: Tue, 9 May 2023 23:33:28 +0300 Message-ID: Subject: Re: [PATCH V4 2/3] clk: qcom: videocc-sm8450: Add video clock controller driver for SM8450 To: Taniya Das Cc: Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Andy Gross , Michael Turquette , Bjorn Andersson , Konrad Dybcio , linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, quic_skakitap@quicinc.com, quic_jkona@quicinc.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable 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 Tue, 9 May 2023 at 20:22, Taniya Das wrote: > > Add support for the video clock controller driver for peripheral clock > clients to be able to request for video cc clocks. > > Signed-off-by: Taniya Das > --- > Changes since V3: > - Use lower case hex. > - Check the return value here and bail out early on failure in probe. > > Changes since V2: > - Update the header file name to match the latest upstream header > files. > > Changes since V1: > - Use DT indices instead of fw_name. > - Replace pm_runtime_enable with devm_pm_runtime_enable. > - Change license to GPL from GPL V2. > > drivers/clk/qcom/Kconfig | 9 + > drivers/clk/qcom/Makefile | 1 + > drivers/clk/qcom/videocc-sm8450.c | 461 ++++++++++++++++++++++++++++++ > 3 files changed, 471 insertions(+) > create mode 100644 drivers/clk/qcom/videocc-sm8450.c [skipped] > +static const struct qcom_reset_map video_cc_sm8450_resets[] = { > + [CVP_VIDEO_CC_INTERFACE_BCR] = { 0x80e0 }, > + [CVP_VIDEO_CC_MVS0_BCR] = { 0x8098 }, > + [CVP_VIDEO_CC_MVS0C_BCR] = { 0x8048 }, > + [CVP_VIDEO_CC_MVS1_BCR] = { 0x80bc }, > + [CVP_VIDEO_CC_MVS1C_BCR] = { 0x8070 }, Can we have a common VIDEO_CC prefix here please? > + [VIDEO_CC_MVS0C_CLK_ARES] = { 0x8064, 2 }, > + [VIDEO_CC_MVS1C_CLK_ARES] = { 0x808c, 2 }, > +}; > + > +static const struct regmap_config video_cc_sm8450_regmap_config = { > + .reg_bits = 32, > + .reg_stride = 4, > + .val_bits = 32, > + .max_register = 0x9f4c, > + .fast_io = true, > +}; > + > +static struct qcom_cc_desc video_cc_sm8450_desc = { > + .config = &video_cc_sm8450_regmap_config, > + .clks = video_cc_sm8450_clocks, > + .num_clks = ARRAY_SIZE(video_cc_sm8450_clocks), > + .resets = video_cc_sm8450_resets, > + .num_resets = ARRAY_SIZE(video_cc_sm8450_resets), > + .gdscs = video_cc_sm8450_gdscs, > + .num_gdscs = ARRAY_SIZE(video_cc_sm8450_gdscs), > +}; > + > +static const struct of_device_id video_cc_sm8450_match_table[] = { > + { .compatible = "qcom,sm8450-videocc" }, > + { } > +}; > +MODULE_DEVICE_TABLE(of, video_cc_sm8450_match_table); > + > +static int video_cc_sm8450_probe(struct platform_device *pdev) > +{ > + struct regmap *regmap; > + int ret; > + > + ret = devm_pm_runtime_enable(&pdev->dev); > + if (ret) > + return ret; > + > + ret = pm_runtime_resume_and_get(&pdev->dev); > + if (ret) > + return ret; > + > + regmap = qcom_cc_map(pdev, &video_cc_sm8450_desc); > + if (IS_ERR(regmap)) { > + pm_runtime_put(&pdev->dev); > + return PTR_ERR(regmap); > + } > + > + clk_lucid_evo_pll_configure(&video_cc_pll0, regmap, &video_cc_pll0_config); > + clk_lucid_evo_pll_configure(&video_cc_pll1, regmap, &video_cc_pll1_config); > + > + /* > + * Keep clocks always enabled: > + * video_cc_ahb_clk > + * video_cc_sleep_clk > + * video_cc_xo_clk > + */ > + regmap_update_bits(regmap, 0x80e4, BIT(0), BIT(0)); > + regmap_update_bits(regmap, 0x8130, BIT(0), BIT(0)); > + regmap_update_bits(regmap, 0x8114, BIT(0), BIT(0)); > + > + ret = qcom_cc_really_probe(pdev, &video_cc_sm8450_desc, regmap); > + > + pm_runtime_put(&pdev->dev); > + > + return ret; > +} > + > +static struct platform_driver video_cc_sm8450_driver = { > + .probe = video_cc_sm8450_probe, > + .driver = { > + .name = "video_cc-sm8450", > + .of_match_table = video_cc_sm8450_match_table, > + }, > +}; > + > +static int __init video_cc_sm8450_init(void) > +{ > + return platform_driver_register(&video_cc_sm8450_driver); > +} > +subsys_initcall(video_cc_sm8450_init); > + > +static void __exit video_cc_sm8450_exit(void) > +{ > + platform_driver_unregister(&video_cc_sm8450_driver); > +} > +module_exit(video_cc_sm8450_exit); module_platform_driver() ? > + > +MODULE_DESCRIPTION("QTI VIDEO_CC SM8450 Driver"); > +MODULE_LICENSE("GPL"); > -- > 2.17.1 > -- With best wishes Dmitry