]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/dma/ti-dma-crossbar.c
x86/msr-index: Cleanup bit defines
[mirror_ubuntu-bionic-kernel.git] / drivers / dma / ti-dma-crossbar.c
index 7df910e7c34881d3632437a340ca210f92837eb2..9272b173c74655203ec4c1997988dccaa9ba02d3 100644 (file)
@@ -54,7 +54,15 @@ struct ti_am335x_xbar_map {
 
 static inline void ti_am335x_xbar_write(void __iomem *iomem, int event, u8 val)
 {
-       writeb_relaxed(val, iomem + event);
+       /*
+        * TPCC_EVT_MUX_60_63 register layout is different than the
+        * rest, in the sense, that event 63 is mapped to lowest byte
+        * and event 60 is mapped to highest, handle it separately.
+        */
+       if (event >= 60 && event <= 63)
+               writeb_relaxed(val, iomem + (63 - event % 4));
+       else
+               writeb_relaxed(val, iomem + event);
 }
 
 static void ti_am335x_xbar_free(struct device *dev, void *route_data)