Lines Matching +full:lcd +full:- +full:controller
1 // SPDX-License-Identifier: GPL-2.0-or-later
3 * Driver for the Himax HX-8357 LCD Controller
10 #include <linux/lcd.h>
216 struct hx8357_data *lcd = lcd_get_data(lcdev); in hx8357_spi_write_then_read() local
231 return -ENOMEM; in hx8357_spi_write_then_read()
252 ret = spi_sync(lcd->spi, &msg); in hx8357_spi_write_then_read()
254 dev_err(&lcdev->dev, "Couldn't send SPI data\n"); in hx8357_spi_write_then_read()
289 * The controller needs 120ms when entering in sleep mode before we can in hx8357_enter_standby()
306 * The controller needs 120ms when exiting from sleep mode before we in hx8357_exit_standby()
320 struct hx8357_data *lcd = lcd_get_data(lcdev); in hx8357_lcd_reset() local
323 gpiod_set_value(lcd->reset, 0); in hx8357_lcd_reset()
325 gpiod_set_value(lcd->reset, 1); in hx8357_lcd_reset()
327 gpiod_set_value(lcd->reset, 0); in hx8357_lcd_reset()
329 /* The controller needs 120ms to recover from reset */ in hx8357_lcd_reset()
335 struct hx8357_data *lcd = lcd_get_data(lcdev); in hx8357_lcd_init() local
342 if (lcd->im_pins) { in hx8357_lcd_init()
343 gpiod_set_value_cansleep(lcd->im_pins->desc[0], 1); in hx8357_lcd_init()
344 gpiod_set_value_cansleep(lcd->im_pins->desc[1], 0); in hx8357_lcd_init()
345 gpiod_set_value_cansleep(lcd->im_pins->desc[2], 1); in hx8357_lcd_init()
428 * The controller needs 120ms to fully recover from exiting sleep mode in hx8357_lcd_init()
490 * The controller needs 120ms to fully recover from exiting sleep mode in hx8369_lcd_init()
539 struct hx8357_data *lcd = lcd_get_data(lcdev); in hx8357_set_power() local
542 if (POWER_IS_ON(power) && !POWER_IS_ON(lcd->state)) in hx8357_set_power()
544 else if (!POWER_IS_ON(power) && POWER_IS_ON(lcd->state)) in hx8357_set_power()
548 lcd->state = power; in hx8357_set_power()
550 dev_warn(&lcdev->dev, "failed to set power mode %d\n", power); in hx8357_set_power()
557 struct hx8357_data *lcd = lcd_get_data(lcdev); in hx8357_get_power() local
559 return lcd->state; in hx8357_get_power()
571 struct device *dev = &spi->dev; in hx8357_probe()
573 struct hx8357_data *lcd; in hx8357_probe() local
577 lcd = devm_kzalloc(dev, sizeof(*lcd), GFP_KERNEL); in hx8357_probe()
578 if (!lcd) in hx8357_probe()
579 return -ENOMEM; in hx8357_probe()
585 lcd->spi = spi; in hx8357_probe()
589 return -EINVAL; in hx8357_probe()
591 lcd->reset = devm_gpiod_get(dev, "reset", GPIOD_OUT_LOW); in hx8357_probe()
592 if (IS_ERR(lcd->reset)) in hx8357_probe()
593 return dev_err_probe(dev, PTR_ERR(lcd->reset), "failed to request reset GPIO\n"); in hx8357_probe()
594 gpiod_set_consumer_name(lcd->reset, "hx8357-reset"); in hx8357_probe()
596 lcd->im_pins = devm_gpiod_get_array_optional(dev, "im", GPIOD_OUT_LOW); in hx8357_probe()
597 if (IS_ERR(lcd->im_pins)) in hx8357_probe()
598 return dev_err_probe(dev, PTR_ERR(lcd->im_pins), "failed to request im GPIOs\n"); in hx8357_probe()
599 if (lcd->im_pins) { in hx8357_probe()
600 if (lcd->im_pins->ndescs < HX8357_NUM_IM_PINS) in hx8357_probe()
601 return dev_err_probe(dev, -EINVAL, "not enough im GPIOs\n"); in hx8357_probe()
604 gpiod_set_consumer_name(lcd->im_pins->desc[i], "im_pins"); in hx8357_probe()
607 lcdev = devm_lcd_device_register(dev, "mxsfb", dev, lcd, &hx8357_ops); in hx8357_probe()
648 MODULE_AUTHOR("Maxime Ripard <maxime.ripard@free-electrons.com>");
649 MODULE_DESCRIPTION("Himax HX-8357 LCD Driver");