Lines Matching +full:vcc5 +full:- +full:supply
1 // SPDX-License-Identifier: GPL-2.0-only
5 * Copyright (c) 2004-2006 Richard Purdie
43 #define POWER1_VW_ON 0x01 /* VW Supply FET ON */
44 #define POWER1_GVSS_ON 0x02 /* GVSS(-8V) Power Supply ON */
45 #define POWER1_VDD_ON 0x04 /* VDD(8V),SVSS(-4V) Power Supply ON */
47 #define POWER1_VW_OFF 0x00 /* VW Supply FET OFF */
48 #define POWER1_GVSS_OFF 0x00 /* GVSS(-8V) Power Supply OFF */
49 #define POWER1_VDD_OFF 0x00 /* VDD(8V),SVSS(-4V) Power Supply OFF */
53 #define POWER0_DAC_ON 0x04 /* DAC Power Supply ON */
54 #define POWER0_COM_ON 0x08 /* COM Power Supply ON */
55 #define POWER0_VCC5_ON 0x10 /* VCC5 Power Supply ON */
57 #define POWER0_DAC_OFF 0x00 /* DAC Power Supply OFF */
58 #define POWER0_COM_OFF 0x00 /* COM Power Supply OFF */
59 #define POWER0_VCC5_OFF 0x00 /* VCC5 Power Supply OFF */
177 .tx_buf = lcd->buf, in corgi_ssp_lcdtg_send()
180 lcd->buf[0] = ((adrs & 0x07) << 5) | (data & 0x1f); in corgi_ssp_lcdtg_send()
184 return spi_sync(lcd->spi_dev, &msg); in corgi_ssp_lcdtg_send()
226 /* VDD(+8V), SVSS(-4V) ON */ in corgi_lcd_power_on()
249 /* VCC5 ON, DAC ON */ in corgi_lcd_power_on()
254 /* GVSS(-8V) ON, VDD ON */ in corgi_lcd_power_on()
275 lcdtg_set_phadadj(lcd, lcd->mode); in corgi_lcd_power_on()
284 switch (lcd->mode) { in corgi_lcd_power_on()
317 /* (5)VCC5 OFF */ in corgi_lcd_power_off()
340 if (m->xres == 640 || m->xres == 480) in corgi_lcd_set_mode()
343 if (lcd->mode == mode) in corgi_lcd_set_mode()
358 lcd->mode = mode; in corgi_lcd_set_mode()
366 if (POWER_IS_ON(power) && !POWER_IS_ON(lcd->power)) in corgi_lcd_set_power()
369 if (!POWER_IS_ON(power) && POWER_IS_ON(lcd->power)) in corgi_lcd_set_power()
372 lcd->power = power; in corgi_lcd_set_power()
380 return lcd->power; in corgi_lcd_get_power()
393 return lcd->intensity; in corgi_bl_get_intensity()
408 if (lcd->backlight_cont) in corgi_bl_set_intensity()
409 gpiod_set_value_cansleep(lcd->backlight_cont, cont); in corgi_bl_set_intensity()
411 if (lcd->backlight_on) in corgi_bl_set_intensity()
412 gpiod_set_value_cansleep(lcd->backlight_on, intensity); in corgi_bl_set_intensity()
414 if (lcd->kick_battery) in corgi_bl_set_intensity()
415 lcd->kick_battery(); in corgi_bl_set_intensity()
417 lcd->intensity = intensity; in corgi_bl_set_intensity()
429 if ((corgibl_flags & CORGIBL_BATTLOW) && intensity > lcd->limit_mask) in corgi_bl_update_status()
430 intensity = lcd->limit_mask; in corgi_bl_update_status()
442 backlight_update_status(the_corgi_lcd->bl_dev); in corgi_lcd_limit_intensity()
458 corgi_lcd_set_power(lcd->lcd_dev, FB_BLANK_POWERDOWN); in corgi_lcd_suspend()
467 corgi_lcd_set_power(lcd->lcd_dev, FB_BLANK_UNBLANK); in corgi_lcd_resume()
468 backlight_update_status(lcd->bl_dev); in corgi_lcd_resume()
478 struct spi_device *spi = lcd->spi_dev; in setup_gpio_backlight()
480 lcd->backlight_on = devm_gpiod_get_optional(&spi->dev, in setup_gpio_backlight()
482 if (IS_ERR(lcd->backlight_on)) in setup_gpio_backlight()
483 return PTR_ERR(lcd->backlight_on); in setup_gpio_backlight()
485 lcd->backlight_cont = devm_gpiod_get_optional(&spi->dev, "BL_CONT", in setup_gpio_backlight()
487 if (IS_ERR(lcd->backlight_cont)) in setup_gpio_backlight()
488 return PTR_ERR(lcd->backlight_cont); in setup_gpio_backlight()
496 struct corgi_lcd_platform_data *pdata = dev_get_platdata(&spi->dev); in corgi_lcd_probe()
501 dev_err(&spi->dev, "platform data not available\n"); in corgi_lcd_probe()
502 return -EINVAL; in corgi_lcd_probe()
505 lcd = devm_kzalloc(&spi->dev, sizeof(struct corgi_lcd), GFP_KERNEL); in corgi_lcd_probe()
507 return -ENOMEM; in corgi_lcd_probe()
509 lcd->spi_dev = spi; in corgi_lcd_probe()
511 lcd->lcd_dev = devm_lcd_device_register(&spi->dev, "corgi_lcd", in corgi_lcd_probe()
512 &spi->dev, lcd, &corgi_lcd_ops); in corgi_lcd_probe()
513 if (IS_ERR(lcd->lcd_dev)) in corgi_lcd_probe()
514 return PTR_ERR(lcd->lcd_dev); in corgi_lcd_probe()
516 lcd->power = FB_BLANK_POWERDOWN; in corgi_lcd_probe()
517 lcd->mode = (pdata) ? pdata->init_mode : CORGI_LCD_MODE_VGA; in corgi_lcd_probe()
521 props.max_brightness = pdata->max_intensity; in corgi_lcd_probe()
522 lcd->bl_dev = devm_backlight_device_register(&spi->dev, "corgi_bl", in corgi_lcd_probe()
523 &spi->dev, lcd, &corgi_bl_ops, in corgi_lcd_probe()
525 if (IS_ERR(lcd->bl_dev)) in corgi_lcd_probe()
526 return PTR_ERR(lcd->bl_dev); in corgi_lcd_probe()
528 lcd->bl_dev->props.brightness = pdata->default_intensity; in corgi_lcd_probe()
529 lcd->bl_dev->props.power = BACKLIGHT_POWER_ON; in corgi_lcd_probe()
535 lcd->kick_battery = pdata->kick_battery; in corgi_lcd_probe()
538 corgi_lcd_set_power(lcd->lcd_dev, FB_BLANK_UNBLANK); in corgi_lcd_probe()
539 backlight_update_status(lcd->bl_dev); in corgi_lcd_probe()
541 lcd->limit_mask = pdata->limit_mask; in corgi_lcd_probe()
550 lcd->bl_dev->props.power = BACKLIGHT_POWER_ON; in corgi_lcd_remove()
551 lcd->bl_dev->props.brightness = 0; in corgi_lcd_remove()
552 backlight_update_status(lcd->bl_dev); in corgi_lcd_remove()
553 corgi_lcd_set_power(lcd->lcd_dev, FB_BLANK_POWERDOWN); in corgi_lcd_remove()
558 .name = "corgi-lcd",
570 MODULE_ALIAS("spi:corgi-lcd");