Searched refs:vtg (Results 1 - 6 of 6) sorted by relevance

/linux-4.1.27/drivers/gpu/drm/sti/
H A Dsti_vtg.c83 * @slave: slave vtg
98 static void vtg_register(struct sti_vtg *vtg) vtg_register() argument
100 list_add_tail(&vtg->link, &vtg_lookup); vtg_register()
105 struct sti_vtg *vtg; of_vtg_find() local
107 list_for_each_entry(vtg, &vtg_lookup, link) { of_vtg_find()
108 if (vtg->np == np) of_vtg_find()
109 return vtg; of_vtg_find()
115 static void vtg_reset(struct sti_vtg *vtg) vtg_reset() argument
118 if (vtg->slave) vtg_reset()
119 vtg_reset(vtg->slave); vtg_reset()
121 writel(1, vtg->regs + VTG_DRST_AUTOC); vtg_reset()
124 static void vtg_set_mode(struct sti_vtg *vtg, vtg_set_mode() argument
129 if (vtg->slave) vtg_set_mode()
130 vtg_set_mode(vtg->slave, VTG_TYPE_SLAVE_BY_EXT0, mode); vtg_set_mode()
132 writel(mode->htotal, vtg->regs + VTG_CLKLN); vtg_set_mode()
133 writel(mode->vtotal * 2, vtg->regs + VTG_HLFLN); vtg_set_mode()
137 writel(tmp, vtg->regs + VTG_VID_TFO); vtg_set_mode()
138 writel(tmp, vtg->regs + VTG_VID_BFO); vtg_set_mode()
142 writel(tmp, vtg->regs + VTG_VID_TFS); vtg_set_mode()
143 writel(tmp, vtg->regs + VTG_VID_BFS); vtg_set_mode()
148 writel(tmp, vtg->regs + VTG_H_HD_1); vtg_set_mode()
152 writel(tmp, vtg->regs + VTG_TOP_V_VD_1); vtg_set_mode()
153 writel(tmp, vtg->regs + VTG_BOT_V_VD_1); vtg_set_mode()
154 writel(0, vtg->regs + VTG_TOP_V_HD_1); vtg_set_mode()
155 writel(0, vtg->regs + VTG_BOT_V_HD_1); vtg_set_mode()
159 writel(tmp, vtg->regs + VTG_H_HD_2); vtg_set_mode()
163 writel(tmp, vtg->regs + VTG_TOP_V_VD_2); vtg_set_mode()
164 writel(tmp, vtg->regs + VTG_BOT_V_VD_2); vtg_set_mode()
165 writel(0, vtg->regs + VTG_TOP_V_HD_2); vtg_set_mode()
166 writel(0, vtg->regs + VTG_BOT_V_HD_2); vtg_set_mode()
171 writel(tmp, vtg->regs + VTG_H_HD_3); vtg_set_mode()
175 writel(tmp, vtg->regs + VTG_TOP_V_VD_3); vtg_set_mode()
176 writel(tmp, vtg->regs + VTG_BOT_V_VD_3); vtg_set_mode()
180 writel(tmp, vtg->regs + VTG_TOP_V_HD_3); vtg_set_mode()
181 writel(tmp, vtg->regs + VTG_BOT_V_HD_3); vtg_set_mode()
185 writel(tmp, vtg->regs + VTG_H_HD_4); vtg_set_mode()
189 writel(tmp, vtg->regs + VTG_TOP_V_VD_4); vtg_set_mode()
190 writel(tmp, vtg->regs + VTG_BOT_V_VD_4); vtg_set_mode()
191 writel(0, vtg->regs + VTG_TOP_V_HD_4); vtg_set_mode()
192 writel(0, vtg->regs + VTG_BOT_V_HD_4); vtg_set_mode()
195 writel(type, vtg->regs + VTG_MODE); vtg_set_mode()
198 static void vtg_enable_irq(struct sti_vtg *vtg) vtg_enable_irq() argument
201 writel(0xFFFF, vtg->regs + VTG_HOST_ITS_BCLR); vtg_enable_irq()
202 writel(0xFFFF, vtg->regs + VTG_HOST_ITM_BCLR); vtg_enable_irq()
203 writel(VTG_IRQ_MASK, vtg->regs + VTG_HOST_ITM_BSET); vtg_enable_irq()
206 void sti_vtg_set_config(struct sti_vtg *vtg, sti_vtg_set_config() argument
210 vtg_set_mode(vtg, VTG_TYPE_MASTER, mode); sti_vtg_set_config()
212 vtg_reset(vtg); sti_vtg_set_config()
214 /* enable irq for the vtg vblank synchro */ sti_vtg_set_config()
215 if (vtg->slave) sti_vtg_set_config()
216 vtg_enable_irq(vtg->slave); sti_vtg_set_config()
218 vtg_enable_irq(vtg); sti_vtg_set_config()
261 int sti_vtg_register_client(struct sti_vtg *vtg, sti_vtg_register_client() argument
264 if (vtg->slave) sti_vtg_register_client()
265 return sti_vtg_register_client(vtg->slave, nb, crtc_id); sti_vtg_register_client()
267 vtg->crtc_id = crtc_id; sti_vtg_register_client()
268 return raw_notifier_chain_register(&vtg->notifier_list, nb); sti_vtg_register_client()
272 int sti_vtg_unregister_client(struct sti_vtg *vtg, struct notifier_block *nb) sti_vtg_unregister_client() argument
274 if (vtg->slave) sti_vtg_unregister_client()
275 return sti_vtg_unregister_client(vtg->slave, nb); sti_vtg_unregister_client()
277 return raw_notifier_chain_unregister(&vtg->notifier_list, nb); sti_vtg_unregister_client()
283 struct sti_vtg *vtg = arg; vtg_irq_thread() local
286 event = (vtg->irq_status & VTG_IRQ_TOP) ? vtg_irq_thread()
289 raw_notifier_call_chain(&vtg->notifier_list, event, &vtg->crtc_id); vtg_irq_thread()
296 struct sti_vtg *vtg = arg; vtg_irq() local
298 vtg->irq_status = readl(vtg->regs + VTG_HOST_ITS); vtg_irq()
300 writel(vtg->irq_status, vtg->regs + VTG_HOST_ITS_BCLR); vtg_irq()
303 readl(vtg->regs + VTG_HOST_ITS); vtg_irq()
312 struct sti_vtg *vtg; vtg_probe() local
317 vtg = devm_kzalloc(dev, sizeof(*vtg), GFP_KERNEL); vtg_probe()
318 if (!vtg) vtg_probe()
321 vtg->dev = dev; vtg_probe()
322 vtg->np = pdev->dev.of_node; vtg_probe()
330 vtg->regs = devm_ioremap_nocache(dev, res->start, resource_size(res)); vtg_probe()
334 vtg->slave = of_vtg_find(np); vtg_probe()
336 if (!vtg->slave) vtg_probe()
339 vtg->irq = platform_get_irq(pdev, 0); vtg_probe()
340 if (IS_ERR_VALUE(vtg->irq)) { vtg_probe()
342 return vtg->irq; vtg_probe()
346 dev_name(vtg->dev)); vtg_probe()
348 RAW_INIT_NOTIFIER_HEAD(&vtg->notifier_list); vtg_probe()
350 ret = devm_request_threaded_irq(dev, vtg->irq, vtg_irq, vtg_probe()
351 vtg_irq_thread, IRQF_ONESHOT, irq_name, vtg); vtg_probe()
358 vtg_register(vtg); vtg_probe()
359 platform_set_drvdata(pdev, vtg); vtg_probe()
361 DRM_INFO("%s %s\n", __func__, dev_name(vtg->dev)); vtg_probe()
372 { .compatible = "st,vtg", },
379 .name = "sti-vtg",
H A Dsti_vtg.h18 void sti_vtg_set_config(struct sti_vtg *vtg,
20 int sti_vtg_register_client(struct sti_vtg *vtg,
22 int sti_vtg_unregister_client(struct sti_vtg *vtg,
H A Dsti_compositor.h62 * @vtg_main: vtg for main data path
63 * @vtg_aux: vtg for auxillary data path
H A Dsti_compositor.c246 vtg_np = of_parse_phandle(pdev->dev.of_node, "st,vtg", 0); sti_compositor_probe()
250 vtg_np = of_parse_phandle(pdev->dev.of_node, "st,vtg", 1); sti_compositor_probe()
H A Dsti_hqvdp.c336 * @vtg: vtg for main data path
353 struct sti_vtg *vtg; member in struct:sti_hqvdp
631 sti_vtg_register_client(hqvdp->vtg, sti_hqvdp_prepare_layer()
678 sti_vtg_unregister_client(hqvdp->vtg, &hqvdp->vtg_nb)) sti_hqvdp_disable_layer()
1038 vtg_np = of_parse_phandle(pdev->dev.of_node, "st,vtg", 0); sti_hqvdp_probe()
1040 hqvdp->vtg = of_vtg_find(vtg_np); sti_hqvdp_probe()
/linux-4.1.27/drivers/mfd/
H A Dmenelaus.c458 u16 vtg; member in struct:menelaus_vtg_value
462 static int menelaus_set_voltage(const struct menelaus_vtg *vtg, int mV, menelaus_set_voltage() argument
470 ret = menelaus_read_reg(vtg->vtg_reg); menelaus_set_voltage()
473 val = ret & ~(((1 << vtg->vtg_bits) - 1) << vtg->vtg_shift); menelaus_set_voltage()
474 val |= vtg_val << vtg->vtg_shift; menelaus_set_voltage()
478 vtg->name, mV, vtg->vtg_reg, val); menelaus_set_voltage()
480 ret = menelaus_write_reg(vtg->vtg_reg, val); menelaus_set_voltage()
483 ret = menelaus_write_reg(vtg->mode_reg, mode); menelaus_set_voltage()
493 static int menelaus_get_vtg_value(int vtg, const struct menelaus_vtg_value *tbl, menelaus_get_vtg_value() argument
499 if (tbl->vtg == vtg) menelaus_get_vtg_value()
659 const struct menelaus_vtg *vtg; menelaus_set_vdcdc() local
665 vtg = &vdcdc2_vtg; menelaus_set_vdcdc()
667 vtg = &vdcdc3_vtg; menelaus_set_vdcdc()
670 return menelaus_set_voltage(vtg, 0, 0, 0); menelaus_set_vdcdc()
676 return menelaus_set_voltage(vtg, mV, val, 0x03); menelaus_set_vdcdc()

Completed in 172 milliseconds