10 #include <linux/errno.h>
11 #include <linux/kernel.h>
12 #include <linux/string.h>
14 #include <hwregs/reg_map.h>
17 #include <hwregs/pinmux_defs.h>
29 static void crisv32_pinmux_set(
int port);
60 for (i = first_pin; i <= last_pin; i++) {
64 spin_unlock_irqrestore(&pinmux_lock, flags);
66 panic(
"Pinmux alloc failed!\n");
72 for (i = first_pin; i <= last_pin; i++)
75 crisv32_pinmux_set(port);
77 spin_unlock_irqrestore(&pinmux_lock, flags);
86 char saved[
sizeof pins];
208 spin_unlock_irqrestore(&pinmux_lock, flags);
214 crisv32_pinmux_set(
int port)
223 gpio_val |= (1 <<
i);
246 if (port >
PORTS || port < 0)
251 for (i = first_pin; i <= last_pin; i++)
254 crisv32_pinmux_set(port);
255 spin_unlock_irqrestore(&pinmux_lock, flags);
264 char saved[
sizeof pins];
366 spin_unlock_irqrestore(&pinmux_lock, flags);
379 for (i = 0; i <
PORTS; i++) {
384 " Pin %d = %d\n", j,
pins[i * PORT_PINS + j]);