Re: [RFC 7/9] usb: ehci: add big-endian registers support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Aug 28, 2015 at 01:24:08AM +0300, Antony Pavlov wrote:
> +
> +#ifdef CONFIG_USB_EHCI_BIG_ENDIAN_MMIO
> +#define ehci_big_endian_mmio(e)		((e)->big_endian_mmio)
> +#else
> +#define ehci_big_endian_mmio(e)		0
> +#endif
> +
> +static inline void ehci_writel(const struct ehci_priv *ehci,
> +				__u32 __iomem *regs, const unsigned int val)
>  {
> -	writel(val, regs);
> +	if (IS_ENABLED(CONFIG_USB_EHCI_BIG_ENDIAN_MMIO)) {
> +		ehci_big_endian_mmio(ehci) ?
> +			iowrite32be(val, regs) :
> +			writel(val, regs);
> +	} else
> +		writel(val, regs);
>  }

	if (ehci_big_endian_mmio(ehci))
		iowrite32be(val, regs);
	else
		writel(val, regs);

is enough.

Sascha

-- 
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
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux