[oe-commits] org.oe.dev linux-2.6.25: Add virtual mouse driver, but for AVR32 only.
likewise commit
oe at amethyst.openembedded.net
Mon Sep 1 18:14:52 UTC 2008
linux-2.6.25: Add virtual mouse driver, but for AVR32 only.
The AT32STK1002 board comes with a non-touchscreen LCD; this driver
helps to mimick touches on the screen. Currently, it sends the
coordinates and a left mouse button click and release when performing
echo "100 100 0" >/sys/devices/platform/vms/coordinates
Author: likewise at openembedded.org
Branch: org.openembedded.dev
Revision: 7ba62c1bc5f5f44c638e1e5f4805429a188ca3a6
ViewMTN: http://monotone.openembedded.org/revision/info/7ba62c1bc5f5f44c638e1e5f4805429a188ca3a6
Files:
1
packages/linux/linux-2.6.25/at32stk1000/virtualmouse.patch
packages/linux/linux_2.6.25.bb
Diffs:
#
# mt diff -r002177588ab82b5850d1db6d5957ccd908c6ed9d -r7ba62c1bc5f5f44c638e1e5f4805429a188ca3a6
#
#
#
# add_file "packages/linux/linux-2.6.25/at32stk1000/virtualmouse.patch"
# content [02f56a6c5ba2e3fcf2eee0a14b900182c3272b07]
#
# patch "packages/linux/linux_2.6.25.bb"
# from [17408d418b583626e5de54e9ef049c0f271e98f5]
# to [c680ef2795b703554c5aa221d5b1e4888d53655b]
#
============================================================
--- packages/linux/linux-2.6.25/at32stk1000/virtualmouse.patch 02f56a6c5ba2e3fcf2eee0a14b900182c3272b07
+++ packages/linux/linux-2.6.25/at32stk1000/virtualmouse.patch 02f56a6c5ba2e3fcf2eee0a14b900182c3272b07
@@ -0,0 +1,125 @@
+Index: linux-2.6.25/drivers/input/Kconfig
+===================================================================
+--- linux-2.6.25.orig/drivers/input/Kconfig 2008-04-17 04:49:44.000000000 +0200
++++ linux-2.6.25/drivers/input/Kconfig 2008-08-21 16:37:40.000000000 +0200
+@@ -69,6 +69,13 @@
+ To compile this driver as a module, choose M here: the
+ module will be called mousedev.
+
++config INPUT_VMS
++ tristate "Virtual Mouse Driver" if EMBEDDED
++ default y
++ ---help---
++ vms.c from the book Essential Linux Device Drivers
++
++
+ config INPUT_MOUSEDEV_PSAUX
+ bool "Provide legacy /dev/psaux device"
+ default y
+Index: linux-2.6.25/drivers/input/Makefile
+===================================================================
+--- linux-2.6.25.orig/drivers/input/Makefile 2008-04-17 04:49:44.000000000 +0200
++++ linux-2.6.25/drivers/input/Makefile 2008-08-21 16:37:40.000000000 +0200
+@@ -11,6 +11,8 @@
+ obj-$(CONFIG_INPUT_POLLDEV) += input-polldev.o
+
+ obj-$(CONFIG_INPUT_MOUSEDEV) += mousedev.o
++
++obj-$(CONFIG_INPUT_VMS) += vms.o
+ obj-$(CONFIG_INPUT_JOYDEV) += joydev.o
+ obj-$(CONFIG_INPUT_EVDEV) += evdev.o
+ obj-$(CONFIG_INPUT_EVBUG) += evbug.o
+Index: linux-2.6.25/drivers/input/vms.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ linux-2.6.25/drivers/input/vms.c 2008-08-21 17:24:05.000000000 +0200
+@@ -0,0 +1,89 @@
++/**
++ * Copyright (c) 2008 by Pearson Education, Inc.
++ *
++ * This material may be distributed only subject to the terms and conditions
++ * set forth in the Open Publication License, v1.0 or later (the latest version
++ * is presently available at http://www.opencontent.org/openpub/).
++ *
++ * Copyright (c) 2008 Leon Woestenberg
++ * Copyright (c) 2008 Sreekrishnan Venkateswaran
++ *
++ * I copied this from Sreekrishnan's book (see http://elinuxdd.com) -- Leon.
++ *
++ */
++
++#include <linux/fs.h>
++#include <asm/uaccess.h>
++#include <linux/input.h>
++#include <linux/platform_device.h>
++
++struct input_dev *vms_input_dev;
++static struct platform_device *vms_dev;
++
++/* for each set of coordinates, we publish them along with a left button
++ * press and release event
++ */
++static ssize_t write_vms(struct device *dev, struct device_attribute *attr,
++ const char *buffer, size_t count)
++{
++ int x, y;
++ sscanf(buffer, "%d%d", &x, &y);
++ input_report_abs(vms_input_dev, ABS_X, x);
++ input_report_abs(vms_input_dev, ABS_Y, y);
++ input_report_key(vms_input_dev, BTN_LEFT, 1);
++ input_sync(vms_input_dev);
++ input_report_key(vms_input_dev, BTN_LEFT, 0);
++ input_sync(vms_input_dev);
++ return count;
++}
++
++DEVICE_ATTR(coordinates, 0644, NULL, write_vms);
++
++static struct attribute *vms_attrs[] = {
++ &dev_attr_coordinates.attr,
++ NULL
++};
++
++static struct attribute_group vms_attr_group = {
++ .attrs = vms_attrs,
++};
++
++static int __init vms_init(void)
++{
++ vms_dev = platform_device_register_simple("vms", -1, NULL, 0);
++ if (IS_ERR(vms_dev)) {
++ PTR_ERR(vms_dev);
++ printk("vms_init: error\n");
++ }
++ sysfs_create_group(&vms_dev->dev.kobj, &vms_attr_group);
++
++ vms_input_dev = input_allocate_device();
++ if (!vms_input_dev) {
++ printk("bad input_allocate_device()\n");
++ }
++
++ set_bit(EV_ABS, vms_input_dev->evbit);
++ set_bit(ABS_X, vms_input_dev->absbit);
++ set_bit(ABS_Y, vms_input_dev->absbit);
++
++ set_bit(EV_KEY, vms_input_dev->evbit);
++ set_bit(BTN_LEFT, vms_input_dev->keybit);
++
++ input_register_device(vms_input_dev);
++ printk("vms initialized\n");
++ return 0;
++}
++
++static int __init vms_exit(void)
++{
++ input_unregister_device(vms_input_dev);
++ sysfs_remove_group(&vms_dev->dev.kobj, &vms_attr_group);
++ platform_device_unregister(vms_dev);
++ return;
++}
++
++module_init(vms_init);
++module_exit(vms_exit);
++
++MODULE_LICENSE("GPL");
++
============================================================
--- packages/linux/linux_2.6.25.bb 17408d418b583626e5de54e9ef049c0f271e98f5
+++ packages/linux/linux_2.6.25.bb c680ef2795b703554c5aa221d5b1e4888d53655b
@@ -1,6 +1,6 @@ require linux.inc
require linux.inc
-PR = "r3"
+PR = "r4"
# Mark archs/machines that this kernel supports
DEFAULT_PREFERENCE = "-1"
@@ -31,6 +31,7 @@ SRC_URI_append_at32stk1000 = " \
SRC_URI_append_at32stk1000 = " \
http://avr32linux.org/twiki/pub/Main/LinuxPatches/linux-2.6.25.6.atmel.1.patch.bz2;patch=1 \
+ file://virtualmouse.patch;patch=1 \
"
SRC_URI_append_at91-l9260 = " \
More information about the Openembedded-commits
mailing list