r4810 - developers/werner/wlan-spi/patches-tracking
werner at docs.openmoko.org
werner at docs.openmoko.org
Fri Nov 21 22:41:33 CET 2008
Author: werner
Date: 2008-11-21 22:41:31 +0100 (Fri, 21 Nov 2008)
New Revision: 4810
Added:
developers/werner/wlan-spi/patches-tracking/debug-gta02-trigger.patch
Log:
Debugging tool: raise GPF6 (AUX) when reaching a trigger.
Added: developers/werner/wlan-spi/patches-tracking/debug-gta02-trigger.patch
===================================================================
--- developers/werner/wlan-spi/patches-tracking/debug-gta02-trigger.patch (rev 0)
+++ developers/werner/wlan-spi/patches-tracking/debug-gta02-trigger.patch 2008-11-21 21:41:31 UTC (rev 4810)
@@ -0,0 +1,95 @@
+Index: ktrack/arch/arm/plat-s3c24xx/Makefile
+===================================================================
+--- ktrack.orig/arch/arm/plat-s3c24xx/Makefile 2008-11-21 19:22:53.000000000 -0200
++++ ktrack/arch/arm/plat-s3c24xx/Makefile 2008-11-21 19:23:02.000000000 -0200
+@@ -51,4 +51,5 @@
+ gta02_pm_wlan.o \
+ neo1973_shadow.o \
+ neo1973_pm_resume_reason.o \
+- neo1973_memconfig.o
++ neo1973_memconfig.o \
++ gta02_trigger.o
+Index: ktrack/arch/arm/plat-s3c24xx/gta02_trigger.c
+===================================================================
+--- /dev/null 1970-01-01 00:00:00.000000000 +0000
++++ ktrack/arch/arm/plat-s3c24xx/gta02_trigger.c 2008-11-21 19:40:23.000000000 -0200
+@@ -0,0 +1,79 @@
++#include <linux/module.h>
++#include <linux/kernel.h>
++#include <linux/init.h>
++#include <linux/device.h>
++#include <linux/sysfs.h>
++#include <mach/gpio.h>
++#include <mach/regs-gpio.h>
++
++
++static int trigger_value = -1;
++static int trigger_count;
++
++
++
++void trigger(void)
++{
++ if (trigger_count++ != trigger_value)
++ return;
++ printk(KERN_ERR "TRIGGER (%d)\n", trigger_count-1);
++ gpio_direction_output(S3C2410_GPF6, 1);
++}
++
++
++static ssize_t trigger_read(struct device *dev, struct device_attribute *attr,
++ char *buf)
++{
++ return sprintf(buf, "%d\n", trigger_value);
++}
++
++
++static ssize_t trigger_write(struct device *dev, struct device_attribute *attr,
++ const char *buf, size_t count)
++{
++ long tmp;
++ char *end;
++
++ tmp = simple_strtol(buf, &end, 0);
++ if (end == buf)
++ return -EINVAL;
++ trigger_value = tmp;
++ return count;
++}
++
++
++static ssize_t trigger_count_read(struct device *dev,
++ struct device_attribute *attr, char *buf)
++{
++ return sprintf(buf, "%d\n", trigger_count);
++}
++
++
++static ssize_t trigger_count_write(struct device *dev,
++ struct device_attribute *attr, const char *buf, size_t count)
++{
++ trigger_count = 0;
++ return count;
++}
++
++
++static DEVICE_ATTR(trigger, 0644, trigger_read, trigger_write);
++static DEVICE_ATTR(trigger_count, 0644, trigger_count_read,
++ trigger_count_write);
++
++
++static int __init trigger_init(void)
++{
++ int ret;
++
++ ret = sysfs_create_file(kernel_kobj, &dev_attr_trigger.attr);
++ if (ret)
++ return ret;
++ /* @@@ we don't really care about errors here ... */
++ return sysfs_create_file(kernel_kobj, &dev_attr_trigger_count.attr);
++}
++
++
++module_init(trigger_init);
++
++EXPORT_SYMBOL_GPL(trigger);
More information about the commitlog
mailing list