sn9c20x: fixed exposure control for HV7131R sensor
PATCH 1/1 sn9c20x: fixed exposure control for HV7131R sensor
Made the range of exposure values (0-0x1770) distribute evenly through HV7131R's exposure control bytes.
Signed-off-by German Galkin <[email protected]>
---
(quoted diff) +0 -0
b/drivers/media/video/gspca/sn9c20x.c
index 99632a7..f173b35 100644
drivers/media/video/gspca/sn9c20x.c +0 -0
@@ -1656,9 +1656,9 @@ static int set_exposure(struct gspca_dev
*gspca_dev)
case SENSOR_HV7131R:
exp[0] |= (4 << 4);
exp[2] = 0x25;
- exp[3] = ((sd->exposure * 0xffffff) / 0xffff) >> 16;
- exp[4] = ((sd->exposure * 0xffffff) / 0xffff) >> 8;
- exp[5] = ((sd->exposure * 0xffffff) / 0xffff) & 0xff;
+ exp[3] = (sd->exposure >> 5) & 0xff;
+ exp[4] = (sd->exposure << 3) & 0xff;
+ exp[5] = 0;
break;
default:
return 0;Hi German,
Your patch got line-wrapped. Also, it doesn't apply. Please, resubmit it against the latest development tree.
Cheers,
Mauro.
Quoted 30 lines · German Galkin
Made the range of exposure values (0-0x1770) distribute evenly through HV7131R's exposure control bytes.
Signed-off-by German Galkin <[email protected]>---
drivers/media/video/gspca/sn9c20x.c +3
-3@@ -1656,9 +1656,9 @@ static int set_exposure(struct gspca_dev *gspca_dev)case SENSOR_HV7131R : exp[0 ] |= (4 <<4 ); exp[2 ] =0x25 ; - exp[3 ] = ((sd->exposure *0xffffff ) /0xffff ) >>16 ; - exp[4 ] = ((sd->exposure *0xffffff ) /0xffff ) >>8 ; - exp[5 ] = ((sd->exposure *0xffffff ) /0xffff ) &0xff ; + exp[3 ] = (sd->exposure >>5 ) &0xff ; + exp[4 ] = (sd->exposure <<3 ) &0xff ; + exp[5 ] =0 ;break ;default :return 0;--
To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html