wangrui schrieb:
Brian,

Thank you for the information. Sorry I didn't know that there is
already a patch. I'm working on the resolution problem now ( Change
SN9c202 to 1280x1024 ). But no luck so far.


int mt9m111_set_autoexposure(struct usb_sn9c20x *dev)
{
        __u16 buf[1];
        int page = 0;
        int ret = 0;
        int data = 0x3080;

        switch (dev->vsettings.auto_exposure) {
        case V4L2_EXPOSURE_AUTO:
                data|=0x7000;
                data|=0x000C;
        break;
        case V4L2_EXPOSURE_MANUAL:
                data&=~0x7000;
        break;
        case V4L2_EXPOSURE_SHUTTER_PRIORITY:
                data|=0x7000;
                data&=~0x000C;
        break;
        case V4L2_EXPOSURE_APERTURE_PRIORITY:
                data|=0x7000;
                data&=~0x000C;
                data|=0x0004;
        break;
        default:
                return -EINVAL;

You don't have to use such a big switch. Another one of Brian's patches reduces the option for auto_exposure to 1 (auto) and 0 (manual). This is not exactly V4L2 compliant but it is more intuitive in our case.

GWater

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to