aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/media/pwc
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@stusta.de>2005-04-22 18:07:00 -0400
committerGreg KH <gregkh@suse.de>2005-04-22 18:07:00 -0400
commit2c47e7f37830cc83e7c77f0d5b7d4ac15105475b (patch)
tree051be37e98b7f5a1fe590818c1044ea3aac3f42a /drivers/usb/media/pwc
parent7107627b04b46bce8212e6a6811add5eb8bcb476 (diff)
[PATCH] USB: drivers/usb/media/pwc/: make code static
This patch makes needlessly global code static. Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/media/pwc')
-rw-r--r--drivers/usb/media/pwc/pwc-ctrl.c78
-rw-r--r--drivers/usb/media/pwc/pwc-if.c2
-rw-r--r--drivers/usb/media/pwc/pwc.h6
3 files changed, 41 insertions, 45 deletions
diff --git a/drivers/usb/media/pwc/pwc-ctrl.c b/drivers/usb/media/pwc/pwc-ctrl.c
index 26aa914bc541..42352f531bc0 100644
--- a/drivers/usb/media/pwc/pwc-ctrl.c
+++ b/drivers/usb/media/pwc/pwc-ctrl.c
@@ -418,6 +418,44 @@ static inline int set_video_mode_Kiara(struct pwc_device *pdev, int size, int fr
418 418
419 419
420 420
421static void pwc_set_image_buffer_size(struct pwc_device *pdev)
422{
423 int i, factor = 0, filler = 0;
424
425 /* for PALETTE_YUV420P */
426 switch(pdev->vpalette)
427 {
428 case VIDEO_PALETTE_YUV420P:
429 factor = 6;
430 filler = 128;
431 break;
432 case VIDEO_PALETTE_RAW:
433 factor = 6; /* can be uncompressed YUV420P */
434 filler = 0;
435 break;
436 }
437
438 /* Set sizes in bytes */
439 pdev->image.size = pdev->image.x * pdev->image.y * factor / 4;
440 pdev->view.size = pdev->view.x * pdev->view.y * factor / 4;
441
442 /* Align offset, or you'll get some very weird results in
443 YUV420 mode... x must be multiple of 4 (to get the Y's in
444 place), and y even (or you'll mixup U & V). This is less of a
445 problem for YUV420P.
446 */
447 pdev->offset.x = ((pdev->view.x - pdev->image.x) / 2) & 0xFFFC;
448 pdev->offset.y = ((pdev->view.y - pdev->image.y) / 2) & 0xFFFE;
449
450 /* Fill buffers with gray or black */
451 for (i = 0; i < MAX_IMAGES; i++) {
452 if (pdev->image_ptr[i] != NULL)
453 memset(pdev->image_ptr[i], filler, pdev->view.size);
454 }
455}
456
457
458
421/** 459/**
422 @pdev: device structure 460 @pdev: device structure
423 @width: viewport width 461 @width: viewport width
@@ -475,44 +513,6 @@ int pwc_set_video_mode(struct pwc_device *pdev, int width, int height, int frame
475} 513}
476 514
477 515
478void pwc_set_image_buffer_size(struct pwc_device *pdev)
479{
480 int i, factor = 0, filler = 0;
481
482 /* for PALETTE_YUV420P */
483 switch(pdev->vpalette)
484 {
485 case VIDEO_PALETTE_YUV420P:
486 factor = 6;
487 filler = 128;
488 break;
489 case VIDEO_PALETTE_RAW:
490 factor = 6; /* can be uncompressed YUV420P */
491 filler = 0;
492 break;
493 }
494
495 /* Set sizes in bytes */
496 pdev->image.size = pdev->image.x * pdev->image.y * factor / 4;
497 pdev->view.size = pdev->view.x * pdev->view.y * factor / 4;
498
499 /* Align offset, or you'll get some very weird results in
500 YUV420 mode... x must be multiple of 4 (to get the Y's in
501 place), and y even (or you'll mixup U & V). This is less of a
502 problem for YUV420P.
503 */
504 pdev->offset.x = ((pdev->view.x - pdev->image.x) / 2) & 0xFFFC;
505 pdev->offset.y = ((pdev->view.y - pdev->image.y) / 2) & 0xFFFE;
506
507 /* Fill buffers with gray or black */
508 for (i = 0; i < MAX_IMAGES; i++) {
509 if (pdev->image_ptr[i] != NULL)
510 memset(pdev->image_ptr[i], filler, pdev->view.size);
511 }
512}
513
514
515
516/* BRIGHTNESS */ 516/* BRIGHTNESS */
517 517
518int pwc_get_brightness(struct pwc_device *pdev) 518int pwc_get_brightness(struct pwc_device *pdev)
@@ -949,7 +949,7 @@ int pwc_set_leds(struct pwc_device *pdev, int on_value, int off_value)
949 return SendControlMsg(SET_STATUS_CTL, LED_FORMATTER, 2); 949 return SendControlMsg(SET_STATUS_CTL, LED_FORMATTER, 2);
950} 950}
951 951
952int pwc_get_leds(struct pwc_device *pdev, int *on_value, int *off_value) 952static int pwc_get_leds(struct pwc_device *pdev, int *on_value, int *off_value)
953{ 953{
954 unsigned char buf[2]; 954 unsigned char buf[2];
955 int ret; 955 int ret;
diff --git a/drivers/usb/media/pwc/pwc-if.c b/drivers/usb/media/pwc/pwc-if.c
index 100a5a4f03a3..c3c3e5a101d9 100644
--- a/drivers/usb/media/pwc/pwc-if.c
+++ b/drivers/usb/media/pwc/pwc-if.c
@@ -129,7 +129,7 @@ static int default_mbufs = 2; /* Default number of mmap() buffers */
129 int pwc_trace = TRACE_MODULE | TRACE_FLOW | TRACE_PWCX; 129 int pwc_trace = TRACE_MODULE | TRACE_FLOW | TRACE_PWCX;
130static int power_save = 0; 130static int power_save = 0;
131static int led_on = 100, led_off = 0; /* defaults to LED that is on while in use */ 131static int led_on = 100, led_off = 0; /* defaults to LED that is on while in use */
132 int pwc_preferred_compression = 2; /* 0..3 = uncompressed..high */ 132static int pwc_preferred_compression = 2; /* 0..3 = uncompressed..high */
133static struct { 133static struct {
134 int type; 134 int type;
135 char serial_number[30]; 135 char serial_number[30];
diff --git a/drivers/usb/media/pwc/pwc.h b/drivers/usb/media/pwc/pwc.h
index 53b516d29cf5..267869dab185 100644
--- a/drivers/usb/media/pwc/pwc.h
+++ b/drivers/usb/media/pwc/pwc.h
@@ -226,9 +226,8 @@ struct pwc_device
226extern "C" { 226extern "C" {
227#endif 227#endif
228 228
229/* Global variables */ 229/* Global variable */
230extern int pwc_trace; 230extern int pwc_trace;
231extern int pwc_preferred_compression;
232 231
233/** functions in pwc-if.c */ 232/** functions in pwc-if.c */
234int pwc_try_video_mode(struct pwc_device *pdev, int width, int height, int new_fps, int new_compression, int new_snapshot); 233int pwc_try_video_mode(struct pwc_device *pdev, int width, int height, int new_fps, int new_compression, int new_snapshot);
@@ -243,8 +242,6 @@ void pwc_construct(struct pwc_device *pdev);
243/** Functions in pwc-ctrl.c */ 242/** Functions in pwc-ctrl.c */
244/* Request a certain video mode. Returns < 0 if not possible */ 243/* Request a certain video mode. Returns < 0 if not possible */
245extern int pwc_set_video_mode(struct pwc_device *pdev, int width, int height, int frames, int compression, int snapshot); 244extern int pwc_set_video_mode(struct pwc_device *pdev, int width, int height, int frames, int compression, int snapshot);
246/* Calculate the number of bytes per image (not frame) */
247extern void pwc_set_image_buffer_size(struct pwc_device *pdev);
248 245
249/* Various controls; should be obvious. Value 0..65535, or < 0 on error */ 246/* Various controls; should be obvious. Value 0..65535, or < 0 on error */
250extern int pwc_get_brightness(struct pwc_device *pdev); 247extern int pwc_get_brightness(struct pwc_device *pdev);
@@ -256,7 +253,6 @@ extern int pwc_set_gamma(struct pwc_device *pdev, int value);
256extern int pwc_get_saturation(struct pwc_device *pdev); 253extern int pwc_get_saturation(struct pwc_device *pdev);
257extern int pwc_set_saturation(struct pwc_device *pdev, int value); 254extern int pwc_set_saturation(struct pwc_device *pdev, int value);
258extern int pwc_set_leds(struct pwc_device *pdev, int on_value, int off_value); 255extern int pwc_set_leds(struct pwc_device *pdev, int on_value, int off_value);
259extern int pwc_get_leds(struct pwc_device *pdev, int *on_value, int *off_value);
260extern int pwc_get_cmos_sensor(struct pwc_device *pdev, int *sensor); 256extern int pwc_get_cmos_sensor(struct pwc_device *pdev, int *sensor);
261 257
262/* Power down or up the camera; not supported by all models */ 258/* Power down or up the camera; not supported by all models */