#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>
bool enabled;
struct platform_device *pdev;
+ struct phy *phy;
struct device *dev;
struct resource *res;
struct clk *pll_clk;
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;
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;
}
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);
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);
* 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)
{
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) {
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");
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);
* 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;
* @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];
struct mipi_dsim_config *dsim_config;
unsigned int enabled;
void *lcd_panel_info;
-
- const char *phy_label;
};
/*