Lines 34-39
Link Here
|
34 |
#include <linux/usb.h> |
34 |
#include <linux/usb.h> |
35 |
#include <linux/delay.h> |
35 |
#include <linux/delay.h> |
36 |
#include <linux/version.h> /* For LINUX_VERSION_CODE */ |
36 |
#include <linux/version.h> /* For LINUX_VERSION_CODE */ |
|
|
37 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) ) |
38 |
#include <linux/semaphore.h> |
39 |
#endif |
37 |
#if ( LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,24) ) |
40 |
#if ( LINUX_VERSION_CODE <= KERNEL_VERSION(2,6,24) ) |
38 |
#include <sound/driver.h> |
41 |
#include <sound/driver.h> |
39 |
#endif |
42 |
#endif |
Lines 3062-3068
Link Here
|
3062 |
goto hdj_create_bulk_interface_error; |
3065 |
goto hdj_create_bulk_interface_error; |
3063 |
} |
3066 |
} |
3064 |
/* allocate the buffer for bulk_out_urb */ |
3067 |
/* allocate the buffer for bulk_out_urb */ |
|
|
3068 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) ) |
3069 |
sema_init(&ubulk->bulk_out_buffer_mutex,1); |
3070 |
#else |
3065 |
init_MUTEX(&ubulk->bulk_out_buffer_mutex); |
3071 |
init_MUTEX(&ubulk->bulk_out_buffer_mutex); |
|
|
3072 |
#endif |
3066 |
|
3073 |
|
3067 |
ubulk->bulk_out_buffer = |
3074 |
ubulk->bulk_out_buffer = |
3068 |
usb_buffer_alloc(ubulk->chip->dev, ubulk->bulk_out_size, |
3075 |
usb_buffer_alloc(ubulk->chip->dev, ubulk->bulk_out_size, |
Lines 3601-3607
Link Here
|
3601 |
return -EINVAL; |
3608 |
return -EINVAL; |
3602 |
} |
3609 |
} |
3603 |
|
3610 |
|
|
|
3611 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) ) |
3612 |
sema_init(&ubulk->output_control_mutex,1); |
3613 |
#else |
3604 |
init_MUTEX(&ubulk->output_control_mutex); |
3614 |
init_MUTEX(&ubulk->output_control_mutex); |
|
|
3615 |
#endif |
3605 |
init_completion(&ubulk->output_control_completion); |
3616 |
init_completion(&ubulk->output_control_completion); |
3606 |
|
3617 |
|
3607 |
/* Every product here except the Steel targets HID. Since the steel does not target HID, we don't |
3618 |
/* Every product here except the Steel targets HID. Since the steel does not target HID, we don't |
Lines 3855-3861
Link Here
|
3855 |
u16 value = 0; |
3866 |
u16 value = 0; |
3856 |
struct hdj_console_context *dc = ((struct hdj_console_context *)ubulk->device_context); |
3867 |
struct hdj_console_context *dc = ((struct hdj_console_context *)ubulk->device_context); |
3857 |
|
3868 |
|
|
|
3869 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) ) |
3870 |
sema_init(&dc->device_config_mutex,1); |
3871 |
#else |
3858 |
init_MUTEX(&dc->device_config_mutex); |
3872 |
init_MUTEX(&dc->device_config_mutex); |
|
|
3873 |
#endif |
3859 |
|
3874 |
|
3860 |
ret = hdjbulk_init_common_context(ubulk,&ubulk->hdj_common); |
3875 |
ret = hdjbulk_init_common_context(ubulk,&ubulk->hdj_common); |
3861 |
if (ret!=0) { |
3876 |
if (ret!=0) { |
Lines 4133-4139
Link Here
|
4133 |
|
4148 |
|
4134 |
spin_lock_init(&dc->bulk_buffer_lock); |
4149 |
spin_lock_init(&dc->bulk_buffer_lock); |
4135 |
init_completion(&dc->bulk_request_completion); |
4150 |
init_completion(&dc->bulk_request_completion); |
|
|
4151 |
#if ( LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37) ) |
4152 |
sema_init(&dc->bulk_request_mutex,1); |
4153 |
#else |
4136 |
init_MUTEX(&dc->bulk_request_mutex); |
4154 |
init_MUTEX(&dc->bulk_request_mutex); |
|
|
4155 |
#endif |
4137 |
|
4156 |
|
4138 |
if ((ret = init_continuous_reader(ubulk))!=0) { |
4157 |
if ((ret = init_continuous_reader(ubulk))!=0) { |
4139 |
printk(KERN_WARNING"%s() init_continuous_reader() failed, rc:%d\n", |
4158 |
printk(KERN_WARNING"%s() init_continuous_reader() failed, rc:%d\n", |