File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -88,13 +88,23 @@ static int ddcci_monitor_readctrl(struct ddcci_device *device,
88
88
return - EIO ;
89
89
}
90
90
91
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION (6 , 10 , 0 )
92
+ static bool ddcci_backlight_controls_device (struct backlight_device * bl ,
93
+ struct device * display_dev )
94
+ {
95
+ struct ddcci_monitor_drv_data * drv_data = bl_get_data (bl );
96
+
97
+ return drv_data -> fb_dev == NULL || drv_data -> fb_dev == display_dev ;
98
+ }
99
+ #else
91
100
static int ddcci_backlight_check_fb (struct backlight_device * bl ,
92
101
struct fb_info * info )
93
102
{
94
103
struct ddcci_monitor_drv_data * drv_data = bl_get_data (bl );
95
104
96
105
return drv_data -> fb_dev == NULL || drv_data -> fb_dev == info -> dev ;
97
106
}
107
+ #endif
98
108
99
109
static int ddcci_backlight_update_status (struct backlight_device * bl )
100
110
{
@@ -135,7 +145,11 @@ static const struct backlight_ops ddcci_backlight_ops = {
135
145
.options = 0 ,
136
146
.update_status = ddcci_backlight_update_status ,
137
147
.get_brightness = ddcci_backlight_get_brightness ,
148
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION (6 , 10 , 0 )
149
+ .controls_device = ddcci_backlight_controls_device ,
150
+ #else
138
151
.check_fb = ddcci_backlight_check_fb ,
152
+ #endif
139
153
};
140
154
141
155
static const char * ddcci_monitor_vcp_name (unsigned char vcp )
Original file line number Diff line number Diff line change @@ -1824,7 +1824,9 @@ static struct i2c_driver ddcci_driver = {
1824
1824
#else
1825
1825
.remove = ddcci_remove ,
1826
1826
#endif
1827
- .class = I2C_CLASS_SPD ,
1827
+ #if LINUX_VERSION_CODE < KERNEL_VERSION (6 , 8 , 0 )
1828
+ .class = I2C_CLASS_DDC ,
1829
+ #endif
1828
1830
.detect = ddcci_detect ,
1829
1831
.address_list = I2C_ADDRS (
1830
1832
DDCCI_DEFAULT_DEVICE_ADDR >>1
@@ -1840,6 +1842,11 @@ static int __init ddcci_module_init(void)
1840
1842
int ret ;
1841
1843
1842
1844
pr_debug ("initializing ddcci driver\n" );
1845
+
1846
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION (6 , 8 , 0 )
1847
+ pr_warn ("WARNING: Auto-probing of displays is not available on kernel 6.8 and later\n" );
1848
+ #endif
1849
+
1843
1850
/* Allocate a device number region for the character devices */
1844
1851
ret = alloc_chrdev_region (& ddcci_cdev_first , 0 , 128 , DEVICE_NAME );
1845
1852
if (ret < 0 ) {
You can’t perform that action at this time.
0 commit comments