From: Florian Fainelli <f.fainelli@gmail.com>
To: linux-mips@linux-mips.org
Cc: jhogan@kernel.org, david.daney@cavium.com, paul.burton@mips.com,
Florian Fainelli <f.fainelli@gmail.com>,
Ralf Baechle <ralf@linux-mips.org>,
Kevin Cernekee <cernekee@gmail.com>,
Huacai Chen <chenhc@lemote.com>,
Jiaxun Yang <jiaxun.yang@flygoat.com>,
Bart Van Assche <bart.vanassche@sandisk.com>,
Doug Ledford <dledford@redhat.com>,
linux-kernel@vger.kernel.org (open list)
Subject: [PATCH 1/2] MIPS: Allow including mach-generic/dma-coherence.h
Date: Tue, 23 Jan 2018 17:40:09 -0800 [thread overview]
Message-ID: <1516758010-7641-2-git-send-email-f.fainelli@gmail.com> (raw)
In-Reply-To: <1516758010-7641-1-git-send-email-f.fainelli@gmail.com>
Check whether a platform is already defining any of the functions we
provide in mach-generic/dma-coherence.h. This is a preliminary change to
allow cleaning up machine's dma-coherence.h files.
Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
---
arch/mips/include/asm/mach-generic/dma-coherence.h | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/arch/mips/include/asm/mach-generic/dma-coherence.h b/arch/mips/include/asm/mach-generic/dma-coherence.h
index 61addb1677e9..e6e7dfa15801 100644
--- a/arch/mips/include/asm/mach-generic/dma-coherence.h
+++ b/arch/mips/include/asm/mach-generic/dma-coherence.h
@@ -11,29 +11,38 @@
struct device;
+#ifndef plat_map_dma_mem
static inline dma_addr_t plat_map_dma_mem(struct device *dev, void *addr,
size_t size)
{
return virt_to_phys(addr);
}
+#endif
+#ifndef plat_map_dma_mem_page
static inline dma_addr_t plat_map_dma_mem_page(struct device *dev,
struct page *page)
{
return page_to_phys(page);
}
+#endif
+#ifndef plat_dma_addr_to_phys
static inline unsigned long plat_dma_addr_to_phys(struct device *dev,
dma_addr_t dma_addr)
{
return dma_addr;
}
+#endif
+#ifndef plat_unmap_dma_mem
static inline void plat_unmap_dma_mem(struct device *dev, dma_addr_t dma_addr,
size_t size, enum dma_data_direction direction)
{
}
+#endif
+#ifndef plat_dma_supported
static inline int plat_dma_supported(struct device *dev, u64 mask)
{
/*
@@ -46,7 +55,9 @@ static inline int plat_dma_supported(struct device *dev, u64 mask)
return 1;
}
+#endif
+#ifndef plat_device_is_coherent
static inline int plat_device_is_coherent(struct device *dev)
{
#ifdef CONFIG_DMA_PERDEV_COHERENT
@@ -63,6 +74,7 @@ static inline int plat_device_is_coherent(struct device *dev)
}
#endif
}
+#endif
#ifndef plat_post_dma_flush
static inline void plat_post_dma_flush(struct device *dev)
@@ -71,15 +83,19 @@ static inline void plat_post_dma_flush(struct device *dev)
#endif
#ifdef CONFIG_SWIOTLB
+#ifndef phys_to_dma
static inline dma_addr_t phys_to_dma(struct device *dev, phys_addr_t paddr)
{
return paddr;
}
+#endif
+#ifndef dma_to_phys
static inline phys_addr_t dma_to_phys(struct device *dev, dma_addr_t daddr)
{
return daddr;
}
#endif
+#endif /* CONFIG_SWIOTLB */
#endif /* __ASM_MACH_GENERIC_DMA_COHERENCE_H */
--
2.7.4
next prev parent reply other threads:[~2018-01-24 1:40 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-24 1:40 [PATCH 0/2] MIPS: generic dma-coherence.h inclusion Florian Fainelli
2018-01-24 1:40 ` Florian Fainelli [this message]
2018-03-13 17:24 ` [PATCH 1/2] MIPS: Allow including mach-generic/dma-coherence.h James Hogan
2018-01-24 1:40 ` [PATCH 2/2] MIPS: Update dma-coherence.h files Florian Fainelli
2018-03-13 17:19 ` James Hogan
2018-01-26 8:31 ` [PATCH 0/2] MIPS: generic dma-coherence.h inclusion Steven J. Hill
2018-01-29 20:10 ` Florian Fainelli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1516758010-7641-2-git-send-email-f.fainelli@gmail.com \
--to=f.fainelli@gmail.com \
--cc=bart.vanassche@sandisk.com \
--cc=cernekee@gmail.com \
--cc=chenhc@lemote.com \
--cc=david.daney@cavium.com \
--cc=dledford@redhat.com \
--cc=jhogan@kernel.org \
--cc=jiaxun.yang@flygoat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=paul.burton@mips.com \
--cc=ralf@linux-mips.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome