Commit 5b1f9e43 authored by Stelian Pop's avatar Stelian Pop Committed by Linus Torvalds

[PATCH] meye: cache the camera settings in the driver

Retrieving the current settings from the camera does not work very well, we
need to cache the values in the driver.
Signed-off-by: default avatarStelian Pop <stelian@popies.net>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent df829116
...@@ -1281,34 +1281,40 @@ static int meye_do_ioctl(struct inode *inode, struct file *file, ...@@ -1281,34 +1281,40 @@ static int meye_do_ioctl(struct inode *inode, struct file *file,
down(&meye.lock); down(&meye.lock);
switch (c->id) { switch (c->id) {
case V4L2_CID_BRIGHTNESS: case V4L2_CID_BRIGHTNESS:
sonypi_camera_command( sonypi_camera_command(
SONYPI_COMMAND_SETCAMERABRIGHTNESS, c->value); SONYPI_COMMAND_SETCAMERABRIGHTNESS, c->value);
meye.picture.brightness = c->value << 10;
break; break;
case V4L2_CID_HUE: case V4L2_CID_HUE:
sonypi_camera_command( sonypi_camera_command(
SONYPI_COMMAND_SETCAMERAHUE, c->value); SONYPI_COMMAND_SETCAMERAHUE, c->value);
meye.picture.hue = c->value << 10;
break; break;
case V4L2_CID_CONTRAST: case V4L2_CID_CONTRAST:
sonypi_camera_command( sonypi_camera_command(
SONYPI_COMMAND_SETCAMERACOLOR, c->value); SONYPI_COMMAND_SETCAMERACONTRAST, c->value);
meye.picture.contrast = c->value << 10;
break; break;
case V4L2_CID_SATURATION: case V4L2_CID_SATURATION:
sonypi_camera_command( sonypi_camera_command(
SONYPI_COMMAND_SETCAMERACOLOR, c->value); SONYPI_COMMAND_SETCAMERACOLOR, c->value);
meye.picture.colour = c->value << 10;
break; break;
case V4L2_CID_AGC: case V4L2_CID_AGC:
sonypi_camera_command( sonypi_camera_command(
SONYPI_COMMAND_SETCAMERAAGC, c->value); SONYPI_COMMAND_SETCAMERAAGC, c->value);
meye.params.agc = c->value;
break; break;
case V4L2_CID_SHARPNESS: case V4L2_CID_SHARPNESS:
sonypi_camera_command( sonypi_camera_command(
SONYPI_COMMAND_SETCAMERASHARPNESS, c->value); SONYPI_COMMAND_SETCAMERASHARPNESS, c->value);
meye.params.sharpness = c->value;
break; break;
case V4L2_CID_PICTURE: case V4L2_CID_PICTURE:
sonypi_camera_command( sonypi_camera_command(
SONYPI_COMMAND_SETCAMERAPICTURE, c->value); SONYPI_COMMAND_SETCAMERAPICTURE, c->value);
meye.params.picture = c->value;
break; break;
case V4L2_CID_JPEGQUAL: case V4L2_CID_JPEGQUAL:
meye.params.quality = c->value; meye.params.quality = c->value;
...@@ -1330,32 +1336,25 @@ static int meye_do_ioctl(struct inode *inode, struct file *file, ...@@ -1330,32 +1336,25 @@ static int meye_do_ioctl(struct inode *inode, struct file *file,
down(&meye.lock); down(&meye.lock);
switch (c->id) { switch (c->id) {
case V4L2_CID_BRIGHTNESS: case V4L2_CID_BRIGHTNESS:
c->value = sonypi_camera_command( c->value = meye.picture.brightness >> 10;
SONYPI_COMMAND_GETCAMERABRIGHTNESS, 0);
break; break;
case V4L2_CID_HUE: case V4L2_CID_HUE:
c->value = sonypi_camera_command( c->value = meye.picture.hue >> 10;
SONYPI_COMMAND_GETCAMERAHUE, 0);
break; break;
case V4L2_CID_CONTRAST: case V4L2_CID_CONTRAST:
c->value = sonypi_camera_command( c->value = meye.picture.contrast >> 10;
SONYPI_COMMAND_GETCAMERACOLOR, 0);
break; break;
case V4L2_CID_SATURATION: case V4L2_CID_SATURATION:
c->value = sonypi_camera_command( c->value = meye.picture.colour >> 10;
SONYPI_COMMAND_GETCAMERACOLOR, 0);
break; break;
case V4L2_CID_AGC: case V4L2_CID_AGC:
c->value = sonypi_camera_command( c->value = meye.params.agc;
SONYPI_COMMAND_GETCAMERAAGC, 0);
break; break;
case V4L2_CID_SHARPNESS: case V4L2_CID_SHARPNESS:
c->value = sonypi_camera_command( c->value = meye.params.sharpness;
SONYPI_COMMAND_GETCAMERASHARPNESS, 0);
break; break;
case V4L2_CID_PICTURE: case V4L2_CID_PICTURE:
c->value = sonypi_camera_command( c->value = meye.params.picture;
SONYPI_COMMAND_GETCAMERAPICTURE, 0);
break; break;
case V4L2_CID_JPEGQUAL: case V4L2_CID_JPEGQUAL:
c->value = meye.params.quality; c->value = meye.params.quality;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment