.. | .. |
---|
20 | 20 | #include <linux/workqueue.h> |
---|
21 | 21 | #include <linux/version.h> |
---|
22 | 22 | #include <linux/pwm.h> |
---|
| 23 | +#include <linux/compat.h> |
---|
23 | 24 | |
---|
24 | 25 | #define DRIVER_VERSION KERNEL_VERSION(0, 0x01, 0x1) |
---|
25 | 26 | |
---|
.. | .. |
---|
48 | 49 | /* assures led-triggers compatibility */ |
---|
49 | 50 | struct work_struct work_brightness_set; |
---|
50 | 51 | |
---|
51 | | - struct timeval timestamp; |
---|
| 52 | + struct __kernel_old_timeval timestamp; |
---|
52 | 53 | |
---|
53 | 54 | u32 timeout; |
---|
54 | 55 | bool waiting; |
---|
.. | .. |
---|
102 | 103 | wake_up(&led->done); |
---|
103 | 104 | } |
---|
104 | 105 | } else { |
---|
105 | | - led->timestamp = ns_to_timeval(ktime_get_ns()); |
---|
| 106 | + led->timestamp = ns_to_kernel_old_timeval(ktime_get_ns()); |
---|
106 | 107 | } |
---|
107 | 108 | mutex_unlock(&led->lock); |
---|
108 | 109 | return 0; |
---|
.. | .. |
---|
448 | 449 | unsigned int cmd, void *arg) |
---|
449 | 450 | { |
---|
450 | 451 | struct rgb13h_led *led = sd_to_led(sd); |
---|
451 | | - struct timeval *t; |
---|
| 452 | + struct __kernel_old_timeval *t; |
---|
452 | 453 | |
---|
453 | 454 | if (cmd == RK_VIDIOC_FLASH_TIMEINFO) { |
---|
454 | | - t = (struct timeval *)arg; |
---|
| 455 | + t = (struct __kernel_old_timeval *)arg; |
---|
455 | 456 | t->tv_sec = led->timestamp.tv_sec; |
---|
456 | 457 | t->tv_usec = led->timestamp.tv_usec; |
---|
457 | 458 | } else { |
---|
.. | .. |
---|
462 | 463 | |
---|
463 | 464 | #ifdef CONFIG_COMPAT |
---|
464 | 465 | #define RK_VIDIOC_COMPAT_FLASH_TIMEINFO \ |
---|
465 | | - _IOR('V', BASE_VIDIOC_PRIVATE + 0, struct compat_timeval) |
---|
| 466 | + _IOR('V', BASE_VIDIOC_PRIVATE + 0, struct old_timeval32) |
---|
466 | 467 | static long rgb13h_compat_ioctl32(struct v4l2_subdev *sd, |
---|
467 | 468 | unsigned int cmd, |
---|
468 | 469 | unsigned long arg) |
---|
469 | 470 | { |
---|
470 | | - struct timeval t; |
---|
471 | | - struct compat_timeval compat_t; |
---|
472 | | - struct compat_timeval __user *p32 = compat_ptr(arg); |
---|
| 471 | + struct __kernel_old_timeval t; |
---|
| 472 | + struct old_timeval32 compat_t; |
---|
| 473 | + struct old_timeval32 __user *p32 = compat_ptr(arg); |
---|
473 | 474 | |
---|
474 | 475 | if (cmd == RK_VIDIOC_COMPAT_FLASH_TIMEINFO) { |
---|
475 | 476 | rgb13h_ioctl(sd, RK_VIDIOC_FLASH_TIMEINFO, &t); |
---|