aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/ds1620.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/ds1620.c')
-rw-r--r--drivers/char/ds1620.c25
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 */
46extern spinlock_t gpio_lock;
47extern unsigned int system_rev; 46extern unsigned int system_rev;
48 47
49static inline void netwinder_ds1620_set_clk(int clk) 48static 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
54static inline void netwinder_ds1620_set_data(int dat) 53static 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
59static inline int netwinder_ds1620_get_data(void) 58static 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
64static inline void netwinder_ds1620_set_data_dir(int dir) 63static 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
69static inline void netwinder_ds1620_reset(void) 68static 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
75static inline void netwinder_lock(unsigned long *flags) 74static 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
80static inline void netwinder_unlock(unsigned long *flags) 79static 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
85static inline void netwinder_set_fan(int i) 84static 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
94static inline int netwinder_get_fan(void) 93static 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/*