From ada816f513aca842bb380de403bd3af132a8934e Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman" Date: Wed, 15 Apr 2009 13:42:44 +1000 Subject: sysstat: fix build on omap3 to actually work (gnu_hash problem like ltrace) --- recipes/sysstat/sysstat_8.1.6.bb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/recipes/sysstat/sysstat_8.1.6.bb b/recipes/sysstat/sysstat_8.1.6.bb index 0f394ed259..a734d14f57 100644 --- a/recipes/sysstat/sysstat_8.1.6.bb +++ b/recipes/sysstat/sysstat_8.1.6.bb @@ -2,6 +2,7 @@ DESCRIPTION = "The sysstat utilities are a collection of performance monitoring HOMEPAGE = "http://pagesperso-orange.fr/sebastien.godard/" LICENSE = "GPL" SECTION = "console/utils" +PR = "r1" SRC_URI = "http://pagesperso-orange.fr/sebastien.godard/sysstat-${PV}.tar.gz" @@ -13,3 +14,4 @@ do_configure_prepend() { FILES_${PN} += "${libdir}/sa" +TARGET_CC_ARCH += "${LDFLAGS}" -- cgit v1.2.3 From 6f4ba50ad3c93176978b98d02167145d97f0525c Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Wed, 15 Apr 2009 16:07:07 +1000 Subject: xserver-kdrive-common: fix Xserver script to detect overo and run xorg --- recipes/xserver-kdrive-common/xserver-kdrive-common/Xserver | 2 +- recipes/xserver-kdrive-common/xserver-kdrive-common_0.1.bb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/recipes/xserver-kdrive-common/xserver-kdrive-common/Xserver b/recipes/xserver-kdrive-common/xserver-kdrive-common/Xserver index f6f5943847..584cb0a53c 100644 --- a/recipes/xserver-kdrive-common/xserver-kdrive-common/Xserver +++ b/recipes/xserver-kdrive-common/xserver-kdrive-common/Xserver @@ -155,7 +155,7 @@ case `module_id` in "Freescale MX21ADS") # That's what /proc/cpuinfo shows as hardware on the chumby ARGS="$ARGS -dpi 121 -screen 320x240 -hide-cursor -mouse tslib" ;; - "OMAP3 Beagle Board") + "OMAP3 Beagle Board" | "Gumstix Overo") ARGS="$ARGS ${PPM}" # 32bpp - we'll enable it once newer kernels are.. working. # ARGS="$ARGS -fbbpp32" diff --git a/recipes/xserver-kdrive-common/xserver-kdrive-common_0.1.bb b/recipes/xserver-kdrive-common/xserver-kdrive-common_0.1.bb index 6b585c44e0..abd7191863 100644 --- a/recipes/xserver-kdrive-common/xserver-kdrive-common_0.1.bb +++ b/recipes/xserver-kdrive-common/xserver-kdrive-common_0.1.bb @@ -1,7 +1,7 @@ DESCRIPTION = "Common X11 scripts" LICENSE = "GPL" SECTION = "x11" -PR = "r36" +PR = "r37" SRC_URI = "\ file://Xdefaults \ -- cgit v1.2.3 From 272ae318b03bcd062f8b43258ce54a2cd96b9f45 Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Wed, 15 Apr 2009 09:16:05 +0200 Subject: udev: add 141, needs more work since it only creates static libs and the OE-only kernel match patch needs to get evaluated --- conf/checksums.ini | 8 +++ recipes/udev/udev-141/init | 60 ++++++++++++++++ recipes/udev/udev-141/local.rules | 32 +++++++++ recipes/udev/udev-141/permissions.rules | 119 ++++++++++++++++++++++++++++++++ recipes/udev/udev-141/run.rules | 14 ++++ recipes/udev/udev-141/udev.rules | 116 +++++++++++++++++++++++++++++++ recipes/udev/udev_141.bb | 55 +++++++++++++++ 7 files changed, 404 insertions(+) create mode 100644 recipes/udev/udev-141/init create mode 100644 recipes/udev/udev-141/local.rules create mode 100644 recipes/udev/udev-141/permissions.rules create mode 100644 recipes/udev/udev-141/run.rules create mode 100644 recipes/udev/udev-141/udev.rules create mode 100644 recipes/udev/udev_141.bb diff --git a/conf/checksums.ini b/conf/checksums.ini index 909a0e06cd..6518eb5e7d 100644 --- a/conf/checksums.ini +++ b/conf/checksums.ini @@ -178,6 +178,10 @@ sha256=fe044ec9817a31f2b76f701b2cfd980809676943a901ba3d49200162807fa1f9 md5=82c698151f934eb28c65d1838cee7d9e sha256=d392567cb39b4ea606c0e0acafd8ed72320311b995336ece5fcefcf9b150e9d7 +[http://hal.freedesktop.org/releases/DeviceKit-003.tar.gz] +md5=8b311547f4a2c8c6b6598e3318d66cd7 +sha256=d2d21f995d1a152ca2d8beea6d37f31e48cca034b82ceb7322f39422e849e9cf + [http://search.cpan.org/CPAN/authors/id/G/GA/GAAS/Digest-SHA1-2.11.tar.gz] md5=2449bfe21d6589c96eebf94dae24df6b sha256=3cebe0a6894daee3bfa5d9619fc90e7619cb6a77ac1b04d027341cd6033ae989 @@ -22906,6 +22910,10 @@ sha256=cc9f58ff58fbd3f5868e1f1e368e3c93e1f441afd0ac1dcbd5d01a9ce5b5b0d7 md5=a3fcdcd21b2f33d598f45a68fff892bd sha256=ee3922bd46dbdc406be5d498be5bc062a0b39f05f1c0a1b22c3657eb0e805975 +[http://kernel.org/pub/linux/utils/kernel/hotplug/udev-141.tar.gz] +md5=86382b7bbc64459e714c65a2a4e10916 +sha256=001be4a8963c48e7debc82c6078562d087a2979da63e558a5e3613c03725c377 + [http://udhcp.busybox.net/source/udhcp-0.9.8.tar.gz] md5=2d7e548820d2ded5e183933cb701defb sha256=da0ca1e821e3fa7cfbe73ddb1480b921002ee992f5e5fbc611422c103b907443 diff --git a/recipes/udev/udev-141/init b/recipes/udev/udev-141/init new file mode 100644 index 0000000000..9e11f08989 --- /dev/null +++ b/recipes/udev/udev-141/init @@ -0,0 +1,60 @@ +#!/bin/sh -e + +### BEGIN INIT INFO +# Provides: udev +# Required-Start: mountvirtfs +# Required-Stop: +# Default-Start: S +# Default-Stop: +# Short-Description: Start udevd, populate /dev and load drivers. +### END INIT INFO + +export TZ=/etc/localtime + +[ -d /sys/class ] || exit 1 +[ -r /proc/mounts ] || exit 1 +[ -x /sbin/udevd ] || exit 1 +[ -f /etc/udev/udev.conf ] && . /etc/udev/udev.conf + +kill_udevd() { + if [ -x /sbin/pidof ]; then + pid=`/sbin/pidof -x udevd` + [ -n "$pid" ] && kill $pid + fi +} + +export ACTION=add +# propagate /dev from /sys +echo -n "Starting udev" + +# mount the tmpfs on /dev, if not already done +LANG=C awk "\$2 == \"/dev\" && \$4 == \"tmpfs\" { exit 1 }" /proc/mounts && { + mount -n -o mode=0755 -t tmpfs none "/dev" + mkdir -m 0755 /dev/pts + mkdir -m 0755 /dev/shm +} + +if [ -e /etc/dev.tar ]; then + (cd /; tar xf /etc/dev.tar) + not_first_boot=1 +fi + +# make_extra_nodes +kill_udevd > "/dev/null" 2>&1 + + # trigger the sorted events + echo -e '\000\000\000\000' > /proc/sys/kernel/hotplug + /sbin/udevd -d + + /sbin/udevadm control env STARTUP=1 + if [ "$not_first_boot" != "" ];then + /sbin/udevadm trigger --subsystem-nomatch=tty --subsystem-nomatch=mem --subsystem-nomatch=vc --subsystem-nomatch=vtconsole --subsystem-nomatch=misc --subsystem-nomatch=dcon --subsystem-nomatch=pci_bus --subsystem-nomatch=graphics --subsystem-nomatch=backlight --subsystem-nomatch=video4linux --subsystem-nomatch=platform + (/sbin/udevadm settle --timeout=3; /sbin/udevadm control env STARTUP=)& + else + /sbin/udevadm trigger + /sbin/udevadm settle + (cd /; tar cf /etc/dev.tar dev) + fi + +echo +exit 0 diff --git a/recipes/udev/udev-141/local.rules b/recipes/udev/udev-141/local.rules new file mode 100644 index 0000000000..a4866923fd --- /dev/null +++ b/recipes/udev/udev-141/local.rules @@ -0,0 +1,32 @@ +# There are a number of modifiers that are allowed to be used in some +# of the different fields. They provide the following subsitutions: +# +# %n the "kernel number" of the device. +# For example, 'sda3' has a "kernel number" of '3' +# %e the smallest number for that name which does not matches an existing node +# %k the kernel name for the device +# %M the kernel major number for the device +# %m the kernel minor number for the device +# %b the bus id for the device +# %c the string returned by the PROGRAM +# %s{filename} the content of a sysfs attribute +# %% the '%' char itself +# + +# Media automounting +SUBSYSTEM=="block", ACTION=="add" RUN+="/etc/udev/scripts/mount.sh" +SUBSYSTEM=="block", ACTION=="remove" RUN+="/etc/udev/scripts/mount.sh" + +# Handle network interface setup +SUBSYSTEM=="net", ACTION=="add" RUN+="/etc/udev/scripts/network.sh" +SUBSYSTEM=="net", ACTION=="remove" RUN+="/etc/udev/scripts/network.sh" + +# The first rtc device is symlinked to /dev/rtc +KERNEL=="rtc0", SYMLINK+="rtc" + +# Try and modprobe for drivers for new hardware +ACTION=="add", DEVPATH=="/devices/*", ENV{MODALIAS}=="?*", RUN+="/sbin/modprobe $env{MODALIAS}" + +# Create a symlink to any touchscreen input device +SUBSYSTEM=="input", KERNEL=="event[0-9]*", SYSFS{modalias}=="input:*-e0*,3,*a0,1,*18,*", SYMLINK+="input/touchscreen0" +SUBSYSTEM=="input", KERNEL=="event[0-9]*", SYSFS{modalias}=="ads7846", SYMLINK+="input/touchscreen0" diff --git a/recipes/udev/udev-141/permissions.rules b/recipes/udev/udev-141/permissions.rules new file mode 100644 index 0000000000..940d163047 --- /dev/null +++ b/recipes/udev/udev-141/permissions.rules @@ -0,0 +1,119 @@ +ACTION!="add", GOTO="permissions_end" + +# workarounds needed to synchronize with sysfs +# only needed for kernels < v2.6.18-rc1 +ENV{PHYSDEVPATH}!="?*", ENV{PHYSDEVBUS}=="?*", WAIT_FOR_SYSFS="bus" +SUBSYSTEM=="scsi", KERNEL=="[0-9]*:[0-9]*", WAIT_FOR_SYSFS="ioerr_cnt" +# only needed for kernels < 2.6.16 +SUBSYSTEM=="net", WAIT_FOR_SYSFS="address" +# only needed for kernels < 2.6.17 +SUBSYSTEM=="net", ENV{DRIVER}=="?*", WAIT_FOR_SYSFS="device/driver" + +# devices needed to load the drivers providing them +KERNEL=="tun", OPTIONS+="ignore_remove" +KERNEL=="ppp", OPTIONS+="ignore_remove" +KERNEL=="loop[0-9]*", OPTIONS+="ignore_remove" + +# default permissions for block devices +SUBSYSTEM=="block", GROUP="disk" +# the aacraid driver is broken and reports that disks removable (see #404927) +SUBSYSTEM=="block", ATTRS{removable}=="1", \ + DRIVERS!="aacraid", GROUP="floppy" +# all block devices on these buses are "removable" +SUBSYSTEM=="block", SUBSYSTEMS=="usb|ieee1394|mmc|pcmcia", GROUP="floppy" + +# IDE devices +KERNEL=="hd[a-z]|pcd[0-9]*", DRIVERS=="ide-cdrom|pcd", \ + IMPORT{program}="cdrom_id --export $tempnode" +ENV{ID_CDROM}=="?*", GROUP="cdrom" +KERNEL=="ht[0-9]*", GROUP="tape" +KERNEL=="nht[0-9]*", GROUP="tape" + +# SCSI devices +KERNEL=="sr[0-9]*", IMPORT{program}="cdrom_id --export $tempnode" +SUBSYSTEMS=="scsi", ATTRS{type}=="1", GROUP="tape" +SUBSYSTEMS=="scsi", ATTRS{type}=="4", GROUP="cdrom" +SUBSYSTEMS=="scsi", ATTRS{type}=="5", GROUP="cdrom" +SUBSYSTEMS=="scsi", ATTRS{type}=="8", GROUP="tape" + +# USB devices +KERNEL=="legousbtower*", MODE="0666" +KERNEL=="lp[0-9]*", SUBSYSTEMS=="usb", GROUP="lp" + +# usbfs-like devices +SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", \ + MODE="0664" + +# iRiver music players +SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", GROUP="plugdev", \ + ATTRS{idVendor}=="4102", ATTRS{idProduct}=="10[01][135789]" + +# serial devices +SUBSYSTEM=="tty", GROUP="dialout" +SUBSYSTEM=="capi", GROUP="dialout" +SUBSYSTEM=="slamr", GROUP="dialout" +SUBSYSTEM=="zaptel", GROUP="dialout" + +# vc devices (all members of the tty subsystem) +KERNEL=="ptmx", MODE="0666", GROUP="root" +KERNEL=="console", MODE="0600", GROUP="root" +KERNEL=="tty", MODE="0666", GROUP="root" +KERNEL=="tty[0-9]*", GROUP="root" +KERNEL=="pty*", MODE="0666", GROUP="tty" + +# video devices +SUBSYSTEM=="video4linux", GROUP="video" +SUBSYSTEM=="drm", GROUP="video" +SUBSYSTEM=="dvb", GROUP="video" +SUBSYSTEM=="em8300", GROUP="video" +SUBSYSTEM=="graphics", GROUP="video" +SUBSYSTEM=="nvidia", GROUP="video" + +# misc devices +KERNEL=="random", MODE="0666" +KERNEL=="urandom", MODE="0666" +KERNEL=="mem", MODE="0640", GROUP="kmem" +KERNEL=="kmem", MODE="0640", GROUP="kmem" +KERNEL=="port", MODE="0640", GROUP="kmem" +KERNEL=="full", MODE="0666" +KERNEL=="null", MODE="0666" +KERNEL=="zero", MODE="0666" +KERNEL=="inotify", MODE="0666" +KERNEL=="sgi_fetchop", MODE="0666" +KERNEL=="sonypi", MODE="0666" +KERNEL=="agpgart", GROUP="video" +KERNEL=="rtc|rtc[0-9]*", GROUP="audio" +KERNEL=="kqemu", MODE="0666" +KERNEL=="tun", MODE="0666", + +KERNEL=="cdemu[0-9]*", GROUP="cdrom" +KERNEL=="pktcdvd[0-9]*", GROUP="cdrom" +KERNEL=="pktcdvd", MODE="0644" + +# printers and parallel devices +SUBSYSTEM=="printer", GROUP="lp" +SUBSYSTEM=="ppdev", GROUP="lp" +KERNEL=="irlpt*", GROUP="lp" +KERNEL=="pt[0-9]*", GROUP="tape" +KERNEL=="pht[0-9]*", GROUP="tape" + +# sound devices +SUBSYSTEM=="sound", GROUP="audio" + +# ieee1394 devices +KERNEL=="raw1394", GROUP="disk" +KERNEL=="dv1394*", GROUP="video" +KERNEL=="video1394*", GROUP="video" + +# input devices +KERNEL=="event[0-9]*", ATTRS{name}=="*dvb*|*DVB*|* IR *" \ + MODE="0664", GROUP="video" +KERNEL=="js[0-9]*", MODE="0664" +KERNEL=="lirc[0-9]*", GROUP="video" + +# AOE character devices +SUBSYSTEM=="aoe", MODE="0220", GROUP="disk" +SUBSYSTEM=="aoe", KERNEL=="err", MODE="0440" + +LABEL="permissions_end" + diff --git a/recipes/udev/udev-141/run.rules b/recipes/udev/udev-141/run.rules new file mode 100644 index 0000000000..75d71375bb --- /dev/null +++ b/recipes/udev/udev-141/run.rules @@ -0,0 +1,14 @@ +# debugging monitor +RUN+="socket:/org/kernel/udev/monitor" + +# run a command on remove events +ACTION=="remove", ENV{REMOVE_CMD}!="", RUN+="$env{REMOVE_CMD}" + +# ignore the events generated by virtual consoles +KERNEL=="ptmx", OPTIONS+="last_rule" +KERNEL=="console", OPTIONS+="last_rule" +KERNEL=="tty" , OPTIONS+="last_rule" +KERNEL=="tty[0-9]*", OPTIONS+="last_rule" +KERNEL=="pty*", OPTIONS+="last_rule" +SUBSYSTEM=="vc", OPTIONS+="last_rule" + diff --git a/recipes/udev/udev-141/udev.rules b/recipes/udev/udev-141/udev.rules new file mode 100644 index 0000000000..a19d4a0bf6 --- /dev/null +++ b/recipes/udev/udev-141/udev.rules @@ -0,0 +1,116 @@ +# There are a number of modifiers that are allowed to be used in some +# of the different fields. They provide the following subsitutions: +# +# %n the "kernel number" of the device. +# For example, 'sda3' has a "kernel number" of '3' +# %e the smallest number for that name which does not matches an existing node +# %k the kernel name for the device +# %M the kernel major number for the device +# %m the kernel minor number for the device +# %b the bus id for the device +# %c the string returned by the PROGRAM +# %s{filename} the content of a sysfs attribute +# %% the '%' char itself +# + +# workaround for devices which do not report media changes +SUBSYSTEMS=="ide", KERNEL=="hd[a-z]", ATTR{removable}=="1", \ + ENV{ID_MODEL}=="IOMEGA_ZIP*", NAME="%k", OPTIONS+="all_partitions" +SUBSYSTEMS=="ide", KERNEL=="hd[a-z]", ATTRS{media}=="floppy", \ + OPTIONS+="all_partitions" + +# SCSI devices +SUBSYSTEMS=="scsi", KERNEL=="sr[0-9]*", NAME="scd%n", SYMLINK+="sr%n" + +# USB devices +SUBSYSTEMS=="usb", KERNEL=="auer[0-9]*", NAME="usb/%k" +SUBSYSTEMS=="usb", KERNEL=="cpad[0-9]*", NAME="usb/%k" +SUBSYSTEMS=="usb", KERNEL=="dabusb*", NAME="usb/%k" +SUBSYSTEMS=="usb", KERNEL=="hiddev*", NAME="usb/%k" +SUBSYSTEMS=="usb", KERNEL=="legousbtower*", NAME="usb/%k" +SUBSYSTEMS=="usb", KERNEL=="lp[0-9]*", NAME="usb/%k" +SUBSYSTEMS=="usb", KERNEL=="ttyUSB*", \ + ATTRS{product}=="Palm Handheld*|Handspring Visor|palmOne Handheld", \ + SYMLINK+="pilot" + +# usbfs-like devices +SUBSYSTEM=="usb_device", PROGRAM="/bin/sh -c 'K=%k; K=$${K#usbdev}; printf bus/usb/%%03i/%%03i $${K%%%%.*} $${K#*.}'", ACTION=="add", \ + NAME="%c" +SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", NAME="bus/usb/$env{BUSNUM}/$env{DEVNUM}" + +# serial devices +KERNEL=="capi", NAME="capi20", SYMLINK+="isdn/capi20" +KERNEL=="capi[0-9]*", NAME="capi/%n" + +# video devices +KERNEL=="dvb*", PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/adapter%%i/%%s $${K%%%%.*} $${K#*.}", ACTION=="add", \ + NAME="%c" +KERNEL=="card[0-9]*", NAME="dri/%k" + +# misc devices +KERNEL=="hw_random", NAME="hwrng" +KERNEL=="tun", NAME="net/%k" +KERNEL=="evtchn", NAME="xen/%k" + +KERNEL=="cdemu[0-9]*", NAME="cdemu/%n" +KERNEL=="pktcdvd[0-9]*", NAME="pktcdvd/%n" +KERNEL=="pktcdvd", NAME="pktcdvd/control" + +KERNEL=="cpu[0-9]*", NAME="cpu/%n/cpuid" +KERNEL=="msr[0-9]*", NAME="cpu/%n/msr" +KERNEL=="microcode", NAME="cpu/microcode" + +KERNEL=="umad*", NAME="infiniband/%k" +KERNEL=="issm*", NAME="infiniband/%k" +KERNEL=="uverbs*", NAME="infiniband/%k" +KERNEL=="ucm*", NAME="infiniband/%k" +KERNEL=="rdma_ucm", NAME="infiniband/%k" + +# ALSA devices +KERNEL=="controlC[0-9]*", NAME="snd/%k" +KERNEL=="hwC[D0-9]*", NAME="snd/%k" +KERNEL=="pcmC[D0-9cp]*", NAME="snd/%k" +KERNEL=="midiC[D0-9]*", NAME="snd/%k" +KERNEL=="timer", NAME="snd/%k" +KERNEL=="seq", NAME="snd/%k" + +# ieee1394 devices +KERNEL=="dv1394*", NAME="dv1394/%n" +KERNEL=="video1394*", NAME="video1394/%n" + +# input devices +KERNEL=="mice", NAME="input/%k" +KERNEL=="mouse[0-9]*", NAME="input/%k" +KERNEL=="event[0-9]*", NAME="input/%k" +KERNEL=="js[0-9]*", NAME="input/%k" +KERNEL=="ts[0-9]*", NAME="input/%k" +KERNEL=="uinput", NAME="input/%k" + +# Zaptel +KERNEL=="zapctl", NAME="zap/ctl" +KERNEL=="zaptimer", NAME="zap/timer" +KERNEL=="zapchannel", NAME="zap/channel" +KERNEL=="zappseudo", NAME="zap/pseudo" +KERNEL=="zap[0-9]*", NAME="zap/%n" + +# AOE character devices +SUBSYSTEM=="aoe", KERNEL=="discover", NAME="etherd/%k" +SUBSYSTEM=="aoe", KERNEL=="err", NAME="etherd/%k" +SUBSYSTEM=="aoe", KERNEL=="interfaces", NAME="etherd/%k" +SUBSYSTEM=="aoe", KERNEL=="revalidate", NAME="etherd/%k" + +# device mapper creates its own device nodes, so ignore these +KERNEL=="dm-[0-9]*", OPTIONS+="ignore_device" +KERNEL=="device-mapper", NAME="mapper/control" + +KERNEL=="rfcomm[0-9]*", NAME="%k", GROUP="users", MODE="0660" + +# Firmware Helper +ACTION=="add", SUBSYSTEM=="firmware", RUN+="/lib/udev/firmware.sh" + +# Samsung UARTS +KERNEL=="s3c2410_serial[0-9]", NAME="ttySAC%n" + +# MXC UARTs +KERNEL=="ttymxc[0-4]", NAME="ttymxc%n" + diff --git a/recipes/udev/udev_141.bb b/recipes/udev/udev_141.bb new file mode 100644 index 0000000000..a11c13d563 --- /dev/null +++ b/recipes/udev/udev_141.bb @@ -0,0 +1,55 @@ +DESCRIPTION = "udev is a daemon which dynamically creates and removes device nodes from \ +/dev/, handles hotplug events and loads drivers at boot time. It replaces \ +the hotplug package and requires a kernel not older than 2.6.12." +RPROVIDES_${PN} = "hotplug" + +# Untested, fails to creat shared libs +DEFAULT_PREFERENCE = "-1" + +SRC_URI = "http://kernel.org/pub/linux/utils/kernel/hotplug/udev-${PV}.tar.gz \ + file://mount.blacklist \ + file://run.rules \ + " + +SRC_URI_append_h2200 = " file://50-hostap_cs.rules " +PACKAGE_ARCH_h2200 = "h2200" + +require udev.inc + +INITSCRIPT_PARAMS = "start 03 S ." + +FILES_${PN} += "${base_libdir}/udev/*" +FILES_${PN}-dbg += "${base_libdir}/udev/.debug" +UDEV_EXTRAS = "extras/firmware/ extras/scsi_id/ extras/volume_id/" +EXTRA_OEMAKE += "libudevdir=/lib/udev libdir=${base_libdir} prefix=" + +do_install () { + install -d ${D}${usrsbindir} \ + ${D}${sbindir} + oe_runmake 'DESTDIR=${D}' INSTALL=install install + install -d ${D}${sysconfdir}/init.d + install -m 0755 ${WORKDIR}/init ${D}${sysconfdir}/init.d/udev + + install -d ${D}${sysconfdir}/udev/rules.d/ + + install -m 0644 ${WORKDIR}/mount.blacklist ${D}${sysconfdir}/udev/ + install -m 0644 ${WORKDIR}/local.rules ${D}${sysconfdir}/udev/rules.d/local.rules + install -m 0644 ${WORKDIR}/permissions.rules ${D}${sysconfdir}/udev/rules.d/permissions.rules + install -m 0644 ${WORKDIR}/run.rules ${D}${sysconfdir}/udev/rules.d/run.rules + install -m 0644 ${WORKDIR}/udev.rules ${D}${sysconfdir}/udev/rules.d/udev.rules + install -m 0644 ${WORKDIR}/links.conf ${D}${sysconfdir}/udev/links.conf + if [ "${UDEV_DEVFS_RULES}" = "1" ]; then + install -m 0644 ${WORKDIR}/devfs-udev.rules ${D}${sysconfdir}/udev/rules.d/devfs-udev.rules + fi + + install -d ${D}${sysconfdir}/udev/scripts/ + + install -m 0755 ${WORKDIR}/mount.sh ${D}${sysconfdir}/udev/scripts/mount.sh + install -m 0755 ${WORKDIR}/network.sh ${D}${sysconfdir}/udev/scripts + + install -d ${D}${base_libdir}/udev/ +} + +do_install_append_h2200() { + install -m 0644 ${WORKDIR}/50-hostap_cs.rules ${D}${sysconfdir}/udev/rules.d/50-hostap_cs.rules +} -- cgit v1.2.3 From 1705a068b09d5bb8fec42ae84cb9990d36f31720 Mon Sep 17 00:00:00 2001 From: Koen Kooi Date: Wed, 15 Apr 2009 10:49:01 +0200 Subject: haserl: update to 0.9.25 --- conf/checksums.ini | 4 ++++ recipes/haserl/haserl_0.9.25.bb | 9 +++++++++ 2 files changed, 13 insertions(+) create mode 100644 recipes/haserl/haserl_0.9.25.bb diff --git a/conf/checksums.ini b/conf/checksums.ini index 6518eb5e7d..5343d6c30d 100644 --- a/conf/checksums.ini +++ b/conf/checksums.ini @@ -10002,6 +10002,10 @@ sha256=bbe44edc3d519028761a22b282b912ab8f43db2003c6791c295c4a52f5db48bf md5=31d1f505afe3ba1b351e18612aa57a70 sha256=bbe44edc3d519028761a22b282b912ab8f43db2003c6791c295c4a52f5db48bf +[http://downloads.sourceforge.net/haserl/haserl-0.9.25.tar.gz] +md5=906c634a2af4ac3a4b656ef4e244c4cd +sha256=d33ba27082c8bc4427ccebd8a56cf9aef190391f0361398197efb03210910f0e + [http://www.server-side.de/download/havp-0.82.tar.gz] md5=9e6a16b7d074782d1c62f1f7316e56ab sha256=e2db8d3383cd8eca6a18ebee85875de895f3ac7414eab091a87f052d79a87b09 diff --git a/recipes/haserl/haserl_0.9.25.bb b/recipes/haserl/haserl_0.9.25.bb new file mode 100644 index 0000000000..d1a06007c0 --- /dev/null +++ b/recipes/haserl/haserl_0.9.25.bb @@ -0,0 +1,9 @@ +# Copyright (C) 2007-2008, Stelios Koroneos - Digital OPSiS, All Rights Reserved +# Released under the MIT license (see packages/COPYING) +DESCRIPTION = "A cgi wrapper for embedding shell scripts into html documents" +SECTION = "console/network" +LICENSE = "GPL" + +SRC_URI = "${SOURCEFORGE_MIRROR}/${PN}/${PN}-${PV}.tar.gz" + +inherit autotools gettext -- cgit v1.2.3 From f374f6e0e6ef2cf5731b38b58d463f555fb0f5c8 Mon Sep 17 00:00:00 2001 From: Dirk Opfer Date: Tue, 14 Apr 2009 21:27:28 +0200 Subject: uclibc: use LDFLAGS for ldd and ldconfig (fixes QA error) --- recipes/uclibc/uclibc.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/uclibc/uclibc.inc b/recipes/uclibc/uclibc.inc index be085ab513..f2f3e9b605 100644 --- a/recipes/uclibc/uclibc.inc +++ b/recipes/uclibc/uclibc.inc @@ -208,7 +208,7 @@ do_install() { rmdir ${D}/usr/bin fi - oe_runmake utils + oe_runmake "SSP_ALL_CFLAGS=${TARGET_LINK_HASH_STYLE}" utils oe_runmake STRIPTOOL=true PREFIX=${D} DEVEL_PREFIX=${prefix}/ RUNTIME_PREFIX=/ \ install_utils -- cgit v1.2.3 From df32f8c84d0e7a5fbe51b66ac8d991003bf0f8a0 Mon Sep 17 00:00:00 2001 From: Florian Boor Date: Tue, 14 Apr 2009 17:01:39 +0200 Subject: initramfs-image: Make sure static busybox gets into the initfs image. --- recipes/images/initramfs-image.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/recipes/images/initramfs-image.bb b/recipes/images/initramfs-image.bb index d3d1d751cf..e5189849ba 100644 --- a/recipes/images/initramfs-image.bb +++ b/recipes/images/initramfs-image.bb @@ -2,7 +2,7 @@ # command line, from teh choices of block device, loop back images (including # recursive) and NFS. -IMAGE_INSTALL = "initramfs-module-block initramfs-module-loop initramfs-module-nfs" +IMAGE_INSTALL = "busybox-static initramfs-module-block initramfs-module-loop initramfs-module-nfs" IMAGE_LINGUAS = "" # Remove any kernel-image that the kernel-module-* packages may have pulled in. -- cgit v1.2.3 From 99fc9b7e925353cd03fde3847416379815436dd1 Mon Sep 17 00:00:00 2001 From: Florian Boor Date: Wed, 15 Apr 2009 11:46:49 +0200 Subject: micro2440.conf: New device: FriendlyARM micro2440 --- conf/machine/micro2440.conf | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 conf/machine/micro2440.conf diff --git a/conf/machine/micro2440.conf b/conf/machine/micro2440.conf new file mode 100644 index 0000000000..17aa0d310a --- /dev/null +++ b/conf/machine/micro2440.conf @@ -0,0 +1,19 @@ +#@TYPE: Machine +#@Name: FriendlyARM micro2440 +#@DESCRIPTION: Machine configuration for FriendlyARM micro2440 Samsung 2440 based board + +TARGET_ARCH = "arm" + +PREFERRED_PROVIDER_virtual/kernel = "linux" + +# used by sysvinit_2 +SERIAL_CONSOLE = "115200 ttySAC0" + +IMAGE_FSTYPES = "jffs2 tar.gz" + +MACHINE_FEATURES = "kernel26 touchscreen screen usbhost usbgadget sound alsa ethernet" + +require conf/machine/include/tune-arm920t.inc + +KERNEL_IMAGETYPE = "uImage" +EXTRA_IMAGECMD_jffs2 = "--pad --little-endian -e16KiB -s 0x200 -n" -- cgit v1.2.3 From 0328f2d7844b000c71650a14d8479fcf98b1a58e Mon Sep 17 00:00:00 2001 From: Florian Boor Date: Wed, 15 Apr 2009 11:49:06 +0200 Subject: linux: initial micro2440 support for 2.6.29 using mini2440 kernel patches. --- ...rted-the-s3c2410-touchscreen-from-openmok.patch | 792 ++ ...Backported-openmoko-s-touchscreen-filters.patch | 1260 ++ .../micro2440/0003-VENDOR-armworks-logo.patch | 12079 +++++++++++++++++++ .../0004-920T-Use-specific-920t-mtune.patch | 28 + ...mp-fix-for-the-40-relocation-binutils-pro.patch | 49 + ...the-machine-code-to-get-the-BBT-table-fro.patch | 49 + .../0007-MINI2440-Add-machine-support.patch | 793 ++ ...I2440-Delays-command-check-response-on-SD.patch | 30 + .../0009-MINI2440-Rename-the-SoC-tty-names.patch | 35 + ...INI2440-creates-a-mini2440_defconfig-file.patch | 2067 ++++ .../0011-MINI2440-Add-touchscreen-support.patch | 192 + ...2-GRO-Disable-GRO-on-legacy-netif_rx-path.patch | 54 + recipes/linux/linux-2.6.29/micro2440/defconfig | 2053 ++++ recipes/linux/linux_2.6.29.bb | 16 + 14 files changed, 19497 insertions(+) create mode 100644 recipes/linux/linux-2.6.29/micro2440/0001-S3C-Backported-the-s3c2410-touchscreen-from-openmok.patch create mode 100644 recipes/linux/linux-2.6.29/micro2440/0002-S3C-Backported-openmoko-s-touchscreen-filters.patch create mode 100644 recipes/linux/linux-2.6.29/micro2440/0003-VENDOR-armworks-logo.patch create mode 100644 recipes/linux/linux-2.6.29/micro2440/0004-920T-Use-specific-920t-mtune.patch create mode 100644 recipes/linux/linux-2.6.29/micro2440/0005-920T-Temp-fix-for-the-40-relocation-binutils-pro.patch create mode 100644 recipes/linux/linux-2.6.29/micro2440/0006-S3C-Allow-the-machine-code-to-get-the-BBT-table-fro.patch create mode 100644 recipes/linux/linux-2.6.29/micro2440/0007-MINI2440-Add-machine-support.patch create mode 100644 recipes/linux/linux-2.6.29/micro2440/0008-MINI2440-Delays-command-check-response-on-SD.patch create mode 100644 recipes/linux/linux-2.6.29/micro2440/0009-MINI2440-Rename-the-SoC-tty-names.patch create mode 100644 recipes/linux/linux-2.6.29/micro2440/0010-MINI2440-creates-a-mini2440_defconfig-file.patch create mode 100644 recipes/linux/linux-2.6.29/micro2440/0011-MINI2440-Add-touchscreen-support.patch create mode 100644 recipes/linux/linux-2.6.29/micro2440/0012-GRO-Disable-GRO-on-legacy-netif_rx-path.patch create mode 100644 recipes/linux/linux-2.6.29/micro2440/defconfig diff --git a/recipes/linux/linux-2.6.29/micro2440/0001-S3C-Backported-the-s3c2410-touchscreen-from-openmok.patch b/recipes/linux/linux-2.6.29/micro2440/0001-S3C-Backported-the-s3c2410-touchscreen-from-openmok.patch new file mode 100644 index 0000000000..4e3b3001f8 --- /dev/null +++ b/recipes/linux/linux-2.6.29/micro2440/0001-S3C-Backported-the-s3c2410-touchscreen-from-openmok.patch @@ -0,0 +1,792 @@ +From d13aef4d7aff3b01ea349a07b899debe094bf33e Mon Sep 17 00:00:00 2001 +From: Michel Pollet +Date: Fri, 13 Mar 2009 18:43:43 +0000 +Subject: [PATCH] S3C: Backported the s3c2410 touchscreen from openmoko + +This peripheral is pretty essential for the s3c and is missing +from mainstream linux. This is a straight port of the moko +kernel. +--- + arch/arm/mach-s3c2410/include/mach/ts.h | 35 ++ + arch/arm/plat-s3c/include/plat/devs.h | 3 +- + arch/arm/plat-s3c24xx/devs.c | 19 + + arch/arm/plat-s3c24xx/s3c244x.c | 3 + + drivers/input/touchscreen/Kconfig | 18 + + drivers/input/touchscreen/Makefile | 1 + + drivers/input/touchscreen/s3c2410_ts.c | 609 +++++++++++++++++++++++++++++++ + 7 files changed, 687 insertions(+), 1 deletions(-) + create mode 100644 arch/arm/mach-s3c2410/include/mach/ts.h + create mode 100644 drivers/input/touchscreen/s3c2410_ts.c + +diff --git a/arch/arm/mach-s3c2410/include/mach/ts.h b/arch/arm/mach-s3c2410/include/mach/ts.h +new file mode 100644 +index 0000000..1b451ea +--- /dev/null ++++ b/arch/arm/mach-s3c2410/include/mach/ts.h +@@ -0,0 +1,35 @@ ++/* arch/arm/mach-s3c2410/include/mach/ts.h ++ * ++ * Copyright (c) 2005 Arnaud Patard ++ * ++ * ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License version 2 as ++ * published by the Free Software Foundation. ++ * ++ * ++ * Changelog: ++ * 24-Mar-2005 RTP Created file ++ * 03-Aug-2005 RTP Renamed to ts.h ++ */ ++ ++#ifndef __ASM_ARM_TS_H ++#define __ASM_ARM_TS_H ++ ++#include <../drivers/input/touchscreen/ts_filter.h> ++ ++struct s3c2410_ts_mach_info { ++ int delay; ++ int presc; ++ /* array of pointers to filter APIs we want to use, in order ++ * ends on first NULL, all NULL is OK ++ */ ++ struct ts_filter_api *filter_sequence[MAX_TS_FILTER_CHAIN]; ++ /* array of configuration ints, one for each filter above */ ++ void *filter_config[MAX_TS_FILTER_CHAIN]; ++}; ++ ++void set_s3c2410ts_info(struct s3c2410_ts_mach_info *hard_s3c2410ts_info); ++ ++#endif /* __ASM_ARM_TS_H */ ++ +diff --git a/arch/arm/plat-s3c/include/plat/devs.h b/arch/arm/plat-s3c/include/plat/devs.h +index 6b1b523..cf160ab 100644 +--- a/arch/arm/plat-s3c/include/plat/devs.h ++++ b/arch/arm/plat-s3c/include/plat/devs.h +@@ -45,10 +45,11 @@ extern struct platform_device s3c_device_nand; + + extern struct platform_device s3c_device_usbgadget; + ++extern struct platform_device s3c_device_ts; ++ + /* s3c2440 specific devices */ + + #ifdef CONFIG_CPU_S3C2440 + + extern struct platform_device s3c_device_camif; +- + #endif +diff --git a/arch/arm/plat-s3c24xx/devs.c b/arch/arm/plat-s3c24xx/devs.c +index 16ac01d..a3f8102 100644 +--- a/arch/arm/plat-s3c24xx/devs.c ++++ b/arch/arm/plat-s3c24xx/devs.c +@@ -26,6 +26,8 @@ + #include + #include + #include ++#include ++#include + #include + + #include +@@ -229,6 +231,23 @@ struct platform_device s3c_device_nand = { + + EXPORT_SYMBOL(s3c_device_nand); + ++/* Touchscreen */ ++struct platform_device s3c_device_ts = { ++ .name = "s3c2410-ts", ++ .id = -1, ++}; ++ ++EXPORT_SYMBOL(s3c_device_ts); ++ ++static struct s3c2410_ts_mach_info s3c2410ts_info; ++ ++void set_s3c2410ts_info(struct s3c2410_ts_mach_info *hard_s3c2410ts_info) ++{ ++ memcpy(&s3c2410ts_info,hard_s3c2410ts_info,sizeof(struct s3c2410_ts_mach_info)); ++ s3c_device_ts.dev.platform_data = &s3c2410ts_info; ++} ++EXPORT_SYMBOL(set_s3c2410ts_info); ++ + /* USB Device (Gadget)*/ + + static struct resource s3c_usbgadget_resource[] = { +diff --git a/arch/arm/plat-s3c24xx/s3c244x.c b/arch/arm/plat-s3c24xx/s3c244x.c +index c1de6bb..df78a15 100644 +--- a/arch/arm/plat-s3c24xx/s3c244x.c ++++ b/arch/arm/plat-s3c24xx/s3c244x.c +@@ -59,6 +59,8 @@ void __init s3c244x_init_uarts(struct s3c2410_uartcfg *cfg, int no) + s3c24xx_init_uartdevs("s3c2440-uart", s3c2410_uart_resources, cfg, no); + } + ++extern struct platform_device s3c_device_ts; ++ + void __init s3c244x_map_io(void) + { + /* register our io-tables */ +@@ -70,6 +72,7 @@ void __init s3c244x_map_io(void) + s3c_device_sdi.name = "s3c2440-sdi"; + s3c_device_i2c0.name = "s3c2440-i2c"; + s3c_device_nand.name = "s3c2440-nand"; ++ s3c_device_ts.name = "s3c2440-ts"; + s3c_device_usbgadget.name = "s3c2440-usbgadget"; + } + +diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig +index bb6486a..9076492 100644 +--- a/drivers/input/touchscreen/Kconfig ++++ b/drivers/input/touchscreen/Kconfig +@@ -79,6 +79,24 @@ config TOUCHSCREEN_FUJITSU + To compile this driver as a module, choose M here: the + module will be called fujitsu-ts. + ++config TOUCHSCREEN_S3C2410 ++ tristate "Samsung S3C2410 touchscreen input driver" ++ depends on ARCH_S3C2410 && INPUT && INPUT_TOUCHSCREEN ++ select SERIO ++ help ++ Say Y here if you have the s3c2410 touchscreen. ++ ++ If unsure, say N. ++ ++ To compile this driver as a module, choose M here: the ++ module will be called s3c2410_ts. ++ ++config TOUCHSCREEN_S3C2410_DEBUG ++ boolean "Samsung S3C2410 touchscreen debug messages" ++ depends on TOUCHSCREEN_S3C2410 ++ help ++ Select this if you want debug messages ++ + config TOUCHSCREEN_GUNZE + tristate "Gunze AHL-51S touchscreen" + select SERIO +diff --git a/drivers/input/touchscreen/Makefile b/drivers/input/touchscreen/Makefile +index d3375af..fbcde99 100644 +--- a/drivers/input/touchscreen/Makefile ++++ b/drivers/input/touchscreen/Makefile +@@ -34,3 +34,4 @@ wm97xx-ts-$(CONFIG_TOUCHSCREEN_WM9705) += wm9705.o + wm97xx-ts-$(CONFIG_TOUCHSCREEN_WM9712) += wm9712.o + wm97xx-ts-$(CONFIG_TOUCHSCREEN_WM9713) += wm9713.o + obj-$(CONFIG_TOUCHSCREEN_WM97XX_MAINSTONE) += mainstone-wm97xx.o ++obj-$(CONFIG_TOUCHSCREEN_S3C2410) += s3c2410_ts.o +diff --git a/drivers/input/touchscreen/s3c2410_ts.c b/drivers/input/touchscreen/s3c2410_ts.c +new file mode 100644 +index 0000000..ea0777c +--- /dev/null ++++ b/drivers/input/touchscreen/s3c2410_ts.c +@@ -0,0 +1,609 @@ ++/* ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ * ++ * Copyright (c) 2004 Arnaud Patard ++ * iPAQ H1940 touchscreen support ++ * ++ * ChangeLog ++ * ++ * 2004-09-05: Herbert Pƶtzl ++ * - added clock (de-)allocation code ++ * ++ * 2005-03-06: Arnaud Patard ++ * - h1940_ -> s3c2410 (this driver is now also used on the n30 ++ * machines :P) ++ * - Debug messages are now enabled with the config option ++ * TOUCHSCREEN_S3C2410_DEBUG ++ * - Changed the way the value are read ++ * - Input subsystem should now work ++ * - Use ioremap and readl/writel ++ * ++ * 2005-03-23: Arnaud Patard ++ * - Make use of some undocumented features of the touchscreen ++ * controller ++ * ++ * 2007-05-23: Harald Welte ++ * - Add proper support for S32440 ++ * ++ * 2008-06-23: Andy Green ++ * - removed averaging system ++ * - added generic Touchscreen filter stuff ++ * ++ * 2008-11-27: Nelson Castillo ++ * - improve interrupt handling ++ */ ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#include ++#include ++ ++#include ++ ++#include "ts_filter.h" ++ ++/* For ts.dev.id.version */ ++#define S3C2410TSVERSION 0x0101 ++ ++#define TSC_SLEEP (S3C2410_ADCTSC_PULL_UP_DISABLE | S3C2410_ADCTSC_XY_PST(0)) ++ ++#define WAIT4INT(x) (((x)<<8) | \ ++ S3C2410_ADCTSC_YM_SEN | \ ++ S3C2410_ADCTSC_YP_SEN | \ ++ S3C2410_ADCTSC_XP_SEN | \ ++ S3C2410_ADCTSC_XY_PST(3)) ++ ++#define AUTOPST (S3C2410_ADCTSC_YM_SEN | \ ++ S3C2410_ADCTSC_YP_SEN | \ ++ S3C2410_ADCTSC_XP_SEN | \ ++ S3C2410_ADCTSC_AUTO_PST | \ ++ S3C2410_ADCTSC_XY_PST(0)) ++ ++#define DEBUG_LVL KERN_DEBUG ++ ++MODULE_AUTHOR("Arnaud Patard "); ++MODULE_DESCRIPTION("s3c2410 touchscreen driver"); ++MODULE_LICENSE("GPL"); ++ ++/* ++ * Definitions & global arrays. ++ */ ++ ++static char *s3c2410ts_name = "s3c2410 TouchScreen"; ++ ++#define TS_RELEASE_TIMEOUT (HZ >> 7 ? HZ >> 7 : 1) /* 8ms (5ms if HZ is 200) */ ++#define TS_EVENT_FIFO_SIZE (2 << 6) /* must be a power of 2 */ ++ ++#define TS_STATE_STANDBY 0 /* initial state */ ++#define TS_STATE_PRESSED 1 ++#define TS_STATE_RELEASE_PENDING 2 ++#define TS_STATE_RELEASE 3 ++ ++/* ++ * Per-touchscreen data. ++ */ ++ ++struct s3c2410ts { ++ struct input_dev *dev; ++ struct ts_filter *tsf[MAX_TS_FILTER_CHAIN]; ++ int coords[2]; /* just X and Y for us */ ++ int is_down; ++ int state; ++ struct kfifo *event_fifo; ++}; ++ ++static struct s3c2410ts ts; ++ ++static void __iomem *base_addr; ++ ++/* ++ * A few low level functions. ++ */ ++ ++static inline void s3c2410_ts_connect(void) ++{ ++ s3c2410_gpio_cfgpin(S3C2410_GPG12, S3C2410_GPG12_XMON); ++ s3c2410_gpio_cfgpin(S3C2410_GPG13, S3C2410_GPG13_nXPON); ++ s3c2410_gpio_cfgpin(S3C2410_GPG14, S3C2410_GPG14_YMON); ++ s3c2410_gpio_cfgpin(S3C2410_GPG15, S3C2410_GPG15_nYPON); ++} ++ ++static void s3c2410_ts_start_adc_conversion(void) ++{ ++ writel(S3C2410_ADCTSC_PULL_UP_DISABLE | AUTOPST, ++ base_addr + S3C2410_ADCTSC); ++ writel(readl(base_addr + S3C2410_ADCCON) | S3C2410_ADCCON_ENABLE_START, ++ base_addr + S3C2410_ADCCON); ++} ++ ++/* ++ * Just send the input events. ++ */ ++ ++enum ts_input_event {IE_DOWN = 0, IE_UP}; ++ ++static void ts_input_report(int event, int coords[]) ++{ ++#ifdef CONFIG_TOUCHSCREEN_S3C2410_DEBUG ++ static char *s[] = {"down", "up"}; ++ struct timeval tv; ++ ++ do_gettimeofday(&tv); ++#endif ++ ++ if (event == IE_DOWN) { ++ input_report_abs(ts.dev, ABS_X, coords[0]); ++ input_report_abs(ts.dev, ABS_Y, coords[1]); ++ input_report_key(ts.dev, BTN_TOUCH, 1); ++ input_report_abs(ts.dev, ABS_PRESSURE, 1); ++ ++#ifdef CONFIG_TOUCHSCREEN_S3C2410_DEBUG ++ printk(DEBUG_LVL "T:%06d %6s (X:%03d, Y:%03d)\n", ++ (int)tv.tv_usec, s[event], coords[0], coords[1]); ++#endif ++ } else { ++ input_report_key(ts.dev, BTN_TOUCH, 0); ++ input_report_abs(ts.dev, ABS_PRESSURE, 0); ++ ++#ifdef CONFIG_TOUCHSCREEN_S3C2410_DEBUG ++ printk(DEBUG_LVL "T:%06d %6s\n", ++ (int)tv.tv_usec, s[event]); ++#endif ++ } ++ ++ input_sync(ts.dev); ++} ++ ++/* ++ * Manage the state of the touchscreen. ++ */ ++ ++static void event_send_timer_f(unsigned long data); ++ ++static struct timer_list event_send_timer = ++ TIMER_INITIALIZER(event_send_timer_f, 0, 0); ++ ++static void event_send_timer_f(unsigned long data) ++{ ++ static int noop_counter; ++ int event_type; ++ ++ while (__kfifo_get(ts.event_fifo, (unsigned char *)&event_type, ++ sizeof(int))) { ++ int buf[2]; ++ ++ switch (event_type) { ++ case 'D': ++ if (ts.state == TS_STATE_RELEASE_PENDING) ++ /* Ignore short UP event */ ++ ts.state = TS_STATE_PRESSED; ++ break; ++ ++ case 'U': ++ ts.state = TS_STATE_RELEASE_PENDING; ++ break; ++ ++ case 'P': ++ if (ts.is_down) /* stylus_action needs a conversion */ ++ s3c2410_ts_start_adc_conversion(); ++ ++ if (unlikely(__kfifo_get(ts.event_fifo, ++ (unsigned char *)buf, ++ sizeof(int) * 2) ++ != sizeof(int) * 2)) ++ goto ts_exit_error; ++ ++ ts_input_report(IE_DOWN, buf); ++ ts.state = TS_STATE_PRESSED; ++ break; ++ ++ default: ++ goto ts_exit_error; ++ } ++ ++ noop_counter = 0; ++ } ++ ++ if (noop_counter++ >= 1) { ++ noop_counter = 0; ++ if (ts.state == TS_STATE_RELEASE_PENDING) { ++ /* We delay the UP event for a ++ * while to avoid jitter. If we get a DOWN ++ * event we do not send it. */ ++ ++ ts_input_report(IE_UP, NULL); ++ ts.state = TS_STATE_STANDBY; ++ ++ if (ts.tsf[0]) ++ (ts.tsf[0]->api->clear)(ts.tsf[0]); ++ } ++ } else { ++ mod_timer(&event_send_timer, jiffies + TS_RELEASE_TIMEOUT); ++ } ++ ++ return; ++ ++ts_exit_error: /* should not happen unless we have a bug */ ++ printk(KERN_ERR __FILE__ ": event_send_timer_f failed\n"); ++} ++ ++/* ++ * Manage interrupts. ++ */ ++ ++static irqreturn_t stylus_updown(int irq, void *dev_id) ++{ ++ unsigned long data0; ++ unsigned long data1; ++ int event_type; ++ ++ data0 = readl(base_addr+S3C2410_ADCDAT0); ++ data1 = readl(base_addr+S3C2410_ADCDAT1); ++ ++ ts.is_down = (!(data0 & S3C2410_ADCDAT0_UPDOWN)) && ++ (!(data1 & S3C2410_ADCDAT0_UPDOWN)); ++ ++ event_type = ts.is_down ? 'D' : 'U'; ++ ++ if (unlikely(__kfifo_put(ts.event_fifo, (unsigned char *)&event_type, ++ sizeof(int)) != sizeof(int))) /* should not happen */ ++ printk(KERN_ERR __FILE__": stylus_updown lost event!\n"); ++ ++ if (ts.is_down) ++ s3c2410_ts_start_adc_conversion(); ++ else ++ writel(WAIT4INT(0), base_addr+S3C2410_ADCTSC); ++ ++ mod_timer(&event_send_timer, jiffies + 1); ++ ++ return IRQ_HANDLED; ++} ++ ++static irqreturn_t stylus_action(int irq, void *dev_id) ++{ ++ int buf[3]; ++ ++ /* grab the ADC results */ ++ ts.coords[0] = readl(base_addr + S3C2410_ADCDAT0) & ++ S3C2410_ADCDAT0_XPDATA_MASK; ++ ts.coords[1] = readl(base_addr + S3C2410_ADCDAT1) & ++ S3C2410_ADCDAT1_YPDATA_MASK; ++ ++ if (ts.tsf[0]) { /* filtering is enabled, don't use raw directly */ ++ switch ((ts.tsf[0]->api->process)(ts.tsf[0], &ts.coords[0])) { ++ case 0: /* ++ * no real sample came out of processing yet, ++ * get another raw result to feed it ++ */ ++ s3c2410_ts_start_adc_conversion(); ++ return IRQ_HANDLED; ++ case 1: /* filters are ready to deliver a sample */ ++ (ts.tsf[0]->api->scale)(ts.tsf[0], &ts.coords[0]); ++ break; ++ case -1: ++ /* error in filters, ignore the event */ ++ (ts.tsf[0]->api->clear)(ts.tsf[0]); ++ writel(WAIT4INT(1), base_addr + S3C2410_ADCTSC); ++ return IRQ_HANDLED; ++ default: ++ printk(KERN_ERR":stylus_action error\n"); ++ } ++ } ++ ++ /* We use a buffer because want an atomic operation */ ++ buf[0] = 'P'; ++ buf[1] = ts.coords[0]; ++ buf[2] = ts.coords[1]; ++ ++ if (unlikely(__kfifo_put(ts.event_fifo, (unsigned char *)buf, ++ sizeof(int) * 3) != sizeof(int) * 3)) ++ /* should not happen */ ++ printk(KERN_ERR":stylus_action error\n"); ++ ++ writel(WAIT4INT(1), base_addr + S3C2410_ADCTSC); ++ mod_timer(&event_send_timer, jiffies + 1); ++ ++ return IRQ_HANDLED; ++} ++ ++static struct clk *adc_clock; ++ ++/* ++ * The functions for inserting/removing us as a module. ++ */ ++ ++static int __init s3c2410ts_probe(struct platform_device *pdev) ++{ ++ int rc; ++ struct s3c2410_ts_mach_info *info; ++ struct input_dev *input_dev; ++ int ret = 0; ++ ++ dev_info(&pdev->dev, "Starting\n"); ++ ++ info = (struct s3c2410_ts_mach_info *)pdev->dev.platform_data; ++ ++ if (!info) ++ { ++ dev_err(&pdev->dev, "Hm... too bad: no platform data for ts\n"); ++ return -EINVAL; ++ } ++ ++#ifdef CONFIG_TOUCHSCREEN_S3C2410_DEBUG ++ printk(DEBUG_LVL "Entering s3c2410ts_init\n"); ++#endif ++ ++ adc_clock = clk_get(NULL, "adc"); ++ if (!adc_clock) { ++ dev_err(&pdev->dev, "failed to get adc clock source\n"); ++ return -ENOENT; ++ } ++ clk_enable(adc_clock); ++ ++#ifdef CONFIG_TOUCHSCREEN_S3C2410_DEBUG ++ printk(DEBUG_LVL "got and enabled clock\n"); ++#endif ++ ++ base_addr = ioremap(S3C2410_PA_ADC,0x20); ++ if (base_addr == NULL) { ++ dev_err(&pdev->dev, "Failed to remap register block\n"); ++ ret = -ENOMEM; ++ goto bail0; ++ } ++ ++ ++ /* If we acutally are a S3C2410: Configure GPIOs */ ++ if (!strcmp(pdev->name, "s3c2410-ts")) ++ s3c2410_ts_connect(); ++ ++ if ((info->presc & 0xff) > 0) ++ writel(S3C2410_ADCCON_PRSCEN | ++ S3C2410_ADCCON_PRSCVL(info->presc&0xFF), ++ base_addr + S3C2410_ADCCON); ++ else ++ writel(0, base_addr+S3C2410_ADCCON); ++ ++ /* Initialise registers */ ++ if ((info->delay & 0xffff) > 0) ++ writel(info->delay & 0xffff, base_addr + S3C2410_ADCDLY); ++ ++ writel(WAIT4INT(0), base_addr + S3C2410_ADCTSC); ++ ++ /* Initialise input stuff */ ++ memset(&ts, 0, sizeof(struct s3c2410ts)); ++ input_dev = input_allocate_device(); ++ ++ if (!input_dev) { ++ dev_err(&pdev->dev, "Unable to allocate the input device\n"); ++ ret = -ENOMEM; ++ goto bail1; ++ } ++ ++ ts.dev = input_dev; ++ ts.dev->evbit[0] = BIT_MASK(EV_SYN) | BIT_MASK(EV_KEY) | ++ BIT_MASK(EV_ABS); ++ ts.dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH); ++ input_set_abs_params(ts.dev, ABS_X, 0, 0x3FF, 0, 0); ++ input_set_abs_params(ts.dev, ABS_Y, 0, 0x3FF, 0, 0); ++ input_set_abs_params(ts.dev, ABS_PRESSURE, 0, 1, 0, 0); ++ ++ ts.dev->name = s3c2410ts_name; ++ ts.dev->id.bustype = BUS_RS232; ++ ts.dev->id.vendor = 0xDEAD; ++ ts.dev->id.product = 0xBEEF; ++ ts.dev->id.version = S3C2410TSVERSION; ++ ts.state = TS_STATE_STANDBY; ++ ts.event_fifo = kfifo_alloc(TS_EVENT_FIFO_SIZE, GFP_KERNEL, NULL); ++ if (IS_ERR(ts.event_fifo)) { ++ ret = -EIO; ++ goto bail2; ++ } ++ ++ /* create the filter chain set up for the 2 coordinates we produce */ ++ ret = ts_filter_create_chain( ++ pdev, (struct ts_filter_api **)&info->filter_sequence, ++ (void *)&info->filter_config, ts.tsf, ARRAY_SIZE(ts.coords)); ++ if (ret) ++ dev_info(&pdev->dev, "%d filter(s) initialized\n", ret); ++ else /* this is OK, just means there won't be any filtering */ ++ dev_info(&pdev->dev, "Unfiltered output selected\n"); ++ ++ if (ts.tsf[0]) ++ (ts.tsf[0]->api->clear)(ts.tsf[0]); ++ else ++ dev_info(&pdev->dev, "No filtering\n"); ++ ++ /* Get irqs */ ++ if (request_irq(IRQ_ADC, stylus_action, IRQF_SAMPLE_RANDOM, ++ "s3c2410_action", ts.dev)) { ++ dev_err(&pdev->dev, "Could not allocate ts IRQ_ADC !\n"); ++ iounmap(base_addr); ++ ret = -EIO; ++ goto bail3; ++ } ++ if (request_irq(IRQ_TC, stylus_updown, IRQF_SAMPLE_RANDOM, ++ "s3c2410_action", ts.dev)) { ++ dev_err(&pdev->dev, "Could not allocate ts IRQ_TC !\n"); ++ free_irq(IRQ_ADC, ts.dev); ++ iounmap(base_addr); ++ ret = -EIO; ++ goto bail4; ++ } ++ ++ dev_info(&pdev->dev, "successfully loaded\n"); ++ ++ /* All went ok, so register to the input system */ ++ rc = input_register_device(ts.dev); ++ if (rc) { ++ ret = -EIO; ++ goto bail5; ++ } ++ ++ return 0; ++ ++bail5: ++ free_irq(IRQ_TC, ts.dev); ++ free_irq(IRQ_ADC, ts.dev); ++ clk_disable(adc_clock); ++ iounmap(base_addr); ++ disable_irq(IRQ_TC); ++bail4: ++ disable_irq(IRQ_ADC); ++bail3: ++ ts_filter_destroy_chain(pdev, ts.tsf); ++ kfifo_free(ts.event_fifo); ++bail2: ++ input_unregister_device(ts.dev); ++bail1: ++ iounmap(base_addr); ++bail0: ++ ++ return ret; ++} ++ ++static int s3c2410ts_remove(struct platform_device *pdev) ++{ ++ disable_irq(IRQ_ADC); ++ disable_irq(IRQ_TC); ++ free_irq(IRQ_TC,ts.dev); ++ free_irq(IRQ_ADC,ts.dev); ++ ++ if (adc_clock) { ++ clk_disable(adc_clock); ++ clk_put(adc_clock); ++ adc_clock = NULL; ++ } ++ ++ input_unregister_device(ts.dev); ++ iounmap(base_addr); ++ ++ ts_filter_destroy_chain(pdev, ts.tsf); ++ ++ kfifo_free(ts.event_fifo); ++ ++ return 0; ++} ++ ++#ifdef CONFIG_PM ++static int s3c2410ts_suspend(struct platform_device *pdev, pm_message_t state) ++{ ++ writel(TSC_SLEEP, base_addr+S3C2410_ADCTSC); ++ writel(readl(base_addr+S3C2410_ADCCON) | S3C2410_ADCCON_STDBM, ++ base_addr+S3C2410_ADCCON); ++ ++ disable_irq(IRQ_ADC); ++ disable_irq(IRQ_TC); ++ ++ clk_disable(adc_clock); ++ ++ return 0; ++} ++ ++static int s3c2410ts_resume(struct platform_device *pdev) ++{ ++ struct s3c2410_ts_mach_info *info = ++ ( struct s3c2410_ts_mach_info *)pdev->dev.platform_data; ++ ++ clk_enable(adc_clock); ++ mdelay(1); ++ ++ if (ts.tsf[0]) ++ (ts.tsf[0]->api->clear)(ts.tsf[0]); ++ ++ enable_irq(IRQ_ADC); ++ enable_irq(IRQ_TC); ++ ++ if ((info->presc&0xff) > 0) ++ writel(S3C2410_ADCCON_PRSCEN | ++ S3C2410_ADCCON_PRSCVL(info->presc&0xFF), ++ base_addr+S3C2410_ADCCON); ++ else ++ writel(0,base_addr+S3C2410_ADCCON); ++ ++ /* Initialise registers */ ++ if ((info->delay & 0xffff) > 0) ++ writel(info->delay & 0xffff, base_addr+S3C2410_ADCDLY); ++ ++ writel(WAIT4INT(0), base_addr+S3C2410_ADCTSC); ++ ++ return 0; ++} ++ ++#else ++#define s3c2410ts_suspend NULL ++#define s3c2410ts_resume NULL ++#endif ++ ++static struct platform_driver s3c2410ts_driver = { ++ .driver = { ++ .name = "s3c2410-ts", ++ .owner = THIS_MODULE, ++ }, ++ .probe = s3c2410ts_probe, ++ .remove = s3c2410ts_remove, ++ .suspend = s3c2410ts_suspend, ++ .resume = s3c2410ts_resume, ++ ++}; ++ ++static struct platform_driver s3c2440ts_driver = { ++ .driver = { ++ .name = "s3c2440-ts", ++ .owner = THIS_MODULE, ++ }, ++ .probe = s3c2410ts_probe, ++ .remove = s3c2410ts_remove, ++ .suspend = s3c2410ts_suspend, ++ .resume = s3c2410ts_resume, ++ ++}; ++ ++static int __init s3c2410ts_init(void) ++{ ++ int rc; ++ ++ rc = platform_driver_register(&s3c2410ts_driver); ++ if (rc < 0) ++ return rc; ++ ++ rc = platform_driver_register(&s3c2440ts_driver); ++ if (rc < 0) ++ platform_driver_unregister(&s3c2410ts_driver); ++ ++ return rc; ++} ++ ++static void __exit s3c2410ts_exit(void) ++{ ++ platform_driver_unregister(&s3c2440ts_driver); ++ platform_driver_unregister(&s3c2410ts_driver); ++} ++ ++module_init(s3c2410ts_init); ++module_exit(s3c2410ts_exit); ++ +-- +1.5.6.3 + diff --git a/recipes/linux/linux-2.6.29/micro2440/0002-S3C-Backported-openmoko-s-touchscreen-filters.patch b/recipes/linux/linux-2.6.29/micro2440/0002-S3C-Backported-openmoko-s-touchscreen-filters.patch new file mode 100644 index 0000000000..c171db81ec --- /dev/null +++ b/recipes/linux/linux-2.6.29/micro2440/0002-S3C-Backported-openmoko-s-touchscreen-filters.patch @@ -0,0 +1,1260 @@ +From fe4e1650cff50bff8e8ad62dc036609f53307442 Mon Sep 17 00:00:00 2001 +From: Michel Pollet +Date: Sat, 14 Mar 2009 10:24:07 +0000 +Subject: [PATCH] S3C: Backported openmoko's touchscreen filters + +Openmoko's touchscreen layer supports various filtering policy +for the ADC and touchscreen corrdinates. This is a staight port. +--- + drivers/input/touchscreen/Kconfig | 48 ++++++ + drivers/input/touchscreen/Makefile | 5 + + drivers/input/touchscreen/ts_filter.c | 73 +++++++++ + drivers/input/touchscreen/ts_filter.h | 62 +++++++ + drivers/input/touchscreen/ts_filter_group.c | 221 ++++++++++++++++++++++++++ + drivers/input/touchscreen/ts_filter_group.h | 39 +++++ + drivers/input/touchscreen/ts_filter_linear.c | 173 ++++++++++++++++++++ + drivers/input/touchscreen/ts_filter_linear.h | 64 ++++++++ + drivers/input/touchscreen/ts_filter_mean.c | 174 ++++++++++++++++++++ + drivers/input/touchscreen/ts_filter_mean.h | 34 ++++ + drivers/input/touchscreen/ts_filter_median.c | 217 +++++++++++++++++++++++++ + drivers/input/touchscreen/ts_filter_median.h | 36 ++++ + 12 files changed, 1146 insertions(+), 0 deletions(-) + create mode 100644 drivers/input/touchscreen/ts_filter.c + create mode 100644 drivers/input/touchscreen/ts_filter.h + create mode 100644 drivers/input/touchscreen/ts_filter_group.c + create mode 100644 drivers/input/touchscreen/ts_filter_group.h + create mode 100644 drivers/input/touchscreen/ts_filter_linear.c + create mode 100644 drivers/input/touchscreen/ts_filter_linear.h + create mode 100644 drivers/input/touchscreen/ts_filter_mean.c + create mode 100644 drivers/input/touchscreen/ts_filter_mean.h + create mode 100644 drivers/input/touchscreen/ts_filter_median.c + create mode 100644 drivers/input/touchscreen/ts_filter_median.h + +diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig +index 9076492..75ff0a8 100644 +--- a/drivers/input/touchscreen/Kconfig ++++ b/drivers/input/touchscreen/Kconfig +@@ -11,6 +11,54 @@ menuconfig INPUT_TOUCHSCREEN + + if INPUT_TOUCHSCREEN + ++menuconfig TOUCHSCREEN_FILTER ++ boolean "Touchscreen Filtering" ++ depends on INPUT_TOUCHSCREEN ++ select TOUCHSCREEN_FILTER_GROUP ++ select TOUCHSCREEN_FILTER_MEDIAN ++ select TOUCHSCREEN_FILTER_MEAN ++ select TOUCHSCREEN_FILTER_LINEAR ++ help ++ Select this to include kernel touchscreen filter support. The filters ++ can be combined in any order in your machine init and the parameters ++ for them can also be set there. ++ ++if TOUCHSCREEN_FILTER ++ ++config TOUCHSCREEN_FILTER_GROUP ++ bool "Group Touchscreen Filter" ++ depends on INPUT_TOUCHSCREEN && TOUCHSCREEN_FILTER ++ default Y ++ help ++ Say Y here if you want to use the Group touchscreen filter, it ++ avoids using atypical samples. ++ ++config TOUCHSCREEN_FILTER_MEDIAN ++ bool "Median Average Touchscreen Filter" ++ depends on INPUT_TOUCHSCREEN && TOUCHSCREEN_FILTER ++ default Y ++ help ++ Say Y here if you want to use the Median touchscreen filter, it's ++ highly effective if you data is noisy with occasional excursions. ++ ++config TOUCHSCREEN_FILTER_MEAN ++ bool "Mean Average Touchscreen Filter" ++ depends on INPUT_TOUCHSCREEN && TOUCHSCREEN_FILTER ++ default Y ++ help ++ Say Y here if you want to use the Mean touchscreen filter, it ++ can further improve decent quality data by removing jitter ++ ++config TOUCHSCREEN_FILTER_LINEAR ++ bool "Linear Touchscreen Filter" ++ depends on INPUT_TOUCHSCREEN && TOUCHSCREEN_FILTER ++ default Y ++ help ++ Say Y here if you want to use the Linear touchscreen filter, it ++ enables the use of calibration data for the touchscreen. ++ ++endif ++ + config TOUCHSCREEN_ADS7846 + tristate "ADS7846/TSC2046 and ADS7843 based touchscreens" + depends on SPI_MASTER +diff --git a/drivers/input/touchscreen/Makefile b/drivers/input/touchscreen/Makefile +index fbcde99..4b0a03e 100644 +--- a/drivers/input/touchscreen/Makefile ++++ b/drivers/input/touchscreen/Makefile +@@ -35,3 +35,8 @@ wm97xx-ts-$(CONFIG_TOUCHSCREEN_WM9712) += wm9712.o + wm97xx-ts-$(CONFIG_TOUCHSCREEN_WM9713) += wm9713.o + obj-$(CONFIG_TOUCHSCREEN_WM97XX_MAINSTONE) += mainstone-wm97xx.o + obj-$(CONFIG_TOUCHSCREEN_S3C2410) += s3c2410_ts.o ++obj-$(CONFIG_TOUCHSCREEN_FILTER) += ts_filter.o ++obj-$(CONFIG_TOUCHSCREEN_FILTER_GROUP) += ts_filter_group.o ++obj-$(CONFIG_TOUCHSCREEN_FILTER_LINEAR) += ts_filter_linear.o ++obj-$(CONFIG_TOUCHSCREEN_FILTER_MEDIAN) += ts_filter_median.o ++obj-$(CONFIG_TOUCHSCREEN_FILTER_MEAN) += ts_filter_mean.o +diff --git a/drivers/input/touchscreen/ts_filter.c b/drivers/input/touchscreen/ts_filter.c +new file mode 100644 +index 0000000..832844d +--- /dev/null ++++ b/drivers/input/touchscreen/ts_filter.c +@@ -0,0 +1,73 @@ ++/* ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ * ++ * Copyright (c) 2008 Andy Green ++ */ ++ ++#include ++#include ++#include "ts_filter.h" ++ ++static DEFINE_MUTEX(chain_mutex); ++ ++int ts_filter_create_chain(struct platform_device *pdev, ++ struct ts_filter_api **api, void **config, ++ struct ts_filter **arr, int count_coords) ++{ ++ int count = 0; ++ struct ts_filter *last = NULL; ++ ++ if (!api) ++ return 0; ++ ++ mutex_lock(&chain_mutex); ++ ++ while (*api) { ++ *arr = ((*api)->create)(pdev, *config++, count_coords); ++ if (!*arr) { ++ printk(KERN_ERR "Filter %d failed init\n", count); ++ return count; ++ } ++ (*arr)->api = *api++; ++ if (last) ++ last->next = *arr; ++ last = *arr; ++ arr++; ++ count++; ++ } ++ ++ mutex_unlock(&chain_mutex); ++ ++ return count; ++} ++EXPORT_SYMBOL_GPL(ts_filter_create_chain); ++ ++void ts_filter_destroy_chain(struct platform_device *pdev, ++ struct ts_filter **arr) ++{ ++ struct ts_filter **first = arr; ++ ++ mutex_lock(&chain_mutex); ++ ++ while (*arr) { ++ ((*arr)->api->destroy)(pdev, *arr); ++ arr++; ++ } ++ *first = NULL; ++ ++ mutex_unlock(&chain_mutex); ++} ++EXPORT_SYMBOL_GPL(ts_filter_destroy_chain); ++ +diff --git a/drivers/input/touchscreen/ts_filter.h b/drivers/input/touchscreen/ts_filter.h +new file mode 100644 +index 0000000..3746e45 +--- /dev/null ++++ b/drivers/input/touchscreen/ts_filter.h +@@ -0,0 +1,62 @@ ++#ifndef __TS_FILTER_H__ ++#define __TS_FILTER_H__ ++ ++/* ++ * Touchscreen filter. ++ * ++ * (c) 2008 Andy Green ++ */ ++ ++#include ++ ++#define MAX_TS_FILTER_CHAIN 8 /* Max. filters we can chain up. */ ++#define MAX_TS_FILTER_COORDS 3 /* X, Y and Z (pressure). */ ++ ++struct ts_filter; ++ ++/* Operations that a filter can perform. */ ++ ++struct ts_filter_api { ++ struct ts_filter * (*create)(struct platform_device *pdev, void *config, ++ int count_coords); ++ void (*destroy)(struct platform_device *pdev, struct ts_filter *filter); ++ void (*clear)(struct ts_filter *filter); ++ int (*process)(struct ts_filter *filter, int *coords); ++ void (*scale)(struct ts_filter *filter, int *coords); ++}; ++ ++/* ++ * This is the common part of all filters. ++ * We use this type as an otherwise opaque handle on to ++ * the actual filter. Therefore you need one of these ++ * at the start of your actual filter struct. ++ */ ++ ++struct ts_filter { ++ struct ts_filter *next; /* Next in chain. */ ++ struct ts_filter_api *api; /* Operations to use for this object. */ ++ int count_coords; ++ int coords[MAX_TS_FILTER_COORDS]; ++}; ++ ++/* ++ * Helper to create a filter chain from an array of API pointers and ++ * array of config ints. Leaves pointers to created filters in arr ++ * array and fills in ->next pointers to create the chain. ++ */ ++ ++#ifdef CONFIG_TOUCHSCREEN_FILTER ++extern int ts_filter_create_chain(struct platform_device *pdev, ++ struct ts_filter_api **api, void **config, ++ struct ts_filter **arr, int count_coords); ++ ++/* Helper to destroy a whole chain from the list of filter pointers. */ ++ ++extern void ts_filter_destroy_chain(struct platform_device *pdev, ++ struct ts_filter **arr); ++#else ++#define ts_filter_create_chain(pdev, api, config, arr, count_coords) (0) ++#define ts_filter_destroy_chain(pdev, arr) do { } while (0) ++#endif ++ ++#endif +diff --git a/drivers/input/touchscreen/ts_filter_group.c b/drivers/input/touchscreen/ts_filter_group.c +new file mode 100644 +index 0000000..f2ecd92 +--- /dev/null ++++ b/drivers/input/touchscreen/ts_filter_group.c +@@ -0,0 +1,221 @@ ++/* ++ * This program is free software; you can redistribute it and/or modify ++ * it under the terms of the GNU General Public License as published by ++ * the Free Software Foundation; either version 2 of the License, or ++ * (at your option) any later version. ++ * ++ * This program is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ * GNU General Public License for more details. ++ * ++ * You should have received a copy of the GNU General Public License ++ * along with this program; if not, write to the Free Software ++ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ++ * ++ * Copyright (C) 2008 by Openmoko, Inc. ++ * Author: Nelson Castillo ++ * All rights reserved. ++ * ++ * This filter is useful to reject samples that are not reliable. We consider ++ * that a sample is not reliable if it deviates form the Majority. ++ * ++ * 1) We collect S samples. ++ * ++ * 2) For each dimension: ++ * ++ * - We sort the points. ++ * - Points that are "close enough" are considered to be in the same set. ++ * - We choose the set with more elements. If more than "threshold" ++ * points are in this set we use the first and the last point of the set ++ * to define the valid range for this dimension [min, max], otherwise we ++ * discard all the points and go to step 1. ++ * ++ * 3) We consider the unsorted S samples and try to feed them to the next ++ * filter in the chain. If one of the points of each sample ++ * is not in the allowed range for its dimension, we discard the sample. ++ * ++ */ ++ ++#include ++#include ++#include ++#include "ts_filter_group.h" ++ ++static void ts_filter_group_clear_internal(struct ts_filter_group *tsfg, ++ int attempts) ++{ ++ tsfg->N = 0; ++ tsfg->tries_left = attempts; ++} ++ ++static void ts_filter_group_clear(struct ts_filter *tsf) ++{ ++ struct ts_filter_group *tsfg = (struct ts_filter_group *)tsf; ++ ++ ts_filter_group_clear_internal(tsfg, tsfg->config->attempts); ++ ++ if (tsf->next) /* chain */ ++ (tsf->next->api->clear)(tsf->next); ++} ++ ++static struct ts_filter *ts_filter_group_create(struct platform_device *pdev, ++ void *conf, int count_coords) ++{ ++ struct ts_filter_group *tsfg; ++ int i; ++ ++ BUG_ON((count_coords < 1) || (count_coords > MAX_TS_FILTER_COORDS)); ++ ++ tsfg = kzalloc(sizeof(struct ts_filter_group), GFP_KERNEL); ++ if (!tsfg) ++ return NULL; ++ ++ tsfg->config = (struct ts_filter_group_configuration *)conf; ++ tsfg->tsf.count_coords = count_coords; ++ ++ BUG_ON(tsfg->config->attempts <= 0); ++ ++ tsfg->samples[0] = kmalloc((2 + count_coords) * sizeof(int) * ++ tsfg->config->extent, GFP_KERNEL); ++ if (!tsfg->samples[0]) { ++ kfree(tsfg); ++ return NULL; ++ } ++ for (i = 1; i < count_coords; ++i) ++ tsfg->samples[i] = tsfg->samples[0] + i * tsfg->config->extent; ++ tsfg->sorted_samples = tsfg->samples[0] + count_coords * ++ tsfg->config->extent; ++ tsfg->group_size = tsfg->samples[0] + (1 + count_coords) * ++ tsfg->config->extent; ++ ++ ts_filter_group_clear_internal(tsfg, tsfg->config->attempts); ++ ++ printk(KERN_INFO" Created group ts filter len %d depth %d close %d " ++ "thresh %d\n", tsfg->config->extent, count_coords, ++ tsfg->config->close_enough, tsfg->config->threshold); ++ ++ return &tsfg->tsf; ++} ++ ++static void ts_filter_group_destroy(struct platform_device *pdev, ++ struct ts_filter *tsf) ++{ ++ struct ts_filter_group *tsfg = (struct ts_filter_group *)tsf; ++ ++ kfree(tsfg->samples[0]); /* first guy has pointer from kmalloc */ ++ kfree(tsf); ++} ++ ++static void ts_filter_group_scale(struct ts_filter *tsf, int *coords) ++{ ++ if (tsf->next) ++ (tsf->next->api->scale)(tsf->next, coords); ++} ++ ++static int int_cmp(const void *_a, const void *_b) ++{ ++ const int *a = _a; ++ const int *b = _b; ++ ++ if (*a > *b) ++ return 1; ++ if (*a < *b) ++ return -1; ++ return 0; ++} ++ ++static int ts_filter_group_process(struct ts_filter *tsf, int *coords) ++{ ++ struct ts_filter_group *tsfg = (struct ts_filter_group *)tsf; ++ int n; ++ int i; ++ int ret = 0; /* ask for more samples by default */ ++ ++ BUG_ON(tsfg->N >= tsfg->config->extent); ++ ++ for (n = 0; n < tsf->count_coords; n++) ++ tsfg->samples[n][tsfg->N] = coords[n]; ++ ++ if (++tsfg->N < tsfg->config->extent) ++ return 0; /* we meed more samples */ ++ ++ for (n = 0; n < tsfg->tsf.count_coords; n++) { ++ int *v = tsfg->sorted_samples; ++ int ngroups = 0; ++ int best_size; ++ int best_idx = 0; ++ int idx = 0; ++ ++ memcpy(v, tsfg->samples[n], tsfg->N * sizeof(int)); ++ sort(v, tsfg->N, sizeof(int), int_cmp, NULL); ++ ++ tsfg->group_size[0] = 1; ++ for (i = 1; i < tsfg->N; ++i) { ++ if (v[i] - v[i - 1] <= tsfg->config->close_enough) ++ tsfg->group_size[ngroups]++; ++ else ++ tsfg->group_size[++ngroups] = 1; ++ } ++ ngroups++; ++ ++ best_size = tsfg->group_size[0]; ++ for (i = 1; i < ngroups; i++) { ++ idx += tsfg->group_size[i - 1]; ++ if (best_size < tsfg->group_size[i]) { ++ best_size = tsfg->group_size[i]; ++ best_idx = idx; ++ } ++ } ++ ++ if (best_size < tsfg->config->threshold) { ++ /* this set is not good enough for us */ ++ if (--tsfg->tries_left) { ++ ts_filter_group_clear_internal ++ (tsfg, tsfg->tries_left); ++ return 0; /* ask for more samples */ ++ } ++