* [1/4] usb: dwc2: Move dwc2_readl/writel functions after hsotg structure
@ 2018-05-07 12:43 Gevorg Sahakyan
0 siblings, 0 replies; 3+ messages in thread
From: Gevorg Sahakyan @ 2018-05-07 12:43 UTC (permalink / raw)
To: Felipe Balbi, Greg Kroah-Hartman, Minas Harutyunyan, linux-usb
Cc: John Youn, Gevorg Sahakya
From: Gevorg Sahakyan <sahakyan@synopsys.com>
Moved dwc2_readl/writel functions after hsotg declaration for
adding hsotg structure to dwc2_readl/writel function prototypes.
Signed-off-by: Gevorg Sahakyan <sahakyan@synopsys.com>
Signed-off-by: Gevorg Sahakya <sahakyan@synopsys.com>
---
drivers/usb/dwc2/core.h | 108 ++++++++++++++++++++++++------------------------
1 file changed, 54 insertions(+), 54 deletions(-)
diff --git a/drivers/usb/dwc2/core.h b/drivers/usb/dwc2/core.h
index d83be5651f87..275b63b08e0f 100644
--- a/drivers/usb/dwc2/core.h
+++ b/drivers/usb/dwc2/core.h
@@ -65,60 +65,6 @@
DWC2_TRACE_SCHEDULER_VB(pr_fmt("%s: SCH: " fmt), \
dev_name(hsotg->dev), ##__VA_ARGS__)
-#ifdef CONFIG_MIPS
-/*
- * There are some MIPS machines that can run in either big-endian
- * or little-endian mode and that use the dwc2 register without
- * a byteswap in both ways.
- * Unlike other architectures, MIPS apparently does not require a
- * barrier before the __raw_writel() to synchronize with DMA but does
- * require the barrier after the __raw_writel() to serialize a set of
- * writes. This set of operations was added specifically for MIPS and
- * should only be used there.
- */
-static inline u32 dwc2_readl(const void __iomem *addr)
-{
- u32 value = __raw_readl(addr);
-
- /* In order to preserve endianness __raw_* operation is used. Therefore
- * a barrier is needed to ensure IO access is not re-ordered across
- * reads or writes
- */
- mb();
- return value;
-}
-
-static inline void dwc2_writel(u32 value, void __iomem *addr)
-{
- __raw_writel(value, addr);
-
- /*
- * In order to preserve endianness __raw_* operation is used. Therefore
- * a barrier is needed to ensure IO access is not re-ordered across
- * reads or writes
- */
- mb();
-#ifdef DWC2_LOG_WRITES
- pr_info("INFO:: wrote %08x to %p\n", value, addr);
-#endif
-}
-#else
-/* Normal architectures just use readl/write */
-static inline u32 dwc2_readl(const void __iomem *addr)
-{
- return readl(addr);
-}
-
-static inline void dwc2_writel(u32 value, void __iomem *addr)
-{
- writel(value, addr);
-
-#ifdef DWC2_LOG_WRITES
- pr_info("info:: wrote %08x to %p\n", value, addr);
-#endif
-}
-#endif
-
/* Maximum number of Endpoints/HostChannels */
#define MAX_EPS_CHANNELS 16
@@ -1094,6 +1040,60 @@ struct dwc2_hsotg {
#endif /* CONFIG_USB_DWC2_PERIPHERAL || CONFIG_USB_DWC2_DUAL_ROLE */
};
+#ifdef CONFIG_MIPS
+/*
+ * There are some MIPS machines that can run in either big-endian
+ * or little-endian mode and that use the dwc2 register without
+ * a byteswap in both ways.
+ * Unlike other architectures, MIPS apparently does not require a
+ * barrier before the __raw_writel() to synchronize with DMA but does
+ * require the barrier after the __raw_writel() to serialize a set of
+ * writes. This set of operations was added specifically for MIPS and
+ * should only be used there.
+ */
+static inline u32 dwc2_readl(const void __iomem *addr)
+{
+ u32 value = __raw_readl(addr);
+
+ /* In order to preserve endianness __raw_* operation is used. Therefore
+ * a barrier is needed to ensure IO access is not re-ordered across
+ * reads or writes
+ */
+ mb();
+ return value;
+}
+
+static inline void dwc2_writel(u32 value, void __iomem *addr)
+{
+ __raw_writel(value, addr);
+
+ /*
+ * In order to preserve endianness __raw_* operation is used. Therefore
+ * a barrier is needed to ensure IO access is not re-ordered across
+ * reads or writes
+ */
+ mb();
+#ifdef DWC2_LOG_WRITES
+ pr_info("INFO:: wrote %08x to %p\n", value, addr);
+#endif
+}
+#else
+/* Normal architectures just use readl/write */
+static inline u32 dwc2_readl(const void __iomem *addr)
+{
+ return readl(addr);
+}
+
+static inline void dwc2_writel(u32 value, void __iomem *addr)
+{
+ writel(value, addr);
+
+#ifdef DWC2_LOG_WRITES
+ pr_info("info:: wrote %08x to %p\n", value, addr);
+#endif
+}
+#endif
+
/* Reasons for halting a host channel */
enum dwc2_halt_status {
DWC2_HC_XFER_NO_HALT_STATUS,
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [1/4] usb: dwc2: Move dwc2_readl/writel functions after hsotg structure
@ 2018-05-15 7:17 Felipe Balbi
0 siblings, 0 replies; 3+ messages in thread
From: Felipe Balbi @ 2018-05-15 7:17 UTC (permalink / raw)
To: Gevorg Sahakya, Greg Kroah-Hartman, Minas Harutyunyan, linux-usb
Cc: John Youn
Gevorg Sahakya <Gevorg.Sahakyan@synopsys.com> writes:
> From: Gevorg Sahakyan <sahakyan@synopsys.com>
>
> Moved dwc2_readl/writel functions after hsotg declaration for
> adding hsotg structure to dwc2_readl/writel function prototypes.
>
> Signed-off-by: Gevorg Sahakyan <sahakyan@synopsys.com>
> Signed-off-by: Gevorg Sahakya <sahakyan@synopsys.com>
Why two signed-off-by for the same person?
^ permalink raw reply [flat|nested] 3+ messages in thread
* [1/4] usb: dwc2: Move dwc2_readl/writel functions after hsotg structure
@ 2018-05-15 7:41 Minas Harutyunyan
0 siblings, 0 replies; 3+ messages in thread
From: Minas Harutyunyan @ 2018-05-15 7:41 UTC (permalink / raw)
To: Felipe Balbi, Gevorg Sahakya, Greg Kroah-Hartman,
Minas Harutyunyan, linux-usb@vger.kernel.org
Cc: John Youn
Hi Filipe,
On 5/15/2018 11:19 AM, Felipe Balbi wrote:
> Gevorg Sahakya <Gevorg.Sahakyan@synopsys.com> writes:
>
>> From: Gevorg Sahakyan <sahakyan@synopsys.com>
>>
>> Moved dwc2_readl/writel functions after hsotg declaration for
>> adding hsotg structure to dwc2_readl/writel function prototypes.
>>
>> Signed-off-by: Gevorg Sahakyan <sahakyan@synopsys.com>
>> Signed-off-by: Gevorg Sahakya <sahakyan@synopsys.com>
>
> Why two signed-off-by for the same person?
>
Second signed-off added wrongly. Should Gevorg re-submit the patch with
1 signed-off?
Thanks,
Minas
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-05-15 7:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-05-15 7:17 [1/4] usb: dwc2: Move dwc2_readl/writel functions after hsotg structure Felipe Balbi
-- strict thread matches above, loose matches on Subject: below --
2018-05-15 7:41 Minas Harutyunyan
2018-05-07 12:43 Gevorg Sahakyan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).