3 * @author Josua Grawitter
6 * @brief Common control functions the HV7131R Image Sensor
8 * @note Copyright (C) Josua Grawitter
12 * This program is free software; you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation; either version 2 of the License, or
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
28 #include "sn9c20x-bridge.h"
30 struct sn9c20x_i2c_regs hv7131r_init
[] = {
57 int hv7131r_set_exposure(struct usb_sn9c20x
*dev
)
63 val
= ((dev
->vsettings
.exposure
<< 8) * 0xffffff) / 0xffff;
65 buf
[0] = (val
>> 16) & 0xff;
66 buf
[1] = (val
>> 8) & 0xff;
69 ret
= sn9c20x_write_i2c_data_ext(dev
, 3, 0x25, buf
, 0x1e);
74 int hv7131r_set_gain(struct usb_sn9c20x
*dev
)
79 buf
= dev
->vsettings
.gain
;
81 ret
= sn9c20x_write_i2c_data_ext(dev
, 1, 0x30, &buf
, 0x1d);
86 int hv7131r_set_hvflip(struct usb_sn9c20x
*dev
)
91 ret
= sn9c20x_read_i2c_data(dev
, 1, 0x01, &buf
);
95 if (dev
->vsettings
.hflip
)
100 if (dev
->vsettings
.vflip
)
105 ret
= sn9c20x_write_i2c_data(dev
, 1, 0x01, &buf
);