File tree Expand file tree Collapse file tree 5 files changed +27
-27
lines changed Expand file tree Collapse file tree 5 files changed +27
-27
lines changed Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ static int fb_notifier_callback(struct notifier_block *self,
112
112
113
113
if (!bd -> ops )
114
114
goto out ;
115
- if (bd -> ops -> check_fb && !bd -> ops -> check_fb (bd , info ))
115
+ if (bd -> ops -> controls_device && !bd -> ops -> controls_device (bd , info -> device ))
116
116
goto out ;
117
117
if (fb_bd && fb_bd != bd )
118
118
goto out ;
Original file line number Diff line number Diff line change @@ -99,18 +99,18 @@ static int bd6107_backlight_update_status(struct backlight_device *backlight)
99
99
return 0 ;
100
100
}
101
101
102
- static int bd6107_backlight_check_fb (struct backlight_device * backlight ,
103
- struct fb_info * info )
102
+ static bool bd6107_backlight_controls_device (struct backlight_device * backlight ,
103
+ struct device * display_dev )
104
104
{
105
105
struct bd6107 * bd = bl_get_data (backlight );
106
106
107
- return !bd -> pdata -> dev || bd -> pdata -> dev == info -> device ;
107
+ return !bd -> pdata -> dev || bd -> pdata -> dev == display_dev ;
108
108
}
109
109
110
110
static const struct backlight_ops bd6107_backlight_ops = {
111
- .options = BL_CORE_SUSPENDRESUME ,
112
- .update_status = bd6107_backlight_update_status ,
113
- .check_fb = bd6107_backlight_check_fb ,
111
+ .options = BL_CORE_SUSPENDRESUME ,
112
+ .update_status = bd6107_backlight_update_status ,
113
+ .controls_device = bd6107_backlight_controls_device ,
114
114
};
115
115
116
116
static int bd6107_probe (struct i2c_client * client )
Original file line number Diff line number Diff line change @@ -30,18 +30,18 @@ static int gpio_backlight_update_status(struct backlight_device *bl)
30
30
return 0 ;
31
31
}
32
32
33
- static int gpio_backlight_check_fb (struct backlight_device * bl ,
34
- struct fb_info * info )
33
+ static bool gpio_backlight_controls_device (struct backlight_device * bl ,
34
+ struct device * display_dev )
35
35
{
36
36
struct gpio_backlight * gbl = bl_get_data (bl );
37
37
38
- return !gbl -> dev || gbl -> dev == info -> device ;
38
+ return !gbl -> dev || gbl -> dev == display_dev ;
39
39
}
40
40
41
41
static const struct backlight_ops gpio_backlight_ops = {
42
- .options = BL_CORE_SUSPENDRESUME ,
43
- .update_status = gpio_backlight_update_status ,
44
- .check_fb = gpio_backlight_check_fb ,
42
+ .options = BL_CORE_SUSPENDRESUME ,
43
+ .update_status = gpio_backlight_update_status ,
44
+ .controls_device = gpio_backlight_controls_device ,
45
45
};
46
46
47
47
static int gpio_backlight_probe (struct platform_device * pdev )
Original file line number Diff line number Diff line change @@ -62,18 +62,18 @@ static int lv5207lp_backlight_update_status(struct backlight_device *backlight)
62
62
return 0 ;
63
63
}
64
64
65
- static int lv5207lp_backlight_check_fb (struct backlight_device * backlight ,
66
- struct fb_info * info )
65
+ static bool lv5207lp_backlight_controls_device (struct backlight_device * backlight ,
66
+ struct device * display_dev )
67
67
{
68
68
struct lv5207lp * lv = bl_get_data (backlight );
69
69
70
- return !lv -> pdata -> dev || lv -> pdata -> dev == info -> device ;
70
+ return !lv -> pdata -> dev || lv -> pdata -> dev == display_dev ;
71
71
}
72
72
73
73
static const struct backlight_ops lv5207lp_backlight_ops = {
74
- .options = BL_CORE_SUSPENDRESUME ,
75
- .update_status = lv5207lp_backlight_update_status ,
76
- .check_fb = lv5207lp_backlight_check_fb ,
74
+ .options = BL_CORE_SUSPENDRESUME ,
75
+ .update_status = lv5207lp_backlight_update_status ,
76
+ .controls_device = lv5207lp_backlight_controls_device ,
77
77
};
78
78
79
79
static int lv5207lp_probe (struct i2c_client * client )
Original file line number Diff line number Diff line change 13
13
#include <linux/fb.h>
14
14
#include <linux/mutex.h>
15
15
#include <linux/notifier.h>
16
+ #include <linux/types.h>
16
17
17
18
/**
18
19
* enum backlight_update_reason - what method was used to update backlight
@@ -110,7 +111,6 @@ enum backlight_scale {
110
111
};
111
112
112
113
struct backlight_device ;
113
- struct fb_info ;
114
114
115
115
/**
116
116
* struct backlight_ops - backlight operations
@@ -160,18 +160,18 @@ struct backlight_ops {
160
160
int (* get_brightness )(struct backlight_device * );
161
161
162
162
/**
163
- * @check_fb : Check the framebuffer device.
163
+ * @controls_device : Check against the display device
164
164
*
165
- * Check if given framebuffer device is the one bound to this backlight.
166
- * This operation is optional and if not implemented it is assumed that the
167
- * fbdev is always the one bound to the backlight.
165
+ * Check if the backlight controls the given display device. This
166
+ * operation is optional and if not implemented it is assumed that
167
+ * the display is always the one controlled by the backlight.
168
168
*
169
169
* RETURNS:
170
170
*
171
- * If info is NULL or the info matches the fbdev bound to the backlight return true.
172
- * If info does not match the fbdev bound to the backlight return false.
171
+ * If display_dev is NULL or display_dev matches the device controlled by
172
+ * the backlight, return true. Otherwise return false.
173
173
*/
174
- int (* check_fb )(struct backlight_device * bd , struct fb_info * info );
174
+ bool (* controls_device )(struct backlight_device * bd , struct device * display_dev );
175
175
};
176
176
177
177
/**
You can’t perform that action at this time.
0 commit comments