Looks good, but I have a few requests: On Wed, Dec 12, 2018 at 5:05 PM Ping Cheng <pingli...@gmail.com> wrote: > > Make those devices not supported by RHEL 6.10 into wacom-ot.ko so > both drivers can live happily together ;). > > Signed-off-by: Ping Cheng <ping.ch...@wacom.com> > --- > 2.6.32/Makefile.in | 17 ++++++++++++----- > 2.6.32/wacom_sys.c | 7 ++++++- > 2.6.32/wacom_wac.c | 18 ++++++++++++++---- > configure.ac | 12 ++++++++++++ > 4 files changed, 44 insertions(+), 10 deletions(-) > > diff --git a/2.6.32/Makefile.in b/2.6.32/Makefile.in > index 6290771..4a331d6 100644 > --- a/2.6.32/Makefile.in > +++ b/2.6.32/Makefile.in > @@ -4,11 +4,19 @@ ifneq ($(KERNELRELEASE),) > # Do NOT indent stuff in this part! It has to be like this to make the > # $(error ... ) stuff work > > +RHEL6_RELEASE := @RHEL6_RELEASE@ > +WCM_OT_NAME := "" > + > ifneq ($(CONFIG_USB_WACOM),y) > WCM_VERSION := $(shell cd $(KBUILD_EXTMOD)/.. && ./git-version-gen) > -ccflags-y := -DWACOM_VERSION_SUFFIX=\"-$(WCM_VERSION)\" -Wall -Wextra > -Wno-unused-parameter -Wno-missing-field-initializers $(EXTRA_CFLAGS) > -wacom-objs := wacom_wac.o wacom_sys.o > -obj-m += wacom.o > + ifeq ($(RHEL6_RELEASE),10) > + WCM_OT_NAME := -ot > + ccflags-y := -DWACOM_VERSION_SUFFIX=\"-$(WCM_VERSION)\" -Wall -Wextra > -Wno-unused-parameter -Wno-missing-field-initializers $(EXTRA_CFLAGS) > -DRHEL6_RELEASE > + else > + ccflags-y := -DWACOM_VERSION_SUFFIX=\"-$(WCM_VERSION)\" -Wall -Wextra > -Wno-unused-parameter -Wno-missing-field-initializers $(EXTRA_CFLAGS) > + endif # RHEL6_RELEASE
To keep things cleaner, I'd leave the definition of "ccflags-y" alone but add `ccflags-y += -DRHEL6_RELEASE` to the "ifeq" block. > +wacom$(WCM_OT_NAME)-objs := wacom_wac.o wacom_sys.o > +obj-m += wacom$(WCM_OT_NAME).o > obj-m += wacom_w8001.o > else > $(error You requested to build wacom with configure, but wacom is configured > as built-in in your kernel config) > @@ -48,8 +56,7 @@ uninstall: > @# which causes trouble for tools like 'rm' which don't > @# see the path how you might think. As a workaround, > @# first cd into the directory and then remove. > - cd $(WCM_KERNEL_DIR)/../extra; rm wacom.ko* > - cd $(WCM_KERNEL_DIR)/../extra; rm wacom_w8001.ko* > + cd $(WCM_KERNEL_DIR)/../extra; rm wacom*.ko* > rm -f /etc/depmod.d/input-wacom.conf > PATH="$(PATH):/bin:/sbin" depmod -a $(MODUTS) > > diff --git a/2.6.32/wacom_sys.c b/2.6.32/wacom_sys.c > index 5ca4c61..4a1fb70 100644 > --- a/2.6.32/wacom_sys.c > +++ b/2.6.32/wacom_sys.c > @@ -39,6 +39,11 @@ > #define HID_COLLECTION_END 0xc0 > #define HID_LONGITEM 0xfc > > +#ifdef RHEL6_RELEASE > +#define wacom_driver_name "wacom-ot" > +#else > +#define wacom_driver_name "wacom" > +#endif > > enum { > WCM_UNDEFINED = 0, > @@ -1088,7 +1093,7 @@ static int wacom_reset_resume(struct usb_interface > *intf) > } > > static struct usb_driver wacom_driver = { > - .name = "wacom", > + .name = wacom_driver_name, > .id_table = wacom_ids, > .probe = wacom_probe, > .disconnect = wacom_disconnect, > diff --git a/2.6.32/wacom_wac.c b/2.6.32/wacom_wac.c > index c4705f8..9a5fe39 100644 > --- a/2.6.32/wacom_wac.c > +++ b/2.6.32/wacom_wac.c > @@ -2484,6 +2484,7 @@ void wacom_setup_input_capabilities(struct input_dev > *input_dev, > wacom_setup_numbered_buttons(input_dev, numbered_buttons); > } > > +#ifndef RHEL6_RELEASE > static const struct wacom_features wacom_features_0x00 = > { "Wacom Penpartner", WACOM_PKGLEN_PENPRTN, 5040, 3780, 255, 0, > PENPARTNER, WACOM_PENPRTN_RES, WACOM_PENPRTN_RES }; > @@ -2950,10 +2951,10 @@ static const struct wacom_features > wacom_features_0x343 = > WACOM_DTU_OFFSET, WACOM_DTU_OFFSET }; > static const struct wacom_features wacom_features_0x34A = > { "Wacom MobileStudio Pro 13 Touch", WACOM_PKGLEN_MSPROT, .type = > WACOM_MSPROT, /* Touch */ > - .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x34D }; > + .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x34D, .touch_max = 10 }; All of these touch_max modifications should go into their own patch. > static const struct wacom_features wacom_features_0x34B = > { "Wacom MobileStudio Pro 16 Touch", WACOM_PKGLEN_MSPROT, .type = > WACOM_MSPROT, /* Touch */ > - .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x34E }; > + .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x34E, .touch_max = 10 }; > static const struct wacom_features wacom_features_0x34D = > { "Wacom MobileStudio Pro 13", WACOM_PKGLEN_MSPRO, 59552, 33848, > 8191, 63, > WACOM_MSPRO, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 11, > @@ -2966,6 +2967,7 @@ static const struct wacom_features wacom_features_0x34E > = > WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET, > WACOM_CINTIQ_OFFSET, WACOM_CINTIQ_OFFSET, > .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x34B }; > +#endif /* Wacom Out-of-tree check */ > static const struct wacom_features wacom_features_0x34F = > { "Wacom Cintiq Pro 13 FHD", WACOM_PKGLEN_MSPRO, 59552, 33848, 8191, > 63, > WACOM_MSPRO, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 0, > @@ -2992,10 +2994,10 @@ static const struct wacom_features > wacom_features_0x352 = > .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x356 }; > static const struct wacom_features wacom_features_0x353 = > { "Wacom Cintiq Pro 13FHD Touch", WACOM_PKGLEN_MSPROT, .type = > WACOM_MSPROT, > - .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x34f }; /* Touch */ > + .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x34f, .touch_max = 10 }; /* > Touch */ > static const struct wacom_features wacom_features_0x354 = > { "Wacom Cintiq Pro 16UHD Touch", WACOM_PKGLEN_MSPROT, .type = > WACOM_MSPROT, > - .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x350 }; /* Touch */ > + .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x350, .touch_max = 10 }; /* > Touch */ > static const struct wacom_features wacom_features_0x355 = > { "Wacom Cintiq Pro 24 Touch", WACOM_PKGLEN_27QHDT, .type = > WACOM_27QHDT, > .oVid = USB_VENDOR_ID_WACOM, .oPid = 0x351, .touch_max = 10 }; /* > Touch */ > @@ -3031,12 +3033,14 @@ static const struct wacom_features > wacom_features_0x376 = > static const struct wacom_features wacom_features_0x378 = > { "Intuos BT M", WACOM_PKGLEN_INTUOSP2, 21600, 13500, 4095, > 63, INTUOSHT3, WACOM_INTUOS_RES, WACOM_INTUOS_RES, 4 }; > +#ifndef RHEL6_RELEASE > static const struct wacom_features wacom_features_0x37A = > { "Wacom One by Wacom S", WACOM_PKGLEN_BBPEN, 15200, 9500, 2047, 63, > BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; > static const struct wacom_features wacom_features_0x37B = > { "Wacom One by Wacom M", WACOM_PKGLEN_BBPEN, 21600, 13500, 2047, 63, > BAMBOO_PT, WACOM_INTUOS_RES, WACOM_INTUOS_RES }; > +#endif > static const struct wacom_features wacom_features_0x37C = > { "Wacom Cintiq Pro 24", WACOM_PKGLEN_MSPRO, 105286, 59574, 8191, 63, > /* Pen-only */ > WACOM_MSPRO, WACOM_INTUOS3_RES, WACOM_INTUOS3_RES, 0, > @@ -3072,6 +3076,7 @@ static const struct wacom_features wacom_features_0x382 > = > .driver_info = (kernel_ulong_t)&wacom_features_##prod > > const struct usb_device_id wacom_ids[] = { > +#ifndef RHEL6_RELEASE > { USB_DEVICE_WACOM(0x00) }, > { USB_DEVICE_WACOM(0x03) }, > { USB_DEVICE_WACOM(0x10) }, > @@ -3215,6 +3220,7 @@ const struct usb_device_id wacom_ids[] = { > { USB_DEVICE_WACOM(0x34B) }, > { USB_DEVICE_WACOM(0x34D) }, > { USB_DEVICE_WACOM(0x34E) }, > +#endif Could you add /* RHEL6_RELEASE */ after these statements to make it clear where they begin? > { USB_DEVICE_WACOM(0x34F) }, > { USB_DEVICE_WACOM(0x350) }, > { USB_DEVICE_WACOM(0x351) }, > @@ -3232,12 +3238,15 @@ const struct usb_device_id wacom_ids[] = { > { USB_DEVICE_WACOM(0x375) }, > { USB_DEVICE_WACOM(0x376) }, > { USB_DEVICE_WACOM(0x378) }, > +#ifndef RHEL6_RELEASE > { USB_DEVICE_WACOM(0x37A) }, > { USB_DEVICE_WACOM(0x37B) }, > +#endif > { USB_DEVICE_WACOM(0x37C) }, > { USB_DEVICE_WACOM(0x37D) }, > { USB_DEVICE_WACOM(0x37E) }, > { USB_DEVICE_WACOM(0x382) }, > +#ifndef RHEL6_RELEASE > { USB_DEVICE_WACOM(0x4001) }, > { USB_DEVICE_WACOM(0x4004) }, > { USB_DEVICE_WACOM(0x5000) }, > @@ -3248,6 +3257,7 @@ const struct usb_device_id wacom_ids[] = { > { USB_DEVICE_WACOM(0x5048) }, > { USB_DEVICE_WACOM(0x5090) }, > { USB_DEVICE_LENOVO(0x6004) }, > +#endif > { } > }; > MODULE_DEVICE_TABLE(usb, wacom_ids); > diff --git a/configure.ac b/configure.ac > index 52386d5..5ea344c 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -107,6 +107,17 @@ package and try again.]) > fi > WCM_ENV_KERNEL="yes" > > +dnl Check for RedHat entreprise Linux >= 6.9 > +AC_MSG_CHECKING(RHEL6 minor release) > +RHEL6_RELEASE=[$(sed -n 's/^\(Red Hat Enterprise Linux\|CentOS\) .*release > 6.\([0-9]*\).*$/\2/gp' "/etc/redhat-release" 2> /dev/null | head -n1)] This one's optional, but we could/should have a third patch which modifies this sed one-liner (and RHEL7_RELEASE as well) to also handle the "Scientific Linux" fork of RHEL. The /etc/redhat-release strings for that fork are e.g. "Scientific Linux release 6.10 (Carbon)" and "Scientific Linux release 7.6 (Nitrogen)". Jason --- Now instead of four in the eights place / you’ve got three, ‘Cause you added one / (That is to say, eight) to the two, / But you can’t take seven from three, / So you look at the sixty-fours.... > +dnl RHEL6_RELEASE="" > +if test "$RHEL6_RELEASE" = ""; then > + RHEL6_RELEASE="0" > +elif test "$RHEL6_RELEASE" -ge "9"; then > + RHEL6_RELEASE="10" > +fi > +AC_MSG_RESULT([$RHEL6_RELEASE]) > + > dnl Check for RedHat entreprise Linux >= 7.4 > AC_MSG_CHECKING(RHEL7 minor release) > RHEL7_RELEASE=[$(sed -n 's/^\(Red Hat Enterprise\|CentOS\) Linux .*release > 7.\([0-9]*\).*$/\2/gp' "/etc/redhat-release" 2> /dev/null | head -n1)] > @@ -331,6 +342,7 @@ echo > WCM_SRC_SUBDIRS=". $WCM_KERNEL_VER" > AC_SUBST(WCM_KERNEL_DIR) > AC_SUBST(WCM_KERNEL_VER) > +AC_SUBST(RHEL6_RELEASE) > AC_SUBST(RHEL7_RELEASE) > AC_SUBST(MODUTS) > AC_SUBST(MODSIGN_HASHALGO) > -- > 2.7.4 > _______________________________________________ Linuxwacom-devel mailing list Linuxwacom-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel