/* * 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 #include #include #include "../ion.h" #include /* Needed by all modules */ #include /* 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);