disp: msm: dsi: rework DSI PLL to be configured within PHY
Change avoids clock framework APIs to configure the DSI PHY PLL. It follows HW recommendation to set the byte and pclk dividers. Change-Id: I8c110f3997e4ec4c2eaa28778b70091855725ab8 Signed-off-by: Satya Rama Aditya Pinapala <psraditya30@codeaurora.org>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
// SPDX-License-Identifier: GPL-2.0-only
|
||||
/*
|
||||
* Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
|
||||
*/
|
||||
|
||||
#include <linux/of_device.h>
|
||||
@@ -461,6 +461,14 @@ static int dsi_phy_driver_probe(struct platform_device *pdev)
|
||||
goto fail_settings;
|
||||
}
|
||||
|
||||
rc = dsi_catalog_phy_pll_setup(&dsi_phy->hw,
|
||||
dsi_phy->pll->pll_revision);
|
||||
if (rc) {
|
||||
DSI_PHY_ERR(dsi_phy, "Catalog does not support PLL version (%d)\n",
|
||||
dsi_phy->pll->pll_revision);
|
||||
goto fail_settings;
|
||||
}
|
||||
|
||||
item->phy = dsi_phy;
|
||||
|
||||
mutex_lock(&dsi_phy_list_lock);
|
||||
@@ -760,6 +768,45 @@ error:
|
||||
return rc;
|
||||
}
|
||||
|
||||
/**
|
||||
* dsi_phy_configure() - Configure DSI PHY PLL
|
||||
* @dsi_phy: DSI PHY handle.
|
||||
* @commit: boolean to specify if calculated PHY configuration
|
||||
* needs to be committed. Set to false in case of
|
||||
* dynamic clock switch.
|
||||
*
|
||||
* Return: error code.
|
||||
*/
|
||||
int dsi_phy_configure(struct msm_dsi_phy *phy, bool commit)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
phy->pll->type = phy->cfg.phy_type;
|
||||
phy->pll->bpp = dsi_pixel_format_to_bpp(phy->dst_format);
|
||||
phy->pll->lanes = dsi_get_num_of_data_lanes(phy->data_lanes);
|
||||
if (phy->hw.ops.configure)
|
||||
rc = phy->hw.ops.configure(phy->pll, commit);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
/**
|
||||
* dsi_phy_pll_toggle() - Toggle DSI PHY PLL
|
||||
* @dsi_phy: DSI PHY handle.
|
||||
* @prepare: specifies if PLL needs to be turned on or not.
|
||||
*
|
||||
* Return: error code.
|
||||
*/
|
||||
int dsi_phy_pll_toggle(struct msm_dsi_phy *phy, bool prepare)
|
||||
{
|
||||
int rc = 0;
|
||||
|
||||
if (phy->hw.ops.pll_toggle)
|
||||
rc = phy->hw.ops.pll_toggle(phy->pll, prepare);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
static int dsi_phy_enable_ulps(struct msm_dsi_phy *phy,
|
||||
struct dsi_host_config *config, bool clamp_enabled)
|
||||
{
|
||||
|
Reference in New Issue
Block a user