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>
27 static void crisv32_pinmux_set(
int port);
57 if (port >
PORTS || port < 0)
62 for (i = first_pin; i <= last_pin; i++) {
65 && (
pins[port][i] != mode)) {
66 spin_unlock_irqrestore(&pinmux_lock, flags);
68 panic(
"Pinmux alloc failed!\n");
74 for (i = first_pin; i <= last_pin; i++)
77 crisv32_pinmux_set(port);
79 spin_unlock_irqrestore(&pinmux_lock, flags);
87 char saved[
sizeof pins];
154 spin_unlock_irqrestore(&pinmux_lock, flags);
163 spin_unlock_irqrestore(&pinmux_lock, flags);
168 void crisv32_pinmux_set(
int port)
176 gpio_val |= (1 <<
i);
198 if (port >
PORTS || port < 0)
203 for (i = first_pin; i <= last_pin; i++)
206 crisv32_pinmux_set(port);
207 spin_unlock_irqrestore(&pinmux_lock, flags);
215 char saved[
sizeof pins];
282 spin_unlock_irqrestore(&pinmux_lock, flags);
291 spin_unlock_irqrestore(&pinmux_lock, flags);
302 for (i = 0; i <
PORTS; i++) {