diff options
Diffstat (limited to 'drivers/staging/android/ion/css/css_ion_dev.c')
-rw-r--r-- | drivers/staging/android/ion/css/css_ion_dev.c | 71 |
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); |