Merge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-backlight
* 'for-linus' of git://git.o-hand.com/linux-rpurdie-backlight: backlight: panasonic-laptop - Fix incomplete registration failure handling backlight: msi-laptop, msi-wmi: fix incomplete registration failure handling backlight: blackfin - Fix missing registration failure handling backlight: classmate-laptop - Fix missing registration failure handling backlight: mbp_nvidia_bl - add five more MacBook variants backlight: Allow properties to be passed at registration backlight: Add backlight_device parameter to check_fb video: backlight/progear, fix pci device refcounting backlight: l4f00242t03: Fix module licence absence. backlight: Revert some const qualifiers backlight: Add Epson L4F00242T03 LCD driver
This commit is contained in:
commit
61d718076e
|
@ -998,6 +998,7 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (acpi_video_backlight_support()) {
|
if (acpi_video_backlight_support()) {
|
||||||
|
struct backlight_properties props;
|
||||||
int result;
|
int result;
|
||||||
static int count = 0;
|
static int count = 0;
|
||||||
char *name;
|
char *name;
|
||||||
|
@ -1010,12 +1011,14 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
sprintf(name, "acpi_video%d", count++);
|
sprintf(name, "acpi_video%d", count++);
|
||||||
device->backlight = backlight_device_register(name,
|
memset(&props, 0, sizeof(struct backlight_properties));
|
||||||
NULL, device, &acpi_backlight_ops);
|
props.max_brightness = device->brightness->count - 3;
|
||||||
|
device->backlight = backlight_device_register(name, NULL, device,
|
||||||
|
&acpi_backlight_ops,
|
||||||
|
&props);
|
||||||
kfree(name);
|
kfree(name);
|
||||||
if (IS_ERR(device->backlight))
|
if (IS_ERR(device->backlight))
|
||||||
return;
|
return;
|
||||||
device->backlight->props.max_brightness = device->brightness->count-3;
|
|
||||||
|
|
||||||
result = sysfs_create_link(&device->backlight->dev.kobj,
|
result = sysfs_create_link(&device->backlight->dev.kobj,
|
||||||
&device->dev->dev.kobj, "device");
|
&device->dev->dev.kobj, "device");
|
||||||
|
|
|
@ -89,19 +89,21 @@ static struct backlight_ops nv50_bl_ops = {
|
||||||
|
|
||||||
static int nouveau_nv40_backlight_init(struct drm_device *dev)
|
static int nouveau_nv40_backlight_init(struct drm_device *dev)
|
||||||
{
|
{
|
||||||
|
struct backlight_properties props;
|
||||||
struct drm_nouveau_private *dev_priv = dev->dev_private;
|
struct drm_nouveau_private *dev_priv = dev->dev_private;
|
||||||
struct backlight_device *bd;
|
struct backlight_device *bd;
|
||||||
|
|
||||||
if (!(nv_rd32(dev, NV40_PMC_BACKLIGHT) & NV40_PMC_BACKLIGHT_MASK))
|
if (!(nv_rd32(dev, NV40_PMC_BACKLIGHT) & NV40_PMC_BACKLIGHT_MASK))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
memset(&props, 0, sizeof(struct backlight_properties));
|
||||||
|
props.max_brightness = 31;
|
||||||
bd = backlight_device_register("nv_backlight", &dev->pdev->dev, dev,
|
bd = backlight_device_register("nv_backlight", &dev->pdev->dev, dev,
|
||||||
&nv40_bl_ops);
|
&nv40_bl_ops, &props);
|
||||||
if (IS_ERR(bd))
|
if (IS_ERR(bd))
|
||||||
return PTR_ERR(bd);
|
return PTR_ERR(bd);
|
||||||
|
|
||||||
dev_priv->backlight = bd;
|
dev_priv->backlight = bd;
|
||||||
bd->props.max_brightness = 31;
|
|
||||||
bd->props.brightness = nv40_get_intensity(bd);
|
bd->props.brightness = nv40_get_intensity(bd);
|
||||||
backlight_update_status(bd);
|
backlight_update_status(bd);
|
||||||
|
|
||||||
|
@ -110,19 +112,21 @@ static int nouveau_nv40_backlight_init(struct drm_device *dev)
|
||||||
|
|
||||||
static int nouveau_nv50_backlight_init(struct drm_device *dev)
|
static int nouveau_nv50_backlight_init(struct drm_device *dev)
|
||||||
{
|
{
|
||||||
|
struct backlight_properties props;
|
||||||
struct drm_nouveau_private *dev_priv = dev->dev_private;
|
struct drm_nouveau_private *dev_priv = dev->dev_private;
|
||||||
struct backlight_device *bd;
|
struct backlight_device *bd;
|
||||||
|
|
||||||
if (!nv_rd32(dev, NV50_PDISPLAY_SOR_BACKLIGHT))
|
if (!nv_rd32(dev, NV50_PDISPLAY_SOR_BACKLIGHT))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
memset(&props, 0, sizeof(struct backlight_properties));
|
||||||
|
props.max_brightness = 1025;
|
||||||
bd = backlight_device_register("nv_backlight", &dev->pdev->dev, dev,
|
bd = backlight_device_register("nv_backlight", &dev->pdev->dev, dev,
|
||||||
&nv50_bl_ops);
|
&nv50_bl_ops, &props);
|
||||||
if (IS_ERR(bd))
|
if (IS_ERR(bd))
|
||||||
return PTR_ERR(bd);
|
return PTR_ERR(bd);
|
||||||
|
|
||||||
dev_priv->backlight = bd;
|
dev_priv->backlight = bd;
|
||||||
bd->props.max_brightness = 1025;
|
|
||||||
bd->props.brightness = nv50_get_intensity(bd);
|
bd->props.brightness = nv50_get_intensity(bd);
|
||||||
backlight_update_status(bd);
|
backlight_update_status(bd);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -144,6 +144,7 @@ void pmu_backlight_set_sleep(int sleep)
|
||||||
|
|
||||||
void __init pmu_backlight_init()
|
void __init pmu_backlight_init()
|
||||||
{
|
{
|
||||||
|
struct backlight_properties props;
|
||||||
struct backlight_device *bd;
|
struct backlight_device *bd;
|
||||||
char name[10];
|
char name[10];
|
||||||
int level, autosave;
|
int level, autosave;
|
||||||
|
@ -161,13 +162,15 @@ void __init pmu_backlight_init()
|
||||||
|
|
||||||
snprintf(name, sizeof(name), "pmubl");
|
snprintf(name, sizeof(name), "pmubl");
|
||||||
|
|
||||||
bd = backlight_device_register(name, NULL, NULL, &pmu_backlight_data);
|
memset(&props, 0, sizeof(struct backlight_properties));
|
||||||
|
props.max_brightness = FB_BACKLIGHT_LEVELS - 1;
|
||||||
|
bd = backlight_device_register(name, NULL, NULL, &pmu_backlight_data,
|
||||||
|
&props);
|
||||||
if (IS_ERR(bd)) {
|
if (IS_ERR(bd)) {
|
||||||
printk(KERN_ERR "PMU Backlight registration failed\n");
|
printk(KERN_ERR "PMU Backlight registration failed\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
uses_pmu_bl = 1;
|
uses_pmu_bl = 1;
|
||||||
bd->props.max_brightness = FB_BACKLIGHT_LEVELS - 1;
|
|
||||||
pmu_backlight_init_curve(0x7F, 0x46, 0x0E);
|
pmu_backlight_init_curve(0x7F, 0x46, 0x0E);
|
||||||
|
|
||||||
level = bd->props.max_brightness;
|
level = bd->props.max_brightness;
|
||||||
|
|
|
@ -922,9 +922,13 @@ static struct backlight_ops acer_bl_ops = {
|
||||||
|
|
||||||
static int __devinit acer_backlight_init(struct device *dev)
|
static int __devinit acer_backlight_init(struct device *dev)
|
||||||
{
|
{
|
||||||
|
struct backlight_properties props;
|
||||||
struct backlight_device *bd;
|
struct backlight_device *bd;
|
||||||
|
|
||||||
bd = backlight_device_register("acer-wmi", dev, NULL, &acer_bl_ops);
|
memset(&props, 0, sizeof(struct backlight_properties));
|
||||||
|
props.max_brightness = max_brightness;
|
||||||
|
bd = backlight_device_register("acer-wmi", dev, NULL, &acer_bl_ops,
|
||||||
|
&props);
|
||||||
if (IS_ERR(bd)) {
|
if (IS_ERR(bd)) {
|
||||||
printk(ACER_ERR "Could not register Acer backlight device\n");
|
printk(ACER_ERR "Could not register Acer backlight device\n");
|
||||||
acer_backlight_device = NULL;
|
acer_backlight_device = NULL;
|
||||||
|
@ -935,7 +939,6 @@ static int __devinit acer_backlight_init(struct device *dev)
|
||||||
|
|
||||||
bd->props.power = FB_BLANK_UNBLANK;
|
bd->props.power = FB_BLANK_UNBLANK;
|
||||||
bd->props.brightness = read_brightness(bd);
|
bd->props.brightness = read_brightness(bd);
|
||||||
bd->props.max_brightness = max_brightness;
|
|
||||||
backlight_update_status(bd);
|
backlight_update_status(bd);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -639,12 +639,16 @@ static int asus_backlight_init(struct asus_laptop *asus)
|
||||||
{
|
{
|
||||||
struct backlight_device *bd;
|
struct backlight_device *bd;
|
||||||
struct device *dev = &asus->platform_device->dev;
|
struct device *dev = &asus->platform_device->dev;
|
||||||
|
struct backlight_properties props;
|
||||||
|
|
||||||
if (!acpi_check_handle(asus->handle, METHOD_BRIGHTNESS_GET, NULL) &&
|
if (!acpi_check_handle(asus->handle, METHOD_BRIGHTNESS_GET, NULL) &&
|
||||||
!acpi_check_handle(asus->handle, METHOD_BRIGHTNESS_SET, NULL) &&
|
!acpi_check_handle(asus->handle, METHOD_BRIGHTNESS_SET, NULL) &&
|
||||||
lcd_switch_handle) {
|
lcd_switch_handle) {
|
||||||
|
memset(&props, 0, sizeof(struct backlight_properties));
|
||||||
|
props.max_brightness = 15;
|
||||||
|
|
||||||
bd = backlight_device_register(ASUS_LAPTOP_FILE, dev,
|
bd = backlight_device_register(ASUS_LAPTOP_FILE, dev,
|
||||||
asus, &asusbl_ops);
|
asus, &asusbl_ops, &props);
|
||||||
if (IS_ERR(bd)) {
|
if (IS_ERR(bd)) {
|
||||||
pr_err("Could not register asus backlight device\n");
|
pr_err("Could not register asus backlight device\n");
|
||||||
asus->backlight_device = NULL;
|
asus->backlight_device = NULL;
|
||||||
|
@ -653,7 +657,6 @@ static int asus_backlight_init(struct asus_laptop *asus)
|
||||||
|
|
||||||
asus->backlight_device = bd;
|
asus->backlight_device = bd;
|
||||||
|
|
||||||
bd->props.max_brightness = 15;
|
|
||||||
bd->props.power = FB_BLANK_UNBLANK;
|
bd->props.power = FB_BLANK_UNBLANK;
|
||||||
bd->props.brightness = asus_read_brightness(bd);
|
bd->props.brightness = asus_read_brightness(bd);
|
||||||
backlight_update_status(bd);
|
backlight_update_status(bd);
|
||||||
|
|
|
@ -1481,6 +1481,7 @@ static void asus_acpi_exit(void)
|
||||||
|
|
||||||
static int __init asus_acpi_init(void)
|
static int __init asus_acpi_init(void)
|
||||||
{
|
{
|
||||||
|
struct backlight_properties props;
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
result = acpi_bus_register_driver(&asus_hotk_driver);
|
result = acpi_bus_register_driver(&asus_hotk_driver);
|
||||||
|
@ -1507,15 +1508,17 @@ static int __init asus_acpi_init(void)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
memset(&props, 0, sizeof(struct backlight_properties));
|
||||||
|
props.max_brightness = 15;
|
||||||
asus_backlight_device = backlight_device_register("asus", NULL, NULL,
|
asus_backlight_device = backlight_device_register("asus", NULL, NULL,
|
||||||
&asus_backlight_data);
|
&asus_backlight_data,
|
||||||
|
&props);
|
||||||
if (IS_ERR(asus_backlight_device)) {
|
if (IS_ERR(asus_backlight_device)) {
|
||||||
printk(KERN_ERR "Could not register asus backlight device\n");
|
printk(KERN_ERR "Could not register asus backlight device\n");
|
||||||
asus_backlight_device = NULL;
|
asus_backlight_device = NULL;
|
||||||
asus_acpi_exit();
|
asus_acpi_exit();
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
asus_backlight_device->props.max_brightness = 15;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -455,18 +455,22 @@ static int cmpc_bl_update_status(struct backlight_device *bd)
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct backlight_ops cmpc_bl_ops = {
|
static const struct backlight_ops cmpc_bl_ops = {
|
||||||
.get_brightness = cmpc_bl_get_brightness,
|
.get_brightness = cmpc_bl_get_brightness,
|
||||||
.update_status = cmpc_bl_update_status
|
.update_status = cmpc_bl_update_status
|
||||||
};
|
};
|
||||||
|
|
||||||
static int cmpc_bl_add(struct acpi_device *acpi)
|
static int cmpc_bl_add(struct acpi_device *acpi)
|
||||||
{
|
{
|
||||||
|
struct backlight_properties props;
|
||||||
struct backlight_device *bd;
|
struct backlight_device *bd;
|
||||||
|
|
||||||
bd = backlight_device_register("cmpc_bl", &acpi->dev,
|
memset(&props, 0, sizeof(struct backlight_properties));
|
||||||
acpi->handle, &cmpc_bl_ops);
|
props.max_brightness = 7;
|
||||||
bd->props.max_brightness = 7;
|
bd = backlight_device_register("cmpc_bl", &acpi->dev, acpi->handle,
|
||||||
|
&cmpc_bl_ops, &props);
|
||||||
|
if (IS_ERR(bd))
|
||||||
|
return PTR_ERR(bd);
|
||||||
dev_set_drvdata(&acpi->dev, bd);
|
dev_set_drvdata(&acpi->dev, bd);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -291,12 +291,15 @@ static int __init compal_init(void)
|
||||||
/* Register backlight stuff */
|
/* Register backlight stuff */
|
||||||
|
|
||||||
if (!acpi_video_backlight_support()) {
|
if (!acpi_video_backlight_support()) {
|
||||||
compalbl_device = backlight_device_register("compal-laptop", NULL, NULL,
|
struct backlight_properties props;
|
||||||
&compalbl_ops);
|
memset(&props, 0, sizeof(struct backlight_properties));
|
||||||
|
props.max_brightness = COMPAL_LCD_LEVEL_MAX - 1;
|
||||||
|
compalbl_device = backlight_device_register("compal-laptop",
|
||||||
|
NULL, NULL,
|
||||||
|
&compalbl_ops,
|
||||||
|
&props);
|
||||||
if (IS_ERR(compalbl_device))
|
if (IS_ERR(compalbl_device))
|
||||||
return PTR_ERR(compalbl_device);
|
return PTR_ERR(compalbl_device);
|
||||||
|
|
||||||
compalbl_device->props.max_brightness = COMPAL_LCD_LEVEL_MAX-1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = platform_driver_register(&compal_driver);
|
ret = platform_driver_register(&compal_driver);
|
||||||
|
|
|
@ -559,10 +559,14 @@ static int __init dell_init(void)
|
||||||
release_buffer();
|
release_buffer();
|
||||||
|
|
||||||
if (max_intensity) {
|
if (max_intensity) {
|
||||||
dell_backlight_device = backlight_device_register(
|
struct backlight_properties props;
|
||||||
"dell_backlight",
|
memset(&props, 0, sizeof(struct backlight_properties));
|
||||||
&platform_device->dev, NULL,
|
props.max_brightness = max_intensity;
|
||||||
&dell_ops);
|
dell_backlight_device = backlight_device_register("dell_backlight",
|
||||||
|
&platform_device->dev,
|
||||||
|
NULL,
|
||||||
|
&dell_ops,
|
||||||
|
&props);
|
||||||
|
|
||||||
if (IS_ERR(dell_backlight_device)) {
|
if (IS_ERR(dell_backlight_device)) {
|
||||||
ret = PTR_ERR(dell_backlight_device);
|
ret = PTR_ERR(dell_backlight_device);
|
||||||
|
@ -570,7 +574,6 @@ static int __init dell_init(void)
|
||||||
goto fail_backlight;
|
goto fail_backlight;
|
||||||
}
|
}
|
||||||
|
|
||||||
dell_backlight_device->props.max_brightness = max_intensity;
|
|
||||||
dell_backlight_device->props.brightness =
|
dell_backlight_device->props.brightness =
|
||||||
dell_get_intensity(dell_backlight_device);
|
dell_get_intensity(dell_backlight_device);
|
||||||
backlight_update_status(dell_backlight_device);
|
backlight_update_status(dell_backlight_device);
|
||||||
|
|
|
@ -1131,18 +1131,20 @@ static int eeepc_backlight_notify(struct eeepc_laptop *eeepc)
|
||||||
|
|
||||||
static int eeepc_backlight_init(struct eeepc_laptop *eeepc)
|
static int eeepc_backlight_init(struct eeepc_laptop *eeepc)
|
||||||
{
|
{
|
||||||
|
struct backlight_properties props;
|
||||||
struct backlight_device *bd;
|
struct backlight_device *bd;
|
||||||
|
|
||||||
|
memset(&props, 0, sizeof(struct backlight_properties));
|
||||||
|
props.max_brightness = 15;
|
||||||
bd = backlight_device_register(EEEPC_LAPTOP_FILE,
|
bd = backlight_device_register(EEEPC_LAPTOP_FILE,
|
||||||
&eeepc->platform_device->dev,
|
&eeepc->platform_device->dev, eeepc,
|
||||||
eeepc, &eeepcbl_ops);
|
&eeepcbl_ops, &props);
|
||||||
if (IS_ERR(bd)) {
|
if (IS_ERR(bd)) {
|
||||||
pr_err("Could not register eeepc backlight device\n");
|
pr_err("Could not register eeepc backlight device\n");
|
||||||
eeepc->backlight_device = NULL;
|
eeepc->backlight_device = NULL;
|
||||||
return PTR_ERR(bd);
|
return PTR_ERR(bd);
|
||||||
}
|
}
|
||||||
eeepc->backlight_device = bd;
|
eeepc->backlight_device = bd;
|
||||||
bd->props.max_brightness = 15;
|
|
||||||
bd->props.brightness = read_brightness(bd);
|
bd->props.brightness = read_brightness(bd);
|
||||||
bd->props.power = FB_BLANK_UNBLANK;
|
bd->props.power = FB_BLANK_UNBLANK;
|
||||||
backlight_update_status(bd);
|
backlight_update_status(bd);
|
||||||
|
|
|
@ -1126,16 +1126,20 @@ static int __init fujitsu_init(void)
|
||||||
/* Register backlight stuff */
|
/* Register backlight stuff */
|
||||||
|
|
||||||
if (!acpi_video_backlight_support()) {
|
if (!acpi_video_backlight_support()) {
|
||||||
fujitsu->bl_device =
|
struct backlight_properties props;
|
||||||
backlight_device_register("fujitsu-laptop", NULL, NULL,
|
|
||||||
&fujitsubl_ops);
|
memset(&props, 0, sizeof(struct backlight_properties));
|
||||||
|
max_brightness = fujitsu->max_brightness;
|
||||||
|
props.max_brightness = max_brightness - 1;
|
||||||
|
fujitsu->bl_device = backlight_device_register("fujitsu-laptop",
|
||||||
|
NULL, NULL,
|
||||||
|
&fujitsubl_ops,
|
||||||
|
&props);
|
||||||
if (IS_ERR(fujitsu->bl_device)) {
|
if (IS_ERR(fujitsu->bl_device)) {
|
||||||
ret = PTR_ERR(fujitsu->bl_device);
|
ret = PTR_ERR(fujitsu->bl_device);
|
||||||
fujitsu->bl_device = NULL;
|
fujitsu->bl_device = NULL;
|
||||||
goto fail_sysfs_group;
|
goto fail_sysfs_group;
|
||||||
}
|
}
|
||||||
max_brightness = fujitsu->max_brightness;
|
|
||||||
fujitsu->bl_device->props.max_brightness = max_brightness - 1;
|
|
||||||
fujitsu->bl_device->props.brightness = fujitsu->brightness_level;
|
fujitsu->bl_device->props.brightness = fujitsu->brightness_level;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -683,11 +683,14 @@ static int __init msi_init(void)
|
||||||
printk(KERN_INFO "MSI: Brightness ignored, must be controlled "
|
printk(KERN_INFO "MSI: Brightness ignored, must be controlled "
|
||||||
"by ACPI video driver\n");
|
"by ACPI video driver\n");
|
||||||
} else {
|
} else {
|
||||||
|
struct backlight_properties props;
|
||||||
|
memset(&props, 0, sizeof(struct backlight_properties));
|
||||||
|
props.max_brightness = MSI_LCD_LEVEL_MAX - 1;
|
||||||
msibl_device = backlight_device_register("msi-laptop-bl", NULL,
|
msibl_device = backlight_device_register("msi-laptop-bl", NULL,
|
||||||
NULL, &msibl_ops);
|
NULL, &msibl_ops,
|
||||||
|
&props);
|
||||||
if (IS_ERR(msibl_device))
|
if (IS_ERR(msibl_device))
|
||||||
return PTR_ERR(msibl_device);
|
return PTR_ERR(msibl_device);
|
||||||
msibl_device->props.max_brightness = MSI_LCD_LEVEL_MAX-1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = platform_driver_register(&msipf_driver);
|
ret = platform_driver_register(&msipf_driver);
|
||||||
|
|
|
@ -138,7 +138,7 @@ static int bl_set_status(struct backlight_device *bd)
|
||||||
return msi_wmi_set_block(0, backlight_map[bright]);
|
return msi_wmi_set_block(0, backlight_map[bright]);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct backlight_ops msi_backlight_ops = {
|
static const struct backlight_ops msi_backlight_ops = {
|
||||||
.get_brightness = bl_get,
|
.get_brightness = bl_get,
|
||||||
.update_status = bl_set_status,
|
.update_status = bl_set_status,
|
||||||
};
|
};
|
||||||
|
@ -249,12 +249,17 @@ static int __init msi_wmi_init(void)
|
||||||
goto err_uninstall_notifier;
|
goto err_uninstall_notifier;
|
||||||
|
|
||||||
if (!acpi_video_backlight_support()) {
|
if (!acpi_video_backlight_support()) {
|
||||||
backlight = backlight_device_register(DRV_NAME,
|
struct backlight_properties props;
|
||||||
NULL, NULL, &msi_backlight_ops);
|
memset(&props, 0, sizeof(struct backlight_properties));
|
||||||
if (IS_ERR(backlight))
|
props.max_brightness = ARRAY_SIZE(backlight_map) - 1;
|
||||||
|
backlight = backlight_device_register(DRV_NAME, NULL, NULL,
|
||||||
|
&msi_backlight_ops,
|
||||||
|
&props);
|
||||||
|
if (IS_ERR(backlight)) {
|
||||||
|
err = PTR_ERR(backlight);
|
||||||
goto err_free_input;
|
goto err_free_input;
|
||||||
|
}
|
||||||
|
|
||||||
backlight->props.max_brightness = ARRAY_SIZE(backlight_map) - 1;
|
|
||||||
err = bl_get(NULL);
|
err = bl_get(NULL);
|
||||||
if (err < 0)
|
if (err < 0)
|
||||||
goto err_free_backlight;
|
goto err_free_backlight;
|
||||||
|
|
|
@ -352,7 +352,7 @@ static int bl_set_status(struct backlight_device *bd)
|
||||||
return acpi_pcc_write_sset(pcc, SINF_DC_CUR_BRIGHT, bright);
|
return acpi_pcc_write_sset(pcc, SINF_DC_CUR_BRIGHT, bright);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct backlight_ops pcc_backlight_ops = {
|
static const struct backlight_ops pcc_backlight_ops = {
|
||||||
.get_brightness = bl_get,
|
.get_brightness = bl_get,
|
||||||
.update_status = bl_set_status,
|
.update_status = bl_set_status,
|
||||||
};
|
};
|
||||||
|
@ -600,6 +600,7 @@ static int acpi_pcc_hotkey_resume(struct acpi_device *device)
|
||||||
|
|
||||||
static int acpi_pcc_hotkey_add(struct acpi_device *device)
|
static int acpi_pcc_hotkey_add(struct acpi_device *device)
|
||||||
{
|
{
|
||||||
|
struct backlight_properties props;
|
||||||
struct pcc_acpi *pcc;
|
struct pcc_acpi *pcc;
|
||||||
int num_sifr, result;
|
int num_sifr, result;
|
||||||
|
|
||||||
|
@ -637,24 +638,25 @@ static int acpi_pcc_hotkey_add(struct acpi_device *device)
|
||||||
if (result) {
|
if (result) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||||
"Error installing keyinput handler\n"));
|
"Error installing keyinput handler\n"));
|
||||||
goto out_sinf;
|
goto out_hotkey;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* initialize backlight */
|
|
||||||
pcc->backlight = backlight_device_register("panasonic", NULL, pcc,
|
|
||||||
&pcc_backlight_ops);
|
|
||||||
if (IS_ERR(pcc->backlight))
|
|
||||||
goto out_input;
|
|
||||||
|
|
||||||
if (!acpi_pcc_retrieve_biosdata(pcc, pcc->sinf)) {
|
if (!acpi_pcc_retrieve_biosdata(pcc, pcc->sinf)) {
|
||||||
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
|
||||||
"Couldn't retrieve BIOS data\n"));
|
"Couldn't retrieve BIOS data\n"));
|
||||||
goto out_backlight;
|
goto out_input;
|
||||||
|
}
|
||||||
|
/* initialize backlight */
|
||||||
|
memset(&props, 0, sizeof(struct backlight_properties));
|
||||||
|
props.max_brightness = pcc->sinf[SINF_AC_MAX_BRIGHT];
|
||||||
|
pcc->backlight = backlight_device_register("panasonic", NULL, pcc,
|
||||||
|
&pcc_backlight_ops, &props);
|
||||||
|
if (IS_ERR(pcc->backlight)) {
|
||||||
|
result = PTR_ERR(pcc->backlight);
|
||||||
|
goto out_sinf;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* read the initial brightness setting from the hardware */
|
/* read the initial brightness setting from the hardware */
|
||||||
pcc->backlight->props.max_brightness =
|
|
||||||
pcc->sinf[SINF_AC_MAX_BRIGHT];
|
|
||||||
pcc->backlight->props.brightness = pcc->sinf[SINF_AC_CUR_BRIGHT];
|
pcc->backlight->props.brightness = pcc->sinf[SINF_AC_CUR_BRIGHT];
|
||||||
|
|
||||||
/* read the initial sticky key mode from the hardware */
|
/* read the initial sticky key mode from the hardware */
|
||||||
|
@ -669,12 +671,12 @@ static int acpi_pcc_hotkey_add(struct acpi_device *device)
|
||||||
|
|
||||||
out_backlight:
|
out_backlight:
|
||||||
backlight_device_unregister(pcc->backlight);
|
backlight_device_unregister(pcc->backlight);
|
||||||
|
out_sinf:
|
||||||
|
kfree(pcc->sinf);
|
||||||
out_input:
|
out_input:
|
||||||
input_unregister_device(pcc->input_dev);
|
input_unregister_device(pcc->input_dev);
|
||||||
/* no need to input_free_device() since core input API refcount and
|
/* no need to input_free_device() since core input API refcount and
|
||||||
* free()s the device */
|
* free()s the device */
|
||||||
out_sinf:
|
|
||||||
kfree(pcc->sinf);
|
|
||||||
out_hotkey:
|
out_hotkey:
|
||||||
kfree(pcc);
|
kfree(pcc);
|
||||||
|
|
||||||
|
|
|
@ -1291,9 +1291,13 @@ static int sony_nc_add(struct acpi_device *device)
|
||||||
"controlled by ACPI video driver\n");
|
"controlled by ACPI video driver\n");
|
||||||
} else if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle, "GBRT",
|
} else if (ACPI_SUCCESS(acpi_get_handle(sony_nc_acpi_handle, "GBRT",
|
||||||
&handle))) {
|
&handle))) {
|
||||||
|
struct backlight_properties props;
|
||||||
|
memset(&props, 0, sizeof(struct backlight_properties));
|
||||||
|
props.max_brightness = SONY_MAX_BRIGHTNESS - 1;
|
||||||
sony_backlight_device = backlight_device_register("sony", NULL,
|
sony_backlight_device = backlight_device_register("sony", NULL,
|
||||||
NULL,
|
NULL,
|
||||||
&sony_backlight_ops);
|
&sony_backlight_ops,
|
||||||
|
&props);
|
||||||
|
|
||||||
if (IS_ERR(sony_backlight_device)) {
|
if (IS_ERR(sony_backlight_device)) {
|
||||||
printk(KERN_WARNING DRV_PFX "unable to register backlight device\n");
|
printk(KERN_WARNING DRV_PFX "unable to register backlight device\n");
|
||||||
|
@ -1302,8 +1306,6 @@ static int sony_nc_add(struct acpi_device *device)
|
||||||
sony_backlight_device->props.brightness =
|
sony_backlight_device->props.brightness =
|
||||||
sony_backlight_get_brightness
|
sony_backlight_get_brightness
|
||||||
(sony_backlight_device);
|
(sony_backlight_device);
|
||||||
sony_backlight_device->props.max_brightness =
|
|
||||||
SONY_MAX_BRIGHTNESS - 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -6170,6 +6170,7 @@ static const struct tpacpi_quirk brightness_quirk_table[] __initconst = {
|
||||||
|
|
||||||
static int __init brightness_init(struct ibm_init_struct *iibm)
|
static int __init brightness_init(struct ibm_init_struct *iibm)
|
||||||
{
|
{
|
||||||
|
struct backlight_properties props;
|
||||||
int b;
|
int b;
|
||||||
unsigned long quirks;
|
unsigned long quirks;
|
||||||
|
|
||||||
|
@ -6259,9 +6260,12 @@ static int __init brightness_init(struct ibm_init_struct *iibm)
|
||||||
printk(TPACPI_INFO
|
printk(TPACPI_INFO
|
||||||
"detected a 16-level brightness capable ThinkPad\n");
|
"detected a 16-level brightness capable ThinkPad\n");
|
||||||
|
|
||||||
ibm_backlight_device = backlight_device_register(
|
memset(&props, 0, sizeof(struct backlight_properties));
|
||||||
TPACPI_BACKLIGHT_DEV_NAME, NULL, NULL,
|
props.max_brightness = (tp_features.bright_16levels) ? 15 : 7;
|
||||||
&ibm_backlight_data);
|
ibm_backlight_device = backlight_device_register(TPACPI_BACKLIGHT_DEV_NAME,
|
||||||
|
NULL, NULL,
|
||||||
|
&ibm_backlight_data,
|
||||||
|
&props);
|
||||||
if (IS_ERR(ibm_backlight_device)) {
|
if (IS_ERR(ibm_backlight_device)) {
|
||||||
int rc = PTR_ERR(ibm_backlight_device);
|
int rc = PTR_ERR(ibm_backlight_device);
|
||||||
ibm_backlight_device = NULL;
|
ibm_backlight_device = NULL;
|
||||||
|
@ -6280,8 +6284,6 @@ static int __init brightness_init(struct ibm_init_struct *iibm)
|
||||||
"or not on your ThinkPad\n", TPACPI_MAIL);
|
"or not on your ThinkPad\n", TPACPI_MAIL);
|
||||||
}
|
}
|
||||||
|
|
||||||
ibm_backlight_device->props.max_brightness =
|
|
||||||
(tp_features.bright_16levels)? 15 : 7;
|
|
||||||
ibm_backlight_device->props.brightness = b & TP_EC_BACKLIGHT_LVLMSK;
|
ibm_backlight_device->props.brightness = b & TP_EC_BACKLIGHT_LVLMSK;
|
||||||
backlight_update_status(ibm_backlight_device);
|
backlight_update_status(ibm_backlight_device);
|
||||||
|
|
||||||
|
|
|
@ -924,6 +924,7 @@ static int __init toshiba_acpi_init(void)
|
||||||
u32 hci_result;
|
u32 hci_result;
|
||||||
bool bt_present;
|
bool bt_present;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
struct backlight_properties props;
|
||||||
|
|
||||||
if (acpi_disabled)
|
if (acpi_disabled)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
@ -974,10 +975,12 @@ static int __init toshiba_acpi_init(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
props.max_brightness = HCI_LCD_BRIGHTNESS_LEVELS - 1;
|
||||||
toshiba_backlight_device = backlight_device_register("toshiba",
|
toshiba_backlight_device = backlight_device_register("toshiba",
|
||||||
&toshiba_acpi.p_dev->dev,
|
&toshiba_acpi.p_dev->dev,
|
||||||
NULL,
|
NULL,
|
||||||
&toshiba_backlight_data);
|
&toshiba_backlight_data,
|
||||||
|
&props);
|
||||||
if (IS_ERR(toshiba_backlight_device)) {
|
if (IS_ERR(toshiba_backlight_device)) {
|
||||||
ret = PTR_ERR(toshiba_backlight_device);
|
ret = PTR_ERR(toshiba_backlight_device);
|
||||||
|
|
||||||
|
@ -986,7 +989,6 @@ static int __init toshiba_acpi_init(void)
|
||||||
toshiba_acpi_exit();
|
toshiba_acpi_exit();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
toshiba_backlight_device->props.max_brightness = HCI_LCD_BRIGHTNESS_LEVELS - 1;
|
|
||||||
|
|
||||||
/* Register rfkill switch for Bluetooth */
|
/* Register rfkill switch for Bluetooth */
|
||||||
if (hci_get_bt_present(&bt_present) == HCI_SUCCESS && bt_present) {
|
if (hci_get_bt_present(&bt_present) == HCI_SUCCESS && bt_present) {
|
||||||
|
|
|
@ -394,6 +394,7 @@ MODULE_DEVICE_TABLE(dmi, samsung_dmi_table);
|
||||||
|
|
||||||
static int __init samsung_init(void)
|
static int __init samsung_init(void)
|
||||||
{
|
{
|
||||||
|
struct backlight_properties props;
|
||||||
struct sabi_retval sretval;
|
struct sabi_retval sretval;
|
||||||
const char *testStr = "SECLINUX";
|
const char *testStr = "SECLINUX";
|
||||||
void __iomem *memcheck;
|
void __iomem *memcheck;
|
||||||
|
@ -486,12 +487,14 @@ static int __init samsung_init(void)
|
||||||
goto error_no_platform;
|
goto error_no_platform;
|
||||||
|
|
||||||
/* create a backlight device to talk to this one */
|
/* create a backlight device to talk to this one */
|
||||||
|
memset(&props, 0, sizeof(struct backlight_properties));
|
||||||
|
props.max_brightness = MAX_BRIGHT;
|
||||||
backlight_device = backlight_device_register("samsung", &sdev->dev,
|
backlight_device = backlight_device_register("samsung", &sdev->dev,
|
||||||
NULL, &backlight_ops);
|
NULL, &backlight_ops,
|
||||||
|
&props);
|
||||||
if (IS_ERR(backlight_device))
|
if (IS_ERR(backlight_device))
|
||||||
goto error_no_backlight;
|
goto error_no_backlight;
|
||||||
|
|
||||||
backlight_device->props.max_brightness = MAX_BRIGHT;
|
|
||||||
backlight_device->props.brightness = read_brightness();
|
backlight_device->props.brightness = read_brightness();
|
||||||
backlight_device->props.power = FB_BLANK_UNBLANK;
|
backlight_device->props.power = FB_BLANK_UNBLANK;
|
||||||
backlight_update_status(backlight_device);
|
backlight_update_status(backlight_device);
|
||||||
|
|
|
@ -202,6 +202,7 @@ static void appledisplay_work(struct work_struct *work)
|
||||||
static int appledisplay_probe(struct usb_interface *iface,
|
static int appledisplay_probe(struct usb_interface *iface,
|
||||||
const struct usb_device_id *id)
|
const struct usb_device_id *id)
|
||||||
{
|
{
|
||||||
|
struct backlight_properties props;
|
||||||
struct appledisplay *pdata;
|
struct appledisplay *pdata;
|
||||||
struct usb_device *udev = interface_to_usbdev(iface);
|
struct usb_device *udev = interface_to_usbdev(iface);
|
||||||
struct usb_host_interface *iface_desc;
|
struct usb_host_interface *iface_desc;
|
||||||
|
@ -279,16 +280,16 @@ static int appledisplay_probe(struct usb_interface *iface,
|
||||||
/* Register backlight device */
|
/* Register backlight device */
|
||||||
snprintf(bl_name, sizeof(bl_name), "appledisplay%d",
|
snprintf(bl_name, sizeof(bl_name), "appledisplay%d",
|
||||||
atomic_inc_return(&count_displays) - 1);
|
atomic_inc_return(&count_displays) - 1);
|
||||||
|
memset(&props, 0, sizeof(struct backlight_properties));
|
||||||
|
props.max_brightness = 0xff;
|
||||||
pdata->bd = backlight_device_register(bl_name, NULL, pdata,
|
pdata->bd = backlight_device_register(bl_name, NULL, pdata,
|
||||||
&appledisplay_bl_data);
|
&appledisplay_bl_data, &props);
|
||||||
if (IS_ERR(pdata->bd)) {
|
if (IS_ERR(pdata->bd)) {
|
||||||
dev_err(&iface->dev, "Backlight registration failed\n");
|
dev_err(&iface->dev, "Backlight registration failed\n");
|
||||||
retval = PTR_ERR(pdata->bd);
|
retval = PTR_ERR(pdata->bd);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
pdata->bd->props.max_brightness = 0xff;
|
|
||||||
|
|
||||||
/* Try to get brightness */
|
/* Try to get brightness */
|
||||||
brightness = appledisplay_bl_get_brightness(pdata->bd);
|
brightness = appledisplay_bl_get_brightness(pdata->bd);
|
||||||
|
|
||||||
|
|
|
@ -117,6 +117,7 @@ static struct backlight_ops atmel_lcdc_bl_ops = {
|
||||||
|
|
||||||
static void init_backlight(struct atmel_lcdfb_info *sinfo)
|
static void init_backlight(struct atmel_lcdfb_info *sinfo)
|
||||||
{
|
{
|
||||||
|
struct backlight_properties props;
|
||||||
struct backlight_device *bl;
|
struct backlight_device *bl;
|
||||||
|
|
||||||
sinfo->bl_power = FB_BLANK_UNBLANK;
|
sinfo->bl_power = FB_BLANK_UNBLANK;
|
||||||
|
@ -124,8 +125,10 @@ static void init_backlight(struct atmel_lcdfb_info *sinfo)
|
||||||
if (sinfo->backlight)
|
if (sinfo->backlight)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
bl = backlight_device_register("backlight", &sinfo->pdev->dev,
|
memset(&props, 0, sizeof(struct backlight_properties));
|
||||||
sinfo, &atmel_lcdc_bl_ops);
|
props.max_brightness = 0xff;
|
||||||
|
bl = backlight_device_register("backlight", &sinfo->pdev->dev, sinfo,
|
||||||
|
&atmel_lcdc_bl_ops, &props);
|
||||||
if (IS_ERR(bl)) {
|
if (IS_ERR(bl)) {
|
||||||
dev_err(&sinfo->pdev->dev, "error %ld on backlight register\n",
|
dev_err(&sinfo->pdev->dev, "error %ld on backlight register\n",
|
||||||
PTR_ERR(bl));
|
PTR_ERR(bl));
|
||||||
|
@ -135,7 +138,6 @@ static void init_backlight(struct atmel_lcdfb_info *sinfo)
|
||||||
|
|
||||||
bl->props.power = FB_BLANK_UNBLANK;
|
bl->props.power = FB_BLANK_UNBLANK;
|
||||||
bl->props.fb_blank = FB_BLANK_UNBLANK;
|
bl->props.fb_blank = FB_BLANK_UNBLANK;
|
||||||
bl->props.max_brightness = 0xff;
|
|
||||||
bl->props.brightness = atmel_bl_get_brightness(bl);
|
bl->props.brightness = atmel_bl_get_brightness(bl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1802,6 +1802,7 @@ static void aty128_bl_set_power(struct fb_info *info, int power)
|
||||||
|
|
||||||
static void aty128_bl_init(struct aty128fb_par *par)
|
static void aty128_bl_init(struct aty128fb_par *par)
|
||||||
{
|
{
|
||||||
|
struct backlight_properties props;
|
||||||
struct fb_info *info = pci_get_drvdata(par->pdev);
|
struct fb_info *info = pci_get_drvdata(par->pdev);
|
||||||
struct backlight_device *bd;
|
struct backlight_device *bd;
|
||||||
char name[12];
|
char name[12];
|
||||||
|
@ -1817,7 +1818,10 @@ static void aty128_bl_init(struct aty128fb_par *par)
|
||||||
|
|
||||||
snprintf(name, sizeof(name), "aty128bl%d", info->node);
|
snprintf(name, sizeof(name), "aty128bl%d", info->node);
|
||||||
|
|
||||||
bd = backlight_device_register(name, info->dev, par, &aty128_bl_data);
|
memset(&props, 0, sizeof(struct backlight_properties));
|
||||||
|
props.max_brightness = FB_BACKLIGHT_LEVELS - 1;
|
||||||
|
bd = backlight_device_register(name, info->dev, par, &aty128_bl_data,
|
||||||
|
&props);
|
||||||
if (IS_ERR(bd)) {
|
if (IS_ERR(bd)) {
|
||||||
info->bl_dev = NULL;
|
info->bl_dev = NULL;
|
||||||
printk(KERN_WARNING "aty128: Backlight registration failed\n");
|
printk(KERN_WARNING "aty128: Backlight registration failed\n");
|
||||||
|
@ -1829,7 +1833,6 @@ static void aty128_bl_init(struct aty128fb_par *par)
|
||||||
63 * FB_BACKLIGHT_MAX / MAX_LEVEL,
|
63 * FB_BACKLIGHT_MAX / MAX_LEVEL,
|
||||||
219 * FB_BACKLIGHT_MAX / MAX_LEVEL);
|
219 * FB_BACKLIGHT_MAX / MAX_LEVEL);
|
||||||
|
|
||||||
bd->props.max_brightness = FB_BACKLIGHT_LEVELS - 1;
|
|
||||||
bd->props.brightness = bd->props.max_brightness;
|
bd->props.brightness = bd->props.max_brightness;
|
||||||
bd->props.power = FB_BLANK_UNBLANK;
|
bd->props.power = FB_BLANK_UNBLANK;
|
||||||
backlight_update_status(bd);
|
backlight_update_status(bd);
|
||||||
|
|
|
@ -2232,6 +2232,7 @@ static struct backlight_ops aty_bl_data = {
|
||||||
|
|
||||||
static void aty_bl_init(struct atyfb_par *par)
|
static void aty_bl_init(struct atyfb_par *par)
|
||||||
{
|
{
|
||||||
|
struct backlight_properties props;
|
||||||
struct fb_info *info = pci_get_drvdata(par->pdev);
|
struct fb_info *info = pci_get_drvdata(par->pdev);
|
||||||
struct backlight_device *bd;
|
struct backlight_device *bd;
|
||||||
char name[12];
|
char name[12];
|
||||||
|
@ -2243,7 +2244,10 @@ static void aty_bl_init(struct atyfb_par *par)
|
||||||
|
|
||||||
snprintf(name, sizeof(name), "atybl%d", info->node);
|
snprintf(name, sizeof(name), "atybl%d", info->node);
|
||||||
|
|
||||||
bd = backlight_device_register(name, info->dev, par, &aty_bl_data);
|
memset(&props, 0, sizeof(struct backlight_properties));
|
||||||
|
props.max_brightness = FB_BACKLIGHT_LEVELS - 1;
|
||||||
|
bd = backlight_device_register(name, info->dev, par, &aty_bl_data,
|
||||||
|
&props);
|
||||||
if (IS_ERR(bd)) {
|
if (IS_ERR(bd)) {
|
||||||
info->bl_dev = NULL;
|
info->bl_dev = NULL;
|
||||||
printk(KERN_WARNING "aty: Backlight registration failed\n");
|
printk(KERN_WARNING "aty: Backlight registration failed\n");
|
||||||
|
@ -2255,7 +2259,6 @@ static void aty_bl_init(struct atyfb_par *par)
|
||||||
0x3F * FB_BACKLIGHT_MAX / MAX_LEVEL,
|
0x3F * FB_BACKLIGHT_MAX / MAX_LEVEL,
|
||||||
0xFF * FB_BACKLIGHT_MAX / MAX_LEVEL);
|
0xFF * FB_BACKLIGHT_MAX / MAX_LEVEL);
|
||||||
|
|
||||||
bd->props.max_brightness = FB_BACKLIGHT_LEVELS - 1;
|
|
||||||
bd->props.brightness = bd->props.max_brightness;
|
bd->props.brightness = bd->props.max_brightness;
|
||||||
bd->props.power = FB_BLANK_UNBLANK;
|
bd->props.power = FB_BLANK_UNBLANK;
|
||||||
backlight_update_status(bd);
|
backlight_update_status(bd);
|
||||||
|
|
|
@ -134,6 +134,7 @@ static struct backlight_ops radeon_bl_data = {
|
||||||
|
|
||||||
void radeonfb_bl_init(struct radeonfb_info *rinfo)
|
void radeonfb_bl_init(struct radeonfb_info *rinfo)
|
||||||
{
|
{
|
||||||
|
struct backlight_properties props;
|
||||||
struct backlight_device *bd;
|
struct backlight_device *bd;
|
||||||
struct radeon_bl_privdata *pdata;
|
struct radeon_bl_privdata *pdata;
|
||||||
char name[12];
|
char name[12];
|
||||||
|
@ -155,7 +156,10 @@ void radeonfb_bl_init(struct radeonfb_info *rinfo)
|
||||||
|
|
||||||
snprintf(name, sizeof(name), "radeonbl%d", rinfo->info->node);
|
snprintf(name, sizeof(name), "radeonbl%d", rinfo->info->node);
|
||||||
|
|
||||||
bd = backlight_device_register(name, rinfo->info->dev, pdata, &radeon_bl_data);
|
memset(&props, 0, sizeof(struct backlight_properties));
|
||||||
|
props.max_brightness = FB_BACKLIGHT_LEVELS - 1;
|
||||||
|
bd = backlight_device_register(name, rinfo->info->dev, pdata,
|
||||||
|
&radeon_bl_data, &props);
|
||||||
if (IS_ERR(bd)) {
|
if (IS_ERR(bd)) {
|
||||||
rinfo->info->bl_dev = NULL;
|
rinfo->info->bl_dev = NULL;
|
||||||
printk("radeonfb: Backlight registration failed\n");
|
printk("radeonfb: Backlight registration failed\n");
|
||||||
|
@ -185,7 +189,6 @@ void radeonfb_bl_init(struct radeonfb_info *rinfo)
|
||||||
63 * FB_BACKLIGHT_MAX / MAX_RADEON_LEVEL,
|
63 * FB_BACKLIGHT_MAX / MAX_RADEON_LEVEL,
|
||||||
217 * FB_BACKLIGHT_MAX / MAX_RADEON_LEVEL);
|
217 * FB_BACKLIGHT_MAX / MAX_RADEON_LEVEL);
|
||||||
|
|
||||||
bd->props.max_brightness = FB_BACKLIGHT_LEVELS - 1;
|
|
||||||
bd->props.brightness = bd->props.max_brightness;
|
bd->props.brightness = bd->props.max_brightness;
|
||||||
bd->props.power = FB_BLANK_UNBLANK;
|
bd->props.power = FB_BLANK_UNBLANK;
|
||||||
backlight_update_status(bd);
|
backlight_update_status(bd);
|
||||||
|
|
|
@ -187,6 +187,7 @@ static int pm860x_backlight_probe(struct platform_device *pdev)
|
||||||
struct pm860x_backlight_data *data;
|
struct pm860x_backlight_data *data;
|
||||||
struct backlight_device *bl;
|
struct backlight_device *bl;
|
||||||
struct resource *res;
|
struct resource *res;
|
||||||
|
struct backlight_properties props;
|
||||||
unsigned char value;
|
unsigned char value;
|
||||||
char name[MFD_NAME_SIZE];
|
char name[MFD_NAME_SIZE];
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -223,14 +224,15 @@ static int pm860x_backlight_probe(struct platform_device *pdev)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
memset(&props, 0, sizeof(struct backlight_properties));
|
||||||
|
props.max_brightness = MAX_BRIGHTNESS;
|
||||||
bl = backlight_device_register(name, &pdev->dev, data,
|
bl = backlight_device_register(name, &pdev->dev, data,
|
||||||
&pm860x_backlight_ops);
|
&pm860x_backlight_ops, &props);
|
||||||
if (IS_ERR(bl)) {
|
if (IS_ERR(bl)) {
|
||||||
dev_err(&pdev->dev, "failed to register backlight\n");
|
dev_err(&pdev->dev, "failed to register backlight\n");
|
||||||
kfree(data);
|
kfree(data);
|
||||||
return PTR_ERR(bl);
|
return PTR_ERR(bl);
|
||||||
}
|
}
|
||||||
bl->props.max_brightness = MAX_BRIGHTNESS;
|
|
||||||
bl->props.brightness = MAX_BRIGHTNESS;
|
bl->props.brightness = MAX_BRIGHTNESS;
|
||||||
|
|
||||||
platform_set_drvdata(pdev, bl);
|
platform_set_drvdata(pdev, bl);
|
||||||
|
|
|
@ -31,6 +31,13 @@ config LCD_CORGI
|
||||||
Say y here to support the LCD panels usually found on SHARP
|
Say y here to support the LCD panels usually found on SHARP
|
||||||
corgi (C7x0) and spitz (Cxx00) models.
|
corgi (C7x0) and spitz (Cxx00) models.
|
||||||
|
|
||||||
|
config LCD_L4F00242T03
|
||||||
|
tristate "Epson L4F00242T03 LCD"
|
||||||
|
depends on LCD_CLASS_DEVICE && SPI_MASTER && GENERIC_GPIO
|
||||||
|
help
|
||||||
|
SPI driver for Epson L4F00242T03. This provides basic support
|
||||||
|
for init and powering the LCD up/down through a sysfs interface.
|
||||||
|
|
||||||
config LCD_LMS283GF05
|
config LCD_LMS283GF05
|
||||||
tristate "Samsung LMS283GF05 LCD"
|
tristate "Samsung LMS283GF05 LCD"
|
||||||
depends on LCD_CLASS_DEVICE && SPI_MASTER && GENERIC_GPIO
|
depends on LCD_CLASS_DEVICE && SPI_MASTER && GENERIC_GPIO
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
obj-$(CONFIG_LCD_CLASS_DEVICE) += lcd.o
|
obj-$(CONFIG_LCD_CLASS_DEVICE) += lcd.o
|
||||||
obj-$(CONFIG_LCD_CORGI) += corgi_lcd.o
|
obj-$(CONFIG_LCD_CORGI) += corgi_lcd.o
|
||||||
obj-$(CONFIG_LCD_HP700) += jornada720_lcd.o
|
obj-$(CONFIG_LCD_HP700) += jornada720_lcd.o
|
||||||
|
obj-$(CONFIG_LCD_L4F00242T03) += l4f00242t03.o
|
||||||
obj-$(CONFIG_LCD_LMS283GF05) += lms283gf05.o
|
obj-$(CONFIG_LCD_LMS283GF05) += lms283gf05.o
|
||||||
obj-$(CONFIG_LCD_LTV350QV) += ltv350qv.o
|
obj-$(CONFIG_LCD_LTV350QV) += ltv350qv.o
|
||||||
obj-$(CONFIG_LCD_ILI9320) += ili9320.o
|
obj-$(CONFIG_LCD_ILI9320) += ili9320.o
|
||||||
|
|
|
@ -278,6 +278,7 @@ static const struct attribute_group adp5520_bl_attr_group = {
|
||||||
|
|
||||||
static int __devinit adp5520_bl_probe(struct platform_device *pdev)
|
static int __devinit adp5520_bl_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
|
struct backlight_properties props;
|
||||||
struct backlight_device *bl;
|
struct backlight_device *bl;
|
||||||
struct adp5520_bl *data;
|
struct adp5520_bl *data;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
@ -300,17 +301,17 @@ static int __devinit adp5520_bl_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
mutex_init(&data->lock);
|
mutex_init(&data->lock);
|
||||||
|
|
||||||
bl = backlight_device_register(pdev->name, data->master,
|
memset(&props, 0, sizeof(struct backlight_properties));
|
||||||
data, &adp5520_bl_ops);
|
props.max_brightness = ADP5020_MAX_BRIGHTNESS;
|
||||||
|
bl = backlight_device_register(pdev->name, data->master, data,
|
||||||
|
&adp5520_bl_ops, &props);
|
||||||
if (IS_ERR(bl)) {
|
if (IS_ERR(bl)) {
|
||||||
dev_err(&pdev->dev, "failed to register backlight\n");
|
dev_err(&pdev->dev, "failed to register backlight\n");
|
||||||
kfree(data);
|
kfree(data);
|
||||||
return PTR_ERR(bl);
|
return PTR_ERR(bl);
|
||||||
}
|
}
|
||||||
|
|
||||||
bl->props.max_brightness =
|
bl->props.brightness = ADP5020_MAX_BRIGHTNESS;
|
||||||
bl->props.brightness = ADP5020_MAX_BRIGHTNESS;
|
|
||||||
|
|
||||||
if (data->pdata->en_ambl_sens)
|
if (data->pdata->en_ambl_sens)
|
||||||
ret = sysfs_create_group(&bl->dev.kobj,
|
ret = sysfs_create_group(&bl->dev.kobj,
|
||||||
&adp5520_bl_attr_group);
|
&adp5520_bl_attr_group);
|
||||||
|
|
|
@ -56,7 +56,7 @@ static int adx_backlight_get_brightness(struct backlight_device *bldev)
|
||||||
return brightness & 0xff;
|
return brightness & 0xff;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int adx_backlight_check_fb(struct fb_info *fb)
|
static int adx_backlight_check_fb(struct backlight_device *bldev, struct fb_info *fb)
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -70,6 +70,7 @@ static const struct backlight_ops adx_backlight_ops = {
|
||||||
|
|
||||||
static int __devinit adx_backlight_probe(struct platform_device *pdev)
|
static int __devinit adx_backlight_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
|
struct backlight_properties props;
|
||||||
struct backlight_device *bldev;
|
struct backlight_device *bldev;
|
||||||
struct resource *res;
|
struct resource *res;
|
||||||
struct adxbl *bl;
|
struct adxbl *bl;
|
||||||
|
@ -101,14 +102,15 @@ static int __devinit adx_backlight_probe(struct platform_device *pdev)
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
bldev = backlight_device_register(dev_name(&pdev->dev), &pdev->dev, bl,
|
memset(&props, 0, sizeof(struct backlight_properties));
|
||||||
&adx_backlight_ops);
|
props.max_brightness = 0xff;
|
||||||
|
bldev = backlight_device_register(dev_name(&pdev->dev), &pdev->dev,
|
||||||
|
bl, &adx_backlight_ops, &props);
|
||||||
if (!bldev) {
|
if (!bldev) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
bldev->props.max_brightness = 0xff;
|
|
||||||
bldev->props.brightness = 0xff;
|
bldev->props.brightness = 0xff;
|
||||||
bldev->props.power = FB_BLANK_UNBLANK;
|
bldev->props.power = FB_BLANK_UNBLANK;
|
||||||
|
|
||||||
|
|
|
@ -120,6 +120,7 @@ static const struct backlight_ops atmel_pwm_bl_ops = {
|
||||||
|
|
||||||
static int atmel_pwm_bl_probe(struct platform_device *pdev)
|
static int atmel_pwm_bl_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
|
struct backlight_properties props;
|
||||||
const struct atmel_pwm_bl_platform_data *pdata;
|
const struct atmel_pwm_bl_platform_data *pdata;
|
||||||
struct backlight_device *bldev;
|
struct backlight_device *bldev;
|
||||||
struct atmel_pwm_bl *pwmbl;
|
struct atmel_pwm_bl *pwmbl;
|
||||||
|
@ -165,8 +166,10 @@ static int atmel_pwm_bl_probe(struct platform_device *pdev)
|
||||||
goto err_free_gpio;
|
goto err_free_gpio;
|
||||||
}
|
}
|
||||||
|
|
||||||
bldev = backlight_device_register("atmel-pwm-bl",
|
memset(&props, 0, sizeof(struct backlight_properties));
|
||||||
&pdev->dev, pwmbl, &atmel_pwm_bl_ops);
|
props.max_brightness = pdata->pwm_duty_max - pdata->pwm_duty_min;
|
||||||
|
bldev = backlight_device_register("atmel-pwm-bl", &pdev->dev, pwmbl,
|
||||||
|
&atmel_pwm_bl_ops, &props);
|
||||||
if (IS_ERR(bldev)) {
|
if (IS_ERR(bldev)) {
|
||||||
retval = PTR_ERR(bldev);
|
retval = PTR_ERR(bldev);
|
||||||
goto err_free_gpio;
|
goto err_free_gpio;
|
||||||
|
@ -178,7 +181,6 @@ static int atmel_pwm_bl_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
/* Power up the backlight by default at middle intesity. */
|
/* Power up the backlight by default at middle intesity. */
|
||||||
bldev->props.power = FB_BLANK_UNBLANK;
|
bldev->props.power = FB_BLANK_UNBLANK;
|
||||||
bldev->props.max_brightness = pdata->pwm_duty_max - pdata->pwm_duty_min;
|
|
||||||
bldev->props.brightness = bldev->props.max_brightness / 2;
|
bldev->props.brightness = bldev->props.max_brightness / 2;
|
||||||
|
|
||||||
retval = atmel_pwm_bl_init_pwm(pwmbl);
|
retval = atmel_pwm_bl_init_pwm(pwmbl);
|
||||||
|
|
|
@ -38,7 +38,7 @@ static int fb_notifier_callback(struct notifier_block *self,
|
||||||
mutex_lock(&bd->ops_lock);
|
mutex_lock(&bd->ops_lock);
|
||||||
if (bd->ops)
|
if (bd->ops)
|
||||||
if (!bd->ops->check_fb ||
|
if (!bd->ops->check_fb ||
|
||||||
bd->ops->check_fb(evdata->info)) {
|
bd->ops->check_fb(bd, evdata->info)) {
|
||||||
bd->props.fb_blank = *(int *)evdata->data;
|
bd->props.fb_blank = *(int *)evdata->data;
|
||||||
if (bd->props.fb_blank == FB_BLANK_UNBLANK)
|
if (bd->props.fb_blank == FB_BLANK_UNBLANK)
|
||||||
bd->props.state &= ~BL_CORE_FBBLANK;
|
bd->props.state &= ~BL_CORE_FBBLANK;
|
||||||
|
@ -269,7 +269,8 @@ EXPORT_SYMBOL(backlight_force_update);
|
||||||
* ERR_PTR() or a pointer to the newly allocated device.
|
* ERR_PTR() or a pointer to the newly allocated device.
|
||||||
*/
|
*/
|
||||||
struct backlight_device *backlight_device_register(const char *name,
|
struct backlight_device *backlight_device_register(const char *name,
|
||||||
struct device *parent, void *devdata, const struct backlight_ops *ops)
|
struct device *parent, void *devdata, const struct backlight_ops *ops,
|
||||||
|
const struct backlight_properties *props)
|
||||||
{
|
{
|
||||||
struct backlight_device *new_bd;
|
struct backlight_device *new_bd;
|
||||||
int rc;
|
int rc;
|
||||||
|
@ -289,6 +290,11 @@ struct backlight_device *backlight_device_register(const char *name,
|
||||||
dev_set_name(&new_bd->dev, name);
|
dev_set_name(&new_bd->dev, name);
|
||||||
dev_set_drvdata(&new_bd->dev, devdata);
|
dev_set_drvdata(&new_bd->dev, devdata);
|
||||||
|
|
||||||
|
/* Set default properties */
|
||||||
|
if (props)
|
||||||
|
memcpy(&new_bd->props, props,
|
||||||
|
sizeof(struct backlight_properties));
|
||||||
|
|
||||||
rc = device_register(&new_bd->dev);
|
rc = device_register(&new_bd->dev);
|
||||||
if (rc) {
|
if (rc) {
|
||||||
kfree(new_bd);
|
kfree(new_bd);
|
||||||
|
|
|
@ -533,6 +533,7 @@ err_free_backlight_on:
|
||||||
|
|
||||||
static int __devinit corgi_lcd_probe(struct spi_device *spi)
|
static int __devinit corgi_lcd_probe(struct spi_device *spi)
|
||||||
{
|
{
|
||||||
|
struct backlight_properties props;
|
||||||
struct corgi_lcd_platform_data *pdata = spi->dev.platform_data;
|
struct corgi_lcd_platform_data *pdata = spi->dev.platform_data;
|
||||||
struct corgi_lcd *lcd;
|
struct corgi_lcd *lcd;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
@ -559,13 +560,14 @@ static int __devinit corgi_lcd_probe(struct spi_device *spi)
|
||||||
lcd->power = FB_BLANK_POWERDOWN;
|
lcd->power = FB_BLANK_POWERDOWN;
|
||||||
lcd->mode = (pdata) ? pdata->init_mode : CORGI_LCD_MODE_VGA;
|
lcd->mode = (pdata) ? pdata->init_mode : CORGI_LCD_MODE_VGA;
|
||||||
|
|
||||||
lcd->bl_dev = backlight_device_register("corgi_bl", &spi->dev,
|
memset(&props, 0, sizeof(struct backlight_properties));
|
||||||
lcd, &corgi_bl_ops);
|
props.max_brightness = pdata->max_intensity;
|
||||||
|
lcd->bl_dev = backlight_device_register("corgi_bl", &spi->dev, lcd,
|
||||||
|
&corgi_bl_ops, &props);
|
||||||
if (IS_ERR(lcd->bl_dev)) {
|
if (IS_ERR(lcd->bl_dev)) {
|
||||||
ret = PTR_ERR(lcd->bl_dev);
|
ret = PTR_ERR(lcd->bl_dev);
|
||||||
goto err_unregister_lcd;
|
goto err_unregister_lcd;
|
||||||
}
|
}
|
||||||
lcd->bl_dev->props.max_brightness = pdata->max_intensity;
|
|
||||||
lcd->bl_dev->props.brightness = pdata->default_intensity;
|
lcd->bl_dev->props.brightness = pdata->default_intensity;
|
||||||
lcd->bl_dev->props.power = FB_BLANK_UNBLANK;
|
lcd->bl_dev->props.power = FB_BLANK_UNBLANK;
|
||||||
|
|
||||||
|
|
|
@ -170,6 +170,7 @@ static struct lcd_ops cr_lcd_ops = {
|
||||||
|
|
||||||
static int cr_backlight_probe(struct platform_device *pdev)
|
static int cr_backlight_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
|
struct backlight_properties props;
|
||||||
struct backlight_device *bdp;
|
struct backlight_device *bdp;
|
||||||
struct lcd_device *ldp;
|
struct lcd_device *ldp;
|
||||||
struct cr_panel *crp;
|
struct cr_panel *crp;
|
||||||
|
@ -190,8 +191,9 @@ static int cr_backlight_probe(struct platform_device *pdev)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
bdp = backlight_device_register("cr-backlight",
|
memset(&props, 0, sizeof(struct backlight_properties));
|
||||||
&pdev->dev, NULL, &cr_backlight_ops);
|
bdp = backlight_device_register("cr-backlight", &pdev->dev, NULL,
|
||||||
|
&cr_backlight_ops, &props);
|
||||||
if (IS_ERR(bdp)) {
|
if (IS_ERR(bdp)) {
|
||||||
pci_dev_put(lpc_dev);
|
pci_dev_put(lpc_dev);
|
||||||
return PTR_ERR(bdp);
|
return PTR_ERR(bdp);
|
||||||
|
@ -220,9 +222,7 @@ static int cr_backlight_probe(struct platform_device *pdev)
|
||||||
crp->cr_lcd_device = ldp;
|
crp->cr_lcd_device = ldp;
|
||||||
crp->cr_backlight_device->props.power = FB_BLANK_UNBLANK;
|
crp->cr_backlight_device->props.power = FB_BLANK_UNBLANK;
|
||||||
crp->cr_backlight_device->props.brightness = 0;
|
crp->cr_backlight_device->props.brightness = 0;
|
||||||
crp->cr_backlight_device->props.max_brightness = 0;
|
|
||||||
cr_backlight_set_intensity(crp->cr_backlight_device);
|
cr_backlight_set_intensity(crp->cr_backlight_device);
|
||||||
|
|
||||||
cr_lcd_set_power(crp->cr_lcd_device, FB_BLANK_UNBLANK);
|
cr_lcd_set_power(crp->cr_lcd_device, FB_BLANK_UNBLANK);
|
||||||
|
|
||||||
platform_set_drvdata(pdev, crp);
|
platform_set_drvdata(pdev, crp);
|
||||||
|
|
|
@ -105,6 +105,7 @@ static int da903x_backlight_probe(struct platform_device *pdev)
|
||||||
struct da9034_backlight_pdata *pdata = pdev->dev.platform_data;
|
struct da9034_backlight_pdata *pdata = pdev->dev.platform_data;
|
||||||
struct da903x_backlight_data *data;
|
struct da903x_backlight_data *data;
|
||||||
struct backlight_device *bl;
|
struct backlight_device *bl;
|
||||||
|
struct backlight_properties props;
|
||||||
int max_brightness;
|
int max_brightness;
|
||||||
|
|
||||||
data = kzalloc(sizeof(*data), GFP_KERNEL);
|
data = kzalloc(sizeof(*data), GFP_KERNEL);
|
||||||
|
@ -134,15 +135,15 @@ static int da903x_backlight_probe(struct platform_device *pdev)
|
||||||
da903x_write(data->da903x_dev, DA9034_WLED_CONTROL2,
|
da903x_write(data->da903x_dev, DA9034_WLED_CONTROL2,
|
||||||
DA9034_WLED_ISET(pdata->output_current));
|
DA9034_WLED_ISET(pdata->output_current));
|
||||||
|
|
||||||
bl = backlight_device_register(pdev->name, data->da903x_dev,
|
props.max_brightness = max_brightness;
|
||||||
data, &da903x_backlight_ops);
|
bl = backlight_device_register(pdev->name, data->da903x_dev, data,
|
||||||
|
&da903x_backlight_ops, &props);
|
||||||
if (IS_ERR(bl)) {
|
if (IS_ERR(bl)) {
|
||||||
dev_err(&pdev->dev, "failed to register backlight\n");
|
dev_err(&pdev->dev, "failed to register backlight\n");
|
||||||
kfree(data);
|
kfree(data);
|
||||||
return PTR_ERR(bl);
|
return PTR_ERR(bl);
|
||||||
}
|
}
|
||||||
|
|
||||||
bl->props.max_brightness = max_brightness;
|
|
||||||
bl->props.brightness = max_brightness;
|
bl->props.brightness = max_brightness;
|
||||||
|
|
||||||
platform_set_drvdata(pdev, bl);
|
platform_set_drvdata(pdev, bl);
|
||||||
|
|
|
@ -78,6 +78,7 @@ static const struct backlight_ops genericbl_ops = {
|
||||||
|
|
||||||
static int genericbl_probe(struct platform_device *pdev)
|
static int genericbl_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
|
struct backlight_properties props;
|
||||||
struct generic_bl_info *machinfo = pdev->dev.platform_data;
|
struct generic_bl_info *machinfo = pdev->dev.platform_data;
|
||||||
const char *name = "generic-bl";
|
const char *name = "generic-bl";
|
||||||
struct backlight_device *bd;
|
struct backlight_device *bd;
|
||||||
|
@ -89,14 +90,15 @@ static int genericbl_probe(struct platform_device *pdev)
|
||||||
if (machinfo->name)
|
if (machinfo->name)
|
||||||
name = machinfo->name;
|
name = machinfo->name;
|
||||||
|
|
||||||
bd = backlight_device_register (name,
|
memset(&props, 0, sizeof(struct backlight_properties));
|
||||||
&pdev->dev, NULL, &genericbl_ops);
|
props.max_brightness = machinfo->max_intensity;
|
||||||
|
bd = backlight_device_register(name, &pdev->dev, NULL, &genericbl_ops,
|
||||||
|
&props);
|
||||||
if (IS_ERR (bd))
|
if (IS_ERR (bd))
|
||||||
return PTR_ERR (bd);
|
return PTR_ERR (bd);
|
||||||
|
|
||||||
platform_set_drvdata(pdev, bd);
|
platform_set_drvdata(pdev, bd);
|
||||||
|
|
||||||
bd->props.max_brightness = machinfo->max_intensity;
|
|
||||||
bd->props.power = FB_BLANK_UNBLANK;
|
bd->props.power = FB_BLANK_UNBLANK;
|
||||||
bd->props.brightness = machinfo->default_intensity;
|
bd->props.brightness = machinfo->default_intensity;
|
||||||
backlight_update_status(bd);
|
backlight_update_status(bd);
|
||||||
|
|
|
@ -105,16 +105,18 @@ static const struct backlight_ops hp680bl_ops = {
|
||||||
|
|
||||||
static int __devinit hp680bl_probe(struct platform_device *pdev)
|
static int __devinit hp680bl_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
|
struct backlight_properties props;
|
||||||
struct backlight_device *bd;
|
struct backlight_device *bd;
|
||||||
|
|
||||||
bd = backlight_device_register ("hp680-bl", &pdev->dev, NULL,
|
memset(&props, 0, sizeof(struct backlight_properties));
|
||||||
&hp680bl_ops);
|
props.max_brightness = HP680_MAX_INTENSITY;
|
||||||
|
bd = backlight_device_register("hp680-bl", &pdev->dev, NULL,
|
||||||
|
&hp680bl_ops, &props);
|
||||||
if (IS_ERR(bd))
|
if (IS_ERR(bd))
|
||||||
return PTR_ERR(bd);
|
return PTR_ERR(bd);
|
||||||
|
|
||||||
platform_set_drvdata(pdev, bd);
|
platform_set_drvdata(pdev, bd);
|
||||||
|
|
||||||
bd->props.max_brightness = HP680_MAX_INTENSITY;
|
|
||||||
bd->props.brightness = HP680_DEFAULT_INTENSITY;
|
bd->props.brightness = HP680_DEFAULT_INTENSITY;
|
||||||
hp680bl_send_intensity(bd);
|
hp680bl_send_intensity(bd);
|
||||||
|
|
||||||
|
|
|
@ -101,10 +101,14 @@ static const struct backlight_ops jornada_bl_ops = {
|
||||||
|
|
||||||
static int jornada_bl_probe(struct platform_device *pdev)
|
static int jornada_bl_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
|
struct backlight_properties props;
|
||||||
int ret;
|
int ret;
|
||||||
struct backlight_device *bd;
|
struct backlight_device *bd;
|
||||||
|
|
||||||
bd = backlight_device_register(S1D_DEVICENAME, &pdev->dev, NULL, &jornada_bl_ops);
|
memset(&props, 0, sizeof(struct backlight_properties));
|
||||||
|
props.max_brightness = BL_MAX_BRIGHT;
|
||||||
|
bd = backlight_device_register(S1D_DEVICENAME, &pdev->dev, NULL,
|
||||||
|
&jornada_bl_ops, &props);
|
||||||
|
|
||||||
if (IS_ERR(bd)) {
|
if (IS_ERR(bd)) {
|
||||||
ret = PTR_ERR(bd);
|
ret = PTR_ERR(bd);
|
||||||
|
@ -117,7 +121,6 @@ static int jornada_bl_probe(struct platform_device *pdev)
|
||||||
/* note. make sure max brightness is set otherwise
|
/* note. make sure max brightness is set otherwise
|
||||||
you will get seemingly non-related errors when
|
you will get seemingly non-related errors when
|
||||||
trying to change brightness */
|
trying to change brightness */
|
||||||
bd->props.max_brightness = BL_MAX_BRIGHT;
|
|
||||||
jornada_bl_update_status(bd);
|
jornada_bl_update_status(bd);
|
||||||
|
|
||||||
platform_set_drvdata(pdev, bd);
|
platform_set_drvdata(pdev, bd);
|
||||||
|
|
|
@ -141,20 +141,24 @@ static const struct backlight_ops kb3886bl_ops = {
|
||||||
|
|
||||||
static int kb3886bl_probe(struct platform_device *pdev)
|
static int kb3886bl_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
|
struct backlight_properties props;
|
||||||
struct kb3886bl_machinfo *machinfo = pdev->dev.platform_data;
|
struct kb3886bl_machinfo *machinfo = pdev->dev.platform_data;
|
||||||
|
|
||||||
bl_machinfo = machinfo;
|
bl_machinfo = machinfo;
|
||||||
if (!machinfo->limit_mask)
|
if (!machinfo->limit_mask)
|
||||||
machinfo->limit_mask = -1;
|
machinfo->limit_mask = -1;
|
||||||
|
|
||||||
|
memset(&props, 0, sizeof(struct backlight_properties));
|
||||||
|
props.max_brightness = machinfo->max_intensity;
|
||||||
kb3886_backlight_device = backlight_device_register("kb3886-bl",
|
kb3886_backlight_device = backlight_device_register("kb3886-bl",
|
||||||
&pdev->dev, NULL, &kb3886bl_ops);
|
&pdev->dev, NULL,
|
||||||
|
&kb3886bl_ops,
|
||||||
|
&props);
|
||||||
if (IS_ERR(kb3886_backlight_device))
|
if (IS_ERR(kb3886_backlight_device))
|
||||||
return PTR_ERR(kb3886_backlight_device);
|
return PTR_ERR(kb3886_backlight_device);
|
||||||
|
|
||||||
platform_set_drvdata(pdev, kb3886_backlight_device);
|
platform_set_drvdata(pdev, kb3886_backlight_device);
|
||||||
|
|
||||||
kb3886_backlight_device->props.max_brightness = machinfo->max_intensity;
|
|
||||||
kb3886_backlight_device->props.power = FB_BLANK_UNBLANK;
|
kb3886_backlight_device->props.power = FB_BLANK_UNBLANK;
|
||||||
kb3886_backlight_device->props.brightness = machinfo->default_intensity;
|
kb3886_backlight_device->props.brightness = machinfo->default_intensity;
|
||||||
backlight_update_status(kb3886_backlight_device);
|
backlight_update_status(kb3886_backlight_device);
|
||||||
|
|
257
drivers/video/backlight/l4f00242t03.c
Normal file
257
drivers/video/backlight/l4f00242t03.c
Normal file
|
@ -0,0 +1,257 @@
|
||||||
|
/*
|
||||||
|
* l4f00242t03.c -- support for Epson L4F00242T03 LCD
|
||||||
|
*
|
||||||
|
* Copyright 2007-2009 Freescale Semiconductor, Inc. All Rights Reserved.
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009 Alberto Panizzo <maramaopercheseimorto@gmail.com>
|
||||||
|
* Inspired by Marek Vasut work in l4f00242t03.c
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License version 2 as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <linux/device.h>
|
||||||
|
#include <linux/kernel.h>
|
||||||
|
#include <linux/delay.h>
|
||||||
|
#include <linux/gpio.h>
|
||||||
|
#include <linux/lcd.h>
|
||||||
|
#include <linux/regulator/consumer.h>
|
||||||
|
|
||||||
|
#include <linux/spi/spi.h>
|
||||||
|
#include <linux/spi/l4f00242t03.h>
|
||||||
|
|
||||||
|
struct l4f00242t03_priv {
|
||||||
|
struct spi_device *spi;
|
||||||
|
struct lcd_device *ld;
|
||||||
|
int lcd_on:1;
|
||||||
|
struct regulator *io_reg;
|
||||||
|
struct regulator *core_reg;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
static void l4f00242t03_reset(unsigned int gpio)
|
||||||
|
{
|
||||||
|
pr_debug("l4f00242t03_reset.\n");
|
||||||
|
gpio_set_value(gpio, 1);
|
||||||
|
mdelay(100);
|
||||||
|
gpio_set_value(gpio, 0);
|
||||||
|
mdelay(10); /* tRES >= 100us */
|
||||||
|
gpio_set_value(gpio, 1);
|
||||||
|
mdelay(20);
|
||||||
|
}
|
||||||
|
|
||||||
|
#define param(x) ((x) | 0x100)
|
||||||
|
|
||||||
|
static void l4f00242t03_lcd_init(struct spi_device *spi)
|
||||||
|
{
|
||||||
|
struct l4f00242t03_pdata *pdata = spi->dev.platform_data;
|
||||||
|
struct l4f00242t03_priv *priv = dev_get_drvdata(&spi->dev);
|
||||||
|
const u16 cmd[] = { 0x36, param(0), 0x3A, param(0x60) };
|
||||||
|
|
||||||
|
dev_dbg(&spi->dev, "initializing LCD\n");
|
||||||
|
|
||||||
|
if (priv->io_reg) {
|
||||||
|
regulator_set_voltage(priv->io_reg, 1800000, 1800000);
|
||||||
|
regulator_enable(priv->io_reg);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (priv->core_reg) {
|
||||||
|
regulator_set_voltage(priv->core_reg, 2800000, 2800000);
|
||||||
|
regulator_enable(priv->core_reg);
|
||||||
|
}
|
||||||
|
|
||||||
|
gpio_set_value(pdata->data_enable_gpio, 1);
|
||||||
|
msleep(60);
|
||||||
|
spi_write(spi, (const u8 *)cmd, ARRAY_SIZE(cmd) * sizeof(u16));
|
||||||
|
}
|
||||||
|
|
||||||
|
static int l4f00242t03_lcd_power_set(struct lcd_device *ld, int power)
|
||||||
|
{
|
||||||
|
struct l4f00242t03_priv *priv = lcd_get_data(ld);
|
||||||
|
struct spi_device *spi = priv->spi;
|
||||||
|
|
||||||
|
const u16 slpout = 0x11;
|
||||||
|
const u16 dison = 0x29;
|
||||||
|
|
||||||
|
const u16 slpin = 0x10;
|
||||||
|
const u16 disoff = 0x28;
|
||||||
|
|
||||||
|
if (power) {
|
||||||
|
if (priv->lcd_on)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
dev_dbg(&spi->dev, "turning on LCD\n");
|
||||||
|
|
||||||
|
spi_write(spi, (const u8 *)&slpout, sizeof(u16));
|
||||||
|
msleep(60);
|
||||||
|
spi_write(spi, (const u8 *)&dison, sizeof(u16));
|
||||||
|
|
||||||
|
priv->lcd_on = 1;
|
||||||
|
} else {
|
||||||
|
if (!priv->lcd_on)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
dev_dbg(&spi->dev, "turning off LCD\n");
|
||||||
|
|
||||||
|
spi_write(spi, (const u8 *)&disoff, sizeof(u16));
|
||||||
|
msleep(60);
|
||||||
|
spi_write(spi, (const u8 *)&slpin, sizeof(u16));
|
||||||
|
|
||||||
|
priv->lcd_on = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static struct lcd_ops l4f_ops = {
|
||||||
|
.set_power = l4f00242t03_lcd_power_set,
|
||||||
|
.get_power = NULL,
|
||||||
|
};
|
||||||
|
|
||||||
|
static int __devinit l4f00242t03_probe(struct spi_device *spi)
|
||||||
|
{
|
||||||
|
struct l4f00242t03_priv *priv;
|
||||||
|
struct l4f00242t03_pdata *pdata = spi->dev.platform_data;
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
if (pdata == NULL) {
|
||||||
|
dev_err(&spi->dev, "Uninitialized platform data.\n");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
priv = kzalloc(sizeof(struct l4f00242t03_priv), GFP_KERNEL);
|
||||||
|
|
||||||
|
if (priv == NULL) {
|
||||||
|
dev_err(&spi->dev, "No memory for this device.\n");
|
||||||
|
ret = -ENOMEM;
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
|
|
||||||
|
dev_set_drvdata(&spi->dev, priv);
|
||||||
|
spi->bits_per_word = 9;
|
||||||
|
spi_setup(spi);
|
||||||
|
|
||||||
|
priv->spi = spi;
|
||||||
|
|
||||||
|
ret = gpio_request(pdata->reset_gpio, "lcd l4f00242t03 reset");
|
||||||
|
if (ret) {
|
||||||
|
dev_err(&spi->dev,
|
||||||
|
"Unable to get the lcd l4f00242t03 reset gpio.\n");
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = gpio_direction_output(pdata->reset_gpio, 1);
|
||||||
|
if (ret)
|
||||||
|
goto err2;
|
||||||
|
|
||||||
|
ret = gpio_request(pdata->data_enable_gpio,
|
||||||
|
"lcd l4f00242t03 data enable");
|
||||||
|
if (ret) {
|
||||||
|
dev_err(&spi->dev,
|
||||||
|
"Unable to get the lcd l4f00242t03 data en gpio.\n");
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
ret = gpio_direction_output(pdata->data_enable_gpio, 0);
|
||||||
|
if (ret)
|
||||||
|
goto err3;
|
||||||
|
|
||||||
|
if (pdata->io_supply) {
|
||||||
|
priv->io_reg = regulator_get(NULL, pdata->io_supply);
|
||||||
|
|
||||||
|
if (IS_ERR(priv->io_reg)) {
|
||||||
|
pr_err("%s: Unable to get the IO regulator\n",
|
||||||
|
__func__);
|
||||||
|
goto err3;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pdata->core_supply) {
|
||||||
|
priv->core_reg = regulator_get(NULL, pdata->core_supply);
|
||||||
|
|
||||||
|
if (IS_ERR(priv->core_reg)) {
|
||||||
|
pr_err("%s: Unable to get the core regulator\n",
|
||||||
|
__func__);
|
||||||
|
goto err4;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
priv->ld = lcd_device_register("l4f00242t03",
|
||||||
|
&spi->dev, priv, &l4f_ops);
|
||||||
|
if (IS_ERR(priv->ld)) {
|
||||||
|
ret = PTR_ERR(priv->ld);
|
||||||
|
goto err5;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Init the LCD */
|
||||||
|
l4f00242t03_reset(pdata->reset_gpio);
|
||||||
|
l4f00242t03_lcd_init(spi);
|
||||||
|
l4f00242t03_lcd_power_set(priv->ld, 1);
|
||||||
|
|
||||||
|
dev_info(&spi->dev, "Epson l4f00242t03 lcd probed.\n");
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
err5:
|
||||||
|
if (priv->core_reg)
|
||||||
|
regulator_put(priv->core_reg);
|
||||||
|
err4:
|
||||||
|
if (priv->io_reg)
|
||||||
|
regulator_put(priv->io_reg);
|
||||||
|
err3:
|
||||||
|
gpio_free(pdata->data_enable_gpio);
|
||||||
|
err2:
|
||||||
|
gpio_free(pdata->reset_gpio);
|
||||||
|
err:
|
||||||
|
kfree(priv);
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int __devexit l4f00242t03_remove(struct spi_device *spi)
|
||||||
|
{
|
||||||
|
struct l4f00242t03_priv *priv = dev_get_drvdata(&spi->dev);
|
||||||
|
struct l4f00242t03_pdata *pdata = priv->spi->dev.platform_data;
|
||||||
|
|
||||||
|
l4f00242t03_lcd_power_set(priv->ld, 0);
|
||||||
|
lcd_device_unregister(priv->ld);
|
||||||
|
|
||||||
|
gpio_free(pdata->data_enable_gpio);
|
||||||
|
gpio_free(pdata->reset_gpio);
|
||||||
|
|
||||||
|
if (priv->io_reg)
|
||||||
|
regulator_put(priv->core_reg);
|
||||||
|
if (priv->core_reg)
|
||||||
|
regulator_put(priv->io_reg);
|
||||||
|
|
||||||
|
kfree(priv);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static struct spi_driver l4f00242t03_driver = {
|
||||||
|
.driver = {
|
||||||
|
.name = "l4f00242t03",
|
||||||
|
.owner = THIS_MODULE,
|
||||||
|
},
|
||||||
|
.probe = l4f00242t03_probe,
|
||||||
|
.remove = __devexit_p(l4f00242t03_remove),
|
||||||
|
};
|
||||||
|
|
||||||
|
static __init int l4f00242t03_init(void)
|
||||||
|
{
|
||||||
|
return spi_register_driver(&l4f00242t03_driver);
|
||||||
|
}
|
||||||
|
|
||||||
|
static __exit void l4f00242t03_exit(void)
|
||||||
|
{
|
||||||
|
spi_unregister_driver(&l4f00242t03_driver);
|
||||||
|
}
|
||||||
|
|
||||||
|
module_init(l4f00242t03_init);
|
||||||
|
module_exit(l4f00242t03_exit);
|
||||||
|
|
||||||
|
MODULE_AUTHOR("Alberto Panizzo <maramaopercheseimorto@gmail.com>");
|
||||||
|
MODULE_DESCRIPTION("EPSON L4F00242T03 LCD");
|
||||||
|
MODULE_LICENSE("GPL v2");
|
|
@ -167,6 +167,7 @@ static int locomolcd_resume(struct locomo_dev *dev)
|
||||||
|
|
||||||
static int locomolcd_probe(struct locomo_dev *ldev)
|
static int locomolcd_probe(struct locomo_dev *ldev)
|
||||||
{
|
{
|
||||||
|
struct backlight_properties props;
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
local_irq_save(flags);
|
local_irq_save(flags);
|
||||||
|
@ -182,13 +183,16 @@ static int locomolcd_probe(struct locomo_dev *ldev)
|
||||||
|
|
||||||
local_irq_restore(flags);
|
local_irq_restore(flags);
|
||||||
|
|
||||||
locomolcd_bl_device = backlight_device_register("locomo-bl", &ldev->dev, NULL, &locomobl_data);
|
memset(&props, 0, sizeof(struct backlight_properties));
|
||||||
|
props.max_brightness = 4;
|
||||||
|
locomolcd_bl_device = backlight_device_register("locomo-bl",
|
||||||
|
&ldev->dev, NULL,
|
||||||
|
&locomobl_data, &props);
|
||||||
|
|
||||||
if (IS_ERR (locomolcd_bl_device))
|
if (IS_ERR (locomolcd_bl_device))
|
||||||
return PTR_ERR (locomolcd_bl_device);
|
return PTR_ERR (locomolcd_bl_device);
|
||||||
|
|
||||||
/* Set up frontlight so that screen is readable */
|
/* Set up frontlight so that screen is readable */
|
||||||
locomolcd_bl_device->props.max_brightness = 4,
|
|
||||||
locomolcd_bl_device->props.brightness = 2;
|
locomolcd_bl_device->props.brightness = 2;
|
||||||
locomolcd_set_intensity(locomolcd_bl_device);
|
locomolcd_set_intensity(locomolcd_bl_device);
|
||||||
|
|
||||||
|
|
|
@ -104,6 +104,7 @@ static int __devinit max8925_backlight_probe(struct platform_device *pdev)
|
||||||
struct max8925_backlight_pdata *pdata = NULL;
|
struct max8925_backlight_pdata *pdata = NULL;
|
||||||
struct max8925_backlight_data *data;
|
struct max8925_backlight_data *data;
|
||||||
struct backlight_device *bl;
|
struct backlight_device *bl;
|
||||||
|
struct backlight_properties props;
|
||||||
struct resource *res;
|
struct resource *res;
|
||||||
char name[MAX8925_NAME_SIZE];
|
char name[MAX8925_NAME_SIZE];
|
||||||
unsigned char value;
|
unsigned char value;
|
||||||
|
@ -133,14 +134,15 @@ static int __devinit max8925_backlight_probe(struct platform_device *pdev)
|
||||||
data->chip = chip;
|
data->chip = chip;
|
||||||
data->current_brightness = 0;
|
data->current_brightness = 0;
|
||||||
|
|
||||||
|
memset(&props, 0, sizeof(struct backlight_properties));
|
||||||
|
props.max_brightness = MAX_BRIGHTNESS;
|
||||||
bl = backlight_device_register(name, &pdev->dev, data,
|
bl = backlight_device_register(name, &pdev->dev, data,
|
||||||
&max8925_backlight_ops);
|
&max8925_backlight_ops, &props);
|
||||||
if (IS_ERR(bl)) {
|
if (IS_ERR(bl)) {
|
||||||
dev_err(&pdev->dev, "failed to register backlight\n");
|
dev_err(&pdev->dev, "failed to register backlight\n");
|
||||||
kfree(data);
|
kfree(data);
|
||||||
return PTR_ERR(bl);
|
return PTR_ERR(bl);
|
||||||
}
|
}
|
||||||
bl->props.max_brightness = MAX_BRIGHTNESS;
|
|
||||||
bl->props.brightness = MAX_BRIGHTNESS;
|
bl->props.brightness = MAX_BRIGHTNESS;
|
||||||
|
|
||||||
platform_set_drvdata(pdev, bl);
|
platform_set_drvdata(pdev, bl);
|
||||||
|
|
|
@ -137,6 +137,51 @@ static int mbp_dmi_match(const struct dmi_system_id *id)
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct dmi_system_id __initdata mbp_device_table[] = {
|
static const struct dmi_system_id __initdata mbp_device_table[] = {
|
||||||
|
{
|
||||||
|
.callback = mbp_dmi_match,
|
||||||
|
.ident = "MacBook 1,1",
|
||||||
|
.matches = {
|
||||||
|
DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
|
||||||
|
DMI_MATCH(DMI_PRODUCT_NAME, "MacBook1,1"),
|
||||||
|
},
|
||||||
|
.driver_data = (void *)&intel_chipset_data,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.callback = mbp_dmi_match,
|
||||||
|
.ident = "MacBook 2,1",
|
||||||
|
.matches = {
|
||||||
|
DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
|
||||||
|
DMI_MATCH(DMI_PRODUCT_NAME, "MacBook2,1"),
|
||||||
|
},
|
||||||
|
.driver_data = (void *)&intel_chipset_data,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.callback = mbp_dmi_match,
|
||||||
|
.ident = "MacBook 3,1",
|
||||||
|
.matches = {
|
||||||
|
DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
|
||||||
|
DMI_MATCH(DMI_PRODUCT_NAME, "MacBook3,1"),
|
||||||
|
},
|
||||||
|
.driver_data = (void *)&intel_chipset_data,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.callback = mbp_dmi_match,
|
||||||
|
.ident = "MacBook 4,1",
|
||||||
|
.matches = {
|
||||||
|
DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
|
||||||
|
DMI_MATCH(DMI_PRODUCT_NAME, "MacBook4,1"),
|
||||||
|
},
|
||||||
|
.driver_data = (void *)&intel_chipset_data,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
.callback = mbp_dmi_match,
|
||||||
|
.ident = "MacBook 4,2",
|
||||||
|
.matches = {
|
||||||
|
DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."),
|
||||||
|
DMI_MATCH(DMI_PRODUCT_NAME, "MacBook4,2"),
|
||||||
|
},
|
||||||
|
.driver_data = (void *)&intel_chipset_data,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
.callback = mbp_dmi_match,
|
.callback = mbp_dmi_match,
|
||||||
.ident = "MacBookPro 3,1",
|
.ident = "MacBookPro 3,1",
|
||||||
|
@ -250,6 +295,7 @@ static const struct dmi_system_id __initdata mbp_device_table[] = {
|
||||||
|
|
||||||
static int __init mbp_init(void)
|
static int __init mbp_init(void)
|
||||||
{
|
{
|
||||||
|
struct backlight_properties props;
|
||||||
if (!dmi_check_system(mbp_device_table))
|
if (!dmi_check_system(mbp_device_table))
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
|
|
||||||
|
@ -257,14 +303,17 @@ static int __init mbp_init(void)
|
||||||
"Macbook Pro backlight"))
|
"Macbook Pro backlight"))
|
||||||
return -ENXIO;
|
return -ENXIO;
|
||||||
|
|
||||||
mbp_backlight_device = backlight_device_register("mbp_backlight",
|
memset(&props, 0, sizeof(struct backlight_properties));
|
||||||
NULL, NULL, &driver_data->backlight_ops);
|
props.max_brightness = 15;
|
||||||
|
mbp_backlight_device = backlight_device_register("mbp_backlight", NULL,
|
||||||
|
NULL,
|
||||||
|
&driver_data->backlight_ops,
|
||||||
|
&props);
|
||||||
if (IS_ERR(mbp_backlight_device)) {
|
if (IS_ERR(mbp_backlight_device)) {
|
||||||
release_region(driver_data->iostart, driver_data->iolen);
|
release_region(driver_data->iostart, driver_data->iolen);
|
||||||
return PTR_ERR(mbp_backlight_device);
|
return PTR_ERR(mbp_backlight_device);
|
||||||
}
|
}
|
||||||
|
|
||||||
mbp_backlight_device->props.max_brightness = 15;
|
|
||||||
mbp_backlight_device->props.brightness =
|
mbp_backlight_device->props.brightness =
|
||||||
driver_data->backlight_ops.get_brightness(mbp_backlight_device);
|
driver_data->backlight_ops.get_brightness(mbp_backlight_device);
|
||||||
backlight_update_status(mbp_backlight_device);
|
backlight_update_status(mbp_backlight_device);
|
||||||
|
|
|
@ -132,6 +132,7 @@ static const struct backlight_ops omapbl_ops = {
|
||||||
|
|
||||||
static int omapbl_probe(struct platform_device *pdev)
|
static int omapbl_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
|
struct backlight_properties props;
|
||||||
struct backlight_device *dev;
|
struct backlight_device *dev;
|
||||||
struct omap_backlight *bl;
|
struct omap_backlight *bl;
|
||||||
struct omap_backlight_config *pdata = pdev->dev.platform_data;
|
struct omap_backlight_config *pdata = pdev->dev.platform_data;
|
||||||
|
@ -143,7 +144,10 @@ static int omapbl_probe(struct platform_device *pdev)
|
||||||
if (unlikely(!bl))
|
if (unlikely(!bl))
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
dev = backlight_device_register("omap-bl", &pdev->dev, bl, &omapbl_ops);
|
memset(&props, 0, sizeof(struct backlight_properties));
|
||||||
|
props.max_brightness = OMAPBL_MAX_INTENSITY;
|
||||||
|
dev = backlight_device_register("omap-bl", &pdev->dev, bl, &omapbl_ops,
|
||||||
|
&props);
|
||||||
if (IS_ERR(dev)) {
|
if (IS_ERR(dev)) {
|
||||||
kfree(bl);
|
kfree(bl);
|
||||||
return PTR_ERR(dev);
|
return PTR_ERR(dev);
|
||||||
|
@ -160,7 +164,6 @@ static int omapbl_probe(struct platform_device *pdev)
|
||||||
omap_cfg_reg(PWL); /* Conflicts with UART3 */
|
omap_cfg_reg(PWL); /* Conflicts with UART3 */
|
||||||
|
|
||||||
dev->props.fb_blank = FB_BLANK_UNBLANK;
|
dev->props.fb_blank = FB_BLANK_UNBLANK;
|
||||||
dev->props.max_brightness = OMAPBL_MAX_INTENSITY;
|
|
||||||
dev->props.brightness = pdata->default_intensity;
|
dev->props.brightness = pdata->default_intensity;
|
||||||
omapbl_update_status(dev);
|
omapbl_update_status(dev);
|
||||||
|
|
||||||
|
|
|
@ -61,8 +61,10 @@ static const struct backlight_ops progearbl_ops = {
|
||||||
|
|
||||||
static int progearbl_probe(struct platform_device *pdev)
|
static int progearbl_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
|
struct backlight_properties props;
|
||||||
u8 temp;
|
u8 temp;
|
||||||
struct backlight_device *progear_backlight_device;
|
struct backlight_device *progear_backlight_device;
|
||||||
|
int ret;
|
||||||
|
|
||||||
pmu_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101, NULL);
|
pmu_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M7101, NULL);
|
||||||
if (!pmu_dev) {
|
if (!pmu_dev) {
|
||||||
|
@ -73,28 +75,37 @@ static int progearbl_probe(struct platform_device *pdev)
|
||||||
sb_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, NULL);
|
sb_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, NULL);
|
||||||
if (!sb_dev) {
|
if (!sb_dev) {
|
||||||
printk("ALI 1533 SB not found.\n");
|
printk("ALI 1533 SB not found.\n");
|
||||||
pci_dev_put(pmu_dev);
|
ret = -ENODEV;
|
||||||
return -ENODEV;
|
goto put_pmu;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Set SB_MPS1 to enable brightness control. */
|
/* Set SB_MPS1 to enable brightness control. */
|
||||||
pci_read_config_byte(sb_dev, SB_MPS1, &temp);
|
pci_read_config_byte(sb_dev, SB_MPS1, &temp);
|
||||||
pci_write_config_byte(sb_dev, SB_MPS1, temp | 0x20);
|
pci_write_config_byte(sb_dev, SB_MPS1, temp | 0x20);
|
||||||
|
|
||||||
|
memset(&props, 0, sizeof(struct backlight_properties));
|
||||||
|
props.max_brightness = HW_LEVEL_MAX - HW_LEVEL_MIN;
|
||||||
progear_backlight_device = backlight_device_register("progear-bl",
|
progear_backlight_device = backlight_device_register("progear-bl",
|
||||||
&pdev->dev, NULL,
|
&pdev->dev, NULL,
|
||||||
&progearbl_ops);
|
&progearbl_ops,
|
||||||
if (IS_ERR(progear_backlight_device))
|
&props);
|
||||||
return PTR_ERR(progear_backlight_device);
|
if (IS_ERR(progear_backlight_device)) {
|
||||||
|
ret = PTR_ERR(progear_backlight_device);
|
||||||
|
goto put_sb;
|
||||||
|
}
|
||||||
|
|
||||||
platform_set_drvdata(pdev, progear_backlight_device);
|
platform_set_drvdata(pdev, progear_backlight_device);
|
||||||
|
|
||||||
progear_backlight_device->props.power = FB_BLANK_UNBLANK;
|
progear_backlight_device->props.power = FB_BLANK_UNBLANK;
|
||||||
progear_backlight_device->props.brightness = HW_LEVEL_MAX - HW_LEVEL_MIN;
|
progear_backlight_device->props.brightness = HW_LEVEL_MAX - HW_LEVEL_MIN;
|
||||||
progear_backlight_device->props.max_brightness = HW_LEVEL_MAX - HW_LEVEL_MIN;
|
|
||||||
progearbl_set_intensity(progear_backlight_device);
|
progearbl_set_intensity(progear_backlight_device);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
put_sb:
|
||||||
|
pci_dev_put(sb_dev);
|
||||||
|
put_pmu:
|
||||||
|
pci_dev_put(pmu_dev);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int progearbl_remove(struct platform_device *pdev)
|
static int progearbl_remove(struct platform_device *pdev)
|
||||||
|
|
|
@ -65,6 +65,7 @@ static const struct backlight_ops pwm_backlight_ops = {
|
||||||
|
|
||||||
static int pwm_backlight_probe(struct platform_device *pdev)
|
static int pwm_backlight_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
|
struct backlight_properties props;
|
||||||
struct platform_pwm_backlight_data *data = pdev->dev.platform_data;
|
struct platform_pwm_backlight_data *data = pdev->dev.platform_data;
|
||||||
struct backlight_device *bl;
|
struct backlight_device *bl;
|
||||||
struct pwm_bl_data *pb;
|
struct pwm_bl_data *pb;
|
||||||
|
@ -100,15 +101,16 @@ static int pwm_backlight_probe(struct platform_device *pdev)
|
||||||
} else
|
} else
|
||||||
dev_dbg(&pdev->dev, "got pwm for backlight\n");
|
dev_dbg(&pdev->dev, "got pwm for backlight\n");
|
||||||
|
|
||||||
bl = backlight_device_register(dev_name(&pdev->dev), &pdev->dev,
|
memset(&props, 0, sizeof(struct backlight_properties));
|
||||||
pb, &pwm_backlight_ops);
|
props.max_brightness = data->max_brightness;
|
||||||
|
bl = backlight_device_register(dev_name(&pdev->dev), &pdev->dev, pb,
|
||||||
|
&pwm_backlight_ops, &props);
|
||||||
if (IS_ERR(bl)) {
|
if (IS_ERR(bl)) {
|
||||||
dev_err(&pdev->dev, "failed to register backlight\n");
|
dev_err(&pdev->dev, "failed to register backlight\n");
|
||||||
ret = PTR_ERR(bl);
|
ret = PTR_ERR(bl);
|
||||||
goto err_bl;
|
goto err_bl;
|
||||||
}
|
}
|
||||||
|
|
||||||
bl->props.max_brightness = data->max_brightness;
|
|
||||||
bl->props.brightness = data->dft_brightness;
|
bl->props.brightness = data->dft_brightness;
|
||||||
backlight_update_status(bl);
|
backlight_update_status(bl);
|
||||||
|
|
||||||
|
|
|
@ -80,6 +80,7 @@ static const struct backlight_ops bl_ops = {
|
||||||
static int __devinit tosa_bl_probe(struct i2c_client *client,
|
static int __devinit tosa_bl_probe(struct i2c_client *client,
|
||||||
const struct i2c_device_id *id)
|
const struct i2c_device_id *id)
|
||||||
{
|
{
|
||||||
|
struct backlight_properties props;
|
||||||
struct tosa_bl_data *data = kzalloc(sizeof(struct tosa_bl_data), GFP_KERNEL);
|
struct tosa_bl_data *data = kzalloc(sizeof(struct tosa_bl_data), GFP_KERNEL);
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
if (!data)
|
if (!data)
|
||||||
|
@ -99,15 +100,16 @@ static int __devinit tosa_bl_probe(struct i2c_client *client,
|
||||||
i2c_set_clientdata(client, data);
|
i2c_set_clientdata(client, data);
|
||||||
data->i2c = client;
|
data->i2c = client;
|
||||||
|
|
||||||
data->bl = backlight_device_register("tosa-bl", &client->dev,
|
memset(&props, 0, sizeof(struct backlight_properties));
|
||||||
data, &bl_ops);
|
props.max_brightness = 512 - 1;
|
||||||
|
data->bl = backlight_device_register("tosa-bl", &client->dev, data,
|
||||||
|
&bl_ops, &props);
|
||||||
if (IS_ERR(data->bl)) {
|
if (IS_ERR(data->bl)) {
|
||||||
ret = PTR_ERR(data->bl);
|
ret = PTR_ERR(data->bl);
|
||||||
goto err_reg;
|
goto err_reg;
|
||||||
}
|
}
|
||||||
|
|
||||||
data->bl->props.brightness = 69;
|
data->bl->props.brightness = 69;
|
||||||
data->bl->props.max_brightness = 512 - 1;
|
|
||||||
data->bl->props.power = FB_BLANK_UNBLANK;
|
data->bl->props.power = FB_BLANK_UNBLANK;
|
||||||
|
|
||||||
backlight_update_status(data->bl);
|
backlight_update_status(data->bl);
|
||||||
|
|
|
@ -125,6 +125,7 @@ static int wm831x_backlight_probe(struct platform_device *pdev)
|
||||||
struct wm831x_backlight_pdata *pdata;
|
struct wm831x_backlight_pdata *pdata;
|
||||||
struct wm831x_backlight_data *data;
|
struct wm831x_backlight_data *data;
|
||||||
struct backlight_device *bl;
|
struct backlight_device *bl;
|
||||||
|
struct backlight_properties props;
|
||||||
int ret, i, max_isel, isink_reg, dcdc_cfg;
|
int ret, i, max_isel, isink_reg, dcdc_cfg;
|
||||||
|
|
||||||
/* We need platform data */
|
/* We need platform data */
|
||||||
|
@ -191,15 +192,15 @@ static int wm831x_backlight_probe(struct platform_device *pdev)
|
||||||
data->current_brightness = 0;
|
data->current_brightness = 0;
|
||||||
data->isink_reg = isink_reg;
|
data->isink_reg = isink_reg;
|
||||||
|
|
||||||
bl = backlight_device_register("wm831x", &pdev->dev,
|
props.max_brightness = max_isel;
|
||||||
data, &wm831x_backlight_ops);
|
bl = backlight_device_register("wm831x", &pdev->dev, data,
|
||||||
|
&wm831x_backlight_ops, &props);
|
||||||
if (IS_ERR(bl)) {
|
if (IS_ERR(bl)) {
|
||||||
dev_err(&pdev->dev, "failed to register backlight\n");
|
dev_err(&pdev->dev, "failed to register backlight\n");
|
||||||
kfree(data);
|
kfree(data);
|
||||||
return PTR_ERR(bl);
|
return PTR_ERR(bl);
|
||||||
}
|
}
|
||||||
|
|
||||||
bl->props.max_brightness = max_isel;
|
|
||||||
bl->props.brightness = max_isel;
|
bl->props.brightness = max_isel;
|
||||||
|
|
||||||
platform_set_drvdata(pdev, bl);
|
platform_set_drvdata(pdev, bl);
|
||||||
|
|
|
@ -433,7 +433,7 @@ static int bl_get_brightness(struct backlight_device *bd)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct backlight_ops bfin_lq043fb_bl_ops = {
|
static const struct backlight_ops bfin_lq043fb_bl_ops = {
|
||||||
.get_brightness = bl_get_brightness,
|
.get_brightness = bl_get_brightness,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -501,6 +501,7 @@ static irqreturn_t bfin_bf54x_irq_error(int irq, void *dev_id)
|
||||||
|
|
||||||
static int __devinit bfin_bf54x_probe(struct platform_device *pdev)
|
static int __devinit bfin_bf54x_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
|
struct backlight_properties props;
|
||||||
struct bfin_bf54xfb_info *info;
|
struct bfin_bf54xfb_info *info;
|
||||||
struct fb_info *fbinfo;
|
struct fb_info *fbinfo;
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -645,10 +646,16 @@ static int __devinit bfin_bf54x_probe(struct platform_device *pdev)
|
||||||
goto out8;
|
goto out8;
|
||||||
}
|
}
|
||||||
#ifndef NO_BL_SUPPORT
|
#ifndef NO_BL_SUPPORT
|
||||||
bl_dev =
|
memset(&props, 0, sizeof(struct backlight_properties));
|
||||||
backlight_device_register("bf54x-bl", NULL, NULL,
|
props.max_brightness = 255;
|
||||||
&bfin_lq043fb_bl_ops);
|
bl_dev = backlight_device_register("bf54x-bl", NULL, NULL,
|
||||||
bl_dev->props.max_brightness = 255;
|
&bfin_lq043fb_bl_ops, &props);
|
||||||
|
if (IS_ERR(bl_dev)) {
|
||||||
|
printk(KERN_ERR DRIVER_NAME
|
||||||
|
": unable to register backlight.\n");
|
||||||
|
ret = -EINVAL;
|
||||||
|
goto out9;
|
||||||
|
}
|
||||||
|
|
||||||
lcd_dev = lcd_device_register(DRIVER_NAME, &pdev->dev, NULL, &bfin_lcd_ops);
|
lcd_dev = lcd_device_register(DRIVER_NAME, &pdev->dev, NULL, &bfin_lcd_ops);
|
||||||
lcd_dev->props.max_contrast = 255, printk(KERN_INFO "Done.\n");
|
lcd_dev->props.max_contrast = 255, printk(KERN_INFO "Done.\n");
|
||||||
|
@ -656,6 +663,8 @@ static int __devinit bfin_bf54x_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
out9:
|
||||||
|
unregister_framebuffer(fbinfo);
|
||||||
out8:
|
out8:
|
||||||
free_irq(info->irq, info);
|
free_irq(info->irq, info);
|
||||||
out7:
|
out7:
|
||||||
|
|
|
@ -352,7 +352,7 @@ static int bl_get_brightness(struct backlight_device *bd)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct backlight_ops bfin_lq043fb_bl_ops = {
|
static const struct backlight_ops bfin_lq043fb_bl_ops = {
|
||||||
.get_brightness = bl_get_brightness,
|
.get_brightness = bl_get_brightness,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -419,6 +419,7 @@ static irqreturn_t bfin_t350mcqb_irq_error(int irq, void *dev_id)
|
||||||
|
|
||||||
static int __devinit bfin_t350mcqb_probe(struct platform_device *pdev)
|
static int __devinit bfin_t350mcqb_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
|
struct backlight_properties props;
|
||||||
struct bfin_t350mcqbfb_info *info;
|
struct bfin_t350mcqbfb_info *info;
|
||||||
struct fb_info *fbinfo;
|
struct fb_info *fbinfo;
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -540,10 +541,16 @@ static int __devinit bfin_t350mcqb_probe(struct platform_device *pdev)
|
||||||
goto out8;
|
goto out8;
|
||||||
}
|
}
|
||||||
#ifndef NO_BL_SUPPORT
|
#ifndef NO_BL_SUPPORT
|
||||||
bl_dev =
|
memset(&props, 0, sizeof(struct backlight_properties));
|
||||||
backlight_device_register("bf52x-bl", NULL, NULL,
|
props.max_brightness = 255;
|
||||||
&bfin_lq043fb_bl_ops);
|
bl_dev = backlight_device_register("bf52x-bl", NULL, NULL,
|
||||||
bl_dev->props.max_brightness = 255;
|
&bfin_lq043fb_bl_ops, &props);
|
||||||
|
if (IS_ERR(bl_dev)) {
|
||||||
|
printk(KERN_ERR DRIVER_NAME
|
||||||
|
": unable to register backlight.\n");
|
||||||
|
ret = -EINVAL;
|
||||||
|
goto out9;
|
||||||
|
}
|
||||||
|
|
||||||
lcd_dev = lcd_device_register(DRIVER_NAME, NULL, &bfin_lcd_ops);
|
lcd_dev = lcd_device_register(DRIVER_NAME, NULL, &bfin_lcd_ops);
|
||||||
lcd_dev->props.max_contrast = 255, printk(KERN_INFO "Done.\n");
|
lcd_dev->props.max_contrast = 255, printk(KERN_INFO "Done.\n");
|
||||||
|
@ -551,6 +558,8 @@ static int __devinit bfin_t350mcqb_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
out9:
|
||||||
|
unregister_framebuffer(fbinfo);
|
||||||
out8:
|
out8:
|
||||||
free_irq(info->irq, info);
|
free_irq(info->irq, info);
|
||||||
out7:
|
out7:
|
||||||
|
|
|
@ -94,6 +94,7 @@ static struct backlight_ops nvidia_bl_ops = {
|
||||||
|
|
||||||
void nvidia_bl_init(struct nvidia_par *par)
|
void nvidia_bl_init(struct nvidia_par *par)
|
||||||
{
|
{
|
||||||
|
struct backlight_properties props;
|
||||||
struct fb_info *info = pci_get_drvdata(par->pci_dev);
|
struct fb_info *info = pci_get_drvdata(par->pci_dev);
|
||||||
struct backlight_device *bd;
|
struct backlight_device *bd;
|
||||||
char name[12];
|
char name[12];
|
||||||
|
@ -109,7 +110,10 @@ void nvidia_bl_init(struct nvidia_par *par)
|
||||||
|
|
||||||
snprintf(name, sizeof(name), "nvidiabl%d", info->node);
|
snprintf(name, sizeof(name), "nvidiabl%d", info->node);
|
||||||
|
|
||||||
bd = backlight_device_register(name, info->dev, par, &nvidia_bl_ops);
|
memset(&props, 0, sizeof(struct backlight_properties));
|
||||||
|
props.max_brightness = FB_BACKLIGHT_LEVELS - 1;
|
||||||
|
bd = backlight_device_register(name, info->dev, par, &nvidia_bl_ops,
|
||||||
|
&props);
|
||||||
if (IS_ERR(bd)) {
|
if (IS_ERR(bd)) {
|
||||||
info->bl_dev = NULL;
|
info->bl_dev = NULL;
|
||||||
printk(KERN_WARNING "nvidia: Backlight registration failed\n");
|
printk(KERN_WARNING "nvidia: Backlight registration failed\n");
|
||||||
|
@ -121,7 +125,6 @@ void nvidia_bl_init(struct nvidia_par *par)
|
||||||
0x158 * FB_BACKLIGHT_MAX / MAX_LEVEL,
|
0x158 * FB_BACKLIGHT_MAX / MAX_LEVEL,
|
||||||
0x534 * FB_BACKLIGHT_MAX / MAX_LEVEL);
|
0x534 * FB_BACKLIGHT_MAX / MAX_LEVEL);
|
||||||
|
|
||||||
bd->props.max_brightness = FB_BACKLIGHT_LEVELS - 1;
|
|
||||||
bd->props.brightness = bd->props.max_brightness;
|
bd->props.brightness = bd->props.max_brightness;
|
||||||
bd->props.power = FB_BLANK_UNBLANK;
|
bd->props.power = FB_BLANK_UNBLANK;
|
||||||
backlight_update_status(bd);
|
backlight_update_status(bd);
|
||||||
|
|
|
@ -486,6 +486,7 @@ static struct attribute_group taal_attr_group = {
|
||||||
|
|
||||||
static int taal_probe(struct omap_dss_device *dssdev)
|
static int taal_probe(struct omap_dss_device *dssdev)
|
||||||
{
|
{
|
||||||
|
struct backlight_properties props;
|
||||||
struct taal_data *td;
|
struct taal_data *td;
|
||||||
struct backlight_device *bldev;
|
struct backlight_device *bldev;
|
||||||
int r;
|
int r;
|
||||||
|
@ -520,11 +521,16 @@ static int taal_probe(struct omap_dss_device *dssdev)
|
||||||
|
|
||||||
/* if no platform set_backlight() defined, presume DSI backlight
|
/* if no platform set_backlight() defined, presume DSI backlight
|
||||||
* control */
|
* control */
|
||||||
|
memset(&props, 0, sizeof(struct backlight_properties));
|
||||||
if (!dssdev->set_backlight)
|
if (!dssdev->set_backlight)
|
||||||
td->use_dsi_bl = true;
|
td->use_dsi_bl = true;
|
||||||
|
|
||||||
|
if (td->use_dsi_bl)
|
||||||
|
props.max_brightness = 255;
|
||||||
|
else
|
||||||
|
props.max_brightness = 127;
|
||||||
bldev = backlight_device_register("taal", &dssdev->dev, dssdev,
|
bldev = backlight_device_register("taal", &dssdev->dev, dssdev,
|
||||||
&taal_bl_ops);
|
&taal_bl_ops, &props);
|
||||||
if (IS_ERR(bldev)) {
|
if (IS_ERR(bldev)) {
|
||||||
r = PTR_ERR(bldev);
|
r = PTR_ERR(bldev);
|
||||||
goto err2;
|
goto err2;
|
||||||
|
@ -534,13 +540,10 @@ static int taal_probe(struct omap_dss_device *dssdev)
|
||||||
|
|
||||||
bldev->props.fb_blank = FB_BLANK_UNBLANK;
|
bldev->props.fb_blank = FB_BLANK_UNBLANK;
|
||||||
bldev->props.power = FB_BLANK_UNBLANK;
|
bldev->props.power = FB_BLANK_UNBLANK;
|
||||||
if (td->use_dsi_bl) {
|
if (td->use_dsi_bl)
|
||||||
bldev->props.max_brightness = 255;
|
|
||||||
bldev->props.brightness = 255;
|
bldev->props.brightness = 255;
|
||||||
} else {
|
else
|
||||||
bldev->props.max_brightness = 127;
|
|
||||||
bldev->props.brightness = 127;
|
bldev->props.brightness = 127;
|
||||||
}
|
|
||||||
|
|
||||||
taal_bl_update_status(bldev);
|
taal_bl_update_status(bldev);
|
||||||
|
|
||||||
|
|
|
@ -338,6 +338,7 @@ static struct backlight_ops riva_bl_ops = {
|
||||||
|
|
||||||
static void riva_bl_init(struct riva_par *par)
|
static void riva_bl_init(struct riva_par *par)
|
||||||
{
|
{
|
||||||
|
struct backlight_properties props;
|
||||||
struct fb_info *info = pci_get_drvdata(par->pdev);
|
struct fb_info *info = pci_get_drvdata(par->pdev);
|
||||||
struct backlight_device *bd;
|
struct backlight_device *bd;
|
||||||
char name[12];
|
char name[12];
|
||||||
|
@ -353,7 +354,10 @@ static void riva_bl_init(struct riva_par *par)
|
||||||
|
|
||||||
snprintf(name, sizeof(name), "rivabl%d", info->node);
|
snprintf(name, sizeof(name), "rivabl%d", info->node);
|
||||||
|
|
||||||
bd = backlight_device_register(name, info->dev, par, &riva_bl_ops);
|
memset(&props, 0, sizeof(struct backlight_properties));
|
||||||
|
props.max_brightness = FB_BACKLIGHT_LEVELS - 1;
|
||||||
|
bd = backlight_device_register(name, info->dev, par, &riva_bl_ops,
|
||||||
|
&props);
|
||||||
if (IS_ERR(bd)) {
|
if (IS_ERR(bd)) {
|
||||||
info->bl_dev = NULL;
|
info->bl_dev = NULL;
|
||||||
printk(KERN_WARNING "riva: Backlight registration failed\n");
|
printk(KERN_WARNING "riva: Backlight registration failed\n");
|
||||||
|
@ -365,7 +369,6 @@ static void riva_bl_init(struct riva_par *par)
|
||||||
MIN_LEVEL * FB_BACKLIGHT_MAX / MAX_LEVEL,
|
MIN_LEVEL * FB_BACKLIGHT_MAX / MAX_LEVEL,
|
||||||
FB_BACKLIGHT_MAX);
|
FB_BACKLIGHT_MAX);
|
||||||
|
|
||||||
bd->props.max_brightness = FB_BACKLIGHT_LEVELS - 1;
|
|
||||||
bd->props.brightness = bd->props.max_brightness;
|
bd->props.brightness = bd->props.max_brightness;
|
||||||
bd->props.power = FB_BLANK_UNBLANK;
|
bd->props.power = FB_BLANK_UNBLANK;
|
||||||
backlight_update_status(bd);
|
backlight_update_status(bd);
|
||||||
|
|
|
@ -36,18 +36,18 @@ struct backlight_device;
|
||||||
struct fb_info;
|
struct fb_info;
|
||||||
|
|
||||||
struct backlight_ops {
|
struct backlight_ops {
|
||||||
const unsigned int options;
|
unsigned int options;
|
||||||
|
|
||||||
#define BL_CORE_SUSPENDRESUME (1 << 0)
|
#define BL_CORE_SUSPENDRESUME (1 << 0)
|
||||||
|
|
||||||
/* Notify the backlight driver some property has changed */
|
/* Notify the backlight driver some property has changed */
|
||||||
int (* const update_status)(struct backlight_device *);
|
int (*update_status)(struct backlight_device *);
|
||||||
/* Return the current backlight brightness (accounting for power,
|
/* Return the current backlight brightness (accounting for power,
|
||||||
fb_blank etc.) */
|
fb_blank etc.) */
|
||||||
int (* const get_brightness)(struct backlight_device *);
|
int (*get_brightness)(struct backlight_device *);
|
||||||
/* Check if given framebuffer device is the one bound to this backlight;
|
/* Check if given framebuffer device is the one bound to this backlight;
|
||||||
return 0 if not, !=0 if it is. If NULL, backlight always matches the fb. */
|
return 0 if not, !=0 if it is. If NULL, backlight always matches the fb. */
|
||||||
int (* const check_fb)(struct fb_info *);
|
int (*check_fb)(struct backlight_device *, struct fb_info *);
|
||||||
};
|
};
|
||||||
|
|
||||||
/* This structure defines all the properties of a backlight */
|
/* This structure defines all the properties of a backlight */
|
||||||
|
@ -103,7 +103,8 @@ static inline void backlight_update_status(struct backlight_device *bd)
|
||||||
}
|
}
|
||||||
|
|
||||||
extern struct backlight_device *backlight_device_register(const char *name,
|
extern struct backlight_device *backlight_device_register(const char *name,
|
||||||
struct device *dev, void *devdata, const struct backlight_ops *ops);
|
struct device *dev, void *devdata, const struct backlight_ops *ops,
|
||||||
|
const struct backlight_properties *props);
|
||||||
extern void backlight_device_unregister(struct backlight_device *bd);
|
extern void backlight_device_unregister(struct backlight_device *bd);
|
||||||
extern void backlight_force_update(struct backlight_device *bd,
|
extern void backlight_force_update(struct backlight_device *bd,
|
||||||
enum backlight_update_reason reason);
|
enum backlight_update_reason reason);
|
||||||
|
|
31
include/linux/spi/l4f00242t03.h
Normal file
31
include/linux/spi/l4f00242t03.h
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
/*
|
||||||
|
* l4f00242t03.h -- Platform glue for Epson L4F00242T03 LCD
|
||||||
|
*
|
||||||
|
* Copyright (c) 2009 Alberto Panizzo <maramaopercheseimorto@gmail.com>
|
||||||
|
* Based on Marek Vasut work in lms283gf05.h
|
||||||
|
*
|
||||||
|
* This program is free software; you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License version 2 as
|
||||||
|
* published by the Free Software Foundation.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program; if not, write to the Free Software
|
||||||
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef _INCLUDE_LINUX_SPI_L4F00242T03_H_
|
||||||
|
#define _INCLUDE_LINUX_SPI_L4F00242T03_H_
|
||||||
|
|
||||||
|
struct l4f00242t03_pdata {
|
||||||
|
unsigned int reset_gpio;
|
||||||
|
unsigned int data_enable_gpio;
|
||||||
|
const char *io_supply; /* will be set to 1.8 V */
|
||||||
|
const char *core_supply; /* will be set to 2.8 V */
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif /* _INCLUDE_LINUX_SPI_L4F00242T03_H_ */
|
Loading…
Reference in a new issue