| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Qualcomm Technologies HIDMA DMA engine low level code |
|---|
| 3 | 4 | * |
|---|
| 4 | 5 | * 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. |
|---|
| 14 | 6 | */ |
|---|
| 15 | 7 | |
|---|
| 16 | 8 | #include <linux/dmaengine.h> |
|---|
| .. | .. |
|---|
| 181 | 173 | /* |
|---|
| 182 | 174 | * Multiple TREs may be queued and waiting in the pending queue. |
|---|
| 183 | 175 | */ |
|---|
| 184 | | -static void hidma_ll_tre_complete(unsigned long arg) |
|---|
| 176 | +static void hidma_ll_tre_complete(struct tasklet_struct *t) |
|---|
| 185 | 177 | { |
|---|
| 186 | | - struct hidma_lldev *lldev = (struct hidma_lldev *)arg; |
|---|
| 178 | + struct hidma_lldev *lldev = from_tasklet(lldev, t, task); |
|---|
| 187 | 179 | struct hidma_tre *tre; |
|---|
| 188 | 180 | |
|---|
| 189 | 181 | while (kfifo_out(&lldev->handoff_fifo, &tre, 1)) { |
|---|
| .. | .. |
|---|
| 757 | 749 | if (!lldev->tre_ring) |
|---|
| 758 | 750 | return NULL; |
|---|
| 759 | 751 | |
|---|
| 760 | | - memset(lldev->tre_ring, 0, (HIDMA_TRE_SIZE + 1) * nr_tres); |
|---|
| 761 | 752 | lldev->tre_ring_size = HIDMA_TRE_SIZE * nr_tres; |
|---|
| 762 | 753 | lldev->nr_tres = nr_tres; |
|---|
| 763 | 754 | |
|---|
| .. | .. |
|---|
| 777 | 768 | if (!lldev->evre_ring) |
|---|
| 778 | 769 | return NULL; |
|---|
| 779 | 770 | |
|---|
| 780 | | - memset(lldev->evre_ring, 0, (HIDMA_EVRE_SIZE + 1) * nr_tres); |
|---|
| 781 | 771 | lldev->evre_ring_size = HIDMA_EVRE_SIZE * nr_tres; |
|---|
| 782 | 772 | |
|---|
| 783 | 773 | /* the EVRE ring has to be EVRE_SIZE aligned */ |
|---|
| .. | .. |
|---|
| 802 | 792 | return NULL; |
|---|
| 803 | 793 | |
|---|
| 804 | 794 | 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); |
|---|
| 806 | 796 | lldev->initialized = 1; |
|---|
| 807 | 797 | writel(ENABLE_IRQS, lldev->evca + HIDMA_EVCA_IRQ_EN_REG); |
|---|
| 808 | 798 | return lldev; |
|---|