I'm currently working with the DM8148EVM & EZSDK 5.03.01.15. I've enabled the userspace GPIO access (/sys/class/gpio) and have been using the debugfs facilities (/sys/kernel/debug/omap_mux & /sys/kernel/debug/gpio) to double check pin muxing and GPIO states.
I'm a bit confused by the pinmux mode strings (OMAP_MUX_MODEn) reported in /sys/kernel/debug/omap_mux/. For example, consider the touchscreen interrupt pin configured in in board-ti8148evm.c:
static void __init ti814x_tsc_init(void)
{
int error;
omap_mux_init_signal("mlb_clk.gpio0_31", TI814X_PULL_DIS | (1 << 18));
error = gpio_request(GPIO_TSC, "ts_irq");
if (error < 0) {
printk(KERN_ERR "%s: failed to request GPIO for TSC IRQ"
": %d\n", __func__, error);
return;
}
gpio_direction_input(GPIO_TSC);
ti814x_i2c_boardinfo[6].irq = gpio_to_irq(GPIO_TSC);
gpio_export(31, true);
}
So from this I see that the mlb_clk pin (mode 0) is being used as gpio0_31 (mode 7). However, the debugfs entries seem to show conflicting information regarding the mux mode:
# cat /sys/kernel/debug/omap_mux/mlb_clk
name: mlb_clk.gpio0_31 (0x481408f0/0x8f0 = 0x50080), b NA, t NA
mode: OMAP_PIN_OUTPUT | OMAP_MUX_MODE0
signals: mlb_clk | NA | NA | uart2_txd_mux1 | NA | NA | NA | gpio0_31
Is something wrong here, or does the validity of the name and mode strings depend upon how the pinmux setting is defined (i.e., by function call, kernel command line argument, or definition in the omap_board_mux board_mux[] struct)? Are the mode strings just coming from compile-time definitions?
Thank you,
Jon