diff -Nru ddcci-driver-linux-0.4.3/debian/changelog ddcci-driver-linux-0.4.3/debian/changelog --- ddcci-driver-linux-0.4.3/debian/changelog 2023-06-13 10:09:44.000000000 +0000 +++ ddcci-driver-linux-0.4.3/debian/changelog 2023-06-15 11:14:45.000000000 +0000 @@ -1,8 +1,9 @@ -ddcci-driver-linux (0.4.3-1ubuntu2) mantic; urgency=medium +ddcci-driver-linux (0.4.3-2) unstable; urgency=medium - * Import upstream pull requests for v6.2-4 support. + * Add upstream candidate patches to build with versions 6.2, 6.3, and + 6.4 of the kernel. Closes: #1037974. - -- Dimitri John Ledkov Tue, 13 Jun 2023 11:09:44 +0100 + -- Stephen Kitt Thu, 15 Jun 2023 13:14:45 +0200 ddcci-driver-linux (0.4.3-1) unstable; urgency=medium diff -Nru ddcci-driver-linux-0.4.3/debian/control ddcci-driver-linux-0.4.3/debian/control --- ddcci-driver-linux-0.4.3/debian/control 2023-06-13 10:09:44.000000000 +0000 +++ ddcci-driver-linux-0.4.3/debian/control 2023-06-12 03:51:45.000000000 +0000 @@ -1,6 +1,5 @@ Source: ddcci-driver-linux -Maintainer: Ubuntu Developers -XSBC-Original-Maintainer: Stephen Kitt +Maintainer: Stephen Kitt Section: kernel Priority: optional Build-Depends: debhelper-compat (= 13), diff -Nru ddcci-driver-linux-0.4.3/debian/patches/12.patch ddcci-driver-linux-0.4.3/debian/patches/12.patch --- ddcci-driver-linux-0.4.3/debian/patches/12.patch 2023-06-13 10:09:44.000000000 +0000 +++ ddcci-driver-linux-0.4.3/debian/patches/12.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,147 +0,0 @@ -# https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux/-/merge_requests/12.patch -From 1ef6079679acc455f75057dd7097b5b494a241dc Mon Sep 17 00:00:00 2001 -From: Tj -Date: Sun, 14 May 2023 23:12:56 +0100 -Subject: [PATCH] Compatible with v6.2, v6.3 changes - -Several function prototypes were changed to pass const structs, -bus_type.p was removed so cannot be used to detect if bus is ready, and -prototype of register function was changed. ---- - ddcci/ddcci.c | 20 ++++++++++++++------ - dkms.conf | 3 ++- - include/linux/ddcci.h | 9 +++++++-- - 3 files changed, 23 insertions(+), 9 deletions(-) - -Index: ddcci-driver-linux-0.4.3/ddcci/ddcci.c -=================================================================== ---- ddcci-driver-linux-0.4.3.orig/ddcci/ddcci.c -+++ ddcci-driver-linux-0.4.3/ddcci/ddcci.c -@@ -35,6 +35,7 @@ - static unsigned int delay = 60; - static unsigned short autoprobe_addrs[127] = {0xF0, 0xF2, 0xF4, 0xF6, 0xF8}; - static int autoprobe_addr_count = 5; -+static bool is_registered; - - static dev_t ddcci_cdev_first; - static dev_t ddcci_cdev_next; -@@ -934,8 +935,7 @@ static struct attribute *ddcci_char_devi - ATTRIBUTE_GROUPS(ddcci_char_device); - - /* DDC/CI bus */ -- --static int ddcci_device_uevent(struct device *dev, struct kobj_uevent_env *env) -+static int ddcci_device_uevent(CSTRUCT device *dev, struct kobj_uevent_env *env) - { - struct ddcci_device *device = to_ddcci_device(dev); - char model[ARRAY_SIZE(device->model)]; -@@ -1015,7 +1015,7 @@ static void ddcci_device_release(struct - kfree(device); - } - --static char *ddcci_devnode(struct device *dev, -+static char *ddcci_devnode(CSTRUCT device *dev, - umode_t *mode, kuid_t *uid, kgid_t *gid) - { - struct ddcci_device *device; -@@ -1025,7 +1025,7 @@ static char *ddcci_devnode(struct device - device->i2c_client->adapter->nr); - } - --static char *ddcci_dependent_devnode(struct device *dev, -+static char *ddcci_dependent_devnode(CSTRUCT device *dev, - umode_t *mode, kuid_t *uid, kgid_t *gid) - { - struct ddcci_device *device; -@@ -1069,7 +1069,7 @@ static struct device_type ddcci_dependen - * ddcci_verify_device - return parameter as ddcci_device, or NULL - * @dev: device, probably from some driver model iterator - */ --struct ddcci_device *ddcci_verify_device(struct device *dev) -+struct ddcci_device *ddcci_verify_device(CSTRUCT device *dev) - { - if (unlikely(!dev)) - return NULL; -@@ -1104,7 +1104,7 @@ int ddcci_register_driver(struct module - int ret; - - /* Can't register until after driver model init */ -- if (unlikely(WARN_ON(!ddcci_bus_type.p))) -+ if (unlikely(WARN_ON(!is_registered))) - return -EAGAIN; - - pr_debug("registering driver [%s]\n", driver->driver.name); -@@ -1676,8 +1676,14 @@ static int ddcci_detect(struct i2c_clien - } - - /* I2C probe function */ -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0) -+static int ddcci_probe(struct i2c_client *client) -+{ -+ const struct i2c_device_id *id = i2c_client_get_device_id(client); -+#else - static int ddcci_probe(struct i2c_client *client, const struct i2c_device_id *id) - { -+#endif - int i, ret = -ENODEV, tmp; - unsigned char main_addr, addr; - struct ddcci_bus_drv_data *drv_data; -@@ -1861,6 +1867,7 @@ static int __init ddcci_module_init(void - goto err_drvreg; - } - -+ is_registered = true; - pr_debug("ddcci driver initialized\n"); - - return 0; -@@ -1890,6 +1897,7 @@ static void __exit ddcci_module_exit(voi - - i2c_del_driver(&ddcci_driver); - bus_unregister(&ddcci_bus_type); -+ is_registered = false; - unregister_chrdev_region(ddcci_cdev_first, 128); - } - -Index: ddcci-driver-linux-0.4.3/dkms.conf -=================================================================== ---- ddcci-driver-linux-0.4.3.orig/dkms.conf -+++ ddcci-driver-linux-0.4.3/dkms.conf -@@ -7,7 +7,8 @@ BUILT_MODULE_LOCATION[0]="ddcci/" - BUILT_MODULE_LOCATION[1]="ddcci-backlight/" - DEST_MODULE_LOCATION[0]="/extra" - DEST_MODULE_LOCATION[1]="/extra" --MAKE[0]="make KVER=$kernelver -C ${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build" -+#MAKE[0]="make KVER=$kernelver -C ${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build" -+MAKE[0]="make KVER=$kernelver" - AUTOINSTALL="yes" - # Don't build module when BACKLIGHT_CLASS_DEVICE is disabled - if ! grep -q "^CONFIG_BACKLIGHT_CLASS_DEVICE=[ym]$" "$kernel_source_dir/.config" 2>/dev/null ; then -Index: ddcci-driver-linux-0.4.3/include/linux/ddcci.h -=================================================================== ---- ddcci-driver-linux-0.4.3.orig/include/linux/ddcci.h -+++ ddcci-driver-linux-0.4.3/include/linux/ddcci.h -@@ -17,9 +17,14 @@ - #include - #include - #include -+#include -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0) -+#define CSTRUCT const struct -+#else -+#define CSTRUCT struct -+#endif - - #define DDCCI_MODULE_PREFIX "ddcci:" -- - /* Special addresses */ - - /* default device address (even) */ -@@ -132,7 +137,7 @@ int ddcci_register_driver(struct module - ddcci_register_driver(THIS_MODULE, driver) - void ddcci_del_driver(struct ddcci_driver *driver); - --struct ddcci_device *ddcci_verify_device(struct device *dev); -+struct ddcci_device *ddcci_verify_device(CSTRUCT device *dev); - - #define module_ddcci_driver(__ddcci_driver) \ - module_driver(__ddcci_driver, ddcci_add_driver, \ diff -Nru ddcci-driver-linux-0.4.3/debian/patches/13.patch ddcci-driver-linux-0.4.3/debian/patches/13.patch --- ddcci-driver-linux-0.4.3/debian/patches/13.patch 2023-06-13 10:09:36.000000000 +0000 +++ ddcci-driver-linux-0.4.3/debian/patches/13.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,31 +0,0 @@ -# https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux/-/merge_requests/13.patch -From 410fd6e962c6760bd5b287f18b8c6bf8c7bbf261 Mon Sep 17 00:00:00 2001 -From: Tj -Date: Tue, 16 May 2023 09:37:31 +0100 -Subject: [PATCH] Compatible with v6.4 changes - -DEFINE_SEMAPHORE was changed in 48380368dec14859723 to expose the -counter value. ---- - ddcci/ddcci.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/ddcci/ddcci.c b/ddcci/ddcci.c -index ea76352..3c75b90 100644 ---- a/ddcci/ddcci.c -+++ b/ddcci/ddcci.c -@@ -39,7 +39,11 @@ static int autoprobe_addr_count = 5; - static dev_t ddcci_cdev_first; - static dev_t ddcci_cdev_next; - static dev_t ddcci_cdev_end; -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0) -+static DEFINE_SEMAPHORE(core_lock, 1); -+#else - static DEFINE_SEMAPHORE(core_lock); -+#endif - - struct bus_type ddcci_bus_type; - EXPORT_SYMBOL_GPL(ddcci_bus_type); --- -GitLab - diff -Nru ddcci-driver-linux-0.4.3/debian/patches/linux-6.3.patch ddcci-driver-linux-0.4.3/debian/patches/linux-6.3.patch --- ddcci-driver-linux-0.4.3/debian/patches/linux-6.3.patch 1970-01-01 00:00:00.000000000 +0000 +++ ddcci-driver-linux-0.4.3/debian/patches/linux-6.3.patch 2023-06-15 08:06:39.000000000 +0000 @@ -0,0 +1,124 @@ +commit 1ef6079679acc455f75057dd7097b5b494a241dc +Author: Tj +Date: Sun May 14 23:12:56 2023 +0100 + + Compatible with v6.2, v6.3 changes + + Several function prototypes were changed to pass const structs, + bus_type.p was removed so cannot be used to detect if bus is ready, and + prototype of register function was changed. + +--- a/ddcci/ddcci.c ++++ b/ddcci/ddcci.c +@@ -35,6 +35,7 @@ + static unsigned int delay = 60; + static unsigned short autoprobe_addrs[127] = {0xF0, 0xF2, 0xF4, 0xF6, 0xF8}; + static int autoprobe_addr_count = 5; ++static bool is_registered; + + static dev_t ddcci_cdev_first; + static dev_t ddcci_cdev_next; +@@ -934,8 +935,7 @@ + ATTRIBUTE_GROUPS(ddcci_char_device); + + /* DDC/CI bus */ +- +-static int ddcci_device_uevent(struct device *dev, struct kobj_uevent_env *env) ++static int ddcci_device_uevent(CSTRUCT device *dev, struct kobj_uevent_env *env) + { + struct ddcci_device *device = to_ddcci_device(dev); + char model[ARRAY_SIZE(device->model)]; +@@ -1015,7 +1015,7 @@ + kfree(device); + } + +-static char *ddcci_devnode(struct device *dev, ++static char *ddcci_devnode(CSTRUCT device *dev, + umode_t *mode, kuid_t *uid, kgid_t *gid) + { + struct ddcci_device *device; +@@ -1025,7 +1025,7 @@ + device->i2c_client->adapter->nr); + } + +-static char *ddcci_dependent_devnode(struct device *dev, ++static char *ddcci_dependent_devnode(CSTRUCT device *dev, + umode_t *mode, kuid_t *uid, kgid_t *gid) + { + struct ddcci_device *device; +@@ -1069,7 +1069,7 @@ + * ddcci_verify_device - return parameter as ddcci_device, or NULL + * @dev: device, probably from some driver model iterator + */ +-struct ddcci_device *ddcci_verify_device(struct device *dev) ++struct ddcci_device *ddcci_verify_device(CSTRUCT device *dev) + { + if (unlikely(!dev)) + return NULL; +@@ -1104,7 +1104,7 @@ + int ret; + + /* Can't register until after driver model init */ +- if (unlikely(WARN_ON(!ddcci_bus_type.p))) ++ if (unlikely(WARN_ON(!is_registered))) + return -EAGAIN; + + pr_debug("registering driver [%s]\n", driver->driver.name); +@@ -1676,8 +1676,14 @@ + } + + /* I2C probe function */ ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0) ++static int ddcci_probe(struct i2c_client *client) ++{ ++ const struct i2c_device_id *id = i2c_client_get_device_id(client); ++#else + static int ddcci_probe(struct i2c_client *client, const struct i2c_device_id *id) + { ++#endif + int i, ret = -ENODEV, tmp; + unsigned char main_addr, addr; + struct ddcci_bus_drv_data *drv_data; +@@ -1861,6 +1867,7 @@ + goto err_drvreg; + } + ++ is_registered = true; + pr_debug("ddcci driver initialized\n"); + + return 0; +@@ -1890,6 +1897,7 @@ + + i2c_del_driver(&ddcci_driver); + bus_unregister(&ddcci_bus_type); ++ is_registered = false; + unregister_chrdev_region(ddcci_cdev_first, 128); + } + +--- a/include/linux/ddcci.h ++++ b/include/linux/ddcci.h +@@ -17,9 +17,14 @@ + #include + #include + #include ++#include ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 2, 0) ++#define CSTRUCT const struct ++#else ++#define CSTRUCT struct ++#endif + + #define DDCCI_MODULE_PREFIX "ddcci:" +- + /* Special addresses */ + + /* default device address (even) */ +@@ -132,7 +137,7 @@ + ddcci_register_driver(THIS_MODULE, driver) + void ddcci_del_driver(struct ddcci_driver *driver); + +-struct ddcci_device *ddcci_verify_device(struct device *dev); ++struct ddcci_device *ddcci_verify_device(CSTRUCT device *dev); + + #define module_ddcci_driver(__ddcci_driver) \ + module_driver(__ddcci_driver, ddcci_add_driver, \ diff -Nru ddcci-driver-linux-0.4.3/debian/patches/linux-6.4.patch ddcci-driver-linux-0.4.3/debian/patches/linux-6.4.patch --- ddcci-driver-linux-0.4.3/debian/patches/linux-6.4.patch 1970-01-01 00:00:00.000000000 +0000 +++ ddcci-driver-linux-0.4.3/debian/patches/linux-6.4.patch 2023-06-15 08:06:42.000000000 +0000 @@ -0,0 +1,23 @@ +commit 410fd6e962c6760bd5b287f18b8c6bf8c7bbf261 +Author: Tj +Date: Tue May 16 09:37:31 2023 +0100 + + Compatible with v6.4 changes + + DEFINE_SEMAPHORE was changed in 48380368dec14859723 to expose the + counter value. + +--- a/ddcci/ddcci.c ++++ b/ddcci/ddcci.c +@@ -40,7 +40,11 @@ + static dev_t ddcci_cdev_first; + static dev_t ddcci_cdev_next; + static dev_t ddcci_cdev_end; ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 4, 0) ++static DEFINE_SEMAPHORE(core_lock, 1); ++#else + static DEFINE_SEMAPHORE(core_lock); ++#endif + + struct bus_type ddcci_bus_type; + EXPORT_SYMBOL_GPL(ddcci_bus_type); diff -Nru ddcci-driver-linux-0.4.3/debian/patches/series ddcci-driver-linux-0.4.3/debian/patches/series --- ddcci-driver-linux-0.4.3/debian/patches/series 2023-06-13 10:09:36.000000000 +0000 +++ ddcci-driver-linux-0.4.3/debian/patches/series 2023-06-15 08:06:29.000000000 +0000 @@ -1,5 +1,5 @@ 0002-Skip-build-if-BACKLIGHT_CLASS_DEVICE-off.patch pre-5.1-static_assert.patch skip-if-no-config-i2c.patch -12.patch -13.patch +linux-6.3.patch +linux-6.4.patch