MCPcopy Create free account
hub / github.com/F-Stack/f-stack / a10fb_setup_pll

Function a10fb_setup_pll

freebsd/arm/allwinner/a10_fb.c:306–340  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

304}
305
306static int
307a10fb_setup_pll(struct a10fb_softc *sc, uint64_t freq)
308{
309 clk_t clk_sclk1, clk_sclk2;
310 int error;
311
312 error = clk_get_by_ofw_name(sc->dev, 0, "lcd_ch1_sclk1", &clk_sclk1);
313 if (error != 0) {
314 device_printf(sc->dev, "cannot find clk 'lcd_ch1_sclk1'\n");
315 return (error);
316 }
317 error = clk_get_by_ofw_name(sc->dev, 0, "lcd_ch1_sclk2", &clk_sclk2);
318 if (error != 0) {
319 device_printf(sc->dev, "cannot find clk 'lcd_ch1_sclk2'\n");
320 return (error);
321 }
322
323 error = clk_set_freq(clk_sclk2, freq, 0);
324 if (error != 0) {
325 device_printf(sc->dev, "cannot set lcd ch1 frequency\n");
326 return (error);
327 }
328 error = clk_enable(clk_sclk2);
329 if (error != 0) {
330 device_printf(sc->dev, "cannot enable lcd ch1 sclk2\n");
331 return (error);
332 }
333 error = clk_enable(clk_sclk1);
334 if (error != 0) {
335 device_printf(sc->dev, "cannot enable lcd ch1 sclk1\n");
336 return (error);
337 }
338
339 return (0);
340}
341
342static int
343a10fb_setup_tcon(struct a10fb_softc *sc, const struct videomode *mode)

Callers 1

a10fb_setup_tconFunction · 0.85

Calls 1

device_printfFunction · 0.85

Tested by

no test coverage detected