Commit d424aa87 authored by Jim Cromie's avatar Jim Cromie Committed by Linus Torvalds

[PATCH] chardev: GPIO for SCx200 & PC-8736x: put gpio_dump on a diet

Shrink scx200_gpio_dump() to a single printk with ternary ops.  The function
is still ifdef'd out, this is corrected in next patch, when it is actually
used.

The patch 'inadvertently' changed loglevel from DEBUG to INFO.  This is Good,
because in next patch, its wired to a 'command' which the user can invoke when
they want.  When they do so, its because they want INFO to support their
developement effort, and we want to give it to them without compiling a DEBUG
version of the driver.
Signed-off-by: default avatarJim Cromie <jim.cromie@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 55b8c045
...@@ -109,33 +109,16 @@ u32 scx200_gpio_configure(unsigned index, u32 mask, u32 bits) ...@@ -109,33 +109,16 @@ u32 scx200_gpio_configure(unsigned index, u32 mask, u32 bits)
void scx200_gpio_dump(unsigned index) void scx200_gpio_dump(unsigned index)
{ {
u32 config = scx200_gpio_configure(index, ~0, 0); u32 config = scx200_gpio_configure(index, ~0, 0);
printk(KERN_DEBUG "GPIO%02u: 0x%08lx", index, (unsigned long)config);
printk(KERN_INFO NAME ": GPIO-%02u: 0x%08lx %s %s %s %s %s %s %s\n",
if (config & 1) index, (unsigned long) config,
printk(" OE"); /* output enabled */ (config & 1) ? "OE" : "TS", /* output enabled / tristate */
else (config & 2) ? "PP" : "OD", /* push pull / open drain */
printk(" TS"); /* tristate */ (config & 4) ? "PUE" : "PUD", /* pull up enabled/disabled */
if (config & 2) (config & 8) ? "LOCKED" : "", /* locked / unlocked */
printk(" PP"); /* push pull */ (config & 16) ? "LEVEL" : "EDGE", /* level/edge input */
else (config & 32) ? "HI" : "LO", /* trigger on rising/falling edge */
printk(" OD"); /* open drain */ (config & 64) ? "DEBOUNCE" : ""); /* debounce */
if (config & 4)
printk(" PUE"); /* pull up enabled */
else
printk(" PUD"); /* pull up disabled */
if (config & 8)
printk(" LOCKED"); /* locked */
if (config & 16)
printk(" LEVEL"); /* level input */
else
printk(" EDGE"); /* edge input */
if (config & 32)
printk(" HI"); /* trigger on rising edge */
else
printk(" LO"); /* trigger on falling edge */
if (config & 64)
printk(" DEBOUNCE"); /* debounce */
printk("\n");
} }
#endif /* 0 */ #endif /* 0 */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment