mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2024-12-28 16:52:18 +00:00
- Improved handling of LCD power states and interactions with the fbdev subsystem.
- Introduced new LCD_POWER_ constants to decouple the LCD subsystem from fbdev. - Several drivers were updated to use the new LCD_POWER_ constants. - Clarified the semantics of the lcd_ops.controls_device callback. - Removed unnecessary includes and dependencies. - Removed unused notifier functionality. - Simplified code with scoped for-each loops. - Fixed module autoloading for the ktz8866 driver. - Updated device tree bindings to yaml format. - Minor cleanups and improvements in various drivers. -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEdrbJNaO+IJqU8IdIUa+KL4f8d2EFAmc/KTkACgkQUa+KL4f8 d2HzWA//QtnboEtMOOt5hlY/MyGnwDG2nWWwbnlEVQ1zN3lQut4WWOocuyqIu6Wr tfRyLKOsiAWdjFi7NBQlV3ylNyyD4XU9/qNduOAMPe3VGj/lZB70coH+RL4L4JvX cSiue8vF9StX7gB7qxh1uVBastlCu9ofVZV4dFMD4hX+hA3SgBX5itmOfue9AMkm LXdA1DeDvigH5DMPIStHuQS0HVOxv06TJd1syzVBesa8G3raTwluTc16uPJkIwHd MnDqdvevaiW1ZnE3+8o2CmkLfFsB27iltwutXn9MbrUKBz0S7/ruNTib+RguFOaP Eo+ls0KIaiPH4xi0FuHlSiXKwszIvZ3GGeu3fO66k9m+vM2/IesBGgf0GR3Y8Lxr fwl4iNkLguKsBnLHBxhDnrQ3ltQiBw4q8Q2m/zQ4OoaW/sMX+514D3jOZmx3snE1 ODE22bhoznRLyEAHisv4wA9snoAyvEItejczGC7HLJ0SbWUGBbqzHgvhjwMkh6R6 0+6dJ22DTlSwZsyXcSkzA85ayiuxFLhwvD0nfxyGwUD//swg8L7ymnpVLOqpdJcc EgdVQeuaTij0UH9NutMDoIC1Z0SUMvpli1Wk0/Y1Hmg0vICZUUjewcli6VEbZGFu PKkkAeTPJaxfYWW64VHk6flSaW67VjqfiQ01F4oLlRwONcihpxM= =9n4l -----END PGP SIGNATURE----- Merge tag 'backlight-next-6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight Pull backlight updates from Lee Jones: - Improve handling of LCD power states and interactions with the fbdev subsystem - Introduce new LCD_POWER_ constants to decouple the LCD subsystem from fbdev - Update several drivers to use the new LCD_POWER_ constants - Clarify the semantics of the lcd_ops.controls_device callback - Remove unnecessary includes and dependencies - Remove unused notifier functionality - Simplify code with scoped for-each loops - Fix module autoloading for the ktz8866 driver - Update device tree bindings to yaml format - Minor cleanups and improvements in various drivers * tag 'backlight-next-6.13' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight: (33 commits) MAINTAINERS: Use Daniel Thompson's korg address for Backlight work dt-bindings: backlight: Convert zii,rave-sp-backlight.txt to yaml backlight: Remove notifier backlight: ktz8866: Fix module autoloading backlight: 88pm860x_bl: Simplify with scoped for each OF child loop backlight: lcd: Do not include <linux/fb.h> in lcd header backlight: lcd: Remove struct fb_videomode from set_mode callback backlight: lcd: Replace check_fb with controls_device HID: picoLCD: Replace check_fb in favor of struct fb_info.lcd_dev fbdev: omap: Use lcd power constants fbdev: imxfb: Use lcd power constants fbdev: imxfb: Replace check_fb in favor of struct fb_info.lcd_dev fbdev: clps711x-fb: Use lcd power constants fbdev: clps711x-fb: Replace check_fb in favor of struct fb_info.lcd_dev backlight: tdo24m: Use lcd power constants backlight: platform_lcd: Use lcd power constants backlight: platform_lcd: Remove match_fb from struct plat_lcd_data backlight: platform_lcd: Remove include statement for <linux/backlight.h> backlight: otm3225a: Use lcd power constants backlight: ltv350qv: Use lcd power constants ...
This commit is contained in:
commit
2fb7eb3d7e
@ -1,23 +0,0 @@
|
|||||||
Zodiac Inflight Innovations RAVE Supervisory Processor Backlight Bindings
|
|
||||||
|
|
||||||
RAVE SP backlight device is a "MFD cell" device corresponding to
|
|
||||||
backlight functionality of RAVE Supervisory Processor. It is expected
|
|
||||||
that its Device Tree node is specified as a child of the node
|
|
||||||
corresponding to the parent RAVE SP device (as documented in
|
|
||||||
Documentation/devicetree/bindings/mfd/zii,rave-sp.txt)
|
|
||||||
|
|
||||||
Required properties:
|
|
||||||
|
|
||||||
- compatible: Should be "zii,rave-sp-backlight"
|
|
||||||
|
|
||||||
Example:
|
|
||||||
|
|
||||||
rave-sp {
|
|
||||||
compatible = "zii,rave-sp-rdu1";
|
|
||||||
current-speed = <38400>;
|
|
||||||
|
|
||||||
backlight {
|
|
||||||
compatible = "zii,rave-sp-backlight";
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
@ -0,0 +1,36 @@
|
|||||||
|
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
|
||||||
|
%YAML 1.2
|
||||||
|
---
|
||||||
|
$id: http://devicetree.org/schemas/leds/backlight/zii,rave-sp-backlight.yaml#
|
||||||
|
$schema: http://devicetree.org/meta-schemas/core.yaml#
|
||||||
|
|
||||||
|
title: Zodiac Inflight Innovations RAVE Supervisory Processor Backlight
|
||||||
|
|
||||||
|
maintainers:
|
||||||
|
- Frank Li <Frank.Li@nxp.com>
|
||||||
|
|
||||||
|
description:
|
||||||
|
RAVE SP backlight device is a "MFD cell" device corresponding to
|
||||||
|
backlight functionality of RAVE Supervisory Processor. It is expected
|
||||||
|
that its Device Tree node is specified as a child of the node
|
||||||
|
corresponding to the parent RAVE SP device (as documented in
|
||||||
|
Documentation/devicetree/bindings/mfd/zii,rave-sp.yaml)
|
||||||
|
|
||||||
|
properties:
|
||||||
|
compatible:
|
||||||
|
const: zii,rave-sp-backlight
|
||||||
|
|
||||||
|
required:
|
||||||
|
- compatible
|
||||||
|
|
||||||
|
allOf:
|
||||||
|
- $ref: common.yaml
|
||||||
|
|
||||||
|
unevaluatedProperties: false
|
||||||
|
|
||||||
|
examples:
|
||||||
|
- |
|
||||||
|
backlight {
|
||||||
|
compatible = "zii,rave-sp-backlight";
|
||||||
|
};
|
||||||
|
|
@ -3812,7 +3812,7 @@ F: drivers/net/wireless/broadcom/b43legacy/
|
|||||||
|
|
||||||
BACKLIGHT CLASS/SUBSYSTEM
|
BACKLIGHT CLASS/SUBSYSTEM
|
||||||
M: Lee Jones <lee@kernel.org>
|
M: Lee Jones <lee@kernel.org>
|
||||||
M: Daniel Thompson <daniel.thompson@linaro.org>
|
M: Daniel Thompson <danielt@kernel.org>
|
||||||
M: Jingoo Han <jingoohan1@gmail.com>
|
M: Jingoo Han <jingoohan1@gmail.com>
|
||||||
L: dri-devel@lists.freedesktop.org
|
L: dri-devel@lists.freedesktop.org
|
||||||
S: Maintained
|
S: Maintained
|
||||||
|
@ -497,6 +497,10 @@ int picolcd_init_framebuffer(struct picolcd_data *data)
|
|||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef CONFIG_HID_PICOLCD_LCD
|
||||||
|
info->lcd_dev = data->lcd;
|
||||||
|
#endif
|
||||||
|
|
||||||
fbdata = info->par;
|
fbdata = info->par;
|
||||||
spin_lock_init(&fbdata->lock);
|
spin_lock_init(&fbdata->lock);
|
||||||
fbdata->picolcd = data;
|
fbdata->picolcd = data;
|
||||||
|
@ -41,15 +41,9 @@ static int picolcd_set_contrast(struct lcd_device *ldev, int contrast)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int picolcd_check_lcd_fb(struct lcd_device *ldev, struct fb_info *fb)
|
|
||||||
{
|
|
||||||
return fb && fb == picolcd_fbinfo((struct picolcd_data *)lcd_get_data(ldev));
|
|
||||||
}
|
|
||||||
|
|
||||||
static const struct lcd_ops picolcd_lcdops = {
|
static const struct lcd_ops picolcd_lcdops = {
|
||||||
.get_contrast = picolcd_get_contrast,
|
.get_contrast = picolcd_get_contrast,
|
||||||
.set_contrast = picolcd_set_contrast,
|
.set_contrast = picolcd_set_contrast,
|
||||||
.check_fb = picolcd_check_lcd_fb,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
int picolcd_init_lcd(struct picolcd_data *data, struct hid_report *report)
|
int picolcd_init_lcd(struct picolcd_data *data, struct hid_report *report)
|
||||||
|
@ -151,7 +151,7 @@ static int pm860x_backlight_dt_init(struct platform_device *pdev,
|
|||||||
struct pm860x_backlight_data *data,
|
struct pm860x_backlight_data *data,
|
||||||
char *name)
|
char *name)
|
||||||
{
|
{
|
||||||
struct device_node *nproot, *np;
|
struct device_node *nproot;
|
||||||
int iset = 0;
|
int iset = 0;
|
||||||
|
|
||||||
nproot = of_get_child_by_name(pdev->dev.parent->of_node, "backlights");
|
nproot = of_get_child_by_name(pdev->dev.parent->of_node, "backlights");
|
||||||
@ -159,14 +159,13 @@ static int pm860x_backlight_dt_init(struct platform_device *pdev,
|
|||||||
dev_err(&pdev->dev, "failed to find backlights node\n");
|
dev_err(&pdev->dev, "failed to find backlights node\n");
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
for_each_child_of_node(nproot, np) {
|
for_each_child_of_node_scoped(nproot, np) {
|
||||||
if (of_node_name_eq(np, name)) {
|
if (of_node_name_eq(np, name)) {
|
||||||
of_property_read_u32(np, "marvell,88pm860x-iset",
|
of_property_read_u32(np, "marvell,88pm860x-iset",
|
||||||
&iset);
|
&iset);
|
||||||
data->iset = PM8606_WLED_CURRENT(iset);
|
data->iset = PM8606_WLED_CURRENT(iset);
|
||||||
of_property_read_u32(np, "marvell,88pm860x-pwm",
|
of_property_read_u32(np, "marvell,88pm860x-pwm",
|
||||||
&data->pwm);
|
&data->pwm);
|
||||||
of_node_put(np);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -65,7 +65,6 @@
|
|||||||
|
|
||||||
static struct list_head backlight_dev_list;
|
static struct list_head backlight_dev_list;
|
||||||
static struct mutex backlight_dev_list_mutex;
|
static struct mutex backlight_dev_list_mutex;
|
||||||
static struct blocking_notifier_head backlight_notifier;
|
|
||||||
|
|
||||||
static const char *const backlight_types[] = {
|
static const char *const backlight_types[] = {
|
||||||
[BACKLIGHT_RAW] = "raw",
|
[BACKLIGHT_RAW] = "raw",
|
||||||
@ -467,9 +466,6 @@ struct backlight_device *backlight_device_register(const char *name,
|
|||||||
list_add(&new_bd->entry, &backlight_dev_list);
|
list_add(&new_bd->entry, &backlight_dev_list);
|
||||||
mutex_unlock(&backlight_dev_list_mutex);
|
mutex_unlock(&backlight_dev_list_mutex);
|
||||||
|
|
||||||
blocking_notifier_call_chain(&backlight_notifier,
|
|
||||||
BACKLIGHT_REGISTERED, new_bd);
|
|
||||||
|
|
||||||
return new_bd;
|
return new_bd;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(backlight_device_register);
|
EXPORT_SYMBOL(backlight_device_register);
|
||||||
@ -539,9 +535,6 @@ void backlight_device_unregister(struct backlight_device *bd)
|
|||||||
mutex_unlock(&pmac_backlight_mutex);
|
mutex_unlock(&pmac_backlight_mutex);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
blocking_notifier_call_chain(&backlight_notifier,
|
|
||||||
BACKLIGHT_UNREGISTERED, bd);
|
|
||||||
|
|
||||||
mutex_lock(&bd->ops_lock);
|
mutex_lock(&bd->ops_lock);
|
||||||
bd->ops = NULL;
|
bd->ops = NULL;
|
||||||
mutex_unlock(&bd->ops_lock);
|
mutex_unlock(&bd->ops_lock);
|
||||||
@ -566,40 +559,6 @@ static int devm_backlight_device_match(struct device *dev, void *res,
|
|||||||
return *r == data;
|
return *r == data;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* backlight_register_notifier - get notified of backlight (un)registration
|
|
||||||
* @nb: notifier block with the notifier to call on backlight (un)registration
|
|
||||||
*
|
|
||||||
* Register a notifier to get notified when backlight devices get registered
|
|
||||||
* or unregistered.
|
|
||||||
*
|
|
||||||
* RETURNS:
|
|
||||||
*
|
|
||||||
* 0 on success, otherwise a negative error code
|
|
||||||
*/
|
|
||||||
int backlight_register_notifier(struct notifier_block *nb)
|
|
||||||
{
|
|
||||||
return blocking_notifier_chain_register(&backlight_notifier, nb);
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL(backlight_register_notifier);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* backlight_unregister_notifier - unregister a backlight notifier
|
|
||||||
* @nb: notifier block to unregister
|
|
||||||
*
|
|
||||||
* Register a notifier to get notified when backlight devices get registered
|
|
||||||
* or unregistered.
|
|
||||||
*
|
|
||||||
* RETURNS:
|
|
||||||
*
|
|
||||||
* 0 on success, otherwise a negative error code
|
|
||||||
*/
|
|
||||||
int backlight_unregister_notifier(struct notifier_block *nb)
|
|
||||||
{
|
|
||||||
return blocking_notifier_chain_unregister(&backlight_notifier, nb);
|
|
||||||
}
|
|
||||||
EXPORT_SYMBOL(backlight_unregister_notifier);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* devm_backlight_device_register - register a new backlight device
|
* devm_backlight_device_register - register a new backlight device
|
||||||
* @dev: the device to register
|
* @dev: the device to register
|
||||||
@ -767,7 +726,6 @@ static int __init backlight_class_init(void)
|
|||||||
|
|
||||||
INIT_LIST_HEAD(&backlight_dev_list);
|
INIT_LIST_HEAD(&backlight_dev_list);
|
||||||
mutex_init(&backlight_dev_list_mutex);
|
mutex_init(&backlight_dev_list_mutex);
|
||||||
BLOCKING_INIT_NOTIFIER_HEAD(&backlight_notifier);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -17,14 +17,13 @@
|
|||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
#include <linux/delay.h>
|
#include <linux/delay.h>
|
||||||
#include <linux/gpio/consumer.h>
|
#include <linux/gpio/consumer.h>
|
||||||
#include <linux/fb.h>
|
|
||||||
#include <linux/lcd.h>
|
#include <linux/lcd.h>
|
||||||
#include <linux/spi/spi.h>
|
#include <linux/spi/spi.h>
|
||||||
#include <linux/spi/corgi_lcd.h>
|
#include <linux/spi/corgi_lcd.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
#include <asm/mach/sharpsl_param.h>
|
#include <asm/mach/sharpsl_param.h>
|
||||||
|
|
||||||
#define POWER_IS_ON(pwr) ((pwr) <= FB_BLANK_NORMAL)
|
#define POWER_IS_ON(pwr) ((pwr) <= LCD_POWER_REDUCED)
|
||||||
|
|
||||||
/* Register Addresses */
|
/* Register Addresses */
|
||||||
#define RESCTL_ADRS 0x00
|
#define RESCTL_ADRS 0x00
|
||||||
@ -332,12 +331,12 @@ static void corgi_lcd_power_off(struct corgi_lcd *lcd)
|
|||||||
POWER1_VW_OFF | POWER1_GVSS_OFF | POWER1_VDD_OFF);
|
POWER1_VW_OFF | POWER1_GVSS_OFF | POWER1_VDD_OFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int corgi_lcd_set_mode(struct lcd_device *ld, struct fb_videomode *m)
|
static int corgi_lcd_set_mode(struct lcd_device *ld, u32 xres, u32 yres)
|
||||||
{
|
{
|
||||||
struct corgi_lcd *lcd = lcd_get_data(ld);
|
struct corgi_lcd *lcd = lcd_get_data(ld);
|
||||||
int mode = CORGI_LCD_MODE_QVGA;
|
int mode = CORGI_LCD_MODE_QVGA;
|
||||||
|
|
||||||
if (m->xres == 640 || m->xres == 480)
|
if (xres == 640 || xres == 480)
|
||||||
mode = CORGI_LCD_MODE_VGA;
|
mode = CORGI_LCD_MODE_VGA;
|
||||||
|
|
||||||
if (lcd->mode == mode)
|
if (lcd->mode == mode)
|
||||||
@ -455,7 +454,7 @@ static int corgi_lcd_suspend(struct device *dev)
|
|||||||
|
|
||||||
corgibl_flags |= CORGIBL_SUSPENDED;
|
corgibl_flags |= CORGIBL_SUSPENDED;
|
||||||
corgi_bl_set_intensity(lcd, 0);
|
corgi_bl_set_intensity(lcd, 0);
|
||||||
corgi_lcd_set_power(lcd->lcd_dev, FB_BLANK_POWERDOWN);
|
corgi_lcd_set_power(lcd->lcd_dev, LCD_POWER_OFF);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -464,7 +463,7 @@ static int corgi_lcd_resume(struct device *dev)
|
|||||||
struct corgi_lcd *lcd = dev_get_drvdata(dev);
|
struct corgi_lcd *lcd = dev_get_drvdata(dev);
|
||||||
|
|
||||||
corgibl_flags &= ~CORGIBL_SUSPENDED;
|
corgibl_flags &= ~CORGIBL_SUSPENDED;
|
||||||
corgi_lcd_set_power(lcd->lcd_dev, FB_BLANK_UNBLANK);
|
corgi_lcd_set_power(lcd->lcd_dev, LCD_POWER_ON);
|
||||||
backlight_update_status(lcd->bl_dev);
|
backlight_update_status(lcd->bl_dev);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -513,7 +512,7 @@ static int corgi_lcd_probe(struct spi_device *spi)
|
|||||||
if (IS_ERR(lcd->lcd_dev))
|
if (IS_ERR(lcd->lcd_dev))
|
||||||
return PTR_ERR(lcd->lcd_dev);
|
return PTR_ERR(lcd->lcd_dev);
|
||||||
|
|
||||||
lcd->power = FB_BLANK_POWERDOWN;
|
lcd->power = LCD_POWER_OFF;
|
||||||
lcd->mode = (pdata) ? pdata->init_mode : CORGI_LCD_MODE_VGA;
|
lcd->mode = (pdata) ? pdata->init_mode : CORGI_LCD_MODE_VGA;
|
||||||
|
|
||||||
memset(&props, 0, sizeof(struct backlight_properties));
|
memset(&props, 0, sizeof(struct backlight_properties));
|
||||||
@ -535,7 +534,7 @@ static int corgi_lcd_probe(struct spi_device *spi)
|
|||||||
lcd->kick_battery = pdata->kick_battery;
|
lcd->kick_battery = pdata->kick_battery;
|
||||||
|
|
||||||
spi_set_drvdata(spi, lcd);
|
spi_set_drvdata(spi, lcd);
|
||||||
corgi_lcd_set_power(lcd->lcd_dev, FB_BLANK_UNBLANK);
|
corgi_lcd_set_power(lcd->lcd_dev, LCD_POWER_ON);
|
||||||
backlight_update_status(lcd->bl_dev);
|
backlight_update_status(lcd->bl_dev);
|
||||||
|
|
||||||
lcd->limit_mask = pdata->limit_mask;
|
lcd->limit_mask = pdata->limit_mask;
|
||||||
@ -550,7 +549,7 @@ static void corgi_lcd_remove(struct spi_device *spi)
|
|||||||
lcd->bl_dev->props.power = BACKLIGHT_POWER_ON;
|
lcd->bl_dev->props.power = BACKLIGHT_POWER_ON;
|
||||||
lcd->bl_dev->props.brightness = 0;
|
lcd->bl_dev->props.brightness = 0;
|
||||||
backlight_update_status(lcd->bl_dev);
|
backlight_update_status(lcd->bl_dev);
|
||||||
corgi_lcd_set_power(lcd->lcd_dev, FB_BLANK_POWERDOWN);
|
corgi_lcd_set_power(lcd->lcd_dev, LCD_POWER_OFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct spi_driver corgi_lcd_driver = {
|
static struct spi_driver corgi_lcd_driver = {
|
||||||
|
@ -532,7 +532,7 @@ static int hx8369_lcd_init(struct lcd_device *lcdev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define POWER_IS_ON(pwr) ((pwr) <= FB_BLANK_NORMAL)
|
#define POWER_IS_ON(pwr) ((pwr) <= LCD_POWER_REDUCED)
|
||||||
|
|
||||||
static int hx8357_set_power(struct lcd_device *lcdev, int power)
|
static int hx8357_set_power(struct lcd_device *lcdev, int power)
|
||||||
{
|
{
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
* memory is cyclically updated over the RGB interface.
|
* memory is cyclically updated over the RGB interface.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <linux/fb.h>
|
|
||||||
#include <linux/delay.h>
|
#include <linux/delay.h>
|
||||||
#include <linux/errno.h>
|
#include <linux/errno.h>
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
@ -119,7 +118,7 @@
|
|||||||
|
|
||||||
#define CMD_BUFSIZE 16
|
#define CMD_BUFSIZE 16
|
||||||
|
|
||||||
#define POWER_IS_ON(pwr) ((pwr) <= FB_BLANK_NORMAL)
|
#define POWER_IS_ON(pwr) ((pwr) <= LCD_POWER_REDUCED)
|
||||||
|
|
||||||
#define set_tx_byte(b) (tx_invert ? ~(b) : b)
|
#define set_tx_byte(b) (tx_invert ? ~(b) : b)
|
||||||
|
|
||||||
@ -513,7 +512,7 @@ static int ili922x_probe(struct spi_device *spi)
|
|||||||
|
|
||||||
ili922x_display_init(spi);
|
ili922x_display_init(spi);
|
||||||
|
|
||||||
ili->power = FB_BLANK_POWERDOWN;
|
ili->power = LCD_POWER_OFF;
|
||||||
|
|
||||||
lcd = devm_lcd_device_register(&spi->dev, "ili922xlcd", &spi->dev, ili,
|
lcd = devm_lcd_device_register(&spi->dev, "ili922xlcd", &spi->dev, ili,
|
||||||
&ili922x_ops);
|
&ili922x_ops);
|
||||||
@ -525,7 +524,7 @@ static int ili922x_probe(struct spi_device *spi)
|
|||||||
ili->ld = lcd;
|
ili->ld = lcd;
|
||||||
spi_set_drvdata(spi, ili);
|
spi_set_drvdata(spi, ili);
|
||||||
|
|
||||||
ili922x_lcd_power(ili, FB_BLANK_UNBLANK);
|
ili922x_lcd_power(ili, LCD_POWER_ON);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,6 @@
|
|||||||
|
|
||||||
#include <linux/delay.h>
|
#include <linux/delay.h>
|
||||||
#include <linux/err.h>
|
#include <linux/err.h>
|
||||||
#include <linux/fb.h>
|
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
#include <linux/lcd.h>
|
#include <linux/lcd.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
@ -121,7 +120,7 @@ static inline int ili9320_power_off(struct ili9320 *lcd)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define POWER_IS_ON(pwr) ((pwr) <= FB_BLANK_NORMAL)
|
#define POWER_IS_ON(pwr) ((pwr) <= LCD_POWER_REDUCED)
|
||||||
|
|
||||||
static int ili9320_power(struct ili9320 *lcd, int power)
|
static int ili9320_power(struct ili9320 *lcd, int power)
|
||||||
{
|
{
|
||||||
@ -223,7 +222,7 @@ int ili9320_probe_spi(struct spi_device *spi,
|
|||||||
|
|
||||||
ili->dev = dev;
|
ili->dev = dev;
|
||||||
ili->client = client;
|
ili->client = client;
|
||||||
ili->power = FB_BLANK_POWERDOWN;
|
ili->power = LCD_POWER_OFF;
|
||||||
ili->platdata = cfg;
|
ili->platdata = cfg;
|
||||||
|
|
||||||
spi_set_drvdata(spi, ili);
|
spi_set_drvdata(spi, ili);
|
||||||
@ -241,7 +240,7 @@ int ili9320_probe_spi(struct spi_device *spi,
|
|||||||
|
|
||||||
dev_info(dev, "initialising %s\n", client->name);
|
dev_info(dev, "initialising %s\n", client->name);
|
||||||
|
|
||||||
ret = ili9320_power(ili, FB_BLANK_UNBLANK);
|
ret = ili9320_power(ili, LCD_POWER_ON);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
dev_err(dev, "failed to set lcd power state\n");
|
dev_err(dev, "failed to set lcd power state\n");
|
||||||
return ret;
|
return ret;
|
||||||
@ -253,7 +252,7 @@ EXPORT_SYMBOL_GPL(ili9320_probe_spi);
|
|||||||
|
|
||||||
void ili9320_remove(struct ili9320 *ili)
|
void ili9320_remove(struct ili9320 *ili)
|
||||||
{
|
{
|
||||||
ili9320_power(ili, FB_BLANK_POWERDOWN);
|
ili9320_power(ili, LCD_POWER_OFF);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(ili9320_remove);
|
EXPORT_SYMBOL_GPL(ili9320_remove);
|
||||||
|
|
||||||
@ -262,7 +261,7 @@ int ili9320_suspend(struct ili9320 *lcd)
|
|||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
ret = ili9320_power(lcd, FB_BLANK_POWERDOWN);
|
ret = ili9320_power(lcd, LCD_POWER_OFF);
|
||||||
|
|
||||||
if (lcd->platdata->suspend == ILI9320_SUSPEND_DEEP) {
|
if (lcd->platdata->suspend == ILI9320_SUSPEND_DEEP) {
|
||||||
ili9320_write(lcd, ILI9320_POWER1, lcd->power1 |
|
ili9320_write(lcd, ILI9320_POWER1, lcd->power1 |
|
||||||
@ -282,7 +281,7 @@ int ili9320_resume(struct ili9320 *lcd)
|
|||||||
if (lcd->platdata->suspend == ILI9320_SUSPEND_DEEP)
|
if (lcd->platdata->suspend == ILI9320_SUSPEND_DEEP)
|
||||||
ili9320_write(lcd, ILI9320_POWER1, 0x00);
|
ili9320_write(lcd, ILI9320_POWER1, 0x00);
|
||||||
|
|
||||||
return ili9320_power(lcd, FB_BLANK_UNBLANK);
|
return ili9320_power(lcd, LCD_POWER_ON);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(ili9320_resume);
|
EXPORT_SYMBOL_GPL(ili9320_resume);
|
||||||
#endif
|
#endif
|
||||||
@ -290,7 +289,7 @@ EXPORT_SYMBOL_GPL(ili9320_resume);
|
|||||||
/* Power down all displays on reboot, poweroff or halt */
|
/* Power down all displays on reboot, poweroff or halt */
|
||||||
void ili9320_shutdown(struct ili9320 *lcd)
|
void ili9320_shutdown(struct ili9320 *lcd)
|
||||||
{
|
{
|
||||||
ili9320_power(lcd, FB_BLANK_POWERDOWN);
|
ili9320_power(lcd, LCD_POWER_OFF);
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_GPL(ili9320_shutdown);
|
EXPORT_SYMBOL_GPL(ili9320_shutdown);
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <linux/device.h>
|
#include <linux/device.h>
|
||||||
#include <linux/fb.h>
|
#include <linux/io.h>
|
||||||
#include <linux/kernel.h>
|
#include <linux/kernel.h>
|
||||||
#include <linux/lcd.h>
|
#include <linux/lcd.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
@ -23,14 +23,14 @@
|
|||||||
|
|
||||||
static int jornada_lcd_get_power(struct lcd_device *ld)
|
static int jornada_lcd_get_power(struct lcd_device *ld)
|
||||||
{
|
{
|
||||||
return PPSR & PPC_LDD2 ? FB_BLANK_UNBLANK : FB_BLANK_POWERDOWN;
|
return PPSR & PPC_LDD2 ? LCD_POWER_ON : LCD_POWER_OFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int jornada_lcd_get_contrast(struct lcd_device *ld)
|
static int jornada_lcd_get_contrast(struct lcd_device *ld)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (jornada_lcd_get_power(ld) != FB_BLANK_UNBLANK)
|
if (jornada_lcd_get_power(ld) != LCD_POWER_ON)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
jornada_ssp_start();
|
jornada_ssp_start();
|
||||||
@ -71,7 +71,7 @@ static int jornada_lcd_set_contrast(struct lcd_device *ld, int value)
|
|||||||
|
|
||||||
static int jornada_lcd_set_power(struct lcd_device *ld, int power)
|
static int jornada_lcd_set_power(struct lcd_device *ld, int power)
|
||||||
{
|
{
|
||||||
if (power != FB_BLANK_UNBLANK) {
|
if (power != LCD_POWER_ON) {
|
||||||
PPSR &= ~PPC_LDD2;
|
PPSR &= ~PPC_LDD2;
|
||||||
PPDR |= PPC_LDD2;
|
PPDR |= PPC_LDD2;
|
||||||
} else {
|
} else {
|
||||||
@ -106,7 +106,7 @@ static int jornada_lcd_probe(struct platform_device *pdev)
|
|||||||
|
|
||||||
/* lets set our default values */
|
/* lets set our default values */
|
||||||
jornada_lcd_set_contrast(lcd_device, LCD_DEF_CONTRAST);
|
jornada_lcd_set_contrast(lcd_device, LCD_DEF_CONTRAST);
|
||||||
jornada_lcd_set_power(lcd_device, FB_BLANK_UNBLANK);
|
jornada_lcd_set_power(lcd_device, LCD_POWER_ON);
|
||||||
/* give it some time to startup */
|
/* give it some time to startup */
|
||||||
msleep(100);
|
msleep(100);
|
||||||
|
|
||||||
|
@ -190,6 +190,7 @@ static const struct of_device_id ktz8866_match_table[] = {
|
|||||||
},
|
},
|
||||||
{},
|
{},
|
||||||
};
|
};
|
||||||
|
MODULE_DEVICE_TABLE(of, ktz8866_match_table);
|
||||||
|
|
||||||
static struct i2c_driver ktz8866_driver = {
|
static struct i2c_driver ktz8866_driver = {
|
||||||
.driver = {
|
.driver = {
|
||||||
|
@ -112,40 +112,40 @@ static int l4f00242t03_lcd_power_set(struct lcd_device *ld, int power)
|
|||||||
const u16 slpin = 0x10;
|
const u16 slpin = 0x10;
|
||||||
const u16 disoff = 0x28;
|
const u16 disoff = 0x28;
|
||||||
|
|
||||||
if (power <= FB_BLANK_NORMAL) {
|
if (power <= LCD_POWER_REDUCED) {
|
||||||
if (priv->lcd_state <= FB_BLANK_NORMAL) {
|
if (priv->lcd_state <= LCD_POWER_REDUCED) {
|
||||||
/* Do nothing, the LCD is running */
|
/* Do nothing, the LCD is running */
|
||||||
} else if (priv->lcd_state < FB_BLANK_POWERDOWN) {
|
} else if (priv->lcd_state < LCD_POWER_OFF) {
|
||||||
dev_dbg(&spi->dev, "Resuming LCD\n");
|
dev_dbg(&spi->dev, "Resuming LCD\n");
|
||||||
|
|
||||||
spi_write(spi, (const u8 *)&slpout, sizeof(u16));
|
spi_write(spi, (const u8 *)&slpout, sizeof(u16));
|
||||||
msleep(60);
|
msleep(60);
|
||||||
spi_write(spi, (const u8 *)&dison, sizeof(u16));
|
spi_write(spi, (const u8 *)&dison, sizeof(u16));
|
||||||
} else {
|
} else {
|
||||||
/* priv->lcd_state == FB_BLANK_POWERDOWN */
|
/* priv->lcd_state == LCD_POWER_OFF */
|
||||||
l4f00242t03_lcd_init(spi);
|
l4f00242t03_lcd_init(spi);
|
||||||
priv->lcd_state = FB_BLANK_VSYNC_SUSPEND;
|
priv->lcd_state = LCD_POWER_REDUCED_VSYNC_SUSPEND;
|
||||||
l4f00242t03_lcd_power_set(priv->ld, power);
|
l4f00242t03_lcd_power_set(priv->ld, power);
|
||||||
}
|
}
|
||||||
} else if (power < FB_BLANK_POWERDOWN) {
|
} else if (power < LCD_POWER_OFF) {
|
||||||
if (priv->lcd_state <= FB_BLANK_NORMAL) {
|
if (priv->lcd_state <= LCD_POWER_REDUCED) {
|
||||||
/* Send the display in standby */
|
/* Send the display in standby */
|
||||||
dev_dbg(&spi->dev, "Standby the LCD\n");
|
dev_dbg(&spi->dev, "Standby the LCD\n");
|
||||||
|
|
||||||
spi_write(spi, (const u8 *)&disoff, sizeof(u16));
|
spi_write(spi, (const u8 *)&disoff, sizeof(u16));
|
||||||
msleep(60);
|
msleep(60);
|
||||||
spi_write(spi, (const u8 *)&slpin, sizeof(u16));
|
spi_write(spi, (const u8 *)&slpin, sizeof(u16));
|
||||||
} else if (priv->lcd_state < FB_BLANK_POWERDOWN) {
|
} else if (priv->lcd_state < LCD_POWER_OFF) {
|
||||||
/* Do nothing, the LCD is already in standby */
|
/* Do nothing, the LCD is already in standby */
|
||||||
} else {
|
} else {
|
||||||
/* priv->lcd_state == FB_BLANK_POWERDOWN */
|
/* priv->lcd_state == LCD_POWER_OFF */
|
||||||
l4f00242t03_lcd_init(spi);
|
l4f00242t03_lcd_init(spi);
|
||||||
priv->lcd_state = FB_BLANK_UNBLANK;
|
priv->lcd_state = LCD_POWER_ON;
|
||||||
l4f00242t03_lcd_power_set(ld, power);
|
l4f00242t03_lcd_power_set(ld, power);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* power == FB_BLANK_POWERDOWN */
|
/* power == LCD_POWER_OFF */
|
||||||
if (priv->lcd_state != FB_BLANK_POWERDOWN) {
|
if (priv->lcd_state != LCD_POWER_OFF) {
|
||||||
/* Clear the screen before shutting down */
|
/* Clear the screen before shutting down */
|
||||||
spi_write(spi, (const u8 *)&disoff, sizeof(u16));
|
spi_write(spi, (const u8 *)&disoff, sizeof(u16));
|
||||||
msleep(60);
|
msleep(60);
|
||||||
@ -212,8 +212,8 @@ static int l4f00242t03_probe(struct spi_device *spi)
|
|||||||
|
|
||||||
/* Init the LCD */
|
/* Init the LCD */
|
||||||
l4f00242t03_lcd_init(spi);
|
l4f00242t03_lcd_init(spi);
|
||||||
priv->lcd_state = FB_BLANK_VSYNC_SUSPEND;
|
priv->lcd_state = LCD_POWER_REDUCED_VSYNC_SUSPEND;
|
||||||
l4f00242t03_lcd_power_set(priv->ld, FB_BLANK_UNBLANK);
|
l4f00242t03_lcd_power_set(priv->ld, LCD_POWER_ON);
|
||||||
|
|
||||||
dev_info(&spi->dev, "Epson l4f00242t03 lcd probed.\n");
|
dev_info(&spi->dev, "Epson l4f00242t03 lcd probed.\n");
|
||||||
|
|
||||||
@ -224,7 +224,7 @@ static void l4f00242t03_remove(struct spi_device *spi)
|
|||||||
{
|
{
|
||||||
struct l4f00242t03_priv *priv = spi_get_drvdata(spi);
|
struct l4f00242t03_priv *priv = spi_get_drvdata(spi);
|
||||||
|
|
||||||
l4f00242t03_lcd_power_set(priv->ld, FB_BLANK_POWERDOWN);
|
l4f00242t03_lcd_power_set(priv->ld, LCD_POWER_OFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void l4f00242t03_shutdown(struct spi_device *spi)
|
static void l4f00242t03_shutdown(struct spi_device *spi)
|
||||||
@ -232,7 +232,7 @@ static void l4f00242t03_shutdown(struct spi_device *spi)
|
|||||||
struct l4f00242t03_priv *priv = spi_get_drvdata(spi);
|
struct l4f00242t03_priv *priv = spi_get_drvdata(spi);
|
||||||
|
|
||||||
if (priv)
|
if (priv)
|
||||||
l4f00242t03_lcd_power_set(priv->ld, FB_BLANK_POWERDOWN);
|
l4f00242t03_lcd_power_set(priv->ld, LCD_POWER_OFF);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,6 +20,24 @@
|
|||||||
|
|
||||||
#if defined(CONFIG_FB) || (defined(CONFIG_FB_MODULE) && \
|
#if defined(CONFIG_FB) || (defined(CONFIG_FB_MODULE) && \
|
||||||
defined(CONFIG_LCD_CLASS_DEVICE_MODULE))
|
defined(CONFIG_LCD_CLASS_DEVICE_MODULE))
|
||||||
|
static int to_lcd_power(int fb_blank)
|
||||||
|
{
|
||||||
|
switch (fb_blank) {
|
||||||
|
case FB_BLANK_UNBLANK:
|
||||||
|
return LCD_POWER_ON;
|
||||||
|
/* deprecated; TODO: should become 'off' */
|
||||||
|
case FB_BLANK_NORMAL:
|
||||||
|
return LCD_POWER_REDUCED;
|
||||||
|
case FB_BLANK_VSYNC_SUSPEND:
|
||||||
|
return LCD_POWER_REDUCED_VSYNC_SUSPEND;
|
||||||
|
/* 'off' */
|
||||||
|
case FB_BLANK_HSYNC_SUSPEND:
|
||||||
|
case FB_BLANK_POWERDOWN:
|
||||||
|
default:
|
||||||
|
return LCD_POWER_OFF;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* This callback gets called when something important happens inside a
|
/* This callback gets called when something important happens inside a
|
||||||
* framebuffer driver. We're looking if that important event is blanking,
|
* framebuffer driver. We're looking if that important event is blanking,
|
||||||
* and if it is, we're switching lcd power as well ...
|
* and if it is, we're switching lcd power as well ...
|
||||||
@ -27,24 +45,32 @@
|
|||||||
static int fb_notifier_callback(struct notifier_block *self,
|
static int fb_notifier_callback(struct notifier_block *self,
|
||||||
unsigned long event, void *data)
|
unsigned long event, void *data)
|
||||||
{
|
{
|
||||||
struct lcd_device *ld;
|
struct lcd_device *ld = container_of(self, struct lcd_device, fb_notif);
|
||||||
struct fb_event *evdata = data;
|
struct fb_event *evdata = data;
|
||||||
|
struct fb_info *info = evdata->info;
|
||||||
|
struct lcd_device *fb_lcd = fb_lcd_device(info);
|
||||||
|
|
||||||
|
guard(mutex)(&ld->ops_lock);
|
||||||
|
|
||||||
ld = container_of(self, struct lcd_device, fb_notif);
|
|
||||||
if (!ld->ops)
|
if (!ld->ops)
|
||||||
return 0;
|
return 0;
|
||||||
|
if (ld->ops->controls_device && !ld->ops->controls_device(ld, info->device))
|
||||||
|
return 0;
|
||||||
|
if (fb_lcd && fb_lcd != ld)
|
||||||
|
return 0;
|
||||||
|
|
||||||
mutex_lock(&ld->ops_lock);
|
if (event == FB_EVENT_BLANK) {
|
||||||
if (!ld->ops->check_fb || ld->ops->check_fb(ld, evdata->info)) {
|
int power = to_lcd_power(*(int *)evdata->data);
|
||||||
if (event == FB_EVENT_BLANK) {
|
|
||||||
if (ld->ops->set_power)
|
if (ld->ops->set_power)
|
||||||
ld->ops->set_power(ld, *(int *)evdata->data);
|
ld->ops->set_power(ld, power);
|
||||||
} else {
|
} else {
|
||||||
if (ld->ops->set_mode)
|
const struct fb_videomode *videomode = evdata->data;
|
||||||
ld->ops->set_mode(ld, evdata->data);
|
|
||||||
}
|
if (ld->ops->set_mode)
|
||||||
|
ld->ops->set_mode(ld, videomode->xres, videomode->yres);
|
||||||
}
|
}
|
||||||
mutex_unlock(&ld->ops_lock);
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,7 +126,7 @@ static int lms283gf05_power_set(struct lcd_device *ld, int power)
|
|||||||
struct lms283gf05_state *st = lcd_get_data(ld);
|
struct lms283gf05_state *st = lcd_get_data(ld);
|
||||||
struct spi_device *spi = st->spi;
|
struct spi_device *spi = st->spi;
|
||||||
|
|
||||||
if (power <= FB_BLANK_NORMAL) {
|
if (power <= LCD_POWER_REDUCED) {
|
||||||
if (st->reset)
|
if (st->reset)
|
||||||
lms283gf05_reset(st->reset);
|
lms283gf05_reset(st->reset);
|
||||||
lms283gf05_toggle(spi, disp_initseq, ARRAY_SIZE(disp_initseq));
|
lms283gf05_toggle(spi, disp_initseq, ARRAY_SIZE(disp_initseq));
|
||||||
|
@ -6,9 +6,7 @@
|
|||||||
* Author: Jingoo Han <jg1.han@samsung.com>
|
* Author: Jingoo Han <jg1.han@samsung.com>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <linux/backlight.h>
|
|
||||||
#include <linux/delay.h>
|
#include <linux/delay.h>
|
||||||
#include <linux/fb.h>
|
|
||||||
#include <linux/lcd.h>
|
#include <linux/lcd.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/spi/spi.h>
|
#include <linux/spi/spi.h>
|
||||||
@ -206,7 +204,7 @@ static int lms501kf03_ldi_disable(struct lms501kf03 *lcd)
|
|||||||
|
|
||||||
static int lms501kf03_power_is_on(int power)
|
static int lms501kf03_power_is_on(int power)
|
||||||
{
|
{
|
||||||
return (power) <= FB_BLANK_NORMAL;
|
return (power) <= LCD_POWER_REDUCED;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int lms501kf03_power_on(struct lms501kf03 *lcd)
|
static int lms501kf03_power_on(struct lms501kf03 *lcd)
|
||||||
@ -295,8 +293,8 @@ static int lms501kf03_set_power(struct lcd_device *ld, int power)
|
|||||||
{
|
{
|
||||||
struct lms501kf03 *lcd = lcd_get_data(ld);
|
struct lms501kf03 *lcd = lcd_get_data(ld);
|
||||||
|
|
||||||
if (power != FB_BLANK_UNBLANK && power != FB_BLANK_POWERDOWN &&
|
if (power != LCD_POWER_ON && power != LCD_POWER_OFF &&
|
||||||
power != FB_BLANK_NORMAL) {
|
power != LCD_POWER_REDUCED) {
|
||||||
dev_err(lcd->dev, "power value should be 0, 1 or 4.\n");
|
dev_err(lcd->dev, "power value should be 0, 1 or 4.\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
@ -350,11 +348,11 @@ static int lms501kf03_probe(struct spi_device *spi)
|
|||||||
* current lcd status is powerdown and then
|
* current lcd status is powerdown and then
|
||||||
* it enables lcd panel.
|
* it enables lcd panel.
|
||||||
*/
|
*/
|
||||||
lcd->power = FB_BLANK_POWERDOWN;
|
lcd->power = LCD_POWER_OFF;
|
||||||
|
|
||||||
lms501kf03_power(lcd, FB_BLANK_UNBLANK);
|
lms501kf03_power(lcd, LCD_POWER_ON);
|
||||||
} else {
|
} else {
|
||||||
lcd->power = FB_BLANK_UNBLANK;
|
lcd->power = LCD_POWER_ON;
|
||||||
}
|
}
|
||||||
|
|
||||||
spi_set_drvdata(spi, lcd);
|
spi_set_drvdata(spi, lcd);
|
||||||
@ -368,7 +366,7 @@ static void lms501kf03_remove(struct spi_device *spi)
|
|||||||
{
|
{
|
||||||
struct lms501kf03 *lcd = spi_get_drvdata(spi);
|
struct lms501kf03 *lcd = spi_get_drvdata(spi);
|
||||||
|
|
||||||
lms501kf03_power(lcd, FB_BLANK_POWERDOWN);
|
lms501kf03_power(lcd, LCD_POWER_OFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM_SLEEP
|
#ifdef CONFIG_PM_SLEEP
|
||||||
@ -382,16 +380,16 @@ static int lms501kf03_suspend(struct device *dev)
|
|||||||
* when lcd panel is suspend, lcd panel becomes off
|
* when lcd panel is suspend, lcd panel becomes off
|
||||||
* regardless of status.
|
* regardless of status.
|
||||||
*/
|
*/
|
||||||
return lms501kf03_power(lcd, FB_BLANK_POWERDOWN);
|
return lms501kf03_power(lcd, LCD_POWER_OFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int lms501kf03_resume(struct device *dev)
|
static int lms501kf03_resume(struct device *dev)
|
||||||
{
|
{
|
||||||
struct lms501kf03 *lcd = dev_get_drvdata(dev);
|
struct lms501kf03 *lcd = dev_get_drvdata(dev);
|
||||||
|
|
||||||
lcd->power = FB_BLANK_POWERDOWN;
|
lcd->power = LCD_POWER_OFF;
|
||||||
|
|
||||||
return lms501kf03_power(lcd, FB_BLANK_UNBLANK);
|
return lms501kf03_power(lcd, LCD_POWER_ON);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -402,7 +400,7 @@ static void lms501kf03_shutdown(struct spi_device *spi)
|
|||||||
{
|
{
|
||||||
struct lms501kf03 *lcd = spi_get_drvdata(spi);
|
struct lms501kf03 *lcd = spi_get_drvdata(spi);
|
||||||
|
|
||||||
lms501kf03_power(lcd, FB_BLANK_POWERDOWN);
|
lms501kf03_power(lcd, LCD_POWER_OFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct spi_driver lms501kf03_driver = {
|
static struct spi_driver lms501kf03_driver = {
|
||||||
|
@ -6,7 +6,6 @@
|
|||||||
*/
|
*/
|
||||||
#include <linux/delay.h>
|
#include <linux/delay.h>
|
||||||
#include <linux/err.h>
|
#include <linux/err.h>
|
||||||
#include <linux/fb.h>
|
|
||||||
#include <linux/init.h>
|
#include <linux/init.h>
|
||||||
#include <linux/lcd.h>
|
#include <linux/lcd.h>
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
@ -15,7 +14,7 @@
|
|||||||
|
|
||||||
#include "ltv350qv.h"
|
#include "ltv350qv.h"
|
||||||
|
|
||||||
#define POWER_IS_ON(pwr) ((pwr) <= FB_BLANK_NORMAL)
|
#define POWER_IS_ON(pwr) ((pwr) <= LCD_POWER_REDUCED)
|
||||||
|
|
||||||
struct ltv350qv {
|
struct ltv350qv {
|
||||||
struct spi_device *spi;
|
struct spi_device *spi;
|
||||||
@ -233,7 +232,7 @@ static int ltv350qv_probe(struct spi_device *spi)
|
|||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
lcd->spi = spi;
|
lcd->spi = spi;
|
||||||
lcd->power = FB_BLANK_POWERDOWN;
|
lcd->power = LCD_POWER_OFF;
|
||||||
lcd->buffer = devm_kzalloc(&spi->dev, 8, GFP_KERNEL);
|
lcd->buffer = devm_kzalloc(&spi->dev, 8, GFP_KERNEL);
|
||||||
if (!lcd->buffer)
|
if (!lcd->buffer)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
@ -245,7 +244,7 @@ static int ltv350qv_probe(struct spi_device *spi)
|
|||||||
|
|
||||||
lcd->ld = ld;
|
lcd->ld = ld;
|
||||||
|
|
||||||
ret = ltv350qv_power(lcd, FB_BLANK_UNBLANK);
|
ret = ltv350qv_power(lcd, LCD_POWER_ON);
|
||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
@ -258,7 +257,7 @@ static void ltv350qv_remove(struct spi_device *spi)
|
|||||||
{
|
{
|
||||||
struct ltv350qv *lcd = spi_get_drvdata(spi);
|
struct ltv350qv *lcd = spi_get_drvdata(spi);
|
||||||
|
|
||||||
ltv350qv_power(lcd, FB_BLANK_POWERDOWN);
|
ltv350qv_power(lcd, LCD_POWER_OFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM_SLEEP
|
#ifdef CONFIG_PM_SLEEP
|
||||||
@ -266,14 +265,14 @@ static int ltv350qv_suspend(struct device *dev)
|
|||||||
{
|
{
|
||||||
struct ltv350qv *lcd = dev_get_drvdata(dev);
|
struct ltv350qv *lcd = dev_get_drvdata(dev);
|
||||||
|
|
||||||
return ltv350qv_power(lcd, FB_BLANK_POWERDOWN);
|
return ltv350qv_power(lcd, LCD_POWER_OFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ltv350qv_resume(struct device *dev)
|
static int ltv350qv_resume(struct device *dev)
|
||||||
{
|
{
|
||||||
struct ltv350qv *lcd = dev_get_drvdata(dev);
|
struct ltv350qv *lcd = dev_get_drvdata(dev);
|
||||||
|
|
||||||
return ltv350qv_power(lcd, FB_BLANK_UNBLANK);
|
return ltv350qv_power(lcd, LCD_POWER_ON);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -284,7 +283,7 @@ static void ltv350qv_shutdown(struct spi_device *spi)
|
|||||||
{
|
{
|
||||||
struct ltv350qv *lcd = spi_get_drvdata(spi);
|
struct ltv350qv *lcd = spi_get_drvdata(spi);
|
||||||
|
|
||||||
ltv350qv_power(lcd, FB_BLANK_POWERDOWN);
|
ltv350qv_power(lcd, LCD_POWER_OFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct spi_driver ltv350qv_driver = {
|
static struct spi_driver ltv350qv_driver = {
|
||||||
|
@ -189,7 +189,7 @@ static int otm3225a_set_power(struct lcd_device *ld, int power)
|
|||||||
if (power == dd->power)
|
if (power == dd->power)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
if (power > FB_BLANK_UNBLANK)
|
if (power > LCD_POWER_ON)
|
||||||
otm3225a_write(dd->spi, display_off, ARRAY_SIZE(display_off));
|
otm3225a_write(dd->spi, display_off, ARRAY_SIZE(display_off));
|
||||||
else
|
else
|
||||||
otm3225a_write(dd->spi, display_on, ARRAY_SIZE(display_on));
|
otm3225a_write(dd->spi, display_on, ARRAY_SIZE(display_on));
|
||||||
|
@ -9,8 +9,6 @@
|
|||||||
|
|
||||||
#include <linux/module.h>
|
#include <linux/module.h>
|
||||||
#include <linux/platform_device.h>
|
#include <linux/platform_device.h>
|
||||||
#include <linux/fb.h>
|
|
||||||
#include <linux/backlight.h>
|
|
||||||
#include <linux/lcd.h>
|
#include <linux/lcd.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
|
|
||||||
@ -42,7 +40,7 @@ static int platform_lcd_set_power(struct lcd_device *lcd, int power)
|
|||||||
struct platform_lcd *plcd = to_our_lcd(lcd);
|
struct platform_lcd *plcd = to_our_lcd(lcd);
|
||||||
int lcd_power = 1;
|
int lcd_power = 1;
|
||||||
|
|
||||||
if (power == FB_BLANK_POWERDOWN || plcd->suspended)
|
if (power == LCD_POWER_OFF || plcd->suspended)
|
||||||
lcd_power = 0;
|
lcd_power = 0;
|
||||||
|
|
||||||
plcd->pdata->set_power(plcd->pdata, lcd_power);
|
plcd->pdata->set_power(plcd->pdata, lcd_power);
|
||||||
@ -51,21 +49,17 @@ static int platform_lcd_set_power(struct lcd_device *lcd, int power)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int platform_lcd_match(struct lcd_device *lcd, struct fb_info *info)
|
static bool platform_lcd_controls_device(struct lcd_device *lcd, struct device *display_device)
|
||||||
{
|
{
|
||||||
struct platform_lcd *plcd = to_our_lcd(lcd);
|
struct platform_lcd *plcd = to_our_lcd(lcd);
|
||||||
struct plat_lcd_data *pdata = plcd->pdata;
|
|
||||||
|
|
||||||
if (pdata->match_fb)
|
return plcd->us->parent == display_device;
|
||||||
return pdata->match_fb(pdata, info);
|
|
||||||
|
|
||||||
return plcd->us->parent == info->device;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct lcd_ops platform_lcd_ops = {
|
static const struct lcd_ops platform_lcd_ops = {
|
||||||
.get_power = platform_lcd_get_power,
|
.get_power = platform_lcd_get_power,
|
||||||
.set_power = platform_lcd_set_power,
|
.set_power = platform_lcd_set_power,
|
||||||
.check_fb = platform_lcd_match,
|
.controls_device = platform_lcd_controls_device,
|
||||||
};
|
};
|
||||||
|
|
||||||
static int platform_lcd_probe(struct platform_device *pdev)
|
static int platform_lcd_probe(struct platform_device *pdev)
|
||||||
@ -102,7 +96,7 @@ static int platform_lcd_probe(struct platform_device *pdev)
|
|||||||
}
|
}
|
||||||
|
|
||||||
platform_set_drvdata(pdev, plcd);
|
platform_set_drvdata(pdev, plcd);
|
||||||
platform_lcd_set_power(plcd->lcd, FB_BLANK_NORMAL);
|
platform_lcd_set_power(plcd->lcd, LCD_POWER_REDUCED);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -12,11 +12,10 @@
|
|||||||
#include <linux/device.h>
|
#include <linux/device.h>
|
||||||
#include <linux/spi/spi.h>
|
#include <linux/spi/spi.h>
|
||||||
#include <linux/spi/tdo24m.h>
|
#include <linux/spi/tdo24m.h>
|
||||||
#include <linux/fb.h>
|
|
||||||
#include <linux/lcd.h>
|
#include <linux/lcd.h>
|
||||||
#include <linux/slab.h>
|
#include <linux/slab.h>
|
||||||
|
|
||||||
#define POWER_IS_ON(pwr) ((pwr) <= FB_BLANK_NORMAL)
|
#define POWER_IS_ON(pwr) ((pwr) <= LCD_POWER_REDUCED)
|
||||||
|
|
||||||
#define TDO24M_SPI_BUFF_SIZE (4)
|
#define TDO24M_SPI_BUFF_SIZE (4)
|
||||||
#define MODE_QVGA 0
|
#define MODE_QVGA 0
|
||||||
@ -308,12 +307,12 @@ static int tdo24m_get_power(struct lcd_device *ld)
|
|||||||
return lcd->power;
|
return lcd->power;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int tdo24m_set_mode(struct lcd_device *ld, struct fb_videomode *m)
|
static int tdo24m_set_mode(struct lcd_device *ld, u32 xres, u32 yres)
|
||||||
{
|
{
|
||||||
struct tdo24m *lcd = lcd_get_data(ld);
|
struct tdo24m *lcd = lcd_get_data(ld);
|
||||||
int mode = MODE_QVGA;
|
int mode = MODE_QVGA;
|
||||||
|
|
||||||
if (m->xres == 640 || m->xres == 480)
|
if (xres == 640 || xres == 480)
|
||||||
mode = MODE_VGA;
|
mode = MODE_VGA;
|
||||||
|
|
||||||
if (lcd->mode == mode)
|
if (lcd->mode == mode)
|
||||||
@ -354,7 +353,7 @@ static int tdo24m_probe(struct spi_device *spi)
|
|||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
lcd->spi_dev = spi;
|
lcd->spi_dev = spi;
|
||||||
lcd->power = FB_BLANK_POWERDOWN;
|
lcd->power = LCD_POWER_OFF;
|
||||||
lcd->mode = MODE_VGA; /* default to VGA */
|
lcd->mode = MODE_VGA; /* default to VGA */
|
||||||
|
|
||||||
lcd->buf = devm_kzalloc(&spi->dev, TDO24M_SPI_BUFF_SIZE, GFP_KERNEL);
|
lcd->buf = devm_kzalloc(&spi->dev, TDO24M_SPI_BUFF_SIZE, GFP_KERNEL);
|
||||||
@ -390,7 +389,7 @@ static int tdo24m_probe(struct spi_device *spi)
|
|||||||
return PTR_ERR(lcd->lcd_dev);
|
return PTR_ERR(lcd->lcd_dev);
|
||||||
|
|
||||||
spi_set_drvdata(spi, lcd);
|
spi_set_drvdata(spi, lcd);
|
||||||
err = tdo24m_power(lcd, FB_BLANK_UNBLANK);
|
err = tdo24m_power(lcd, LCD_POWER_ON);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
@ -401,7 +400,7 @@ static void tdo24m_remove(struct spi_device *spi)
|
|||||||
{
|
{
|
||||||
struct tdo24m *lcd = spi_get_drvdata(spi);
|
struct tdo24m *lcd = spi_get_drvdata(spi);
|
||||||
|
|
||||||
tdo24m_power(lcd, FB_BLANK_POWERDOWN);
|
tdo24m_power(lcd, LCD_POWER_OFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_PM_SLEEP
|
#ifdef CONFIG_PM_SLEEP
|
||||||
@ -409,14 +408,14 @@ static int tdo24m_suspend(struct device *dev)
|
|||||||
{
|
{
|
||||||
struct tdo24m *lcd = dev_get_drvdata(dev);
|
struct tdo24m *lcd = dev_get_drvdata(dev);
|
||||||
|
|
||||||
return tdo24m_power(lcd, FB_BLANK_POWERDOWN);
|
return tdo24m_power(lcd, LCD_POWER_OFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int tdo24m_resume(struct device *dev)
|
static int tdo24m_resume(struct device *dev)
|
||||||
{
|
{
|
||||||
struct tdo24m *lcd = dev_get_drvdata(dev);
|
struct tdo24m *lcd = dev_get_drvdata(dev);
|
||||||
|
|
||||||
return tdo24m_power(lcd, FB_BLANK_UNBLANK);
|
return tdo24m_power(lcd, LCD_POWER_ON);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -427,7 +426,7 @@ static void tdo24m_shutdown(struct spi_device *spi)
|
|||||||
{
|
{
|
||||||
struct tdo24m *lcd = spi_get_drvdata(spi);
|
struct tdo24m *lcd = spi_get_drvdata(spi);
|
||||||
|
|
||||||
tdo24m_power(lcd, FB_BLANK_POWERDOWN);
|
tdo24m_power(lcd, LCD_POWER_OFF);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct spi_driver tdo24m_driver = {
|
static struct spi_driver tdo24m_driver = {
|
||||||
|
@ -162,22 +162,15 @@ static const struct fb_ops clps711x_fb_ops = {
|
|||||||
.fb_blank = clps711x_fb_blank,
|
.fb_blank = clps711x_fb_blank,
|
||||||
};
|
};
|
||||||
|
|
||||||
static int clps711x_lcd_check_fb(struct lcd_device *lcddev, struct fb_info *fi)
|
|
||||||
{
|
|
||||||
struct clps711x_fb_info *cfb = dev_get_drvdata(&lcddev->dev);
|
|
||||||
|
|
||||||
return (!fi || fi->par == cfb) ? 1 : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int clps711x_lcd_get_power(struct lcd_device *lcddev)
|
static int clps711x_lcd_get_power(struct lcd_device *lcddev)
|
||||||
{
|
{
|
||||||
struct clps711x_fb_info *cfb = dev_get_drvdata(&lcddev->dev);
|
struct clps711x_fb_info *cfb = dev_get_drvdata(&lcddev->dev);
|
||||||
|
|
||||||
if (!IS_ERR_OR_NULL(cfb->lcd_pwr))
|
if (!IS_ERR_OR_NULL(cfb->lcd_pwr))
|
||||||
if (!regulator_is_enabled(cfb->lcd_pwr))
|
if (!regulator_is_enabled(cfb->lcd_pwr))
|
||||||
return FB_BLANK_NORMAL;
|
return LCD_POWER_REDUCED;
|
||||||
|
|
||||||
return FB_BLANK_UNBLANK;
|
return LCD_POWER_ON;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int clps711x_lcd_set_power(struct lcd_device *lcddev, int blank)
|
static int clps711x_lcd_set_power(struct lcd_device *lcddev, int blank)
|
||||||
@ -185,7 +178,7 @@ static int clps711x_lcd_set_power(struct lcd_device *lcddev, int blank)
|
|||||||
struct clps711x_fb_info *cfb = dev_get_drvdata(&lcddev->dev);
|
struct clps711x_fb_info *cfb = dev_get_drvdata(&lcddev->dev);
|
||||||
|
|
||||||
if (!IS_ERR_OR_NULL(cfb->lcd_pwr)) {
|
if (!IS_ERR_OR_NULL(cfb->lcd_pwr)) {
|
||||||
if (blank == FB_BLANK_UNBLANK) {
|
if (blank == LCD_POWER_ON) {
|
||||||
if (!regulator_is_enabled(cfb->lcd_pwr))
|
if (!regulator_is_enabled(cfb->lcd_pwr))
|
||||||
return regulator_enable(cfb->lcd_pwr);
|
return regulator_enable(cfb->lcd_pwr);
|
||||||
} else {
|
} else {
|
||||||
@ -198,7 +191,6 @@ static int clps711x_lcd_set_power(struct lcd_device *lcddev, int blank)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const struct lcd_ops clps711x_lcd_ops = {
|
static const struct lcd_ops clps711x_lcd_ops = {
|
||||||
.check_fb = clps711x_lcd_check_fb,
|
|
||||||
.get_power = clps711x_lcd_get_power,
|
.get_power = clps711x_lcd_get_power,
|
||||||
.set_power = clps711x_lcd_set_power,
|
.set_power = clps711x_lcd_set_power,
|
||||||
};
|
};
|
||||||
@ -325,16 +317,21 @@ static int clps711x_fb_probe(struct platform_device *pdev)
|
|||||||
if (ret)
|
if (ret)
|
||||||
goto out_fb_dealloc_cmap;
|
goto out_fb_dealloc_cmap;
|
||||||
|
|
||||||
|
lcd = devm_lcd_device_register(dev, "clps711x-lcd", dev, cfb,
|
||||||
|
&clps711x_lcd_ops);
|
||||||
|
if (IS_ERR(lcd)) {
|
||||||
|
ret = PTR_ERR(lcd);
|
||||||
|
goto out_fb_dealloc_cmap;
|
||||||
|
}
|
||||||
|
|
||||||
|
info->lcd_dev = lcd;
|
||||||
|
|
||||||
ret = register_framebuffer(info);
|
ret = register_framebuffer(info);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto out_fb_dealloc_cmap;
|
goto out_fb_dealloc_cmap;
|
||||||
|
|
||||||
lcd = devm_lcd_device_register(dev, "clps711x-lcd", dev, cfb,
|
return 0;
|
||||||
&clps711x_lcd_ops);
|
|
||||||
if (!IS_ERR(lcd))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
ret = PTR_ERR(lcd);
|
|
||||||
unregister_framebuffer(info);
|
unregister_framebuffer(info);
|
||||||
|
|
||||||
out_fb_dealloc_cmap:
|
out_fb_dealloc_cmap:
|
||||||
|
@ -782,16 +782,6 @@ static int imxfb_of_read_mode(struct device *dev, struct device_node *np,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int imxfb_lcd_check_fb(struct lcd_device *lcddev, struct fb_info *fi)
|
|
||||||
{
|
|
||||||
struct imxfb_info *fbi = dev_get_drvdata(&lcddev->dev);
|
|
||||||
|
|
||||||
if (!fi || fi->par == fbi)
|
|
||||||
return 1;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int imxfb_lcd_get_contrast(struct lcd_device *lcddev)
|
static int imxfb_lcd_get_contrast(struct lcd_device *lcddev)
|
||||||
{
|
{
|
||||||
struct imxfb_info *fbi = dev_get_drvdata(&lcddev->dev);
|
struct imxfb_info *fbi = dev_get_drvdata(&lcddev->dev);
|
||||||
@ -824,9 +814,9 @@ static int imxfb_lcd_get_power(struct lcd_device *lcddev)
|
|||||||
|
|
||||||
if (!IS_ERR(fbi->lcd_pwr) &&
|
if (!IS_ERR(fbi->lcd_pwr) &&
|
||||||
!regulator_is_enabled(fbi->lcd_pwr))
|
!regulator_is_enabled(fbi->lcd_pwr))
|
||||||
return FB_BLANK_POWERDOWN;
|
return LCD_POWER_OFF;
|
||||||
|
|
||||||
return FB_BLANK_UNBLANK;
|
return LCD_POWER_ON;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int imxfb_regulator_set(struct imxfb_info *fbi, int enable)
|
static int imxfb_regulator_set(struct imxfb_info *fbi, int enable)
|
||||||
@ -852,13 +842,12 @@ static int imxfb_lcd_set_power(struct lcd_device *lcddev, int power)
|
|||||||
struct imxfb_info *fbi = dev_get_drvdata(&lcddev->dev);
|
struct imxfb_info *fbi = dev_get_drvdata(&lcddev->dev);
|
||||||
|
|
||||||
if (!IS_ERR(fbi->lcd_pwr))
|
if (!IS_ERR(fbi->lcd_pwr))
|
||||||
return imxfb_regulator_set(fbi, power == FB_BLANK_UNBLANK);
|
return imxfb_regulator_set(fbi, power == LCD_POWER_ON);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct lcd_ops imxfb_lcd_ops = {
|
static const struct lcd_ops imxfb_lcd_ops = {
|
||||||
.check_fb = imxfb_lcd_check_fb,
|
|
||||||
.get_contrast = imxfb_lcd_get_contrast,
|
.get_contrast = imxfb_lcd_get_contrast,
|
||||||
.set_contrast = imxfb_lcd_set_contrast,
|
.set_contrast = imxfb_lcd_set_contrast,
|
||||||
.get_power = imxfb_lcd_get_power,
|
.get_power = imxfb_lcd_get_power,
|
||||||
@ -1025,11 +1014,6 @@ static int imxfb_probe(struct platform_device *pdev)
|
|||||||
goto failed_cmap;
|
goto failed_cmap;
|
||||||
|
|
||||||
imxfb_set_par(info);
|
imxfb_set_par(info);
|
||||||
ret = register_framebuffer(info);
|
|
||||||
if (ret < 0) {
|
|
||||||
dev_err(&pdev->dev, "failed to register framebuffer\n");
|
|
||||||
goto failed_register;
|
|
||||||
}
|
|
||||||
|
|
||||||
fbi->lcd_pwr = devm_regulator_get(&pdev->dev, "lcd");
|
fbi->lcd_pwr = devm_regulator_get(&pdev->dev, "lcd");
|
||||||
if (PTR_ERR(fbi->lcd_pwr) == -EPROBE_DEFER) {
|
if (PTR_ERR(fbi->lcd_pwr) == -EPROBE_DEFER) {
|
||||||
@ -1046,13 +1030,19 @@ static int imxfb_probe(struct platform_device *pdev)
|
|||||||
|
|
||||||
lcd->props.max_contrast = 0xff;
|
lcd->props.max_contrast = 0xff;
|
||||||
|
|
||||||
|
info->lcd_dev = lcd;
|
||||||
|
|
||||||
|
ret = register_framebuffer(info);
|
||||||
|
if (ret < 0) {
|
||||||
|
dev_err(&pdev->dev, "failed to register framebuffer\n");
|
||||||
|
goto failed_lcd;
|
||||||
|
}
|
||||||
|
|
||||||
imxfb_enable_controller(fbi);
|
imxfb_enable_controller(fbi);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
failed_lcd:
|
failed_lcd:
|
||||||
unregister_framebuffer(info);
|
|
||||||
failed_register:
|
|
||||||
fb_dealloc_cmap(&info->cmap);
|
fb_dealloc_cmap(&info->cmap);
|
||||||
failed_cmap:
|
failed_cmap:
|
||||||
dma_free_wc(&pdev->dev, fbi->map_size, info->screen_buffer,
|
dma_free_wc(&pdev->dev, fbi->map_size, info->screen_buffer,
|
||||||
|
@ -32,7 +32,7 @@ static struct gpio_desc *gpiod_ndisp;
|
|||||||
|
|
||||||
static int ams_delta_lcd_set_power(struct lcd_device *dev, int power)
|
static int ams_delta_lcd_set_power(struct lcd_device *dev, int power)
|
||||||
{
|
{
|
||||||
if (power == FB_BLANK_UNBLANK) {
|
if (power == LCD_POWER_ON) {
|
||||||
if (!(ams_delta_lcd & AMS_DELTA_LCD_POWER)) {
|
if (!(ams_delta_lcd & AMS_DELTA_LCD_POWER)) {
|
||||||
omap_writeb(ams_delta_lcd & AMS_DELTA_MAX_CONTRAST,
|
omap_writeb(ams_delta_lcd & AMS_DELTA_MAX_CONTRAST,
|
||||||
OMAP_PWL_ENABLE);
|
OMAP_PWL_ENABLE);
|
||||||
@ -63,9 +63,9 @@ static int ams_delta_lcd_set_contrast(struct lcd_device *dev, int value)
|
|||||||
static int ams_delta_lcd_get_power(struct lcd_device *dev)
|
static int ams_delta_lcd_get_power(struct lcd_device *dev)
|
||||||
{
|
{
|
||||||
if (ams_delta_lcd & AMS_DELTA_LCD_POWER)
|
if (ams_delta_lcd & AMS_DELTA_LCD_POWER)
|
||||||
return FB_BLANK_UNBLANK;
|
return LCD_POWER_ON;
|
||||||
else
|
else
|
||||||
return FB_BLANK_POWERDOWN;
|
return LCD_POWER_OFF;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ams_delta_lcd_get_contrast(struct lcd_device *dev)
|
static int ams_delta_lcd_get_contrast(struct lcd_device *dev)
|
||||||
@ -155,7 +155,7 @@ static int ams_delta_panel_probe(struct platform_device *pdev)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
ams_delta_lcd_set_contrast(lcd_device, AMS_DELTA_DEFAULT_CONTRAST);
|
ams_delta_lcd_set_contrast(lcd_device, AMS_DELTA_DEFAULT_CONTRAST);
|
||||||
ams_delta_lcd_set_power(lcd_device, FB_BLANK_UNBLANK);
|
ams_delta_lcd_set_power(lcd_device, LCD_POWER_ON);
|
||||||
|
|
||||||
omapfb_register_panel(&ams_delta_panel);
|
omapfb_register_panel(&ams_delta_panel);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -66,24 +66,6 @@ enum backlight_type {
|
|||||||
BACKLIGHT_TYPE_MAX,
|
BACKLIGHT_TYPE_MAX,
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* enum backlight_notification - the type of notification
|
|
||||||
*
|
|
||||||
* The notifications that is used for notification sent to the receiver
|
|
||||||
* that registered notifications using backlight_register_notifier().
|
|
||||||
*/
|
|
||||||
enum backlight_notification {
|
|
||||||
/**
|
|
||||||
* @BACKLIGHT_REGISTERED: The backlight device is registered.
|
|
||||||
*/
|
|
||||||
BACKLIGHT_REGISTERED,
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @BACKLIGHT_UNREGISTERED: The backlight revice is unregistered.
|
|
||||||
*/
|
|
||||||
BACKLIGHT_UNREGISTERED,
|
|
||||||
};
|
|
||||||
|
|
||||||
/** enum backlight_scale - the type of scale used for brightness values
|
/** enum backlight_scale - the type of scale used for brightness values
|
||||||
*
|
*
|
||||||
* The type of scale used for brightness values.
|
* The type of scale used for brightness values.
|
||||||
@ -421,8 +403,6 @@ void devm_backlight_device_unregister(struct device *dev,
|
|||||||
struct backlight_device *bd);
|
struct backlight_device *bd);
|
||||||
void backlight_force_update(struct backlight_device *bd,
|
void backlight_force_update(struct backlight_device *bd,
|
||||||
enum backlight_update_reason reason);
|
enum backlight_update_reason reason);
|
||||||
int backlight_register_notifier(struct notifier_block *nb);
|
|
||||||
int backlight_unregister_notifier(struct notifier_block *nb);
|
|
||||||
struct backlight_device *backlight_device_get_by_name(const char *name);
|
struct backlight_device *backlight_device_get_by_name(const char *name);
|
||||||
struct backlight_device *backlight_device_get_by_type(enum backlight_type type);
|
struct backlight_device *backlight_device_get_by_type(enum backlight_type type);
|
||||||
int backlight_device_set_brightness(struct backlight_device *bd,
|
int backlight_device_set_brightness(struct backlight_device *bd,
|
||||||
|
@ -21,6 +21,7 @@ struct fb_info;
|
|||||||
struct file;
|
struct file;
|
||||||
struct i2c_adapter;
|
struct i2c_adapter;
|
||||||
struct inode;
|
struct inode;
|
||||||
|
struct lcd_device;
|
||||||
struct module;
|
struct module;
|
||||||
struct notifier_block;
|
struct notifier_block;
|
||||||
struct page;
|
struct page;
|
||||||
@ -480,6 +481,13 @@ struct fb_info {
|
|||||||
struct mutex bl_curve_mutex;
|
struct mutex bl_curve_mutex;
|
||||||
u8 bl_curve[FB_BACKLIGHT_LEVELS];
|
u8 bl_curve[FB_BACKLIGHT_LEVELS];
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Assigned LCD device; set before framebuffer
|
||||||
|
* registration, remove after unregister
|
||||||
|
*/
|
||||||
|
struct lcd_device *lcd_dev;
|
||||||
|
|
||||||
#ifdef CONFIG_FB_DEFERRED_IO
|
#ifdef CONFIG_FB_DEFERRED_IO
|
||||||
struct delayed_work deferred_work;
|
struct delayed_work deferred_work;
|
||||||
unsigned long npagerefs;
|
unsigned long npagerefs;
|
||||||
@ -754,6 +762,11 @@ static inline struct backlight_device *fb_bl_device(struct fb_info *info)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
static inline struct lcd_device *fb_lcd_device(struct fb_info *info)
|
||||||
|
{
|
||||||
|
return info->lcd_dev;
|
||||||
|
}
|
||||||
|
|
||||||
/* fbmon.c */
|
/* fbmon.c */
|
||||||
#define FB_MAXTIMINGS 0
|
#define FB_MAXTIMINGS 0
|
||||||
#define FB_VSYNCTIMINGS 1
|
#define FB_VSYNCTIMINGS 1
|
||||||
|
@ -12,7 +12,11 @@
|
|||||||
#include <linux/device.h>
|
#include <linux/device.h>
|
||||||
#include <linux/mutex.h>
|
#include <linux/mutex.h>
|
||||||
#include <linux/notifier.h>
|
#include <linux/notifier.h>
|
||||||
#include <linux/fb.h>
|
|
||||||
|
#define LCD_POWER_ON (0)
|
||||||
|
#define LCD_POWER_REDUCED (1) // deprecated; don't use in new code
|
||||||
|
#define LCD_POWER_REDUCED_VSYNC_SUSPEND (2) // deprecated; don't use in new code
|
||||||
|
#define LCD_POWER_OFF (4)
|
||||||
|
|
||||||
/* Notes on locking:
|
/* Notes on locking:
|
||||||
*
|
*
|
||||||
@ -30,7 +34,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
struct lcd_device;
|
struct lcd_device;
|
||||||
struct fb_info;
|
|
||||||
|
|
||||||
struct lcd_properties {
|
struct lcd_properties {
|
||||||
/* The maximum value for contrast (read-only) */
|
/* The maximum value for contrast (read-only) */
|
||||||
@ -47,11 +50,23 @@ struct lcd_ops {
|
|||||||
int (*get_contrast)(struct lcd_device *);
|
int (*get_contrast)(struct lcd_device *);
|
||||||
/* Set LCD panel contrast */
|
/* Set LCD panel contrast */
|
||||||
int (*set_contrast)(struct lcd_device *, int contrast);
|
int (*set_contrast)(struct lcd_device *, int contrast);
|
||||||
/* Set LCD panel mode (resolutions ...) */
|
|
||||||
int (*set_mode)(struct lcd_device *, struct fb_videomode *);
|
/*
|
||||||
/* Check if given framebuffer device is the one LCD is bound to;
|
* Set LCD panel mode (resolutions ...)
|
||||||
return 0 if not, !=0 if it is. If NULL, lcd always matches the fb. */
|
*/
|
||||||
int (*check_fb)(struct lcd_device *, struct fb_info *);
|
int (*set_mode)(struct lcd_device *lcd, u32 xres, u32 yres);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Check if the LCD controls the given display device. This
|
||||||
|
* operation is optional and if not implemented it is assumed that
|
||||||
|
* the display is always the one controlled by the LCD.
|
||||||
|
*
|
||||||
|
* RETURNS:
|
||||||
|
*
|
||||||
|
* If display_dev is NULL or display_dev matches the device controlled by
|
||||||
|
* the LCD, return true. Otherwise return false.
|
||||||
|
*/
|
||||||
|
bool (*controls_device)(struct lcd_device *lcd, struct device *display_device);
|
||||||
};
|
};
|
||||||
|
|
||||||
struct lcd_device {
|
struct lcd_device {
|
||||||
|
@ -8,11 +8,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
struct plat_lcd_data;
|
struct plat_lcd_data;
|
||||||
struct fb_info;
|
|
||||||
|
|
||||||
struct plat_lcd_data {
|
struct plat_lcd_data {
|
||||||
int (*probe)(struct plat_lcd_data *);
|
int (*probe)(struct plat_lcd_data *);
|
||||||
void (*set_power)(struct plat_lcd_data *, unsigned int power);
|
void (*set_power)(struct plat_lcd_data *, unsigned int power);
|
||||||
int (*match_fb)(struct plat_lcd_data *, struct fb_info *);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user