summaryrefslogtreecommitdiff
path: root/firmware/target/mips/ingenic_x1000/gpio-x1000.h
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/mips/ingenic_x1000/gpio-x1000.h')
-rw-r--r--firmware/target/mips/ingenic_x1000/gpio-x1000.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/firmware/target/mips/ingenic_x1000/gpio-x1000.h b/firmware/target/mips/ingenic_x1000/gpio-x1000.h
index f1a65b37b5..cfbe86338a 100644
--- a/firmware/target/mips/ingenic_x1000/gpio-x1000.h
+++ b/firmware/target/mips/ingenic_x1000/gpio-x1000.h
@@ -26,12 +26,11 @@
26 * -------- 26 * --------
27 * 27 *
28 * To assign a new function to a GPIO, call gpio_config(). This uses the 28 * To assign a new function to a GPIO, call gpio_config(). This uses the
29 * hardware's GPIO Z facility to atomically most GPIO registers at once, 29 * hardware's GPIO Z facility to atomically set most GPIO registers at once,
30 * so it can be used to make any state transition safely. Since GPIO Z is 30 * so it can be used to make any state transition safely. Since GPIO Z is
31 * protected by a mutex, you can't call gpio_config() from interrupt context. 31 * a global hardware resource, it is unsafe to call gpio_config() from IRQ
32 * 32 * context -- if the interrupted code was also running gpio_config(), then
33 * If you need to use GPIO Z directly, then use gpio_lock() and gpio_unlock() 33 * the results would be unpredictable.
34 * to acquire the mutex.
35 * 34 *
36 * Depending on the current GPIO state, certain state transitions are safe to 35 * Depending on the current GPIO state, certain state transitions are safe to
37 * perform without locking, as they only change one register: 36 * perform without locking, as they only change one register:
@@ -74,8 +73,6 @@
74#define GPIO_IRQ_EDGE(i) (0x1e|((i)&1)) 73#define GPIO_IRQ_EDGE(i) (0x1e|((i)&1))
75 74
76extern void gpio_init(void); 75extern void gpio_init(void);
77extern void gpio_lock(void);
78extern void gpio_unlock(void);
79extern void gpio_config(int port, unsigned pinmask, int func); 76extern void gpio_config(int port, unsigned pinmask, int func);
80 77
81static inline void gpio_out_level(int port, unsigned pinmask, int level) 78static inline void gpio_out_level(int port, unsigned pinmask, int level)