hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/dma/nbpfaxi.c
....@@ -1,10 +1,7 @@
1
+// SPDX-License-Identifier: GPL-2.0
12 /*
23 * Copyright (C) 2013-2014 Renesas Electronics Europe Ltd.
34 * Author: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
4
- *
5
- * This program is free software; you can redistribute it and/or modify
6
- * it under the terms of version 2 of the GNU General Public License as
7
- * published by the Free Software Foundation.
85 */
96
107 #include <linux/bitmap.h>
....@@ -147,6 +144,7 @@
147144 * @async_tx: dmaengine object
148145 * @user_wait: waiting for a user ack
149146 * @length: total transfer length
147
+ * @chan: associated DMAC channel
150148 * @sg: list of hardware descriptors, represented by struct nbpf_link_desc
151149 * @node: member in channel descriptor lists
152150 */
....@@ -177,13 +175,17 @@
177175 /**
178176 * struct nbpf_channel - one DMAC channel
179177 * @dma_chan: standard dmaengine channel object
178
+ * @tasklet: channel specific tasklet used for callbacks
180179 * @base: register address base
181180 * @nbpf: DMAC
182181 * @name: IRQ name
183182 * @irq: IRQ number
184
- * @slave_addr: address for slave DMA
185
- * @slave_width:slave data size in bytes
186
- * @slave_burst:maximum slave burst size in bytes
183
+ * @slave_src_addr: source address for slave DMA
184
+ * @slave_src_width: source slave data size in bytes
185
+ * @slave_src_burst: maximum source slave burst size in bytes
186
+ * @slave_dst_addr: destination address for slave DMA
187
+ * @slave_dst_width: destination slave data size in bytes
188
+ * @slave_dst_burst: maximum destination slave burst size in bytes
187189 * @terminal: DMA terminal, assigned to this channel
188190 * @dmarq_cfg: DMA request line configuration - high / low, edge / level for NBPF_CHAN_CFG
189191 * @flags: configuration flags from DT
....@@ -194,6 +196,8 @@
194196 * @active: list of descriptors, scheduled for processing
195197 * @done: list of completed descriptors, waiting post-processing
196198 * @desc_page: list of additionally allocated descriptor pages - if any
199
+ * @running: linked descriptor of running transaction
200
+ * @paused: are translations on this channel paused?
197201 */
198202 struct nbpf_channel {
199203 struct dma_chan dma_chan;
....@@ -479,7 +483,7 @@
479483
480484 default:
481485 pr_warn("%s(): invalid bus width %u\n", __func__, width);
482
- /* fall through */
486
+ fallthrough;
483487 case DMA_SLAVE_BUSWIDTH_1_BYTE:
484488 size = burst;
485489 }
....@@ -1095,8 +1099,8 @@
10951099 if (!dchan)
10961100 return NULL;
10971101
1098
- dev_dbg(dchan->device->dev, "Entry %s(%s)\n", __func__,
1099
- dma_spec->np->name);
1102
+ dev_dbg(dchan->device->dev, "Entry %s(%pOFn)\n", __func__,
1103
+ dma_spec->np);
11001104
11011105 chan = nbpf_to_chan(dchan);
11021106
....@@ -1109,9 +1113,9 @@
11091113 return dchan;
11101114 }
11111115
1112
-static void nbpf_chan_tasklet(unsigned long data)
1116
+static void nbpf_chan_tasklet(struct tasklet_struct *t)
11131117 {
1114
- struct nbpf_channel *chan = (struct nbpf_channel *)data;
1118
+ struct nbpf_channel *chan = from_tasklet(chan, t, tasklet);
11151119 struct nbpf_desc *desc, *tmp;
11161120 struct dmaengine_desc_callback cb;
11171121
....@@ -1256,7 +1260,7 @@
12561260
12571261 snprintf(chan->name, sizeof(chan->name), "nbpf %d", n);
12581262
1259
- tasklet_init(&chan->tasklet, nbpf_chan_tasklet, (unsigned long)chan);
1263
+ tasklet_setup(&chan->tasklet, nbpf_chan_tasklet);
12601264 ret = devm_request_irq(dma_dev->dev, chan->irq,
12611265 nbpf_chan_irq, IRQF_SHARED,
12621266 chan->name, chan);
....@@ -1494,14 +1498,14 @@
14941498 #ifdef CONFIG_PM
14951499 static int nbpf_runtime_suspend(struct device *dev)
14961500 {
1497
- struct nbpf_device *nbpf = platform_get_drvdata(to_platform_device(dev));
1501
+ struct nbpf_device *nbpf = dev_get_drvdata(dev);
14981502 clk_disable_unprepare(nbpf->clk);
14991503 return 0;
15001504 }
15011505
15021506 static int nbpf_runtime_resume(struct device *dev)
15031507 {
1504
- struct nbpf_device *nbpf = platform_get_drvdata(to_platform_device(dev));
1508
+ struct nbpf_device *nbpf = dev_get_drvdata(dev);
15051509 return clk_prepare_enable(nbpf->clk);
15061510 }
15071511 #endif