forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-09 b22da3d8526a935aa31e086e63f60ff3246cb61c
kernel/drivers/dma/qcom/hidma_ll.c
....@@ -1,16 +1,8 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Qualcomm Technologies HIDMA DMA engine low level code
34 *
45 * Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
5
- *
6
- * This program is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License version 2 and
8
- * only version 2 as published by the Free Software Foundation.
9
- *
10
- * This program is distributed in the hope that it will be useful,
11
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
- * GNU General Public License for more details.
146 */
157
168 #include <linux/dmaengine.h>
....@@ -181,9 +173,9 @@
181173 /*
182174 * Multiple TREs may be queued and waiting in the pending queue.
183175 */
184
-static void hidma_ll_tre_complete(unsigned long arg)
176
+static void hidma_ll_tre_complete(struct tasklet_struct *t)
185177 {
186
- struct hidma_lldev *lldev = (struct hidma_lldev *)arg;
178
+ struct hidma_lldev *lldev = from_tasklet(lldev, t, task);
187179 struct hidma_tre *tre;
188180
189181 while (kfifo_out(&lldev->handoff_fifo, &tre, 1)) {
....@@ -757,7 +749,6 @@
757749 if (!lldev->tre_ring)
758750 return NULL;
759751
760
- memset(lldev->tre_ring, 0, (HIDMA_TRE_SIZE + 1) * nr_tres);
761752 lldev->tre_ring_size = HIDMA_TRE_SIZE * nr_tres;
762753 lldev->nr_tres = nr_tres;
763754
....@@ -777,7 +768,6 @@
777768 if (!lldev->evre_ring)
778769 return NULL;
779770
780
- memset(lldev->evre_ring, 0, (HIDMA_EVRE_SIZE + 1) * nr_tres);
781771 lldev->evre_ring_size = HIDMA_EVRE_SIZE * nr_tres;
782772
783773 /* the EVRE ring has to be EVRE_SIZE aligned */
....@@ -802,7 +792,7 @@
802792 return NULL;
803793
804794 spin_lock_init(&lldev->lock);
805
- tasklet_init(&lldev->task, hidma_ll_tre_complete, (unsigned long)lldev);
795
+ tasklet_setup(&lldev->task, hidma_ll_tre_complete);
806796 lldev->initialized = 1;
807797 writel(ENABLE_IRQS, lldev->evca + HIDMA_EVCA_IRQ_EN_REG);
808798 return lldev;