Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 352BFC433EF for ; Mon, 10 Jan 2022 14:12:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235331AbiAJOMf (ORCPT ); Mon, 10 Jan 2022 09:12:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235309AbiAJOMa (ORCPT ); Mon, 10 Jan 2022 09:12:30 -0500 Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com [IPv6:2607:f8b0:4864:20::734]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 215E3C061748 for ; Mon, 10 Jan 2022 06:12:30 -0800 (PST) Received: by mail-qk1-x734.google.com with SMTP id t66so14920907qkb.4 for ; Mon, 10 Jan 2022 06:12:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4DQvnQ3Cgyp1i2b8VzPQ4ffSeU79jX0QQNrlOvytV+k=; b=OUoKQA5Bq99RZPfc/HvGf3IC0D0ABjqCwC4nhlM5NAzpqqcuigYGd2HXdBYHHsC9sG iK9MHGCKPpDTicEzbuKas1BW+7NlK5CttyrOGXV2O9hE/9CmP780h/Qr8WZzGY6m29xf xBQjrx7OzvS/2SMa3KpRiXvuJ+eZlhfnwAKEcFGlBG1kdSJ/M4S/oqatBIdq9C6ufCfp OMhkMCm7mM5YPt2QFK0gXY6mfj9JU1atLPNdpibcHx75wcKvggfl2hj1u17ww/f7nXDG 1ZfE/83az1RzrQI1DH4o5qquWTFw0CRNkEA2MjWyVMuliSpZ0Mtr3VyUjIiX7mrJhYUq ZXOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4DQvnQ3Cgyp1i2b8VzPQ4ffSeU79jX0QQNrlOvytV+k=; b=Axjv6UdTYezwYdXiP7v2UzdIu5fqJpkJPbBbZcUmqaTkCRDvvZ1TlS37nzvuG7aphH /kZzaWg6IQWgQBwfNcwSd4c9sOXqtGkYiImRj0AuXEb2LTf9pKZXnHDcGGP6lQByUx9b LYv+pwruLWy5lqje8wZKKLmdlhoAZEeCbVxEoBQDZRDuoL2ZW6ScQvSaDgb/g6SyN5/l VvjtcKEWYOZTPAgtxoAkKy9bNQi9odFNDSh8hnNBqFaCEt3779zOEoYtx6GfJsXVu6HL j3wmuNaZOtiUYVXtdeXh4UjW6t8ljETgGb34/e5MV+f6bLqRu/mkr/OUD5oyNo7MxZru luRQ== X-Gm-Message-State: AOAM530NzqKCYRHfXSmrsokowrzSJRq/4JunpmqWJTet8UF++k5InDH8 qHHN2RvIWGbzwB5d/0UOZS9+LkcETPfavmigq9UCBz+ln+c= X-Google-Smtp-Source: ABdhPJwc8URm7uyLRQ1JKPTzT8ft0eFiJWdpt88+kIZ845z3s0s9BABfuWZHZDyFD3Yj2xexfrVnVs0bMA5zP14V0ow= X-Received: by 2002:a05:620a:1e1:: with SMTP id x1mr11386078qkn.363.1641823948169; Mon, 10 Jan 2022 06:12:28 -0800 (PST) MIME-Version: 1.0 References: <1641819337-17037-1-git-send-email-quic_rajeevny@quicinc.com> <1641819337-17037-3-git-send-email-quic_rajeevny@quicinc.com> In-Reply-To: <1641819337-17037-3-git-send-email-quic_rajeevny@quicinc.com> From: Dmitry Baryshkov Date: Mon, 10 Jan 2022 17:12:17 +0300 Message-ID: Subject: Re: [v2 2/3] drm/msm/dsi: Add dsi phy tuning configuration support To: Rajeev Nandan Cc: dri-devel@lists.freedesktop.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, sean@poorly.run, robdclark@gmail.com, robh+dt@kernel.org, robh@kernel.org, quic_abhinavk@quicinc.com, quic_kalyant@quicinc.com, quic_mkrishn@quicinc.com, jonathan@marek.ca, airlied@linux.ie, daniel@ffwll.ch, swboyd@chromium.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 10 Jan 2022 at 15:56, Rajeev Nandan wrote: > > Add support for MSM DSI PHY tuning configuration. Current design is > to support drive strength and drive level/amplitude tuning for > 10nm PHY version, but this can be extended to other PHY versions. > > Signed-off-by: Rajeev Nandan > --- > > Changes in v2: > - New. > - Split into generic code and 10nm-specific part (Dmitry Baryshkov) > > drivers/gpu/drm/msm/dsi/phy/dsi_phy.c | 3 +++ > drivers/gpu/drm/msm/dsi/phy/dsi_phy.h | 16 ++++++++++++++++ > 2 files changed, 19 insertions(+) > > diff --git a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c > index 8c65ef6..ee3739d 100644 > --- a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c > +++ b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.c > @@ -739,6 +739,9 @@ static int dsi_phy_driver_probe(struct platform_device *pdev) > } > } > > + if (phy->cfg->ops.tuning_cfg_init) > + phy->cfg->ops.tuning_cfg_init(phy); Please rename to parse_dt_properties() or something like that. > + > ret = dsi_phy_regulator_init(phy); > if (ret) > goto fail; > diff --git a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.h b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.h > index b91303a..b559a2b 100644 > --- a/drivers/gpu/drm/msm/dsi/phy/dsi_phy.h > +++ b/drivers/gpu/drm/msm/dsi/phy/dsi_phy.h > @@ -25,6 +25,7 @@ struct msm_dsi_phy_ops { > void (*save_pll_state)(struct msm_dsi_phy *phy); > int (*restore_pll_state)(struct msm_dsi_phy *phy); > bool (*set_continuous_clock)(struct msm_dsi_phy *phy, bool enable); > + void (*tuning_cfg_init)(struct msm_dsi_phy *phy); > }; > > struct msm_dsi_phy_cfg { > @@ -81,6 +82,20 @@ struct msm_dsi_dphy_timing { > #define DSI_PIXEL_PLL_CLK 1 > #define NUM_PROVIDED_CLKS 2 > > +#define DSI_LANE_MAX 5 > + > +/** > + * struct msm_dsi_phy_tuning_cfg - Holds PHY tuning config parameters. > + * @rescode_offset_top: Offset for pull-up legs rescode. > + * @rescode_offset_bot: Offset for pull-down legs rescode. > + * @vreg_ctrl: vreg ctrl to drive LDO level > + */ > +struct msm_dsi_phy_tuning_cfg { > + u8 rescode_offset_top[DSI_LANE_MAX]; > + u8 rescode_offset_bot[DSI_LANE_MAX]; > + u8 vreg_ctrl; > +}; How generic is this? In other words, you are adding a struct with the generic name to the generic structure. I'd expect that it would be common to several PHY generations. > + > struct msm_dsi_phy { > struct platform_device *pdev; > void __iomem *base; > @@ -98,6 +113,7 @@ struct msm_dsi_phy { > > struct msm_dsi_dphy_timing timing; > const struct msm_dsi_phy_cfg *cfg; > + struct msm_dsi_phy_tuning_cfg tuning_cfg; > > enum msm_dsi_phy_usecase usecase; > bool regulator_ldo_mode; > -- > 2.7.4 > -- With best wishes Dmitry