Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: mbp_nvidia_bl - add two more MacBookPro variants
backlight: Pass device through notify callback in the pwm driver
backlight: PTR_ERR return of wrong pointer in cr_backlight_probe()
backlight: Constify struct backlight_ops
backlight/thinkpad-acpi: issue backlight class events

Fix up trivial conflicts in thinkpad-acpi support (backlight support
already merged earlier).

+50 -29
+1 -1
drivers/video/backlight/adp5520_bl.c
··· 85 85 return error ? data->current_brightness : reg_val; 86 86 } 87 87 88 - static struct backlight_ops adp5520_bl_ops = { 88 + static const struct backlight_ops adp5520_bl_ops = { 89 89 .update_status = adp5520_bl_update_status, 90 90 .get_brightness = adp5520_bl_get_brightness, 91 91 };
+1 -1
drivers/video/backlight/adx_bl.c
··· 61 61 return 1; 62 62 } 63 63 64 - static struct backlight_ops adx_backlight_ops = { 64 + static const struct backlight_ops adx_backlight_ops = { 65 65 .options = 0, 66 66 .update_status = adx_backlight_update_status, 67 67 .get_brightness = adx_backlight_get_brightness,
+1 -1
drivers/video/backlight/atmel-pwm-bl.c
··· 113 113 return pwm_channel_enable(&pwmbl->pwmc); 114 114 } 115 115 116 - static struct backlight_ops atmel_pwm_bl_ops = { 116 + static const struct backlight_ops atmel_pwm_bl_ops = { 117 117 .get_brightness = atmel_pwm_bl_get_intensity, 118 118 .update_status = atmel_pwm_bl_set_intensity, 119 119 };
+1 -1
drivers/video/backlight/backlight.c
··· 269 269 * ERR_PTR() or a pointer to the newly allocated device. 270 270 */ 271 271 struct backlight_device *backlight_device_register(const char *name, 272 - struct device *parent, void *devdata, struct backlight_ops *ops) 272 + struct device *parent, void *devdata, const struct backlight_ops *ops) 273 273 { 274 274 struct backlight_device *new_bd; 275 275 int rc;
+1 -1
drivers/video/backlight/corgi_lcd.c
··· 451 451 } 452 452 EXPORT_SYMBOL(corgi_lcd_limit_intensity); 453 453 454 - static struct backlight_ops corgi_bl_ops = { 454 + static const struct backlight_ops corgi_bl_ops = { 455 455 .get_brightness = corgi_bl_get_intensity, 456 456 .update_status = corgi_bl_update_status, 457 457 };
+2 -2
drivers/video/backlight/cr_bllcd.c
··· 108 108 return intensity; 109 109 } 110 110 111 - static struct backlight_ops cr_backlight_ops = { 111 + static const struct backlight_ops cr_backlight_ops = { 112 112 .get_brightness = cr_backlight_get_intensity, 113 113 .update_status = cr_backlight_set_intensity, 114 114 }; ··· 201 201 if (IS_ERR(ldp)) { 202 202 backlight_device_unregister(bdp); 203 203 pci_dev_put(lpc_dev); 204 - return PTR_ERR(bdp); 204 + return PTR_ERR(ldp); 205 205 } 206 206 207 207 pci_read_config_dword(lpc_dev, CRVML_REG_GPIOBAR,
+1 -1
drivers/video/backlight/da903x_bl.c
··· 95 95 return data->current_brightness; 96 96 } 97 97 98 - static struct backlight_ops da903x_backlight_ops = { 98 + static const struct backlight_ops da903x_backlight_ops = { 99 99 .update_status = da903x_backlight_update_status, 100 100 .get_brightness = da903x_backlight_get_brightness, 101 101 };
+1 -1
drivers/video/backlight/generic_bl.c
··· 70 70 } 71 71 EXPORT_SYMBOL(corgibl_limit_intensity); 72 72 73 - static struct backlight_ops genericbl_ops = { 73 + static const struct backlight_ops genericbl_ops = { 74 74 .options = BL_CORE_SUSPENDRESUME, 75 75 .get_brightness = genericbl_get_intensity, 76 76 .update_status = genericbl_send_intensity,
+1 -1
drivers/video/backlight/hp680_bl.c
··· 98 98 return current_intensity; 99 99 } 100 100 101 - static struct backlight_ops hp680bl_ops = { 101 + static const struct backlight_ops hp680bl_ops = { 102 102 .get_brightness = hp680bl_get_intensity, 103 103 .update_status = hp680bl_set_intensity, 104 104 };
+1 -1
drivers/video/backlight/jornada720_bl.c
··· 93 93 return ret; 94 94 } 95 95 96 - static struct backlight_ops jornada_bl_ops = { 96 + static const struct backlight_ops jornada_bl_ops = { 97 97 .get_brightness = jornada_bl_get_brightness, 98 98 .update_status = jornada_bl_update_status, 99 99 .options = BL_CORE_SUSPENDRESUME,
+1 -1
drivers/video/backlight/kb3886_bl.c
··· 134 134 return kb3886bl_intensity; 135 135 } 136 136 137 - static struct backlight_ops kb3886bl_ops = { 137 + static const struct backlight_ops kb3886bl_ops = { 138 138 .get_brightness = kb3886bl_get_intensity, 139 139 .update_status = kb3886bl_send_intensity, 140 140 };
+1 -1
drivers/video/backlight/locomolcd.c
··· 141 141 return current_intensity; 142 142 } 143 143 144 - static struct backlight_ops locomobl_data = { 144 + static const struct backlight_ops locomobl_data = { 145 145 .get_brightness = locomolcd_get_intensity, 146 146 .update_status = locomolcd_set_intensity, 147 147 };
+19 -1
drivers/video/backlight/mbp_nvidia_bl.c
··· 33 33 unsigned long iostart; 34 34 unsigned long iolen; 35 35 /* Backlight operations structure. */ 36 - struct backlight_ops backlight_ops; 36 + const struct backlight_ops backlight_ops; 37 37 }; 38 38 39 39 /* Module parameters. */ ··· 215 215 .matches = { 216 216 DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), 217 217 DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro5,2"), 218 + }, 219 + .driver_data = (void *)&nvidia_chipset_data, 220 + }, 221 + { 222 + .callback = mbp_dmi_match, 223 + .ident = "MacBookPro 5,3", 224 + .matches = { 225 + DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), 226 + DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro5,3"), 227 + }, 228 + .driver_data = (void *)&nvidia_chipset_data, 229 + }, 230 + { 231 + .callback = mbp_dmi_match, 232 + .ident = "MacBookPro 5,4", 233 + .matches = { 234 + DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), 235 + DMI_MATCH(DMI_PRODUCT_NAME, "MacBookPro5,4"), 218 236 }, 219 237 .driver_data = (void *)&nvidia_chipset_data, 220 238 },
+1 -1
drivers/video/backlight/omap1_bl.c
··· 125 125 return bl->current_intensity; 126 126 } 127 127 128 - static struct backlight_ops omapbl_ops = { 128 + static const struct backlight_ops omapbl_ops = { 129 129 .get_brightness = omapbl_get_intensity, 130 130 .update_status = omapbl_update_status, 131 131 };
+1 -1
drivers/video/backlight/progear_bl.c
··· 54 54 return intensity - HW_LEVEL_MIN; 55 55 } 56 56 57 - static struct backlight_ops progearbl_ops = { 57 + static const struct backlight_ops progearbl_ops = { 58 58 .get_brightness = progearbl_get_intensity, 59 59 .update_status = progearbl_set_intensity, 60 60 };
+7 -4
drivers/video/backlight/pwm_bl.c
··· 22 22 23 23 struct pwm_bl_data { 24 24 struct pwm_device *pwm; 25 + struct device *dev; 25 26 unsigned int period; 26 - int (*notify)(int brightness); 27 + int (*notify)(struct device *, 28 + int brightness); 27 29 }; 28 30 29 31 static int pwm_backlight_update_status(struct backlight_device *bl) ··· 41 39 brightness = 0; 42 40 43 41 if (pb->notify) 44 - brightness = pb->notify(brightness); 42 + brightness = pb->notify(pb->dev, brightness); 45 43 46 44 if (brightness == 0) { 47 45 pwm_config(pb->pwm, 0, pb->period); ··· 58 56 return bl->props.brightness; 59 57 } 60 58 61 - static struct backlight_ops pwm_backlight_ops = { 59 + static const struct backlight_ops pwm_backlight_ops = { 62 60 .update_status = pwm_backlight_update_status, 63 61 .get_brightness = pwm_backlight_get_brightness, 64 62 }; ··· 90 88 91 89 pb->period = data->pwm_period_ns; 92 90 pb->notify = data->notify; 91 + pb->dev = &pdev->dev; 93 92 94 93 pb->pwm = pwm_request(data->pwm_id, "backlight"); 95 94 if (IS_ERR(pb->pwm)) { ··· 149 146 struct pwm_bl_data *pb = dev_get_drvdata(&bl->dev); 150 147 151 148 if (pb->notify) 152 - pb->notify(0); 149 + pb->notify(pb->dev, 0); 153 150 pwm_config(pb->pwm, 0, pb->period); 154 151 pwm_disable(pb->pwm); 155 152 return 0;
+1 -1
drivers/video/backlight/tosa_bl.c
··· 72 72 return props->brightness; 73 73 } 74 74 75 - static struct backlight_ops bl_ops = { 75 + static const struct backlight_ops bl_ops = { 76 76 .get_brightness = tosa_bl_get_brightness, 77 77 .update_status = tosa_bl_update_status, 78 78 };
+1 -1
drivers/video/backlight/wm831x_bl.c
··· 112 112 return data->current_brightness; 113 113 } 114 114 115 - static struct backlight_ops wm831x_backlight_ops = { 115 + static const struct backlight_ops wm831x_backlight_ops = { 116 116 .options = BL_CORE_SUSPENDRESUME, 117 117 .update_status = wm831x_backlight_update_status, 118 118 .get_brightness = wm831x_backlight_get_brightness,
+6 -6
include/linux/backlight.h
··· 36 36 struct fb_info; 37 37 38 38 struct backlight_ops { 39 - unsigned int options; 39 + const unsigned int options; 40 40 41 41 #define BL_CORE_SUSPENDRESUME (1 << 0) 42 42 43 43 /* Notify the backlight driver some property has changed */ 44 - int (*update_status)(struct backlight_device *); 44 + int (* const update_status)(struct backlight_device *); 45 45 /* Return the current backlight brightness (accounting for power, 46 46 fb_blank etc.) */ 47 - int (*get_brightness)(struct backlight_device *); 47 + int (* const get_brightness)(struct backlight_device *); 48 48 /* Check if given framebuffer device is the one bound to this backlight; 49 49 return 0 if not, !=0 if it is. If NULL, backlight always matches the fb. */ 50 - int (*check_fb)(struct fb_info *); 50 + int (* const check_fb)(struct fb_info *); 51 51 }; 52 52 53 53 /* This structure defines all the properties of a backlight */ ··· 86 86 registered this device has been unloaded, and if class_get_devdata() 87 87 points to something in the body of that driver, it is also invalid. */ 88 88 struct mutex ops_lock; 89 - struct backlight_ops *ops; 89 + const struct backlight_ops *ops; 90 90 91 91 /* The framebuffer notifier block */ 92 92 struct notifier_block fb_notif; ··· 103 103 } 104 104 105 105 extern struct backlight_device *backlight_device_register(const char *name, 106 - struct device *dev, void *devdata, struct backlight_ops *ops); 106 + struct device *dev, void *devdata, const struct backlight_ops *ops); 107 107 extern void backlight_device_unregister(struct backlight_device *bd); 108 108 extern void backlight_force_update(struct backlight_device *bd, 109 109 enum backlight_update_reason reason);
+1 -1
include/linux/pwm_backlight.h
··· 10 10 unsigned int dft_brightness; 11 11 unsigned int pwm_period_ns; 12 12 int (*init)(struct device *dev); 13 - int (*notify)(int brightness); 13 + int (*notify)(struct device *dev, int brightness); 14 14 void (*exit)(struct device *dev); 15 15 }; 16 16