1 Index: linux-2.6.23.16/drivers/ssb/driver_chipcommon.c
2 ===================================================================
3 --- linux-2.6.23.16.orig/drivers/ssb/driver_chipcommon.c 2008-02-19 14:37:06.000000000 +0100
4 +++ linux-2.6.23.16/drivers/ssb/driver_chipcommon.c 2008-02-19 14:37:08.000000000 +0100
5 @@ -39,12 +39,14 @@ static inline void chipco_write32(struct
6 ssb_write32(cc->dev, offset, value);
9 -static inline void chipco_write32_masked(struct ssb_chipcommon *cc, u16 offset,
10 - u32 mask, u32 value)
11 +static inline u32 chipco_write32_masked(struct ssb_chipcommon *cc, u16 offset,
12 + u32 mask, u32 value)
15 value |= chipco_read32(cc, offset) & ~mask;
16 chipco_write32(cc, offset, value);
21 void ssb_chipco_set_clockmode(struct ssb_chipcommon *cc,
22 @@ -355,16 +357,37 @@ u32 ssb_chipco_gpio_in(struct ssb_chipco
24 return chipco_read32(cc, SSB_CHIPCO_GPIOIN) & mask;
26 +EXPORT_SYMBOL(ssb_chipco_gpio_in);
28 +u32 ssb_chipco_gpio_out(struct ssb_chipcommon *cc, u32 mask, u32 value)
30 + return chipco_write32_masked(cc, SSB_CHIPCO_GPIOOUT, mask, value);
32 +EXPORT_SYMBOL(ssb_chipco_gpio_out);
34 +u32 ssb_chipco_gpio_outen(struct ssb_chipcommon *cc, u32 mask, u32 value)
36 + return chipco_write32_masked(cc, SSB_CHIPCO_GPIOOUTEN, mask, value);
38 +EXPORT_SYMBOL(ssb_chipco_gpio_outen);
40 +u32 ssb_chipco_gpio_control(struct ssb_chipcommon *cc, u32 mask, u32 value)
42 + return chipco_write32_masked(cc, SSB_CHIPCO_GPIOCTL, mask, value);
44 +EXPORT_SYMBOL(ssb_chipco_gpio_control);
46 -void ssb_chipco_gpio_out(struct ssb_chipcommon *cc, u32 mask, u32 value)
47 +u32 ssb_chipco_gpio_intmask(struct ssb_chipcommon *cc, u32 mask, u32 value)
49 - chipco_write32_masked(cc, SSB_CHIPCO_GPIOOUT, mask, value);
50 + return chipco_write32_masked(cc, SSB_CHIPCO_GPIOIRQ, mask, value);
52 +EXPORT_SYMBOL(ssb_chipco_gpio_intmask);
54 -void ssb_chipco_gpio_outen(struct ssb_chipcommon *cc, u32 mask, u32 value)
55 +u32 ssb_chipco_gpio_polarity(struct ssb_chipcommon *cc, u32 mask, u32 value)
57 - chipco_write32_masked(cc, SSB_CHIPCO_GPIOOUTEN, mask, value);
58 + return chipco_write32_masked(cc, SSB_CHIPCO_GPIOPOL, mask, value);
60 +EXPORT_SYMBOL(ssb_chipco_gpio_polarity);
62 #ifdef CONFIG_SSB_SERIAL
63 int ssb_chipco_serial_init(struct ssb_chipcommon *cc,
64 Index: linux-2.6.23.16/drivers/ssb/driver_extif.c
65 ===================================================================
66 --- linux-2.6.23.16.orig/drivers/ssb/driver_extif.c 2008-02-19 14:37:06.000000000 +0100
67 +++ linux-2.6.23.16/drivers/ssb/driver_extif.c 2008-02-19 14:37:08.000000000 +0100
68 @@ -27,12 +27,14 @@ static inline void extif_write32(struct
69 ssb_write32(extif->dev, offset, value);
72 -static inline void extif_write32_masked(struct ssb_extif *extif, u16 offset,
73 - u32 mask, u32 value)
74 +static inline u32 extif_write32_masked(struct ssb_extif *extif, u16 offset,
75 + u32 mask, u32 value)
78 value |= extif_read32(extif, offset) & ~mask;
79 extif_write32(extif, offset, value);
84 #ifdef CONFIG_SSB_SERIAL
85 @@ -114,16 +116,30 @@ u32 ssb_extif_gpio_in(struct ssb_extif *
87 return extif_read32(extif, SSB_EXTIF_GPIO_IN) & mask;
89 +EXPORT_SYMBOL(ssb_extif_gpio_in);
91 -void ssb_extif_gpio_out(struct ssb_extif *extif, u32 mask, u32 value)
92 +u32 ssb_extif_gpio_out(struct ssb_extif *extif, u32 mask, u32 value)
94 return extif_write32_masked(extif, SSB_EXTIF_GPIO_OUT(0),
97 +EXPORT_SYMBOL(ssb_extif_gpio_out);
99 -void ssb_extif_gpio_outen(struct ssb_extif *extif, u32 mask, u32 value)
100 +u32 ssb_extif_gpio_outen(struct ssb_extif *extif, u32 mask, u32 value)
102 return extif_write32_masked(extif, SSB_EXTIF_GPIO_OUTEN(0),
105 +EXPORT_SYMBOL(ssb_extif_gpio_outen);
107 +u32 ssb_extif_gpio_polarity(struct ssb_extif *extif, u32 mask, u32 value)
109 + return extif_write32_masked(extif, SSB_EXTIF_GPIO_INTPOL, mask, value);
111 +EXPORT_SYMBOL(ssb_extif_gpio_polarity);
113 +u32 ssb_extif_gpio_intmask(struct ssb_extif *extif, u32 mask, u32 value)
115 + return extif_write32_masked(extif, SSB_EXTIF_GPIO_INTMASK, mask, value);
117 +EXPORT_SYMBOL(ssb_extif_gpio_intmask);
118 Index: linux-2.6.23.16/include/linux/ssb/ssb_driver_chipcommon.h
119 ===================================================================
120 --- linux-2.6.23.16.orig/include/linux/ssb/ssb_driver_chipcommon.h 2008-02-19 14:37:06.000000000 +0100
121 +++ linux-2.6.23.16/include/linux/ssb/ssb_driver_chipcommon.h 2008-02-19 14:37:08.000000000 +0100
122 @@ -382,11 +382,13 @@ extern void ssb_chipco_set_clockmode(str
123 extern void ssb_chipco_watchdog_timer_set(struct ssb_chipcommon *cc,
126 +/* Chipcommon GPIO pin access. */
127 u32 ssb_chipco_gpio_in(struct ssb_chipcommon *cc, u32 mask);
129 -void ssb_chipco_gpio_out(struct ssb_chipcommon *cc, u32 mask, u32 value);
131 -void ssb_chipco_gpio_outen(struct ssb_chipcommon *cc, u32 mask, u32 value);
132 +u32 ssb_chipco_gpio_out(struct ssb_chipcommon *cc, u32 mask, u32 value);
133 +u32 ssb_chipco_gpio_outen(struct ssb_chipcommon *cc, u32 mask, u32 value);
134 +u32 ssb_chipco_gpio_control(struct ssb_chipcommon *cc, u32 mask, u32 value);
135 +u32 ssb_chipco_gpio_intmask(struct ssb_chipcommon *cc, u32 mask, u32 value);
136 +u32 ssb_chipco_gpio_polarity(struct ssb_chipcommon *cc, u32 mask, u32 value);
138 #ifdef CONFIG_SSB_SERIAL
139 extern int ssb_chipco_serial_init(struct ssb_chipcommon *cc,
140 Index: linux-2.6.23.16/include/linux/ssb/ssb_driver_extif.h
141 ===================================================================
142 --- linux-2.6.23.16.orig/include/linux/ssb/ssb_driver_extif.h 2008-02-19 14:37:06.000000000 +0100
143 +++ linux-2.6.23.16/include/linux/ssb/ssb_driver_extif.h 2008-02-19 14:37:08.000000000 +0100
144 @@ -171,11 +171,12 @@ extern void ssb_extif_get_clockcontrol(s
145 extern void ssb_extif_timing_init(struct ssb_extif *extif,
148 +/* Extif GPIO pin access */
149 u32 ssb_extif_gpio_in(struct ssb_extif *extif, u32 mask);
151 -void ssb_extif_gpio_out(struct ssb_extif *extif, u32 mask, u32 value);
153 -void ssb_extif_gpio_outen(struct ssb_extif *extif, u32 mask, u32 value);
154 +u32 ssb_extif_gpio_out(struct ssb_extif *extif, u32 mask, u32 value);
155 +u32 ssb_extif_gpio_outen(struct ssb_extif *extif, u32 mask, u32 value);
156 +u32 ssb_extif_gpio_polarity(struct ssb_extif *extif, u32 mask, u32 value);
157 +u32 ssb_extif_gpio_intmask(struct ssb_extif *extif, u32 mask, u32 value);
159 #ifdef CONFIG_SSB_SERIAL
160 extern int ssb_extif_serial_init(struct ssb_extif *extif,