Received: by 10.223.176.46 with SMTP id f43csp135403wra; Tue, 23 Jan 2018 17:41:12 -0800 (PST) X-Google-Smtp-Source: AH8x22498DgCc4nCb0ekHBhtitNKzwymKD7zHpJksr3gCN9j5nG/LlaQq3qnHWL0lGcLCyF2hxO6 X-Received: by 10.98.139.8 with SMTP id j8mr11616054pfe.4.1516758072596; Tue, 23 Jan 2018 17:41:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516758072; cv=none; d=google.com; s=arc-20160816; b=Rirn5tT9/Ec1AK6NG92XNX2UYAGvdMRSEYhbcZKuBH6YquS4DKdK1a2umBhzoq51FV XK8BQV44jb571p7H9oK+FQE0QP5t2VKBrwzqweK08b/vYlCZZIKTCsmPSBBkyjWV5P9s svk6Z5nWoC7vQZgupZekMforeQIUDi/0Wb2nTFYmPMjlH1mQdmAT3RSbGCsn1ZujGjNd sw9Wzhu/zmwrV4l3Nxakiqw/wFWxi5PSCJhbBbhSuTBMcTNiT+rbh7iKOJjAyc/kMhzT 40/DGn8d+IbvKx/zQre9GlSZzb9YIVWWnbOX6BhK8lYSAx9Ec+ahm/SGEkfixVh/LQwt faSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=iltQzQ8BCSfNRNmrnou22xF62QAmV+Ai+Ol+PhW+B1U=; b=dYw6Eo3QDcKgmcpghRQtSYsIK9O66ZpCajF/iD6IefKqQrz92+vA/YMpfp83uo13gO gLqCGzRYkYVdfyUDJKP3rcTu3ZjlLJ+yNmGwnXgg45Z5br9UMOcA6WhTRViYXgKy/iNa Z+jadOZBfUFPNu4dLdabIEZa+nXuZliaCpXigFp8ZX1MpeeR6DmobN3m9fCLheCFWj8t BCxFQiU3+mTi6TiJZimfXmeI+njnvfw8nYhMoAg/s6tNnzdJFkFfl/WZHzRqIsB78GPH jHKqb/TQzLqLBNZ+pUrKylMIzCyRPnSTcsvAoMw3FvJPtbO7rxOBS4PPsaDZrRYnOfj2 54dQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CBaSR9CU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 62-v6si5149946plb.383.2018.01.23.17.40.58; Tue, 23 Jan 2018 17:41:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CBaSR9CU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752094AbeAXBkc (ORCPT + 99 others); Tue, 23 Jan 2018 20:40:32 -0500 Received: from mail-qt0-f194.google.com ([209.85.216.194]:37955 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751682AbeAXBk2 (ORCPT ); Tue, 23 Jan 2018 20:40:28 -0500 Received: by mail-qt0-f194.google.com with SMTP id z10so6569685qti.5 for ; Tue, 23 Jan 2018 17:40:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=iltQzQ8BCSfNRNmrnou22xF62QAmV+Ai+Ol+PhW+B1U=; b=CBaSR9CUF2PWVpWbid7ppx9xOXLz3Bk4/22fhbrKjtInW7pRBqijtWLLByUoiX2mdZ gUqexrFvyckdVD7iCU6155aeKfjrSzzZDKCfJ3vgifK5YMFCzdb5Jxzkt7/ePAoDziBX 4dCmhkKF0ijh3JcGeyxJuc1CIV4m8cp0gFBUrUII9CeGVt+I1bOrjXzxCJaK6Jrnt+wk MAWmmmLxnlBgbtui9SfFXK0j1tcWN9hCYX4hpDub/QF65ih6n7h+FMpSWkXp2m3WyyqE /rJR0Yiruh560cKsPP5uxhRaGFUUeqdnltmYv0jd03ekdIerT7rDVaJv/NzTd+8ytoFr CfLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=iltQzQ8BCSfNRNmrnou22xF62QAmV+Ai+Ol+PhW+B1U=; b=iJ/nqBFUhwg1ckk96aZK+3VbchQIM2iobsoaSDdGcj4llEVG5EMGf7ft7SruEs9RPp 4r5+xvoUwBdeGusO7Q9enaWcmzf63ECMLtj/nO4Qbhj/Mvtb4UVelzaw32tN1rnBrtIP fJx6KWDiK1F1Y5lK1GBdS7+i7QBse8pVhmm+JKMB3OOaCGyUY8oI09G7lQYm8mOgylSX NTDfNyGznr6GvmsYkOAU582iemDT0iJ7Y79+3F6bRk9/aeA2tnVS8GZt6MmC1Q9Jz5dj C5qXLn96SZ4d3pi0/J3SydyiOFGcemG6IeYScJBdLqgTUYDd5l5G3X5Jq8yZEGxyfh// RNbA== X-Gm-Message-State: AKwxytfis9hsFBywDevDuvwQ5s6W1NwYfLG+kgSCSIYptzpPJXG432jy YY4o0/asM7qqzYHHa7qq8mE= X-Received: by 10.55.64.21 with SMTP id n21mr6879349qka.293.1516758027252; Tue, 23 Jan 2018 17:40:27 -0800 (PST) Received: from stbirv-lnx-1.igp.broadcom.net ([192.19.223.250]) by smtp.gmail.com with ESMTPSA id u123sm6071154qkd.21.2018.01.23.17.40.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 23 Jan 2018 17:40:26 -0800 (PST) From: Florian Fainelli To: linux-mips@linux-mips.org Cc: jhogan@kernel.org, david.daney@cavium.com, paul.burton@mips.com, Florian Fainelli , Ralf Baechle , Kevin Cernekee , Huacai Chen , Jiaxun Yang , Bart Van Assche , Doug Ledford , 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 Message-Id: <1516758010-7641-2-git-send-email-f.fainelli@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516758010-7641-1-git-send-email-f.fainelli@gmail.com> References: <1516758010-7641-1-git-send-email-f.fainelli@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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