aboutsummaryrefslogtreecommitdiff
path: root/drivers/staging/android/ion/css/css_ion_dev.c
diff options
context:
space:
mode:
authorManoj Kumar <manoj.kumar3@arm.com>2018-04-24 15:28:48 +0530
committerArvind Chauhan <arvind.chauhan@arm.com>2018-10-30 16:07:02 +0000
commit7d6509e01ad59d547c6fe685e7118d7f9af88ac9 (patch)
tree40e0c2e799683459b47fde92c15eca981bf0f0c3 /drivers/staging/android/ion/css/css_ion_dev.c
parent007476f1eeb55ee44cc7dbe34bad738531f68c9a (diff)
drivers: ion: css: add ion driver for arm css subsystemsack-4.9-armlt-18.10
Change-Id: Id170c304275fd44f849461ab87b495331cc2b312 Signed-off-by: Tushar Khandelwal <tushar.khandelwal@arm.com> Signed-off-by: Manoj Kumar <manoj.kumar3@arm.com>
Diffstat (limited to 'drivers/staging/android/ion/css/css_ion_dev.c')
-rw-r--r--drivers/staging/android/ion/css/css_ion_dev.c71
1 files changed, 71 insertions, 0 deletions
diff --git a/drivers/staging/android/ion/css/css_ion_dev.c b/drivers/staging/android/ion/css/css_ion_dev.c
new file mode 100644
index 000000000000..6e88c492c6fd
--- /dev/null
+++ b/drivers/staging/android/ion/css/css_ion_dev.c
@@ -0,0 +1,71 @@
+/*
+ * drivers/gpu/ion/css/css_ion_dev.c
+ *
+ * Copyright (C) 2014 ARM, Inc.
+ *
+ * This software is licensed under the terms of the GNU General Public
+ * License version 2, as published by the Free Software Foundation, and
+ * may be copied, distributed, and modified under those terms.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ */
+
+#include <linux/err.h>
+#include <linux/platform_device.h>
+#include <linux/dma-mapping.h>
+#include "../ion.h"
+#include <linux/module.h> /* Needed by all modules */
+#include <linux/kernel.h> /* Needed for KERN_INFO */
+
+u64 css_dmamask = DMA_BIT_MASK(64);
+
+struct platform_device css_device_ion = {
+ .name = "ion-css",
+ .id = -1,
+};
+
+struct ion_platform_heap css_heaps[] = {
+ {
+ .id = ION_HEAP_TYPE_SYSTEM,
+ .type = ION_HEAP_TYPE_SYSTEM,
+ .name = "system",
+ },
+ {
+ .id = ION_HEAP_TYPE_SYSTEM_CONTIG,
+ .type = ION_HEAP_TYPE_SYSTEM_CONTIG,
+ .name = "system contig",
+ },
+ {
+ .id = ION_HEAP_TYPE_DMA,
+ .type = ION_HEAP_TYPE_DMA,
+ .name = "ion_dma_heap-3",
+ .priv = &css_device_ion.dev,
+ }
+};
+
+struct ion_platform_data css_ion_pdata = {
+ .nr = 3,
+ .heaps = css_heaps,
+};
+
+static int __init css_ion_dev_init(void)
+{
+ css_device_ion.dev.platform_data = &css_ion_pdata;
+ css_device_ion.dev.coherent_dma_mask = css_dmamask;
+ css_device_ion.dev.dma_mask = &css_dmamask;
+
+
+ return platform_device_register(&css_device_ion);
+}
+
+static void __exit css_ion_dev_exit(void)
+{
+ platform_device_unregister(&css_device_ion);
+}
+
+module_init(css_ion_dev_init);
+module_exit(css_ion_dev_exit);