Lines Matching refs:cfb
47 struct clps711x_fb_info *cfb = info->par; in clps711x_fb_setcolreg() local
57 if (cfb->cmap_invert) in clps711x_fb_setcolreg()
62 writel((readl(cfb->base + regno) & ~mask) | level, cfb->base + regno); in clps711x_fb_setcolreg()
103 struct clps711x_fb_info *cfb = info->par; in clps711x_fb_set_par() local
108 if (size > cfb->buffsize) in clps711x_fb_set_par()
129 lcdcon |= (cfb->ac_prescale & 0x1f) << 25; in clps711x_fb_set_par()
131 pps = clk_get_rate(cfb->clk) / (PICOS2KHZ(info->var.pixclock) * 1000); in clps711x_fb_set_par()
142 regmap_update_bits(cfb->syscon, SYSCON_OFFSET, SYSCON1_LCDEN, 0); in clps711x_fb_set_par()
143 writel(lcdcon, cfb->base + CLPS711X_LCDCON); in clps711x_fb_set_par()
144 regmap_update_bits(cfb->syscon, SYSCON_OFFSET, in clps711x_fb_set_par()
169 struct clps711x_fb_info *cfb = dev_get_drvdata(&lcddev->dev); in clps711x_lcd_check_fb() local
171 return (!fi || fi->par == cfb) ? 1 : 0; in clps711x_lcd_check_fb()
176 struct clps711x_fb_info *cfb = dev_get_drvdata(&lcddev->dev); in clps711x_lcd_get_power() local
178 if (!IS_ERR_OR_NULL(cfb->lcd_pwr)) in clps711x_lcd_get_power()
179 if (!regulator_is_enabled(cfb->lcd_pwr)) in clps711x_lcd_get_power()
187 struct clps711x_fb_info *cfb = dev_get_drvdata(&lcddev->dev); in clps711x_lcd_set_power() local
189 if (!IS_ERR_OR_NULL(cfb->lcd_pwr)) { in clps711x_lcd_set_power()
191 if (!regulator_is_enabled(cfb->lcd_pwr)) in clps711x_lcd_set_power()
192 return regulator_enable(cfb->lcd_pwr); in clps711x_lcd_set_power()
194 if (regulator_is_enabled(cfb->lcd_pwr)) in clps711x_lcd_set_power()
195 return regulator_disable(cfb->lcd_pwr); in clps711x_lcd_set_power()
212 struct clps711x_fb_info *cfb; in clps711x_fb_probe() local
222 info = framebuffer_alloc(sizeof(*cfb), dev); in clps711x_fb_probe()
226 cfb = info->par; in clps711x_fb_probe()
232 cfb->base = devm_ioremap(dev, res->start, resource_size(res)); in clps711x_fb_probe()
233 if (!cfb->base) { in clps711x_fb_probe()
253 cfb->buffsize = resource_size(res); in clps711x_fb_probe()
256 cfb->clk = devm_clk_get(dev, NULL); in clps711x_fb_probe()
257 if (IS_ERR(cfb->clk)) { in clps711x_fb_probe()
258 ret = PTR_ERR(cfb->clk); in clps711x_fb_probe()
262 cfb->syscon = syscon_regmap_lookup_by_phandle(np, "syscon"); in clps711x_fb_probe()
263 if (IS_ERR(cfb->syscon)) { in clps711x_fb_probe()
264 ret = PTR_ERR(cfb->syscon); in clps711x_fb_probe()
275 ret = of_get_fb_videomode(disp, &cfb->mode, OF_USE_NATIVE_MODE); in clps711x_fb_probe()
281 of_property_read_u32(disp, "ac-prescale", &cfb->ac_prescale); in clps711x_fb_probe()
282 cfb->cmap_invert = of_property_read_bool(disp, "cmap-invert"); in clps711x_fb_probe()
291 if (info->fix.smem_start != (readb(cfb->base + CLPS711X_FBADDR) << 28)) in clps711x_fb_probe()
292 regmap_update_bits(cfb->syscon, SYSCON_OFFSET, in clps711x_fb_probe()
295 ret = regmap_read(cfb->syscon, SYSCON_OFFSET, &val); in clps711x_fb_probe()
301 writeb(info->fix.smem_start >> 28, cfb->base + CLPS711X_FBADDR); in clps711x_fb_probe()
303 memset_io(info->screen_base, 0, cfb->buffsize); in clps711x_fb_probe()
306 cfb->lcd_pwr = devm_regulator_get(dev, "lcd"); in clps711x_fb_probe()
307 if (PTR_ERR(cfb->lcd_pwr) == -EPROBE_DEFER) { in clps711x_fb_probe()
320 fb_videomode_to_var(&info->var, &cfb->mode); in clps711x_fb_probe()
334 lcd = devm_lcd_device_register(dev, "clps711x-lcd", dev, cfb, in clps711x_fb_probe()
343 regmap_update_bits(cfb->syscon, SYSCON_OFFSET, SYSCON1_LCDEN, 0); in clps711x_fb_probe()
355 struct clps711x_fb_info *cfb = info->par; in clps711x_fb_remove() local
357 regmap_update_bits(cfb->syscon, SYSCON_OFFSET, SYSCON1_LCDEN, 0); in clps711x_fb_remove()