summaryrefslogtreecommitdiff
path: root/drivers/video
diff options
context:
space:
mode:
authorFancy Fang <chen.fang@nxp.com>2017-12-14 15:21:31 +0800
committerJason Liu <jason.hui.liu@nxp.com>2019-02-12 10:29:58 +0800
commitcf0ef4ced6887938db68f05f5b6d3c2024200b72 (patch)
tree68fe69d830041b3108363327a29f73fa8da89e28 /drivers/video
parentb87e4655dd321cc2d457908f46f84ba36a4077b6 (diff)
MLK-17215-3 video: fbdev: mipi_dsi_northwest: refine 'phy-ref-clkfreq' get to support all socs
Move the code slice of getting 'phy-ref-clkfreq' property to probe function to support arm32 socs besides arm64. Signed-off-by: Fancy Fang <chen.fang@nxp.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/fbdev/mxc/mipi_dsi_northwest.c29
1 files changed, 15 insertions, 14 deletions
diff --git a/drivers/video/fbdev/mxc/mipi_dsi_northwest.c b/drivers/video/fbdev/mxc/mipi_dsi_northwest.c
index 2b9061cd8db0..77b3cc3149a5 100644
--- a/drivers/video/fbdev/mxc/mipi_dsi_northwest.c
+++ b/drivers/video/fbdev/mxc/mipi_dsi_northwest.c
@@ -1166,7 +1166,6 @@ static irqreturn_t mipi_dsi_irq_handler(int irq, void *data)
static int dsi_clks_init(struct mipi_dsi_info *minfo)
{
int ret = 0;
- uint32_t phy_ref_clkfreq;
struct platform_device *pdev = minfo->pdev;
struct device_node *np = pdev->dev.of_node;
@@ -1185,20 +1184,8 @@ static int dsi_clks_init(struct mipi_dsi_info *minfo)
minfo->dbi_clk = devm_clk_get(&pdev->dev, "dbi");
BUG_ON(IS_ERR(minfo->dbi_clk));
- ret = of_property_read_u32(np, "phy-ref-clkfreq",
- &phy_ref_clkfreq);
- if (ret < 0) {
- dev_err(&pdev->dev, "failed to get phy reference clock rate\n");
- return -EINVAL;
- }
- if (phy_ref_clkfreq < 24000000 || phy_ref_clkfreq > 200000000) {
- dev_err(&pdev->dev, "invalid phy reference clock rate\n");
- return -EINVAL;
- }
- minfo->phy_ref_clkfreq = phy_ref_clkfreq;
-
- ret = clk_set_rate(minfo->phy_ref_clk, phy_ref_clkfreq);
+ ret = clk_set_rate(minfo->phy_ref_clk, minfo->phy_ref_clkfreq);
if (ret < 0) {
dev_err(&pdev->dev, "set phy_ref clock rate failed\n");
goto out;
@@ -1245,6 +1232,7 @@ static int mipi_dsi_probe(struct platform_device *pdev)
const char *lcd_panel;
int ret = 0;
u32 vmode_index;
+ uint32_t phy_ref_clkfreq;
mipi_dsi = devm_kzalloc(&pdev->dev, sizeof(*mipi_dsi), GFP_KERNEL);
if (!mipi_dsi)
@@ -1275,6 +1263,19 @@ static int mipi_dsi_probe(struct platform_device *pdev)
return ret;
}
+ ret = of_property_read_u32(np, "phy-ref-clkfreq",
+ &phy_ref_clkfreq);
+ if (ret < 0) {
+ dev_err(&pdev->dev, "failed to get phy reference clock rate\n");
+ return -EINVAL;
+ }
+
+ if (phy_ref_clkfreq < 24000000 || phy_ref_clkfreq > 200000000) {
+ dev_err(&pdev->dev, "invalid phy reference clock rate\n");
+ return -EINVAL;
+ }
+ mipi_dsi->phy_ref_clkfreq = phy_ref_clkfreq;
+
#ifdef CONFIG_FB_IMX64
dsi_clks_init(mipi_dsi);