Lines Matching full:lvds

69 static inline u32 lvds_readl(struct mchp_lvds *lvds, u32 offset)  in lvds_readl()  argument
71 return readl_relaxed(lvds->regs + offset); in lvds_readl()
74 static inline void lvds_writel(struct mchp_lvds *lvds, u32 offset, u32 val) in lvds_writel() argument
76 writel_relaxed(val, lvds->regs + offset); in lvds_writel()
79 static void lvds_serialiser_on(struct mchp_lvds *lvds) in lvds_serialiser_on() argument
84 lvds_writel(lvds, LVDSC_WPMR, (LVDSC_WPMR_WPKEY_PSSWD & in lvds_serialiser_on()
88 while (lvds_readl(lvds, LVDSC_SR) & LVDSC_SR_CS) { in lvds_serialiser_on()
90 dev_err(lvds->dev, "%s: timeout error\n", __func__); in lvds_serialiser_on()
97 lvds_writel(lvds, LVDSC_CFGR, (LVDSC_CFGR_MAPPING_JEIDA | in lvds_serialiser_on()
102 /* Enable the LVDS serializer */ in lvds_serialiser_on()
103 lvds_writel(lvds, LVDSC_CR, LVDSC_CR_SER_EN); in lvds_serialiser_on()
109 struct mchp_lvds *lvds = bridge_to_lvds(bridge); in mchp_lvds_attach() local
111 return drm_bridge_attach(bridge->encoder, lvds->panel_bridge, in mchp_lvds_attach()
117 struct mchp_lvds *lvds = bridge_to_lvds(bridge); in mchp_lvds_enable() local
120 ret = clk_prepare_enable(lvds->pclk); in mchp_lvds_enable()
122 dev_err(lvds->dev, "failed to enable lvds pclk %d\n", ret); in mchp_lvds_enable()
126 ret = pm_runtime_get_sync(lvds->dev); in mchp_lvds_enable()
128 dev_err(lvds->dev, "failed to get pm runtime: %d\n", ret); in mchp_lvds_enable()
132 lvds_serialiser_on(lvds); in mchp_lvds_enable()
137 struct mchp_lvds *lvds = bridge_to_lvds(bridge); in mchp_lvds_disable() local
139 pm_runtime_put(lvds->dev); in mchp_lvds_disable()
140 clk_disable_unprepare(lvds->pclk); in mchp_lvds_disable()
152 struct mchp_lvds *lvds; in mchp_lvds_probe() local
159 lvds = devm_kzalloc(&pdev->dev, sizeof(*lvds), GFP_KERNEL); in mchp_lvds_probe()
160 if (!lvds) in mchp_lvds_probe()
163 lvds->dev = dev; in mchp_lvds_probe()
165 lvds->regs = devm_ioremap_resource(lvds->dev, in mchp_lvds_probe()
167 if (IS_ERR(lvds->regs)) in mchp_lvds_probe()
168 return PTR_ERR(lvds->regs); in mchp_lvds_probe()
170 lvds->pclk = devm_clk_get(lvds->dev, "pclk"); in mchp_lvds_probe()
171 if (IS_ERR(lvds->pclk)) in mchp_lvds_probe()
172 return dev_err_probe(lvds->dev, PTR_ERR(lvds->pclk), in mchp_lvds_probe()
178 "can't find port point, please init lvds panel port!\n"); in mchp_lvds_probe()
182 lvds->panel = of_drm_find_panel(port); in mchp_lvds_probe()
185 if (IS_ERR(lvds->panel)) in mchp_lvds_probe()
188 lvds->panel_bridge = devm_drm_of_get_bridge(dev, dev->of_node, 1, 0); in mchp_lvds_probe()
190 if (IS_ERR(lvds->panel_bridge)) in mchp_lvds_probe()
191 return PTR_ERR(lvds->panel_bridge); in mchp_lvds_probe()
193 lvds->bridge.of_node = dev->of_node; in mchp_lvds_probe()
194 lvds->bridge.type = DRM_MODE_CONNECTOR_LVDS; in mchp_lvds_probe()
195 lvds->bridge.funcs = &mchp_lvds_bridge_funcs; in mchp_lvds_probe()
197 dev_set_drvdata(dev, lvds); in mchp_lvds_probe()
200 dev_err(lvds->dev, "failed to enable pm runtime: %d\n", ret); in mchp_lvds_probe()
204 drm_bridge_add(&lvds->bridge); in mchp_lvds_probe()
211 .compatible = "microchip,sam9x75-lvds",
220 .name = "microchip-lvds",