Lines Matching full:lcd

3  * LCD-OLinuXino support for panel driver
83 struct lcd_olinuxino *lcd = to_lcd_olinuxino(panel); in lcd_olinuxino_disable() local
85 if (!lcd->enabled) in lcd_olinuxino_disable()
88 lcd->enabled = false; in lcd_olinuxino_disable()
95 struct lcd_olinuxino *lcd = to_lcd_olinuxino(panel); in lcd_olinuxino_unprepare() local
97 if (!lcd->prepared) in lcd_olinuxino_unprepare()
100 gpiod_set_value_cansleep(lcd->enable_gpio, 0); in lcd_olinuxino_unprepare()
101 regulator_disable(lcd->supply); in lcd_olinuxino_unprepare()
103 lcd->prepared = false; in lcd_olinuxino_unprepare()
110 struct lcd_olinuxino *lcd = to_lcd_olinuxino(panel); in lcd_olinuxino_prepare() local
113 if (lcd->prepared) in lcd_olinuxino_prepare()
116 ret = regulator_enable(lcd->supply); in lcd_olinuxino_prepare()
120 gpiod_set_value_cansleep(lcd->enable_gpio, 1); in lcd_olinuxino_prepare()
121 lcd->prepared = true; in lcd_olinuxino_prepare()
128 struct lcd_olinuxino *lcd = to_lcd_olinuxino(panel); in lcd_olinuxino_enable() local
130 if (lcd->enabled) in lcd_olinuxino_enable()
133 lcd->enabled = true; in lcd_olinuxino_enable()
141 struct lcd_olinuxino *lcd = to_lcd_olinuxino(panel); in lcd_olinuxino_get_modes() local
142 struct lcd_olinuxino_info *lcd_info = &lcd->eeprom.info; in lcd_olinuxino_get_modes()
147 for (i = 0; i < lcd->eeprom.num_modes; i++) { in lcd_olinuxino_get_modes()
149 &lcd->eeprom.reserved[i * sizeof(*lcd_mode)]; in lcd_olinuxino_get_modes()
209 struct lcd_olinuxino *lcd; in lcd_olinuxino_probe() local
217 lcd = devm_kzalloc(dev, sizeof(*lcd), GFP_KERNEL); in lcd_olinuxino_probe()
218 if (!lcd) in lcd_olinuxino_probe()
221 i2c_set_clientdata(client, lcd); in lcd_olinuxino_probe()
222 lcd->dev = dev; in lcd_olinuxino_probe()
223 lcd->client = client; in lcd_olinuxino_probe()
225 mutex_init(&lcd->mutex); in lcd_olinuxino_probe()
229 mutex_lock(&lcd->mutex); in lcd_olinuxino_probe()
233 (u8 *)&lcd->eeprom + i); in lcd_olinuxino_probe()
234 mutex_unlock(&lcd->mutex); in lcd_olinuxino_probe()
242 checksum = ~crc32(~0, (u8 *)&lcd->eeprom, 252); in lcd_olinuxino_probe()
243 if (checksum != lcd->eeprom.checksum) { in lcd_olinuxino_probe()
249 if (lcd->eeprom.header != LCD_OLINUXINO_HEADER_MAGIC) { in lcd_olinuxino_probe()
255 lcd->eeprom.info.name, in lcd_olinuxino_probe()
256 lcd->eeprom.revision, in lcd_olinuxino_probe()
257 lcd->eeprom.serial); in lcd_olinuxino_probe()
263 if (lcd->eeprom.num_modes > 4) { in lcd_olinuxino_probe()
265 lcd->eeprom.num_modes = 4; in lcd_olinuxino_probe()
268 lcd->enabled = false; in lcd_olinuxino_probe()
269 lcd->prepared = false; in lcd_olinuxino_probe()
271 lcd->supply = devm_regulator_get(dev, "power"); in lcd_olinuxino_probe()
272 if (IS_ERR(lcd->supply)) in lcd_olinuxino_probe()
273 return PTR_ERR(lcd->supply); in lcd_olinuxino_probe()
275 lcd->enable_gpio = devm_gpiod_get(dev, "enable", GPIOD_OUT_LOW); in lcd_olinuxino_probe()
276 if (IS_ERR(lcd->enable_gpio)) in lcd_olinuxino_probe()
277 return PTR_ERR(lcd->enable_gpio); in lcd_olinuxino_probe()
279 drm_panel_init(&lcd->panel, dev, &lcd_olinuxino_funcs, in lcd_olinuxino_probe()
282 ret = drm_panel_of_backlight(&lcd->panel); in lcd_olinuxino_probe()
286 drm_panel_add(&lcd->panel); in lcd_olinuxino_probe()
304 { .compatible = "olimex,lcd-olinuxino" },
321 MODULE_DESCRIPTION("LCD-OLinuXino driver");