From patchwork Mon Dec 23 11:04:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Ujfalusi X-Patchwork-Id: 182390 Delivered-To: patch@linaro.org Received: by 2002:a92:a146:0:0:0:0:0 with SMTP id v67csp277419ili; Mon, 23 Dec 2019 03:06:13 -0800 (PST) X-Google-Smtp-Source: APXvYqwrSHLEwCgazqH96rZqE3kQ04DIDRQ+WATjDzAZKuershQGw+8e9mD5makgmM/9UYS+6MbF X-Received: by 2002:a9d:4e97:: with SMTP id v23mr30099514otk.201.1577099173846; Mon, 23 Dec 2019 03:06:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577099173; cv=none; d=google.com; s=arc-20160816; b=KDke/0tgpfXmLUsTPnN1+AXG8utvFzJJ9NNn2+bzgffq82XU5Se3W5KjrWhcdryIuu 2rJ1VijmgixUC9CrORLusoeR5QckEO/Oh7BFtL4KkhI53SUwwYUPO5NRji0voYo7W2Gx VYQvrLSdpN3dD4CHu7PkML7imUnTc5lL/C3kM+OhOBety9gnfGq8HBppqI08jWFPofxL ZVrcX3BwhjfNwViJZEko1HcjmXWFfTvrSKIDvW5tNaZoYuLTgSLrFFKCQgk+GjeoXGNv WGX/qcr5UMQ3P9ViF0rIcFJOTAh0b5bB6Hvcdull3LzjadnjxonIo6ZwdlJ3nZI4+lGT sjdQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=r1gS6mo4nypLVCopYeBhWj8jG7dU7VspthOGMAgLfCc=; b=nOrzJOeg6aVTm3F8NfXIQH4JovmF7E+tMQ8wW+3PvqmyqgzJ+Vtxk1MQd22AOyhq7w 8ipabWt1anXnJORi1DluWkzWl1D0HPWXNUGfm8p/5VV60tbKiO0Q1vPxeNsNLMhp9TeZ MLJWc1jD+ThhavpD3/Xh2wkxwP3qSNybJR+garXoTBJLDb5jbqwF42WQEvhUm3JQ58Xv YjxctQ5d1BSZAOJg9jXfpHbkNDJy4EB+9jbbHWmYbDuUPigDGsbL2aXyXL6LNUwz2F0q Jok5AdbLoMddp1YIN71cAqTzbv/r5DtwggZfmqfT/Shb8WW36fWTPZXYRnnzSw+7KKai qy0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=reCILNYQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n85si9068501oig.191.2019.12.23.03.06.13; Mon, 23 Dec 2019 03:06:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=reCILNYQ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727403AbfLWLGM (ORCPT + 27 others); Mon, 23 Dec 2019 06:06:12 -0500 Received: from fllv0015.ext.ti.com ([198.47.19.141]:52768 "EHLO fllv0015.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727354AbfLWLGG (ORCPT ); Mon, 23 Dec 2019 06:06:06 -0500 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id xBNB5vOD067342; Mon, 23 Dec 2019 05:05:57 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1577099157; bh=r1gS6mo4nypLVCopYeBhWj8jG7dU7VspthOGMAgLfCc=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=reCILNYQ06w6nhsoWm1LzMu9B8gj/GCwuN1tm6THht27TG84HqLsyP7ae/mdy2r1O oN1QZ4rhvak5Hwd2tHRSx3TbQOPuVqEen+XALH4mX2F2bXCq+zwVuST7JIwIR1YdKq UygbiAcxyJLukkL898z3D1lsK8e2t4lxh8Nel/SE= Received: from DFLE104.ent.ti.com (dfle104.ent.ti.com [10.64.6.25]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id xBNB5vku026316 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Mon, 23 Dec 2019 05:05:57 -0600 Received: from DFLE105.ent.ti.com (10.64.6.26) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Mon, 23 Dec 2019 05:05:47 -0600 Received: from lelv0327.itg.ti.com (10.180.67.183) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3 via Frontend Transport; Mon, 23 Dec 2019 05:05:47 -0600 Received: from feketebors.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0327.itg.ti.com (8.15.2/8.15.2) with ESMTP id xBNB4eMN025693; Mon, 23 Dec 2019 05:05:43 -0600 From: Peter Ujfalusi To: , , , CC: , , , , , , , , , , , Subject: [PATCH v8 16/18] dmaengine: ti: k3-udma: Allow the driver to be built as module Date: Mon, 23 Dec 2019 13:04:56 +0200 Message-ID: <20191223110458.30766-17-peter.ujfalusi@ti.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191223110458.30766-1-peter.ujfalusi@ti.com> References: <20191223110458.30766-1-peter.ujfalusi@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The ring accelerator driver can be built as module since all depending functions are exported. Signed-off-by: Peter Ujfalusi Tested-by: Keerthy Reviewed-by: Grygorii Strashko --- drivers/dma/ti/Kconfig | 2 +- drivers/dma/ti/k3-udma.c | 29 +++++++++++++++++++++++++++-- 2 files changed, 28 insertions(+), 3 deletions(-) -- Peter Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki diff --git a/drivers/dma/ti/Kconfig b/drivers/dma/ti/Kconfig index f76e06651f80..beb000be7d1b 100644 --- a/drivers/dma/ti/Kconfig +++ b/drivers/dma/ti/Kconfig @@ -35,7 +35,7 @@ config DMA_OMAP DMA engine is found on OMAP and DRA7xx parts. config TI_K3_UDMA - bool "Texas Instruments UDMA support" + tristate "Texas Instruments UDMA support" depends on ARCH_K3 || COMPILE_TEST depends on TI_SCI_PROTOCOL depends on TI_SCI_INTA_IRQCHIP diff --git a/drivers/dma/ti/k3-udma.c b/drivers/dma/ti/k3-udma.c index c97c5f6f1e29..dbed2205065a 100644 --- a/drivers/dma/ti/k3-udma.c +++ b/drivers/dma/ti/k3-udma.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -3088,6 +3089,7 @@ static const struct of_device_id udma_of_match[] = { }, { /* Sentinel */ }, }; +MODULE_DEVICE_TABLE(of, udma_of_match); static int udma_get_mmrs(struct platform_device *pdev, struct udma_dev *ud) { @@ -3426,15 +3428,38 @@ static int udma_probe(struct platform_device *pdev) return ret; } +static int udma_remove(struct platform_device *pdev) +{ + struct udma_dev *ud = platform_get_drvdata(pdev); + struct udma_chan *uc; + + list_for_each_entry(uc, &ud->ddev.channels, vc.chan.device_node) + tasklet_kill(&uc->vc.task); + + of_dma_controller_free(pdev->dev.of_node); + dma_async_device_unregister(&ud->ddev); + + /* Make sure that we did proper cleanup */ + cancel_work_sync(&ud->purge_work); + udma_purge_desc_work(&ud->purge_work); + + return 0; +} + static struct platform_driver udma_driver = { .driver = { .name = "ti-udma", .of_match_table = udma_of_match, - .suppress_bind_attrs = true, }, .probe = udma_probe, + .remove = udma_remove, }; -builtin_platform_driver(udma_driver); +module_platform_driver(udma_driver); /* Private interfaces to UDMA */ #include "k3-udma-private.c" + +MODULE_ALIAS("platform:ti-udma"); +MODULE_DESCRIPTION("TI K3 DMA driver for CPPI 5.0 compliant devices"); +MODULE_AUTHOR("Peter Ujfalusi "); +MODULE_LICENSE("GPL v2");