source: branches/backfire/target/linux/ppc40x/patches/121-usb-isp116x-hcd-ppc405-register-access.patch @ 20943

Last change on this file since 20943 was 20943, checked in by juhosg, 6 years ago

backfire: ppc40x: make isp116x-hcd driver usable on the OpenRB board (backport of r20931)

File size: 2.6 KB
  • drivers/usb/host/isp116x.h

    a b struct isp116x_ep { 
    364364#define IRQ_TEST()      do{}while(0) 
    365365#endif 
    366366 
     367#ifdef CONFIG_405EP 
     368static inline void isp116x_writew(u16 val, void __iomem *addr) 
     369{ 
     370        writew(cpu_to_le16(val), addr); 
     371} 
     372 
     373static inline u16 isp116x_readw(void __iomem *addr) 
     374{ 
     375        return le16_to_cpu(readw(addr)); 
     376} 
     377 
     378static inline void isp116x_raw_writew(u16 val, void __iomem *addr) 
     379{ 
     380        writew(cpu_to_le16(val), addr); 
     381} 
     382 
     383static inline u16 isp116x_raw_readw(void __iomem *addr) 
     384{ 
     385        return le16_to_cpu(readw(addr)); 
     386} 
     387#else 
     388static inline void isp116x_writew(u16 val, void __iomem *addr) 
     389{ 
     390        writew(val, addr); 
     391} 
     392 
     393static inline u16 isp116x_readw(void __iomem *addr) 
     394{ 
     395        return readw(addr); 
     396} 
     397 
     398static inline void isp116x_raw_writew(u16 val, void __iomem *addr) 
     399{ 
     400        __raw_writew(val, addr); 
     401} 
     402 
     403static inline u16 isp116x_raw_readw(void __iomem *addr) 
     404{ 
     405        return __raw_readw(addr); 
     406} 
     407#endif 
     408 
    367409static inline void isp116x_write_addr(struct isp116x *isp116x, unsigned reg) 
    368410{ 
    369411        IRQ_TEST(); 
    370         writew(reg & 0xff, isp116x->addr_reg); 
     412        isp116x_writew(reg & 0xff, isp116x->addr_reg); 
    371413        isp116x_delay(isp116x, 300); 
    372414} 
    373415 
    374416static inline void isp116x_write_data16(struct isp116x *isp116x, u16 val) 
    375417{ 
    376         writew(val, isp116x->data_reg); 
     418        isp116x_writew(val, isp116x->data_reg); 
    377419        isp116x_delay(isp116x, 150); 
    378420} 
    379421 
    380422static inline void isp116x_raw_write_data16(struct isp116x *isp116x, u16 val) 
    381423{ 
    382         __raw_writew(val, isp116x->data_reg); 
     424        isp116x_raw_writew(val, isp116x->data_reg); 
    383425        isp116x_delay(isp116x, 150); 
    384426} 
    385427 
    static inline u16 isp116x_read_data16(st 
    387429{ 
    388430        u16 val; 
    389431 
    390         val = readw(isp116x->data_reg); 
     432        val = isp116x_readw(isp116x->data_reg); 
    391433        isp116x_delay(isp116x, 150); 
    392434        return val; 
    393435} 
    static inline u16 isp116x_raw_read_data1 
    396438{ 
    397439        u16 val; 
    398440 
    399         val = __raw_readw(isp116x->data_reg); 
     441        val = isp116x_raw_readw(isp116x->data_reg); 
    400442        isp116x_delay(isp116x, 150); 
    401443        return val; 
    402444} 
    403445 
    404446static inline void isp116x_write_data32(struct isp116x *isp116x, u32 val) 
    405447{ 
    406         writew(val & 0xffff, isp116x->data_reg); 
     448        isp116x_writew(val & 0xffff, isp116x->data_reg); 
    407449        isp116x_delay(isp116x, 150); 
    408         writew(val >> 16, isp116x->data_reg); 
     450        isp116x_writew(val >> 16, isp116x->data_reg); 
    409451        isp116x_delay(isp116x, 150); 
    410452} 
    411453 
    static inline u32 isp116x_read_data32(st 
    413455{ 
    414456        u32 val; 
    415457 
    416         val = (u32) readw(isp116x->data_reg); 
     458        val = (u32) isp116x_readw(isp116x->data_reg); 
    417459        isp116x_delay(isp116x, 150); 
    418         val |= ((u32) readw(isp116x->data_reg)) << 16; 
     460        val |= ((u32) isp116x_readw(isp116x->data_reg)) << 16; 
    419461        isp116x_delay(isp116x, 150); 
    420462        return val; 
    421463} 
Note: See TracBrowser for help on using the repository browser.