From 1112d7bc83b9384ee008d57e35a4431c0552e7e7 Mon Sep 17 00:00:00 2001 From: Subhaditya Nath Date: Tue, 14 Nov 2023 03:50:03 +0530 Subject: [PATCH] ddcci-dkms: upgrade to 0.4.4 --- srcpkgs/ddcci-dkms/patches/linux-6.2.diff | 99 ----------------------- srcpkgs/ddcci-dkms/patches/linux-6.3.diff | 17 ---- srcpkgs/ddcci-dkms/patches/linux-6.4.diff | 14 ---- srcpkgs/ddcci-dkms/template | 5 +- 4 files changed, 2 insertions(+), 133 deletions(-) delete mode 100644 srcpkgs/ddcci-dkms/patches/linux-6.2.diff delete mode 100644 srcpkgs/ddcci-dkms/patches/linux-6.3.diff delete mode 100644 srcpkgs/ddcci-dkms/patches/linux-6.4.diff diff --git a/srcpkgs/ddcci-dkms/patches/linux-6.2.diff b/srcpkgs/ddcci-dkms/patches/linux-6.2.diff deleted file mode 100644 index cd050144ef1ff2..00000000000000 --- a/srcpkgs/ddcci-dkms/patches/linux-6.2.diff +++ /dev/null @@ -1,99 +0,0 @@ ---- 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; -@@ -930,8 +931,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)]; -@@ -1011,7 +1011,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; -@@ -1021,7 +1021,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; -@@ -1065,7 +1065,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; -@@ -1100,7 +1100,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); -@@ -1857,6 +1857,7 @@ static int __init ddcci_module_init(void - goto err_drvreg; - } - -+ is_registered = true; - pr_debug("ddcci driver initialized\n"); - - return 0; -@@ -1886,6 +1887,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); - } - ---- 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 @@ 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 --git a/srcpkgs/ddcci-dkms/patches/linux-6.3.diff b/srcpkgs/ddcci-dkms/patches/linux-6.3.diff deleted file mode 100644 index d86242326cb233..00000000000000 --- a/srcpkgs/ddcci-dkms/patches/linux-6.3.diff +++ /dev/null @@ -1,17 +0,0 @@ ---- a/ddcci/ddcci.c -+++ b/ddcci/ddcci.c -@@ -1672,8 +1672,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; diff --git a/srcpkgs/ddcci-dkms/patches/linux-6.4.diff b/srcpkgs/ddcci-dkms/patches/linux-6.4.diff deleted file mode 100644 index 16aabb9197f4bc..00000000000000 --- a/srcpkgs/ddcci-dkms/patches/linux-6.4.diff +++ /dev/null @@ -1,14 +0,0 @@ ---- a/ddcci/ddcci.c -+++ b/ddcci/ddcci.c -@@ -40,7 +40,11 @@ static bool is_registered; - 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 --git a/srcpkgs/ddcci-dkms/template b/srcpkgs/ddcci-dkms/template index 62a3fcc12e99cb..e1145fc0dd464e 100644 --- a/srcpkgs/ddcci-dkms/template +++ b/srcpkgs/ddcci-dkms/template @@ -1,6 +1,6 @@ # Template file for 'ddcci-dkms' pkgname=ddcci-dkms -version=0.4.3 +version=0.4.4 revision=1 depends="dkms" short_desc="Pair of Linux kernel drivers for DDC/CI monitors (DKMS)" @@ -8,14 +8,13 @@ maintainer="Subhaditya Nath " license="GPL-2.0-or-later" homepage="https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux/" distfiles="https://gitlab.com/ddcci-driver-linux/ddcci-driver-linux/-/archive/v${version}/ddcci-driver-linux-v${version}.tar.gz" -checksum=2c13fb0a66fea3fcd0070c7cce07ec3943550dee667f066562f810b8c2f01656 +checksum=4e1ddcca2b9052ce46c3a4bd494b19ea6908f1fac013284cccb15151c03e59aa dkms_modules="ddcci ${version}" do_install() { vdoc README.md rm LICENSE README.md - rm -f *.patch vmkdir usr/src/ddcci-${version} vcopy "*" usr/src/ddcci-${version} }