summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSylwester Nawrocki <s.nawrocki@samsung.com>2013-04-04 14:13:51 +0200
committerChanho Park <chanho61.park@samsung.com>2014-11-18 11:44:40 +0900
commit94501304906e31ab5e00343dc1658cdd24068fd0 (patch)
tree95b190ba528becfbcf51276a2cae6696e8777eb2
parentafe5a0aaa680afcc39729291b7658eb77b46f475 (diff)
downloadlinux-3.10-94501304906e31ab5e00343dc1658cdd24068fd0.tar.gz
linux-3.10-94501304906e31ab5e00343dc1658cdd24068fd0.tar.bz2
linux-3.10-94501304906e31ab5e00343dc1658cdd24068fd0.zip
video: exynos_dsi: Use generic PHY driver
Use the generic PHY API instead of the platform callback to control the MIPI DSIM DPHY. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> --- Changes since v4: - updated to latest version of the PHY framework - removed PHY labels.
-rw-r--r--drivers/video/display/source-exynos_dsi.c36
-rw-r--r--drivers/video/exynos/exynos_mipi_dsi.c2
-rw-r--r--include/video/exynos_dsi.h5
-rw-r--r--include/video/exynos_mipi_dsim.h5
4 files changed, 13 insertions, 35 deletions
diff --git a/drivers/video/display/source-exynos_dsi.c b/drivers/video/display/source-exynos_dsi.c
index d7094f4e4f7..d36162f66b1 100644
--- a/drivers/video/display/source-exynos_dsi.c
+++ b/drivers/video/display/source-exynos_dsi.c
@@ -24,6 +24,7 @@
#include <linux/mm.h>
#include <linux/module.h>
#include <linux/of.h>
+#include <linux/phy/phy.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
#include <linux/regulator/consumer.h>
@@ -219,6 +220,7 @@ struct exynos_dsi {
bool enabled;
struct platform_device *pdev;
+ struct phy *phy;
struct device *dev;
struct resource *res;
struct clk *pll_clk;
@@ -816,6 +818,7 @@ again:
static bool exynos_dsi_transfer_finish(struct exynos_dsi *dsi)
{
+ static unsigned long j;
struct exynos_dsi_transfer *xfer;
unsigned long flags;
bool start = true;
@@ -824,7 +827,8 @@ static bool exynos_dsi_transfer_finish(struct exynos_dsi *dsi)
if (list_empty(&dsi->transfer_list)) {
spin_unlock_irqrestore(&dsi->transfer_lock, flags);
- dev_warn(dsi->dev, "unexpected TX/RX interrupt\n");
+ if (printk_timed_ratelimit(&j, 500))
+ dev_warn(dsi->dev, "unexpected TX/RX interrupt\n");
return false;
}
@@ -996,8 +1000,7 @@ static int exynos_dsi_enable(struct video_source *src)
clk_prepare_enable(dsi->bus_clk);
clk_prepare_enable(dsi->pll_clk);
- if (dsi->pd->phy_enable)
- dsi->pd->phy_enable(dsi->pdev, true);
+ phy_power_on(dsi->phy);
exynos_dsi_reset(dsi);
exynos_dsi_init_link(dsi);
@@ -1022,8 +1025,7 @@ static int exynos_dsi_disable(struct video_source *src)
exynos_dsi_disable_clock(dsi);
- if (dsi->pd->phy_enable)
- dsi->pd->phy_enable(dsi->pdev, false);
+ phy_power_off(dsi->phy);
clk_disable_unprepare(dsi->pll_clk);
clk_disable_unprepare(dsi->bus_clk);
@@ -1104,12 +1106,6 @@ static const struct dsi_video_source_ops exynos_dsi_ops = {
* Device Tree
*/
-static int (* const of_phy_enables[])(struct platform_device *, bool) = {
-#ifdef CONFIG_S5P_SETUP_MIPIPHY
- [0] = s5p_dsim_phy_enable,
-#endif
-};
-
static struct exynos_dsi_platform_data *exynos_dsi_parse_dt(
struct platform_device *pdev)
{
@@ -1117,7 +1113,6 @@ static struct exynos_dsi_platform_data *exynos_dsi_parse_dt(
struct exynos_dsi_platform_data *dsi_pd;
struct device *dev = &pdev->dev;
const __be32 *prop_data;
- u32 val;
dsi_pd = kzalloc(sizeof(*dsi_pd), GFP_KERNEL);
if (!dsi_pd) {
@@ -1125,19 +1120,6 @@ static struct exynos_dsi_platform_data *exynos_dsi_parse_dt(
return NULL;
}
- prop_data = of_get_property(node, "samsung,phy-type", NULL);
- if (!prop_data) {
- dev_err(dev, "failed to get phy-type property\n");
- goto err_free_pd;
- }
-
- val = be32_to_cpu(*prop_data);
- if (val >= ARRAY_SIZE(of_phy_enables) || !of_phy_enables[val]) {
- dev_err(dev, "Invalid phy-type %u\n", val);
- goto err_free_pd;
- }
- dsi_pd->phy_enable = of_phy_enables[val];
-
prop_data = of_get_property(node, "samsung,pll-stable-time", NULL);
if (!prop_data) {
dev_err(dev, "failed to get pll-stable-time property\n");
@@ -1259,6 +1241,10 @@ static int exynos_dsi_probe(struct platform_device *pdev)
return -ENOMEM;
}
+ dsi->phy = devm_phy_get(&pdev->dev, "dsim");
+ if (IS_ERR(dsi->phy))
+ return PTR_ERR(dsi->phy);
+
platform_set_drvdata(pdev, dsi);
dsi->irq = platform_get_irq(pdev, 0);
diff --git a/drivers/video/exynos/exynos_mipi_dsi.c b/drivers/video/exynos/exynos_mipi_dsi.c
index 248e4442c28..00b3a52c1d6 100644
--- a/drivers/video/exynos/exynos_mipi_dsi.c
+++ b/drivers/video/exynos/exynos_mipi_dsi.c
@@ -373,7 +373,7 @@ static int exynos_mipi_dsi_probe(struct platform_device *pdev)
return ret;
}
- dsim->phy = devm_phy_get(&pdev->dev, dsim_pd->phy_label);
+ dsim->phy = devm_phy_get(&pdev->dev, "dsim");
if (IS_ERR(dsim->phy))
return PTR_ERR(dsim->phy);
diff --git a/include/video/exynos_dsi.h b/include/video/exynos_dsi.h
index 95e1568be20..5c062c75beb 100644
--- a/include/video/exynos_dsi.h
+++ b/include/video/exynos_dsi.h
@@ -25,9 +25,6 @@
*/
struct exynos_dsi_platform_data {
unsigned int enabled;
-
- int (*phy_enable)(struct platform_device *pdev, bool on);
-
unsigned int pll_stable_time;
unsigned long pll_clk_rate;
unsigned long esc_clk_rate;
@@ -36,6 +33,4 @@ struct exynos_dsi_platform_data {
unsigned short rx_timeout;
};
-int s5p_dsim_phy_enable(struct platform_device *pdev, bool on);
-
#endif /* _EXYNOS_MIPI_DSIM_H */
diff --git a/include/video/exynos_mipi_dsim.h b/include/video/exynos_mipi_dsim.h
index 68433852b81..070983d99ec 100644
--- a/include/video/exynos_mipi_dsim.h
+++ b/include/video/exynos_mipi_dsim.h
@@ -216,7 +216,7 @@ struct mipi_dsim_config {
* automatically.
* @e_clk_src: select byte clock source.
* @pd: pointer to MIPI-DSI driver platform data.
- * @phy: pointer to the generic PHY
+ * @phy: pointer to the MIPI-DSI PHY
*/
struct mipi_dsim_device {
struct device *dev;
@@ -250,7 +250,6 @@ struct mipi_dsim_device {
* @enabled: indicate whether mipi controller got enabled or not.
* @lcd_panel_info: pointer for lcd panel specific structure.
* this structure specifies width, height, timing and polarity and so on.
- * @phy_label: the generic PHY label
*/
struct mipi_dsim_platform_data {
char lcd_panel_name[PANEL_NAME_SIZE];
@@ -258,8 +257,6 @@ struct mipi_dsim_platform_data {
struct mipi_dsim_config *dsim_config;
unsigned int enabled;
void *lcd_panel_info;
-
- const char *phy_label;
};
/*