usb: ehci: use linux-way ehci_readl and ehci_writel
Subsystems (2)
PATCH v2 1/1 usb: ehci: use linux-way ehci_readl and ehci_writel
Also drop nowhere defined CONFIG_EHCI_DESC_BIG_ENDIAN.
Signed-off-by Antony Pavlov <[email protected]>
--- drivers/usb/host/ehci.h | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-)
drivers/usb/host/ehci.h +11 -8
@@ -18,6 +18,8 @@#ifndef USB_EHCI_H #define USB_EHCI_H +#include <io.h> +#if !defined(CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS )#define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 16#endif
@@ -68,14 +70,15 @@ struct ehci_hcor {#define USBMODE_CM_HC (3 << 0)/* host controller mode */ #define USBMODE_CM_IDLE (0 << 0)/* idle state */ -#if definedCONFIG_EHCI_DESC_BIG_ENDIAN -#define ehci_readl (x) (*((volatile u32 *)(x))) -#define ehci_writel (a, b) (*((volatile u32 *)(a)) = ((volatile u32)b)) -#else -#define ehci_readl (x) cpu_to_le32((*((volatile u32 *)(x)))) -#define ehci_writel (a, b) (*((volatile u32 *)(a)) = \ - cpu_to_le32(((volatile u32)b))) -#endif +static inline void ehci_writel (__u32 __iomem *regs,const unsigned int val) +{ +writel (val, regs); +} + +static inline unsigned int ehci_readl (__u32 __iomem *regs) +{ +return readl (regs); +}#if definedCONFIG_EHCI_MMIO_BIG_ENDIAN #define hc32_to_cpu (x) be32_to_cpu((x))
Signature · 7 lines
2.0.1 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Sascha Hauer
AppliedQuoted 3 lines · Antony Pavlov
Also drop nowhere defined
CONFIG_EHCI_DESC_BIG_ENDIAN.Signed-off-by Antony Pavlov <[email protected]>
Applied, thanks
Sascha
Quoted 45 lines
--- drivers/usb/host/ehci.h | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-)drivers/usb/host/ehci.h +11
-8@@ -18,6 +18,8 @@#ifndef USB_EHCI_H #define USB_EHCI_H +#include <io.h> +#if !defined(CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS )#define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 16#endif @@ -68,14 +70,15 @@ struct ehci_hcor {#define USBMODE_CM_HC (3 << 0)/* host controller mode */ #define USBMODE_CM_IDLE (0 << 0)/* idle state */ -#if definedCONFIG_EHCI_DESC_BIG_ENDIAN -#define ehci_readl (x) (*((volatile u32 *)(x))) -#define ehci_writel (a, b) (*((volatile u32 *)(a)) = ((volatile u32)b)) -#else -#define ehci_readl (x) cpu_to_le32((*((volatile u32 *)(x)))) -#define ehci_writel (a, b) (*((volatile u32 *)(a)) = \ - cpu_to_le32(((volatile u32)b))) -#endif +static inline void ehci_writel (__u32 __iomem *regs,const unsigned int val) +{ +writel (val, regs); +} + +static inline unsigned int ehci_readl (__u32 __iomem *regs) +{ +return readl (regs); +}#if definedCONFIG_EHCI_MMIO_BIG_ENDIAN #define hc32_to_cpu (x) be32_to_cpu((x))Signature · 1 line
2.0.1
Signature · 9 lines
Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox