21 #define MODULE_NAME "tv8532"
39 .sizeimage = 176 * 144,
44 .sizeimage = 352 * 288,
50 #define R00_PART_CONTROL 0x00
51 #define LATENT_CHANGE 0x80
52 #define EXPO_CHANGE 0x04
53 #define R01_TIMING_CONTROL_LOW 0x01
54 #define CMD_EEprom_Open 0x30
55 #define CMD_EEprom_Close 0x29
56 #define R03_TABLE_ADDR 0x03
57 #define R04_WTRAM_DATA_L 0x04
58 #define R05_WTRAM_DATA_M 0x05
59 #define R06_WTRAM_DATA_H 0x06
60 #define R07_TABLE_LEN 0x07
61 #define R08_RAM_WRITE_ACTION 0x08
62 #define R0C_AD_WIDTHL 0x0c
63 #define R0D_AD_WIDTHH 0x0d
64 #define R0E_AD_HEIGHTL 0x0e
65 #define R0F_AD_HEIGHTH 0x0f
66 #define R10_AD_COL_BEGINL 0x10
67 #define R11_AD_COL_BEGINH 0x11
69 #define R14_AD_ROW_BEGINL 0x14
70 #define R15_AD_ROWBEGINH 0x15
71 #define R1C_AD_EXPOSE_TIMEL 0x1c
72 #define R20_GAIN_G1L 0x20
73 #define R21_GAIN_G1H 0x21
74 #define R22_GAIN_RL 0x22
75 #define R23_GAIN_RH 0x23
76 #define R24_GAIN_BL 0x24
77 #define R25_GAIN_BH 0x25
78 #define R26_GAIN_G2L 0x26
79 #define R27_GAIN_G2H 0x27
80 #define R28_QUANT 0x28
82 #define R2C_POLARITY 0x2c
83 #define R2D_POINT 0x2d
84 #define R2E_POINTH 0x2e
85 #define R2F_POINTB 0x2f
86 #define R30_POINTBH 0x30
88 #define R2A_HIGH_BUDGET 0x2a
89 #define R2B_LOW_BUDGET 0x2b
94 #define R39_Test1 0x39
95 #define R3B_Test3 0x3b
96 #define R83_AD_IDH 0x83
97 #define R91_AD_SLOPEREG 0x91
98 #define R94_AD_BITCONTROL 0x94
124 usb_sndctrlpipe(gspca_dev->
dev, 0),
128 index, gspca_dev->
usb_buf, 1, 500);
132 static void reg_w2(
struct gspca_dev *gspca_dev,
136 gspca_dev->
usb_buf[1] = value >> 8;
138 usb_sndctrlpipe(gspca_dev->
dev, 0),
142 index, gspca_dev->
usb_buf, 2, 500);
145 static void tv_8532WriteEEprom(
struct gspca_dev *gspca_dev)
162 static int sd_config(
struct gspca_dev *gspca_dev,
167 cam = &gspca_dev->
cam;
174 static void tv_8532_setReg(
struct gspca_dev *gspca_dev)
194 static int sd_init(
struct gspca_dev *gspca_dev)
196 tv_8532WriteEEprom(gspca_dev);
201 static void setexposure(
struct gspca_dev *gspca_dev,
s32 val)
208 static void setgain(
struct gspca_dev *gspca_dev,
s32 val)
217 static int sd_start(
struct gspca_dev *gspca_dev)
219 struct sd *
sd = (
struct sd *) gspca_dev;
227 if (gspca_dev->
cam.cam_mode[(
int) gspca_dev->
curr_mode].priv) {
243 tv_8532_setReg(gspca_dev);
246 reg_w1(gspca_dev,
R31_UPD, 0x01);
248 reg_w1(gspca_dev,
R31_UPD, 0x00);
256 static void sd_stopN(
struct gspca_dev *gspca_dev)
261 static void sd_pkt_scan(
struct gspca_dev *gspca_dev,
265 struct sd *sd = (
struct sd *) gspca_dev;
266 int packet_type0, packet_type1;
273 }
else if (sd->
packet == 0)
287 data + 2, gspca_dev->
width);
289 data + gspca_dev->
width + 5, gspca_dev->
width);
294 struct gspca_dev *gspca_dev =
304 setexposure(gspca_dev, ctrl->
val);
307 setgain(gspca_dev, ctrl->
val);
317 static int sd_init_controls(
struct gspca_dev *gspca_dev)
321 gspca_dev->
vdev.ctrl_handler = hdl;
329 pr_err(
"Could not initialize controls\n");
340 .init_controls = sd_init_controls,
343 .pkt_scan = sd_pkt_scan,
348 {USB_DEVICE(0x046d, 0x0920)},
349 {USB_DEVICE(0x046d, 0x0921)},
350 {USB_DEVICE(0x0545, 0x808b)},
351 {USB_DEVICE(0x0545, 0x8333)},
352 {USB_DEVICE(0x0923, 0x010f)},
366 static struct usb_driver sd_driver = {
368 .id_table = device_table,
372 .suspend = gspca_suspend,
373 .resume = gspca_resume,
374 .reset_resume = gspca_resume,