49 |
#include "au_vortex.h" |
#include "au_vortex.h" |
50 |
#include <linux/version.h> |
#include <linux/version.h> |
51 |
|
|
52 |
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 8) |
53 |
|
#define AU_AUDIO_C_NEW_REMAP_PAGE_RANGE |
54 |
|
#endif |
55 |
|
|
56 |
static ssize_t au_audio_read(struct file *file, char *buffer, size_t count, loff_t *ppos); |
static ssize_t au_audio_read(struct file *file, char *buffer, size_t count, loff_t *ppos); |
57 |
static ssize_t au_audio_write(struct file *file, const char *buffer, size_t count, loff_t *ppos); |
static ssize_t au_audio_write(struct file *file, const char *buffer, size_t count, loff_t *ppos); |
58 |
static unsigned int au_audio_poll(struct file *file, struct poll_table_struct *wait); |
static unsigned int au_audio_poll(struct file *file, struct poll_table_struct *wait); |
624 |
unlock_kernel(); |
unlock_kernel(); |
625 |
return -EINVAL; |
return -EINVAL; |
626 |
} |
} |
627 |
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 8) |
#ifdef AU_AUDIO_C_NEW_REMAP_PAGE_RANGE |
628 |
if (remap_page_range(vma, vma->vm_start, virt_to_phys(stream->dmabuf), size, vma->vm_page_prot)) { |
if (remap_page_range(vma, vma->vm_start, virt_to_phys(stream->dmabuf), size, vma->vm_page_prot)) { |
629 |
#else |
#else |
630 |
if (remap_page_range(vma->vm_start, virt_to_phys(stream->dmabuf), size, vma->vm_page_prot)) { |
if (remap_page_range(vma->vm_start, virt_to_phys(stream->dmabuf), size, vma->vm_page_prot)) { |
646 |
unlock_kernel(); |
unlock_kernel(); |
647 |
return -EINVAL; |
return -EINVAL; |
648 |
} |
} |
649 |
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 5, 8) |
#ifdef AU_AUDIO_C_NEW_REMAP_PAGE_RANGE |
650 |
if (remap_page_range(vma, vma->vm_start, virt_to_phys(stream->dmabuf), size, vma->vm_page_prot)) { |
if (remap_page_range(vma, vma->vm_start, virt_to_phys(stream->dmabuf), size, vma->vm_page_prot)) { |
651 |
#else |
#else |
652 |
if (remap_page_range(vma->vm_start, virt_to_phys(stream->dmabuf), size, vma->vm_page_prot)) { |
if (remap_page_range(vma->vm_start, virt_to_phys(stream->dmabuf), size, vma->vm_page_prot)) { |