lkml.org 
[lkml]   [2019]   [Jun]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH V8 2/3] PCI: dwc: Cleanup DBI,ATU read and write APIs
Date
On 6/24/19, 2:26 PM, Vidya Sagar wrote:
>
> Cleanup DBI read and write APIs by removing "__" (underscore) from their
> names as there are no no-underscore versions and the underscore versions
> are already doing what no-underscore versions typically do. It also removes
> passing dbi/dbi2 base address as one of the arguments as the same can be
> derived with in read and write APIs. Since dw_pcie_{readl/writel}_dbi()
> APIs can't be used for ATU read/write as ATU base address could be
> different from DBI base address, this patch attempts to implement
> ATU read/write APIs using ATU base address without using
> dw_pcie_{readl/writel}_dbi() APIs.
>
> Signed-off-by: Vidya Sagar <vidyas@nvidia.com>
> ---
> Changes from v7:
> * Based on suggestion from Jingoo Han, moved implementation of readl, writel for ATU
> region to separate APIs dw_pcie_{read/write}_atu() in pcie-designware.c file and
> calling them from pcie-designware.h file.
>
> Changes from v6:
> * Modified ATU read/write APIs to use implementation specific DBI read/write
> APIs if present.
>
> Changes from v5:
> * Removed passing base address as one of the arguments as the same can be derived within
> the API itself.
> * Modified ATU read/write APIs to call dw_pcie_{write/read}() API
>
> Changes from v4:
> * This is a new patch in this series
>
> drivers/pci/controller/dwc/pcie-designware.c | 28 +++++------
> drivers/pci/controller/dwc/pcie-designware.h | 51 +++++++++++++-------
> 2 files changed, 45 insertions(+), 34 deletions(-)

.......

> +u32 dw_pcie_read_atu(struct dw_pcie *pci, u32 reg, size_t size)
> +{
> + int ret;
> + u32 val;
> +
> + if (pci->ops->read_dbi)
> + return pci->ops->read_dbi(pci, pci->atu_base, reg, size);
> +
> + ret = dw_pcie_read(pci->atu_base + reg, size, &val);
> + if (ret)
> + dev_err(pci->dev, "Read ATU address failed\n");
> +
> + return val;
> +}
> +EXPORT_SYMBOL_GPL(dw_pcie_read_atu);

Don't export dw_pcie_read_atu unnecessarily.

> +
> +void dw_pcie_write_atu(struct dw_pcie *pci, u32 reg, size_t size, u32 val)
> +{
> + int ret;
> +
> + if (pci->ops->write_dbi) {
> + pci->ops->write_dbi(pci, pci->atu_base, reg, size, val);
> + return;
> + }
> +
> + ret = dw_pcie_write(pci->atu_base + reg, size, val);
> + if (ret)
> + dev_err(pci->dev, "Write ATU address failed\n");
> +}
> +EXPORT_SYMBOL_GPL(dw_pcie_write_atu);

Don't export dw_pcie_write_atu unnecessarily.

Best regards,
Jingoo Han

.....

\
 
 \ /
  Last update: 2019-06-25 10:47    [W:0.049 / U:52.040 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site