platform.c (a9c56721d6ae99b22e983d0722e6b1b53a11dd59) platform.c (e7b8514e4d68bec21fc6385fa0a66797ddc34ac9)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Platform driver for the Synopsys DesignWare DMA Controller
4 *
5 * Copyright (C) 2007-2008 Atmel Corporation
6 * Copyright (C) 2010-2011 ST Microelectronics
7 * Copyright (C) 2013 Intel Corporation
8 *

--- 70 unchanged lines hidden (view full) ---

79 info = devm_kzalloc(dev, sizeof(*info), GFP_KERNEL);
80 if (!info)
81 return;
82
83 dma_cap_zero(info->dma_cap);
84 dma_cap_set(DMA_SLAVE, info->dma_cap);
85 info->filter_fn = dw_dma_acpi_filter;
86
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Platform driver for the Synopsys DesignWare DMA Controller
4 *
5 * Copyright (C) 2007-2008 Atmel Corporation
6 * Copyright (C) 2010-2011 ST Microelectronics
7 * Copyright (C) 2013 Intel Corporation
8 *

--- 70 unchanged lines hidden (view full) ---

79 info = devm_kzalloc(dev, sizeof(*info), GFP_KERNEL);
80 if (!info)
81 return;
82
83 dma_cap_zero(info->dma_cap);
84 dma_cap_set(DMA_SLAVE, info->dma_cap);
85 info->filter_fn = dw_dma_acpi_filter;
86
87 ret = devm_acpi_dma_controller_register(dev, acpi_dma_simple_xlate,
88 info);
87 ret = acpi_dma_controller_register(dev, acpi_dma_simple_xlate, info);
89 if (ret)
90 dev_err(dev, "could not register acpi_dma_controller\n");
91}
88 if (ret)
89 dev_err(dev, "could not register acpi_dma_controller\n");
90}
91
92static void dw_dma_acpi_controller_free(struct dw_dma *dw)
93{
94 struct device *dev = dw->dma.dev;
95
96 acpi_dma_controller_free(dev);
97}
92#else /* !CONFIG_ACPI */
93static inline void dw_dma_acpi_controller_register(struct dw_dma *dw) {}
98#else /* !CONFIG_ACPI */
99static inline void dw_dma_acpi_controller_register(struct dw_dma *dw) {}
100static inline void dw_dma_acpi_controller_free(struct dw_dma *dw) {}
94#endif /* !CONFIG_ACPI */
95
96#ifdef CONFIG_OF
97static struct dw_dma_platform_data *
98dw_dma_parse_dt(struct platform_device *pdev)
99{
100 struct device_node *np = pdev->dev.of_node;
101 struct dw_dma_platform_data *pdata;

--- 142 unchanged lines hidden (view full) ---

244}
245
246static int dw_remove(struct platform_device *pdev)
247{
248 struct dw_dma_chip_pdata *data = platform_get_drvdata(pdev);
249 struct dw_dma_chip *chip = data->chip;
250 int ret;
251
101#endif /* !CONFIG_ACPI */
102
103#ifdef CONFIG_OF
104static struct dw_dma_platform_data *
105dw_dma_parse_dt(struct platform_device *pdev)
106{
107 struct device_node *np = pdev->dev.of_node;
108 struct dw_dma_platform_data *pdata;

--- 142 unchanged lines hidden (view full) ---

251}
252
253static int dw_remove(struct platform_device *pdev)
254{
255 struct dw_dma_chip_pdata *data = platform_get_drvdata(pdev);
256 struct dw_dma_chip *chip = data->chip;
257 int ret;
258
259 if (ACPI_HANDLE(&pdev->dev))
260 dw_dma_acpi_controller_free(chip->dw);
261
252 if (pdev->dev.of_node)
253 of_dma_controller_free(pdev->dev.of_node);
254
255 ret = data->remove(chip);
256 if (ret)
257 dev_warn(chip->dev, "can't remove device properly: %d\n", ret);
258
259 pm_runtime_disable(&pdev->dev);

--- 109 unchanged lines hidden ---
262 if (pdev->dev.of_node)
263 of_dma_controller_free(pdev->dev.of_node);
264
265 ret = data->remove(chip);
266 if (ret)
267 dev_warn(chip->dev, "can't remove device properly: %d\n", ret);
268
269 pm_runtime_disable(&pdev->dev);

--- 109 unchanged lines hidden ---