Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 196155
b: refs/heads/master
c: d009559
h: refs/heads/master
i:
  196153: fb4ff51
  196151: 3f048cd
v: v3
  • Loading branch information
Kevin Hilman committed May 12, 2010
1 parent ede91a2 commit 73950f3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 108 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c872670799d5a41fe2c1f2ccf7c531b5661dcfba
refs/heads/master: d009559a4215c71694b1a29ec0e520453087a9f6
107 changes: 0 additions & 107 deletions trunk/arch/arm/plat-omap/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -2310,110 +2310,3 @@ static int __init omap_gpio_sysinit(void)
}

arch_initcall(omap_gpio_sysinit);


#ifdef CONFIG_DEBUG_FS

#include <linux/debugfs.h>
#include <linux/seq_file.h>

static int dbg_gpio_show(struct seq_file *s, void *unused)
{
unsigned i, j, gpio;

for (i = 0, gpio = 0; i < gpio_bank_count; i++) {
struct gpio_bank *bank = gpio_bank + i;
unsigned bankwidth = 16;
u32 mask = 1;

if (bank_is_mpuio(bank))
gpio = OMAP_MPUIO(0);
else if (cpu_class_is_omap2() || cpu_is_omap7xx())
bankwidth = 32;

for (j = 0; j < bankwidth; j++, gpio++, mask <<= 1) {
unsigned irq, value, is_in, irqstat;
const char *label;

label = gpiochip_is_requested(&bank->chip, j);
if (!label)
continue;

irq = bank->virtual_irq_start + j;
value = gpio_get_value(gpio);
is_in = gpio_is_input(bank, mask);

if (bank_is_mpuio(bank))
seq_printf(s, "MPUIO %2d ", j);
else
seq_printf(s, "GPIO %3d ", gpio);
seq_printf(s, "(%-20.20s): %s %s",
label,
is_in ? "in " : "out",
value ? "hi" : "lo");

/* FIXME for at least omap2, show pullup/pulldown state */

irqstat = irq_desc[irq].status;
#if defined(CONFIG_ARCH_OMAP16XX) || defined(CONFIG_ARCH_OMAP2PLUS)
if (is_in && ((bank->suspend_wakeup & mask)
|| irqstat & IRQ_TYPE_SENSE_MASK)) {
char *trigger = NULL;

switch (irqstat & IRQ_TYPE_SENSE_MASK) {
case IRQ_TYPE_EDGE_FALLING:
trigger = "falling";
break;
case IRQ_TYPE_EDGE_RISING:
trigger = "rising";
break;
case IRQ_TYPE_EDGE_BOTH:
trigger = "bothedge";
break;
case IRQ_TYPE_LEVEL_LOW:
trigger = "low";
break;
case IRQ_TYPE_LEVEL_HIGH:
trigger = "high";
break;
case IRQ_TYPE_NONE:
trigger = "(?)";
break;
}
seq_printf(s, ", irq-%d %-8s%s",
irq, trigger,
(bank->suspend_wakeup & mask)
? " wakeup" : "");
}
#endif
seq_printf(s, "\n");
}

if (bank_is_mpuio(bank)) {
seq_printf(s, "\n");
gpio = 0;
}
}
return 0;
}

static int dbg_gpio_open(struct inode *inode, struct file *file)
{
return single_open(file, dbg_gpio_show, &inode->i_private);
}

static const struct file_operations debug_fops = {
.open = dbg_gpio_open,
.read = seq_read,
.llseek = seq_lseek,
.release = single_release,
};

static int __init omap_gpio_debuginit(void)
{
(void) debugfs_create_file("omap_gpio", S_IRUGO,
NULL, NULL, &debug_fops);
return 0;
}
late_initcall(omap_gpio_debuginit);
#endif

0 comments on commit 73950f3

Please sign in to comment.