OSDN Git Service

Add missing ts_option.c.
authorChris Larson <clarson@kergoth.com>
Wed, 17 Jun 2009 16:25:10 +0000 (16:25 +0000)
committerChris Larson <clarson@kergoth.com>
Wed, 17 Jun 2009 16:25:10 +0000 (16:25 +0000)
Inadvertantly missed a file when applying the patch from Alberto Mardegan.

Signed-off-by: Chris Larson <clarson@mvista.com>
src/ts_option.c [new file with mode: 0644]

diff --git a/src/ts_option.c b/src/ts_option.c
new file mode 100644 (file)
index 0000000..d87ff04
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ *  tslib/src/ts_option.c
+ *
+ *  Copyright (C) 2005 Alberto Mardegan <mardy@users.sourceforge.net>
+ *
+ * This file is placed under the LGPL.  Please see the file
+ * COPYING for more details.
+ *
+ * Read the configuration and load the appropriate drivers.
+ */
+#include "config.h"
+#include <stdarg.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#include "tslib-private.h"
+
+
+int ts_option(struct tsdev *ts, enum ts_param param, ...)
+{
+       int ret;
+       va_list ap;
+    
+       va_start(ap, param);
+
+       switch (param) {
+               case TS_SCREEN_RES:
+                       ts->res_x = va_arg(ap, unsigned int);
+                       ts->res_y = va_arg(ap, unsigned int);
+                       ret = 0;
+                       break;
+               case TS_SCREEN_ROT:
+                       ts->rotation = va_arg(ap, int);
+                       ret = 0;
+                       break;
+       }
+       va_end(ap);
+
+       return ret;
+}
+