Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Jul 2014 10:38:22 +0000 (UTC)
From:      Jakub Wojciech Klama <jceel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r268667 - user/jceel/soc2014_evdev/head/sys/dev/evdev
Message-ID:  <201407151038.s6FAcMGU085281@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jceel
Date: Tue Jul 15 10:38:22 2014
New Revision: 268667
URL: http://svnweb.freebsd.org/changeset/base/268667

Log:
  Minor fixes.

Modified:
  user/jceel/soc2014_evdev/head/sys/dev/evdev/evdev.c
  user/jceel/soc2014_evdev/head/sys/dev/evdev/evdev.h

Modified: user/jceel/soc2014_evdev/head/sys/dev/evdev/evdev.c
==============================================================================
--- user/jceel/soc2014_evdev/head/sys/dev/evdev/evdev.c	Tue Jul 15 10:38:05 2014	(r268666)
+++ user/jceel/soc2014_evdev/head/sys/dev/evdev/evdev.c	Tue Jul 15 10:38:22 2014	(r268667)
@@ -42,7 +42,7 @@
 #include <dev/evdev/input.h>
 #include <dev/evdev/evdev.h>
 
-//#define	DEBUG
+#define	DEBUG
 #ifdef DEBUG
 #define	debugf(fmt, args...)	printf("evdev: " fmt "\n", ##args)
 #else
@@ -99,9 +99,7 @@ evdev_register(device_t dev, struct evde
 
 	if (dev != NULL)
 		strlcpy(evdev->ev_shortname, device_get_nameunit(dev), NAMELEN);
-	else
-		strlcpy(evdev->ev_shortname, "uinput", NAMELEN);
-
+	
 	if (evdev->ev_repeat_mode == EVDEV_REPEAT) {
 		/* Initialize callout */
 		callout_init(&evdev->ev_rep_callout, 1);
@@ -141,24 +139,35 @@ evdev_unregister(device_t dev, struct ev
 inline void
 evdev_set_name(struct evdev_dev *evdev, const char *name)
 {
+
 	snprintf(evdev->ev_name, NAMELEN, "%s", name);
 }
 
 inline void
+evdev_set_phys(struct evdev_dev *evdev, const char *name)
+{
+
+	snprintf(evdev->ev_shortname, NAMELEN, "%s", name);
+}
+
+inline void
 evdev_set_serial(struct evdev_dev *evdev, const char *serial)
 {
+
 	snprintf(evdev->ev_serial, NAMELEN, "%s", serial);
 }
 
 inline void
 evdev_set_methods(struct evdev_dev *evdev, struct evdev_methods *methods)
 {
+
 	evdev->ev_methods = methods;
 }
 
 inline void
 evdev_set_softc(struct evdev_dev *evdev, void *softc)
 {
+
 	evdev->ev_softc = softc;
 }
 
@@ -255,7 +264,7 @@ evdev_push_event(struct evdev_dev *evdev
 	struct evdev_client *client;
 
 	debugf("%s pushed event %d/%d/%d",
-	    device_get_nameunit(evdev->ev_dev), type, code, value);
+	    evdev->ev_shortname, type, code, value);
 
 	/* For certain event types, update device state bits */
 	if (type == EV_KEY)
@@ -325,7 +334,7 @@ evdev_register_client(struct evdev_dev *
 
 	debugf("adding new client for device %s", evdev->ev_shortname);
 
-	if (evdev->ev_clients_count == 0 &&
+	if (evdev->ev_clients_count == 0 && evdev->ev_methods != NULL &&
 	    evdev->ev_methods->ev_open != NULL) {
 		debugf("calling ev_open() on device %s", evdev->ev_shortname);
 		evdev->ev_methods->ev_open(evdev, evdev->ev_softc);
@@ -346,7 +355,7 @@ evdev_dispose_client(struct evdev_client
 
 	evdev->ev_clients_count--;
 
-	if (evdev->ev_clients_count == 0 &&
+	if (evdev->ev_clients_count == 0 && evdev->ev_methods != NULL &&
 	    evdev->ev_methods->ev_close != NULL)
 		evdev->ev_methods->ev_close(evdev, evdev->ev_softc);
 

Modified: user/jceel/soc2014_evdev/head/sys/dev/evdev/evdev.h
==============================================================================
--- user/jceel/soc2014_evdev/head/sys/dev/evdev/evdev.h	Tue Jul 15 10:38:05 2014	(r268666)
+++ user/jceel/soc2014_evdev/head/sys/dev/evdev/evdev.h	Tue Jul 15 10:38:22 2014	(r268667)
@@ -137,6 +137,7 @@ struct evdev_client
 struct evdev_dev *evdev_alloc(void);
 void evdev_free(struct evdev_dev *);
 void evdev_set_name(struct evdev_dev *, const char *);
+void evdev_set_phys(struct evdev_dev *, const char *);
 void evdev_set_serial(struct evdev_dev *, const char *);
 void evdev_set_methods(struct evdev_dev *, struct evdev_methods *);
 void evdev_set_softc(struct evdev_dev *, void *);
@@ -168,7 +169,7 @@ void evdev_client_filter_queue(struct ev
 
 /* Utility functions: */
 uint16_t evdev_hid2key(int);
-uint16_t evdev_at2key(int);
+uint16_t evdev_scancode2key(int *, int);
 void evdev_client_dumpqueue(struct evdev_client *);
 
 #endif	/* _DEV_EVDEV_EVDEV_H */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201407151038.s6FAcMGU085281>