uClibc: fix ubicom32 compile error with 0.9.32
[openwrt.git] / target / linux / ppc40x / patches / 121-usb-isp116x-hcd-ppc405-register-access.patch
1 --- a/drivers/usb/host/isp116x.h
2 +++ b/drivers/usb/host/isp116x.h
3 @@ -364,22 +364,64 @@ struct isp116x_ep {
4 #define IRQ_TEST() do{}while(0)
5 #endif
6
7 +#ifdef CONFIG_405EP
8 +static inline void isp116x_writew(u16 val, void __iomem *addr)
9 +{
10 + writew(cpu_to_le16(val), addr);
11 +}
12 +
13 +static inline u16 isp116x_readw(void __iomem *addr)
14 +{
15 + return le16_to_cpu(readw(addr));
16 +}
17 +
18 +static inline void isp116x_raw_writew(u16 val, void __iomem *addr)
19 +{
20 + writew(cpu_to_le16(val), addr);
21 +}
22 +
23 +static inline u16 isp116x_raw_readw(void __iomem *addr)
24 +{
25 + return le16_to_cpu(readw(addr));
26 +}
27 +#else
28 +static inline void isp116x_writew(u16 val, void __iomem *addr)
29 +{
30 + writew(val, addr);
31 +}
32 +
33 +static inline u16 isp116x_readw(void __iomem *addr)
34 +{
35 + return readw(addr);
36 +}
37 +
38 +static inline void isp116x_raw_writew(u16 val, void __iomem *addr)
39 +{
40 + __raw_writew(val, addr);
41 +}
42 +
43 +static inline u16 isp116x_raw_readw(void __iomem *addr)
44 +{
45 + return __raw_readw(addr);
46 +}
47 +#endif
48 +
49 static inline void isp116x_write_addr(struct isp116x *isp116x, unsigned reg)
50 {
51 IRQ_TEST();
52 - writew(reg & 0xff, isp116x->addr_reg);
53 + isp116x_writew(reg & 0xff, isp116x->addr_reg);
54 isp116x_delay(isp116x, 300);
55 }
56
57 static inline void isp116x_write_data16(struct isp116x *isp116x, u16 val)
58 {
59 - writew(val, isp116x->data_reg);
60 + isp116x_writew(val, isp116x->data_reg);
61 isp116x_delay(isp116x, 150);
62 }
63
64 static inline void isp116x_raw_write_data16(struct isp116x *isp116x, u16 val)
65 {
66 - __raw_writew(val, isp116x->data_reg);
67 + isp116x_raw_writew(val, isp116x->data_reg);
68 isp116x_delay(isp116x, 150);
69 }
70
71 @@ -387,7 +429,7 @@ static inline u16 isp116x_read_data16(st
72 {
73 u16 val;
74
75 - val = readw(isp116x->data_reg);
76 + val = isp116x_readw(isp116x->data_reg);
77 isp116x_delay(isp116x, 150);
78 return val;
79 }
80 @@ -396,16 +438,16 @@ static inline u16 isp116x_raw_read_data1
81 {
82 u16 val;
83
84 - val = __raw_readw(isp116x->data_reg);
85 + val = isp116x_raw_readw(isp116x->data_reg);
86 isp116x_delay(isp116x, 150);
87 return val;
88 }
89
90 static inline void isp116x_write_data32(struct isp116x *isp116x, u32 val)
91 {
92 - writew(val & 0xffff, isp116x->data_reg);
93 + isp116x_writew(val & 0xffff, isp116x->data_reg);
94 isp116x_delay(isp116x, 150);
95 - writew(val >> 16, isp116x->data_reg);
96 + isp116x_writew(val >> 16, isp116x->data_reg);
97 isp116x_delay(isp116x, 150);
98 }
99
100 @@ -413,9 +455,9 @@ static inline u32 isp116x_read_data32(st
101 {
102 u32 val;
103
104 - val = (u32) readw(isp116x->data_reg);
105 + val = (u32) isp116x_readw(isp116x->data_reg);
106 isp116x_delay(isp116x, 150);
107 - val |= ((u32) readw(isp116x->data_reg)) << 16;
108 + val |= ((u32) isp116x_readw(isp116x->data_reg)) << 16;
109 isp116x_delay(isp116x, 150);
110 return val;
111 }
This page took 0.052266 seconds and 5 git commands to generate.