diff options
Diffstat (limited to 'drivers/char/ds1620.c')
-rw-r--r-- | drivers/char/ds1620.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/drivers/char/ds1620.c b/drivers/char/ds1620.c index 74e9cd81b5b2..61f0146e215d 100644 --- a/drivers/char/ds1620.c +++ b/drivers/char/ds1620.c | |||
@@ -43,52 +43,51 @@ static const char *fan_state[] = { "off", "on", "on (hardwired)" }; | |||
43 | * chance that the WaveArtist driver could touch these bits to | 43 | * chance that the WaveArtist driver could touch these bits to |
44 | * enable or disable the speaker. | 44 | * enable or disable the speaker. |
45 | */ | 45 | */ |
46 | extern spinlock_t gpio_lock; | ||
47 | extern unsigned int system_rev; | 46 | extern unsigned int system_rev; |
48 | 47 | ||
49 | static inline void netwinder_ds1620_set_clk(int clk) | 48 | static inline void netwinder_ds1620_set_clk(int clk) |
50 | { | 49 | { |
51 | gpio_modify_op(GPIO_DSCLK, clk ? GPIO_DSCLK : 0); | 50 | nw_gpio_modify_op(GPIO_DSCLK, clk ? GPIO_DSCLK : 0); |
52 | } | 51 | } |
53 | 52 | ||
54 | static inline void netwinder_ds1620_set_data(int dat) | 53 | static inline void netwinder_ds1620_set_data(int dat) |
55 | { | 54 | { |
56 | gpio_modify_op(GPIO_DATA, dat ? GPIO_DATA : 0); | 55 | nw_gpio_modify_op(GPIO_DATA, dat ? GPIO_DATA : 0); |
57 | } | 56 | } |
58 | 57 | ||
59 | static inline int netwinder_ds1620_get_data(void) | 58 | static inline int netwinder_ds1620_get_data(void) |
60 | { | 59 | { |
61 | return gpio_read() & GPIO_DATA; | 60 | return nw_gpio_read() & GPIO_DATA; |
62 | } | 61 | } |
63 | 62 | ||
64 | static inline void netwinder_ds1620_set_data_dir(int dir) | 63 | static inline void netwinder_ds1620_set_data_dir(int dir) |
65 | { | 64 | { |
66 | gpio_modify_io(GPIO_DATA, dir ? GPIO_DATA : 0); | 65 | nw_gpio_modify_io(GPIO_DATA, dir ? GPIO_DATA : 0); |
67 | } | 66 | } |
68 | 67 | ||
69 | static inline void netwinder_ds1620_reset(void) | 68 | static inline void netwinder_ds1620_reset(void) |
70 | { | 69 | { |
71 | cpld_modify(CPLD_DS_ENABLE, 0); | 70 | nw_cpld_modify(CPLD_DS_ENABLE, 0); |
72 | cpld_modify(CPLD_DS_ENABLE, CPLD_DS_ENABLE); | 71 | nw_cpld_modify(CPLD_DS_ENABLE, CPLD_DS_ENABLE); |
73 | } | 72 | } |
74 | 73 | ||
75 | static inline void netwinder_lock(unsigned long *flags) | 74 | static inline void netwinder_lock(unsigned long *flags) |
76 | { | 75 | { |
77 | spin_lock_irqsave(&gpio_lock, *flags); | 76 | spin_lock_irqsave(&nw_gpio_lock, *flags); |
78 | } | 77 | } |
79 | 78 | ||
80 | static inline void netwinder_unlock(unsigned long *flags) | 79 | static inline void netwinder_unlock(unsigned long *flags) |
81 | { | 80 | { |
82 | spin_unlock_irqrestore(&gpio_lock, *flags); | 81 | spin_unlock_irqrestore(&nw_gpio_lock, *flags); |
83 | } | 82 | } |
84 | 83 | ||
85 | static inline void netwinder_set_fan(int i) | 84 | static inline void netwinder_set_fan(int i) |
86 | { | 85 | { |
87 | unsigned long flags; | 86 | unsigned long flags; |
88 | 87 | ||
89 | spin_lock_irqsave(&gpio_lock, flags); | 88 | spin_lock_irqsave(&nw_gpio_lock, flags); |
90 | gpio_modify_op(GPIO_FAN, i ? GPIO_FAN : 0); | 89 | nw_gpio_modify_op(GPIO_FAN, i ? GPIO_FAN : 0); |
91 | spin_unlock_irqrestore(&gpio_lock, flags); | 90 | spin_unlock_irqrestore(&nw_gpio_lock, flags); |
92 | } | 91 | } |
93 | 92 | ||
94 | static inline int netwinder_get_fan(void) | 93 | static inline int netwinder_get_fan(void) |
@@ -96,7 +95,7 @@ static inline int netwinder_get_fan(void) | |||
96 | if ((system_rev & 0xf000) == 0x4000) | 95 | if ((system_rev & 0xf000) == 0x4000) |
97 | return FAN_ALWAYS_ON; | 96 | return FAN_ALWAYS_ON; |
98 | 97 | ||
99 | return (gpio_read() & GPIO_FAN) ? FAN_ON : FAN_OFF; | 98 | return (nw_gpio_read() & GPIO_FAN) ? FAN_ON : FAN_OFF; |
100 | } | 99 | } |
101 | 100 | ||
102 | /* | 101 | /* |