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()
208 struct lcd_olinuxino *lcd; in lcd_olinuxino_probe() local
216 lcd = devm_kzalloc(dev, sizeof(*lcd), GFP_KERNEL); in lcd_olinuxino_probe()
217 if (!lcd) in lcd_olinuxino_probe()
220 i2c_set_clientdata(client, lcd); in lcd_olinuxino_probe()
221 lcd->dev = dev; in lcd_olinuxino_probe()
222 lcd->client = client; in lcd_olinuxino_probe()
224 mutex_init(&lcd->mutex); in lcd_olinuxino_probe()
228 mutex_lock(&lcd->mutex); in lcd_olinuxino_probe()
232 (u8 *)&lcd->eeprom + i); in lcd_olinuxino_probe()
233 mutex_unlock(&lcd->mutex); in lcd_olinuxino_probe()
241 checksum = ~crc32(~0, (u8 *)&lcd->eeprom, 252); in lcd_olinuxino_probe()
242 if (checksum != lcd->eeprom.checksum) { in lcd_olinuxino_probe()
248 if (lcd->eeprom.header != LCD_OLINUXINO_HEADER_MAGIC) { in lcd_olinuxino_probe()
254 lcd->eeprom.info.name, in lcd_olinuxino_probe()
255 lcd->eeprom.revision, in lcd_olinuxino_probe()
256 lcd->eeprom.serial); in lcd_olinuxino_probe()
262 if (lcd->eeprom.num_modes > 4) { in lcd_olinuxino_probe()
264 lcd->eeprom.num_modes = 4; in lcd_olinuxino_probe()
267 lcd->enabled = false; in lcd_olinuxino_probe()
268 lcd->prepared = false; in lcd_olinuxino_probe()
270 lcd->supply = devm_regulator_get(dev, "power"); in lcd_olinuxino_probe()
271 if (IS_ERR(lcd->supply)) in lcd_olinuxino_probe()
272 return PTR_ERR(lcd->supply); in lcd_olinuxino_probe()
274 lcd->enable_gpio = devm_gpiod_get(dev, "enable", GPIOD_OUT_LOW); in lcd_olinuxino_probe()
275 if (IS_ERR(lcd->enable_gpio)) in lcd_olinuxino_probe()
276 return PTR_ERR(lcd->enable_gpio); in lcd_olinuxino_probe()
278 drm_panel_init(&lcd->panel, dev, &lcd_olinuxino_funcs, in lcd_olinuxino_probe()
281 ret = drm_panel_of_backlight(&lcd->panel); in lcd_olinuxino_probe()
285 drm_panel_add(&lcd->panel); in lcd_olinuxino_probe()
301 { .compatible = "olimex,lcd-olinuxino" },
318 MODULE_DESCRIPTION("LCD-OLinuXino driver");