diff --git a/Makefile b/Makefile index dd9e80d..d4442b4 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ PACKAGE := hid-wiimote-plus # this is used to name the module file, so it must match the original to override it MODULE := hid-wiimote -VERSION := 0.8.3 +VERSION := 0.8.4 DISTDIR := $(PACKAGE)-$(VERSION) @@ -37,27 +37,28 @@ default: build: - make -C $(KDIR) M=$(SRCDIR) + make --directory=$(KDIR) M=$(SRCDIR) clean: $(info cleaning up) - make -C $(KDIR) M=$(SRCDIR) clean - $(RM) -r $(DISTDIR) + make --directory=$(KDIR) M=$(SRCDIR) clean + $(RM) --recursive $(DISTDIR) $(RM) dkms.conf dist: - mkdir -p $(DISTDIR) - cp $(DISTFILES) $(DISTDIR)/ + mkdir $(DISTDIR) + cp --target-directory=$(DISTDIR) $(DISTFILES) tar -c -z -f $(DISTDIR).tar.gz $(DISTDIR) - $(RM) -r $(DISTDIR) + $(RM) --recursive $(DISTDIR) install: dkms.conf - $(RM) -rf $(SRCTREE)/$(PACKAGE)-$(VERSION) - cp -r $(SRCDIR) $(SRCTREE)/$(PACKAGE)-$(VERSION) - -cp -r 99-wiimote.rules /etc/udev/rules.d/ + $(RM) --recursive $(SRCTREE)/$(DISTDIR) + mkdir --parents $(SRCTREE)/$(DISTDIR) + cp --target-directory=$(SRCTREE)/$(DISTDIR) $(DISTFILES) dkms.conf + -cp --target-directory=/etc/udev/rules.d 99-wiimote.rules dkms add -m $(PACKAGE) -v $(VERSION) dkms build -m $(PACKAGE) -v $(VERSION) dkms install -m $(PACKAGE) -v $(VERSION) @@ -66,7 +67,7 @@ install: dkms.conf uninstall: $(RM) /etc/udev/rules.d/99-wiimote.rules -dkms remove -m $(PACKAGE) -v $(VERSION) --all - $(RM) -r /usr/src/$(PACKAGE)-$(VERSION) + $(RM) --recursive $(SRCTREE)/$(DISTDIR) dkms.conf: dkms.conf.in diff --git a/README.md b/README.md index 4f80024..5dc21be 100644 --- a/README.md +++ b/README.md @@ -62,3 +62,11 @@ If you just want to test it, without installing it, use these commands instead: make build sudo rmmod hid-wiimote sudo insmod ./hid-wiimote.ko + + +Permission issues +----------------- + +The script [99-wiimote.rules](99-wiimote.rules) is installed automatically to +`/etc/udev/rules.d`. If that script is not present, or conflicts with other scripts, you +may end up with devices missing the `ID_INPUT_JOYSTICK` tag, or with wrong permissions. diff --git a/hid-wiimote-modules.c b/hid-wiimote-modules.c index ee3f18b..07b9c05 100644 --- a/hid-wiimote-modules.c +++ b/hid-wiimote-modules.c @@ -235,7 +235,7 @@ static int wiimod_battery_get_property(struct power_supply *psy, state = wdata->state.cmd_battery; spin_unlock_irqrestore(&wdata->state.lock, flags); - val->intval = state * 100 / 0xd0; + val->intval = state; return ret; } case POWER_SUPPLY_PROP_STATUS: