Lines Matching refs:hdmi

22 void hdmi_set_mode(struct hdmi *hdmi, bool power_on)  in hdmi_set_mode()  argument
28 if (!hdmi->hdmi_mode) { in hdmi_set_mode()
30 hdmi_write(hdmi, REG_HDMI_CTRL, ctrl); in hdmi_set_mode()
39 hdmi_write(hdmi, REG_HDMI_CTRL, ctrl); in hdmi_set_mode()
46 struct hdmi *hdmi = dev_id; in hdmi_irq() local
49 hdmi_connector_irq(hdmi->connector); in hdmi_irq()
52 hdmi_i2c_irq(hdmi->i2c); in hdmi_irq()
59 static void hdmi_destroy(struct hdmi *hdmi) in hdmi_destroy() argument
61 struct hdmi_phy *phy = hdmi->phy; in hdmi_destroy()
66 if (hdmi->i2c) in hdmi_destroy()
67 hdmi_i2c_destroy(hdmi->i2c); in hdmi_destroy()
69 platform_set_drvdata(hdmi->pdev, NULL); in hdmi_destroy()
76 static struct hdmi *hdmi_init(struct platform_device *pdev) in hdmi_init()
79 struct hdmi *hdmi = NULL; in hdmi_init() local
82 hdmi = devm_kzalloc(&pdev->dev, sizeof(*hdmi), GFP_KERNEL); in hdmi_init()
83 if (!hdmi) { in hdmi_init()
88 hdmi->pdev = pdev; in hdmi_init()
89 hdmi->config = config; in hdmi_init()
93 hdmi->phy = config->phy_init(hdmi); in hdmi_init()
95 hdmi->phy = ERR_PTR(-ENXIO); in hdmi_init()
97 if (IS_ERR(hdmi->phy)) { in hdmi_init()
98 ret = PTR_ERR(hdmi->phy); in hdmi_init()
100 hdmi->phy = NULL; in hdmi_init()
104 hdmi->mmio = msm_ioremap(pdev, config->mmio_name, "HDMI"); in hdmi_init()
105 if (IS_ERR(hdmi->mmio)) { in hdmi_init()
106 ret = PTR_ERR(hdmi->mmio); in hdmi_init()
110 hdmi->hpd_regs = devm_kzalloc(&pdev->dev, sizeof(hdmi->hpd_regs[0]) * in hdmi_init()
112 if (!hdmi->hpd_regs) { in hdmi_init()
128 hdmi->hpd_regs[i] = reg; in hdmi_init()
131 hdmi->pwr_regs = devm_kzalloc(&pdev->dev, sizeof(hdmi->pwr_regs[0]) * in hdmi_init()
133 if (!hdmi->pwr_regs) { in hdmi_init()
149 hdmi->pwr_regs[i] = reg; in hdmi_init()
152 hdmi->hpd_clks = devm_kzalloc(&pdev->dev, sizeof(hdmi->hpd_clks[0]) * in hdmi_init()
154 if (!hdmi->hpd_clks) { in hdmi_init()
169 hdmi->hpd_clks[i] = clk; in hdmi_init()
172 hdmi->pwr_clks = devm_kzalloc(&pdev->dev, sizeof(hdmi->pwr_clks[0]) * in hdmi_init()
174 if (!hdmi->pwr_clks) { in hdmi_init()
189 hdmi->pwr_clks[i] = clk; in hdmi_init()
192 hdmi->i2c = hdmi_i2c_init(hdmi); in hdmi_init()
193 if (IS_ERR(hdmi->i2c)) { in hdmi_init()
194 ret = PTR_ERR(hdmi->i2c); in hdmi_init()
196 hdmi->i2c = NULL; in hdmi_init()
200 return hdmi; in hdmi_init()
203 if (hdmi) in hdmi_init()
204 hdmi_destroy(hdmi); in hdmi_init()
217 int hdmi_modeset_init(struct hdmi *hdmi, in hdmi_modeset_init() argument
221 struct platform_device *pdev = hdmi->pdev; in hdmi_modeset_init()
224 hdmi->dev = dev; in hdmi_modeset_init()
225 hdmi->encoder = encoder; in hdmi_modeset_init()
227 hdmi_audio_infoframe_init(&hdmi->audio.infoframe); in hdmi_modeset_init()
229 hdmi->bridge = hdmi_bridge_init(hdmi); in hdmi_modeset_init()
230 if (IS_ERR(hdmi->bridge)) { in hdmi_modeset_init()
231 ret = PTR_ERR(hdmi->bridge); in hdmi_modeset_init()
233 hdmi->bridge = NULL; in hdmi_modeset_init()
237 hdmi->connector = hdmi_connector_init(hdmi); in hdmi_modeset_init()
238 if (IS_ERR(hdmi->connector)) { in hdmi_modeset_init()
239 ret = PTR_ERR(hdmi->connector); in hdmi_modeset_init()
241 hdmi->connector = NULL; in hdmi_modeset_init()
245 hdmi->irq = irq_of_parse_and_map(pdev->dev.of_node, 0); in hdmi_modeset_init()
246 if (hdmi->irq < 0) { in hdmi_modeset_init()
247 ret = hdmi->irq; in hdmi_modeset_init()
252 ret = devm_request_irq(&pdev->dev, hdmi->irq, in hdmi_modeset_init()
254 "hdmi_isr", hdmi); in hdmi_modeset_init()
257 hdmi->irq, ret); in hdmi_modeset_init()
261 encoder->bridge = hdmi->bridge; in hdmi_modeset_init()
263 priv->bridges[priv->num_bridges++] = hdmi->bridge; in hdmi_modeset_init()
264 priv->connectors[priv->num_connectors++] = hdmi->connector; in hdmi_modeset_init()
266 platform_set_drvdata(pdev, hdmi); in hdmi_modeset_init()
272 if (hdmi->bridge) { in hdmi_modeset_init()
273 hdmi_bridge_destroy(hdmi->bridge); in hdmi_modeset_init()
274 hdmi->bridge = NULL; in hdmi_modeset_init()
276 if (hdmi->connector) { in hdmi_modeset_init()
277 hdmi->connector->funcs->destroy(hdmi->connector); in hdmi_modeset_init()
278 hdmi->connector = NULL; in hdmi_modeset_init()
364 struct hdmi *hdmi; in hdmi_bind() local
437 hdmi = hdmi_init(to_platform_device(dev)); in hdmi_bind()
438 if (IS_ERR(hdmi)) in hdmi_bind()
439 return PTR_ERR(hdmi); in hdmi_bind()
440 priv->hdmi = hdmi; in hdmi_bind()
450 if (priv->hdmi) { in hdmi_unbind()
451 hdmi_destroy(priv->hdmi); in hdmi_unbind()
452 priv->hdmi = NULL; in hdmi_unbind()