aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/media/easycap/easycap_ioctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/media/easycap/easycap_ioctl.c')
-rw-r--r--drivers/staging/media/easycap/easycap_ioctl.c60
1 files changed, 26 insertions, 34 deletions
diff --git a/drivers/staging/media/easycap/easycap_ioctl.c b/drivers/staging/media/easycap/easycap_ioctl.c
index c99addfb624..9413b37490c 100644
--- a/drivers/staging/media/easycap/easycap_ioctl.c
+++ b/drivers/staging/media/easycap/easycap_ioctl.c
@@ -25,7 +25,6 @@
25*/ 25*/
26/*****************************************************************************/ 26/*****************************************************************************/
27 27
28#include <linux/version.h>
29#include "easycap.h" 28#include "easycap.h"
30 29
31/*--------------------------------------------------------------------------*/ 30/*--------------------------------------------------------------------------*/
@@ -125,7 +124,7 @@ int adjust_standard(struct easycap *peasycap, v4l2_std_id std_id)
125 } 124 }
126 if (peasycap->video_isoc_streaming) { 125 if (peasycap->video_isoc_streaming) {
127 resubmit = true; 126 resubmit = true;
128 kill_video_urbs(peasycap); 127 easycap_video_kill_urbs(peasycap);
129 } else 128 } else
130 resubmit = false; 129 resubmit = false;
131/*--------------------------------------------------------------------------*/ 130/*--------------------------------------------------------------------------*/
@@ -331,7 +330,7 @@ int adjust_standard(struct easycap *peasycap, v4l2_std_id std_id)
331 "from 0x%02X to 0x%02X\n", reg, itwas, isnow); 330 "from 0x%02X to 0x%02X\n", reg, itwas, isnow);
332 } 331 }
333 if (resubmit) 332 if (resubmit)
334 submit_video_urbs(peasycap); 333 easycap_video_submit_urbs(peasycap);
335 return 0; 334 return 0;
336} 335}
337/*****************************************************************************/ 336/*****************************************************************************/
@@ -558,7 +557,7 @@ int adjust_format(struct easycap *peasycap,
558 peasycap->bytesperpixel * peasycap->width * peasycap->height; 557 peasycap->bytesperpixel * peasycap->width * peasycap->height;
559 if (peasycap->video_isoc_streaming) { 558 if (peasycap->video_isoc_streaming) {
560 resubmit = true; 559 resubmit = true;
561 kill_video_urbs(peasycap); 560 easycap_video_kill_urbs(peasycap);
562 } else 561 } else
563 resubmit = false; 562 resubmit = false;
564/*---------------------------------------------------------------------------*/ 563/*---------------------------------------------------------------------------*/
@@ -622,7 +621,7 @@ int adjust_format(struct easycap *peasycap,
622 } 621 }
623/*---------------------------------------------------------------------------*/ 622/*---------------------------------------------------------------------------*/
624 if (resubmit) 623 if (resubmit)
625 submit_video_urbs(peasycap); 624 easycap_video_submit_urbs(peasycap);
626 625
627 return peasycap_best_format - easycap_format; 626 return peasycap_best_format - easycap_format;
628} 627}
@@ -667,16 +666,15 @@ int adjust_brightness(struct easycap *peasycap, int value)
667 peasycap->inputset[peasycap->input].brightness_ok = 1; 666 peasycap->inputset[peasycap->input].brightness_ok = 1;
668 } else 667 } else
669 JOM(8, "%i=peasycap->input\n", peasycap->input); 668 JOM(8, "%i=peasycap->input\n", peasycap->input);
669
670 mood = 0x00FF & (unsigned int)peasycap->brightness; 670 mood = 0x00FF & (unsigned int)peasycap->brightness;
671 if (!write_saa(peasycap->pusb_device, 0x0A, mood)) { 671 if (write_saa(peasycap->pusb_device, 0x0A, mood)) {
672 SAM("adjusting brightness to 0x%02X\n", mood);
673 return 0;
674 } else {
675 SAM("WARNING: failed to adjust brightness " 672 SAM("WARNING: failed to adjust brightness "
676 "to 0x%02X\n", mood); 673 "to 0x%02X\n", mood);
677 return -ENOENT; 674 return -ENOENT;
678 } 675 }
679 break; 676 SAM("adjusting brightness to 0x%02X\n", mood);
677 return 0;
680 } 678 }
681 i1++; 679 i1++;
682 } 680 }
@@ -726,15 +724,13 @@ int adjust_contrast(struct easycap *peasycap, int value)
726 JOM(8, "%i=peasycap->input\n", peasycap->input); 724 JOM(8, "%i=peasycap->input\n", peasycap->input);
727 725
728 mood = 0x00FF & (unsigned int) (peasycap->contrast - 128); 726 mood = 0x00FF & (unsigned int) (peasycap->contrast - 128);
729 if (!write_saa(peasycap->pusb_device, 0x0B, mood)) { 727 if (write_saa(peasycap->pusb_device, 0x0B, mood)) {
730 SAM("adjusting contrast to 0x%02X\n", mood);
731 return 0;
732 } else {
733 SAM("WARNING: failed to adjust contrast to " 728 SAM("WARNING: failed to adjust contrast to "
734 "0x%02X\n", mood); 729 "0x%02X\n", mood);
735 return -ENOENT; 730 return -ENOENT;
736 } 731 }
737 break; 732 SAM("adjusting contrast to 0x%02X\n", mood);
733 return 0;
738 } 734 }
739 i1++; 735 i1++;
740 } 736 }
@@ -784,14 +780,13 @@ int adjust_saturation(struct easycap *peasycap, int value)
784 } else 780 } else
785 JOM(8, "%i=peasycap->input\n", peasycap->input); 781 JOM(8, "%i=peasycap->input\n", peasycap->input);
786 mood = 0x00FF & (unsigned int) (peasycap->saturation - 128); 782 mood = 0x00FF & (unsigned int) (peasycap->saturation - 128);
787 if (!write_saa(peasycap->pusb_device, 0x0C, mood)) { 783 if (write_saa(peasycap->pusb_device, 0x0C, mood)) {
788 SAM("adjusting saturation to 0x%02X\n", mood);
789 return 0;
790 } else {
791 SAM("WARNING: failed to adjust saturation to " 784 SAM("WARNING: failed to adjust saturation to "
792 "0x%02X\n", mood); 785 "0x%02X\n", mood);
793 return -ENOENT; 786 return -ENOENT;
794 } 787 }
788 SAM("adjusting saturation to 0x%02X\n", mood);
789 return 0;
795 break; 790 break;
796 } 791 }
797 i1++; 792 i1++;
@@ -839,13 +834,12 @@ int adjust_hue(struct easycap *peasycap, int value)
839 JOM(8, "%i=peasycap->input\n", peasycap->input); 834 JOM(8, "%i=peasycap->input\n", peasycap->input);
840 i2 = peasycap->hue - 128; 835 i2 = peasycap->hue - 128;
841 mood = 0x00FF & ((int) i2); 836 mood = 0x00FF & ((int) i2);
842 if (!write_saa(peasycap->pusb_device, 0x0D, mood)) { 837 if (write_saa(peasycap->pusb_device, 0x0D, mood)) {
843 SAM("adjusting hue to 0x%02X\n", mood);
844 return 0;
845 } else {
846 SAM("WARNING: failed to adjust hue to 0x%02X\n", mood); 838 SAM("WARNING: failed to adjust hue to 0x%02X\n", mood);
847 return -ENOENT; 839 return -ENOENT;
848 } 840 }
841 SAM("adjusting hue to 0x%02X\n", mood);
842 return 0;
849 break; 843 break;
850 } 844 }
851 i1++; 845 i1++;
@@ -854,7 +848,7 @@ int adjust_hue(struct easycap *peasycap, int value)
854 return -ENOENT; 848 return -ENOENT;
855} 849}
856/*****************************************************************************/ 850/*****************************************************************************/
857int adjust_volume(struct easycap *peasycap, int value) 851static int adjust_volume(struct easycap *peasycap, int value)
858{ 852{
859 s8 mood; 853 s8 mood;
860 int i1; 854 int i1;
@@ -885,15 +879,13 @@ int adjust_volume(struct easycap *peasycap, int value)
885 mood = (16 > peasycap->volume) ? 16 : 879 mood = (16 > peasycap->volume) ? 16 :
886 ((31 < peasycap->volume) ? 31 : 880 ((31 < peasycap->volume) ? 31 :
887 (s8) peasycap->volume); 881 (s8) peasycap->volume);
888 if (!audio_gainset(peasycap->pusb_device, mood)) { 882 if (!easycap_audio_gainset(peasycap->pusb_device, mood)) {
889 SAM("adjusting volume to 0x%02X\n", mood);
890 return 0;
891 } else {
892 SAM("WARNING: failed to adjust volume to " 883 SAM("WARNING: failed to adjust volume to "
893 "0x%2X\n", mood); 884 "0x%2X\n", mood);
894 return -ENOENT; 885 return -ENOENT;
895 } 886 }
896 break; 887 SAM("adjusting volume to 0x%02X\n", mood);
888 return 0;
897 } 889 }
898 i1++; 890 i1++;
899 } 891 }
@@ -971,7 +963,7 @@ long easycap_unlocked_ioctl(struct file *file,
971 SAM("ERROR: peasycap->pusb_device is NULL\n"); 963 SAM("ERROR: peasycap->pusb_device is NULL\n");
972 return -EFAULT; 964 return -EFAULT;
973 } 965 }
974 kd = isdongle(peasycap); 966 kd = easycap_isdongle(peasycap);
975 if (0 <= kd && DONGLE_MANY > kd) { 967 if (0 <= kd && DONGLE_MANY > kd) {
976 if (mutex_lock_interruptible(&easycapdc60_dongle[kd].mutex_video)) { 968 if (mutex_lock_interruptible(&easycapdc60_dongle[kd].mutex_video)) {
977 SAY("ERROR: cannot lock " 969 SAY("ERROR: cannot lock "
@@ -986,7 +978,7 @@ long easycap_unlocked_ioctl(struct file *file,
986 * IF NECESSARY, BAIL OUT. 978 * IF NECESSARY, BAIL OUT.
987 */ 979 */
988/*---------------------------------------------------------------------------*/ 980/*---------------------------------------------------------------------------*/
989 if (kd != isdongle(peasycap)) 981 if (kd != easycap_isdongle(peasycap))
990 return -ERESTARTSYS; 982 return -ERESTARTSYS;
991 if (!file) { 983 if (!file) {
992 SAY("ERROR: file is NULL\n"); 984 SAY("ERROR: file is NULL\n");
@@ -1226,7 +1218,7 @@ long easycap_unlocked_ioctl(struct file *file,
1226 return -EINVAL; 1218 return -EINVAL;
1227 } 1219 }
1228 1220
1229 rc = newinput(peasycap, (int)index); 1221 rc = easycap_newinput(peasycap, (int)index);
1230 if (0 == rc) { 1222 if (0 == rc) {
1231 JOM(8, "newinput(.,%i) OK\n", (int)index); 1223 JOM(8, "newinput(.,%i) OK\n", (int)index);
1232 } else { 1224 } else {
@@ -2209,7 +2201,7 @@ long easycap_unlocked_ioctl(struct file *file,
2209 2201
2210 if (!peasycap->polled) { 2202 if (!peasycap->polled) {
2211 do { 2203 do {
2212 rcdq = easycap_dqbuf(peasycap, 0); 2204 rcdq = easycap_video_dqbuf(peasycap, 0);
2213 if (-EIO == rcdq) { 2205 if (-EIO == rcdq) {
2214 JOM(8, "returning -EIO because " 2206 JOM(8, "returning -EIO because "
2215 "dqbuf() returned -EIO\n"); 2207 "dqbuf() returned -EIO\n");
@@ -2313,7 +2305,7 @@ long easycap_unlocked_ioctl(struct file *file,
2313 mutex_unlock(&easycapdc60_dongle[kd].mutex_video); 2305 mutex_unlock(&easycapdc60_dongle[kd].mutex_video);
2314 return -EFAULT; 2306 return -EFAULT;
2315 } 2307 }
2316 submit_video_urbs(peasycap); 2308 easycap_video_submit_urbs(peasycap);
2317 peasycap->video_idle = 0; 2309 peasycap->video_idle = 0;
2318 peasycap->audio_idle = 0; 2310 peasycap->audio_idle = 0;
2319 peasycap->video_eof = 0; 2311 peasycap->video_eof = 0;