Lines Matching +full:abs +full:- +full:range
1 // SPDX-License-Identifier: GPL-2.0-or-later
16 #include <linux/fsl-diu-fb.h>
50 out_be32(&reset_module_base->rpr, 0x52535445); in mpc512x_restart()
52 out_be32(&reset_module_base->rcr, 0x2); in mpc512x_restart()
61 u8 gamma[0x300]; /* 32-bit aligned! */
62 struct diu_ad ad0; /* 32-bit aligned! */
77 np = of_find_compatible_node(NULL, NULL, "fsl,mpc5121-diu"); in mpc512x_set_pixel_clock()
85 clk_diu = clk_get_sys(np->name, "ipg"); in mpc512x_set_pixel_clock()
99 * determine the acceptable clock range for the monitor (+/- 5%), in mpc512x_set_pixel_clock()
102 pr_debug("DIU pixclock in ps - %u\n", pixclock); in mpc512x_set_pixel_clock()
104 pr_debug("DIU pixclock freq - %u\n", pixclock); in mpc512x_set_pixel_clock()
106 pr_debug("DIU deviation - %lu\n", epsilon); in mpc512x_set_pixel_clock()
107 minpixclock = pixclock - epsilon; in mpc512x_set_pixel_clock()
109 pr_debug("DIU minpixclock - %lu\n", minpixclock); in mpc512x_set_pixel_clock()
110 pr_debug("DIU maxpixclock - %lu\n", maxpixclock); in mpc512x_set_pixel_clock()
115 * - simply request the desired clock and see what the in mpc512x_set_pixel_clock()
118 * - try other candidate frequencies in the order of decreasing in mpc512x_set_pixel_clock()
122 * first match is found -- any potential subsequent match in mpc512x_set_pixel_clock()
127 * arbitrary choice -- it's simple to calculate, in the typical in mpc512x_set_pixel_clock()
137 want = pixclock - offset; in mpc512x_set_pixel_clock()
138 pr_debug("DIU checking clock - %lu\n", want); in mpc512x_set_pixel_clock()
141 delta = abs(pixclock - got); in mpc512x_set_pixel_clock()
147 pr_debug("DIU checking clock - %lu\n", want); in mpc512x_set_pixel_clock()
150 delta = abs(pixclock - got); in mpc512x_set_pixel_clock()
155 pr_debug("DIU clock accepted - %lu\n", want); in mpc512x_set_pixel_clock()
171 delta = abs(pixclock - got); in mpc512x_set_pixel_clock()
210 * Check if DIU was pre-initialized. If so, perform steps
214 * address range will be reserved in setup_arch() after bootmem
226 np = of_find_compatible_node(NULL, NULL, "fsl,mpc5121-diu"); in mpc512x_init_diu()
239 mode = in_be32(&diu_reg->diu_mode); in mpc512x_init_diu()
245 desc = in_be32(&diu_reg->desc[0]); in mpc512x_init_diu()
254 flush_dcache_range(dst, dst + sizeof(struct diu_ad) - 1); in mpc512x_init_diu()
256 res = in_be32(&diu_reg->disp_size); in mpc512x_init_diu()
264 desc = in_be32(&diu_reg->gamma); in mpc512x_init_diu()
274 flush_dcache_range(dst, dst + sizeof(diu_shared_fb.gamma) - 1); in mpc512x_init_diu()
277 out_be32(&diu_reg->gamma, virt_to_phys(&diu_shared_fb.gamma)); in mpc512x_init_diu()
278 out_be32(&diu_reg->desc[1], 0); in mpc512x_init_diu()
279 out_be32(&diu_reg->desc[2], 0); in mpc512x_init_diu()
280 out_be32(&diu_reg->desc[0], virt_to_phys(&diu_shared_fb.ad0)); in mpc512x_init_diu()
318 np = of_find_compatible_node(NULL, NULL, "fsl,mpc5121-ipic"); in mpc512x_init_IRQ()
336 { .compatible = "fsl,mpc5121-immr", },
337 { .compatible = "fsl,mpc5121-localbus", },
338 { .compatible = "fsl,mpc5121-mbx", },
339 { .compatible = "fsl,mpc5121-nfc", },
340 { .compatible = "fsl,mpc5121-sram", },
341 { .compatible = "fsl,mpc5121-pci", },
342 { .compatible = "gpio-leds", },
358 return "fsl,mpc5121-psc"; in mpc512x_select_psc_compat()
361 return "fsl,mpc5125-psc"; in mpc512x_select_psc_compat()
369 return "fsl,mpc5121-reset"; in mpc512x_select_reset_compat()
372 return "fsl,mpc5125-reset"; in mpc512x_select_reset_compat()
412 tx_fifo_size = get_fifo_size(np, "fsl,tx-fifo-size"); in mpc512x_psc_fifo_init()
413 rx_fifo_size = get_fifo_size(np, "fsl,rx-fifo-size"); in mpc512x_psc_fifo_init()
443 out_be32(&FIFOC(psc)->txsz, (fifobase << 16) | tx_fifo_size); in mpc512x_psc_fifo_init()
445 out_be32(&FIFOC(psc)->rxsz, (fifobase << 16) | rx_fifo_size); in mpc512x_psc_fifo_init()
449 out_be32(&FIFOC(psc)->txcmd, 0x80); in mpc512x_psc_fifo_init()
450 out_be32(&FIFOC(psc)->txcmd, 0x01); in mpc512x_psc_fifo_init()
451 out_be32(&FIFOC(psc)->rxcmd, 0x80); in mpc512x_psc_fifo_init()
452 out_be32(&FIFOC(psc)->rxcmd, 0x01); in mpc512x_psc_fifo_init()
479 * mpc512x_cs_config - Setup chip select configuration
493 return -EINVAL; in mpc512x_cs_config()
496 np = of_find_compatible_node(NULL, NULL, "fsl,mpc5121-lpc"); in mpc512x_cs_config()
500 return -ENOMEM; in mpc512x_cs_config()
503 out_be32(&lpc->cs_cfg[cs], val); in mpc512x_cs_config()