backports tree was automatically generated and integrated with the following command:
$ ./gentree.py --integrate --clean --git-revision v4.2-rc7 \
<path>/linux-next <path>/linux-mako
(we're using a slightly modified backports tree to adjust every export automatically for
our needs).
See https://backports.wiki.kernel.org/index.php/Documentation/integration for
documentation and https://github.com/ubuntu-phonedations/backports for the used backports
tree.
All uncessary parts (bcma, wifi, nfc etc.) were dropped and just the bluetooth relevant
parts are kept.
BugLink: http://bugs.launchpad.net/bugs/1489327
Signed-off-by: Simon Fels <simon.fels@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
42 lines
1.3 KiB
C
42 lines
1.3 KiB
C
/*
|
|
* Copyright (c) 2013 Luis R. Rodriguez <mcgrof@do-not-panic.com>
|
|
*
|
|
* Backport compatibility file for Linux for some DMA helpers
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License version 2 as
|
|
* published by the Free Software Foundation.
|
|
*/
|
|
|
|
#include <linux/module.h>
|
|
#include <linux/scatterlist.h>
|
|
#include <linux/dma-attrs.h>
|
|
#include <linux/device.h>
|
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)
|
|
#if LINUX_VERSION_CODE <= KERNEL_VERSION(3,6,0)
|
|
#include <linux/dma-direction.h>
|
|
#include <linux/dma-mapping.h>
|
|
#include <asm/dma-mapping.h>
|
|
#endif /* LINUX_VERSION_CODE <= KERNEL_VERSION(3,6,0) */
|
|
#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0) */
|
|
|
|
#if RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(7,0)
|
|
/*
|
|
* Create scatter-list for the already allocated DMA buffer.
|
|
*/
|
|
int dma_common_get_sgtable(struct device *dev, struct sg_table *sgt,
|
|
void *cpu_addr, dma_addr_t handle, size_t size)
|
|
{
|
|
struct page *page = virt_to_page(cpu_addr);
|
|
int ret;
|
|
|
|
ret = sg_alloc_table(sgt, 1, GFP_KERNEL);
|
|
if (unlikely(ret))
|
|
return ret;
|
|
|
|
sg_set_page(sgt->sgl, page, PAGE_ALIGN(size), 0);
|
|
return 0;
|
|
}
|
|
EXPORT_SYMBOL_GPL(dma_common_get_sgtable);
|
|
#endif /* RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(7,0) */
|