18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * GSPCA Endpoints (formerly known as AOX) se401 USB Camera sub Driver
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci * Copyright (C) 2011 Hans de Goede <hdegoede@redhat.com>
68c2ecf20Sopenharmony_ci *
78c2ecf20Sopenharmony_ci * Based on the v4l1 se401 driver which is:
88c2ecf20Sopenharmony_ci *
98c2ecf20Sopenharmony_ci * Copyright (c) 2000 Jeroen B. Vreeken (pe1rxq@amsat.org)
108c2ecf20Sopenharmony_ci */
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci#define SE401_REQ_GET_CAMERA_DESCRIPTOR		0x06
138c2ecf20Sopenharmony_ci#define SE401_REQ_START_CONTINUOUS_CAPTURE	0x41
148c2ecf20Sopenharmony_ci#define SE401_REQ_STOP_CONTINUOUS_CAPTURE	0x42
158c2ecf20Sopenharmony_ci#define SE401_REQ_CAPTURE_FRAME			0x43
168c2ecf20Sopenharmony_ci#define SE401_REQ_GET_BRT			0x44
178c2ecf20Sopenharmony_ci#define SE401_REQ_SET_BRT			0x45
188c2ecf20Sopenharmony_ci#define SE401_REQ_GET_WIDTH			0x4c
198c2ecf20Sopenharmony_ci#define SE401_REQ_SET_WIDTH			0x4d
208c2ecf20Sopenharmony_ci#define SE401_REQ_GET_HEIGHT			0x4e
218c2ecf20Sopenharmony_ci#define SE401_REQ_SET_HEIGHT			0x4f
228c2ecf20Sopenharmony_ci#define SE401_REQ_GET_OUTPUT_MODE		0x50
238c2ecf20Sopenharmony_ci#define SE401_REQ_SET_OUTPUT_MODE		0x51
248c2ecf20Sopenharmony_ci#define SE401_REQ_GET_EXT_FEATURE		0x52
258c2ecf20Sopenharmony_ci#define SE401_REQ_SET_EXT_FEATURE		0x53
268c2ecf20Sopenharmony_ci#define SE401_REQ_CAMERA_POWER			0x56
278c2ecf20Sopenharmony_ci#define SE401_REQ_LED_CONTROL			0x57
288c2ecf20Sopenharmony_ci#define SE401_REQ_BIOS				0xff
298c2ecf20Sopenharmony_ci
308c2ecf20Sopenharmony_ci#define SE401_BIOS_READ				0x07
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci#define SE401_FORMAT_BAYER	0x40
338c2ecf20Sopenharmony_ci
348c2ecf20Sopenharmony_ci/* Hyundai hv7131b registers
358c2ecf20Sopenharmony_ci   7121 and 7141 should be the same (haven't really checked...) */
368c2ecf20Sopenharmony_ci/* Mode registers: */
378c2ecf20Sopenharmony_ci#define HV7131_REG_MODE_A		0x00
388c2ecf20Sopenharmony_ci#define HV7131_REG_MODE_B		0x01
398c2ecf20Sopenharmony_ci#define HV7131_REG_MODE_C		0x02
408c2ecf20Sopenharmony_ci/* Frame registers: */
418c2ecf20Sopenharmony_ci#define HV7131_REG_FRSU		0x10
428c2ecf20Sopenharmony_ci#define HV7131_REG_FRSL		0x11
438c2ecf20Sopenharmony_ci#define HV7131_REG_FCSU		0x12
448c2ecf20Sopenharmony_ci#define HV7131_REG_FCSL		0x13
458c2ecf20Sopenharmony_ci#define HV7131_REG_FWHU		0x14
468c2ecf20Sopenharmony_ci#define HV7131_REG_FWHL		0x15
478c2ecf20Sopenharmony_ci#define HV7131_REG_FWWU		0x16
488c2ecf20Sopenharmony_ci#define HV7131_REG_FWWL		0x17
498c2ecf20Sopenharmony_ci/* Timing registers: */
508c2ecf20Sopenharmony_ci#define HV7131_REG_THBU		0x20
518c2ecf20Sopenharmony_ci#define HV7131_REG_THBL		0x21
528c2ecf20Sopenharmony_ci#define HV7131_REG_TVBU		0x22
538c2ecf20Sopenharmony_ci#define HV7131_REG_TVBL		0x23
548c2ecf20Sopenharmony_ci#define HV7131_REG_TITU		0x25
558c2ecf20Sopenharmony_ci#define HV7131_REG_TITM		0x26
568c2ecf20Sopenharmony_ci#define HV7131_REG_TITL		0x27
578c2ecf20Sopenharmony_ci#define HV7131_REG_TMCD		0x28
588c2ecf20Sopenharmony_ci/* Adjust Registers: */
598c2ecf20Sopenharmony_ci#define HV7131_REG_ARLV		0x30
608c2ecf20Sopenharmony_ci#define HV7131_REG_ARCG		0x31
618c2ecf20Sopenharmony_ci#define HV7131_REG_AGCG		0x32
628c2ecf20Sopenharmony_ci#define HV7131_REG_ABCG		0x33
638c2ecf20Sopenharmony_ci#define HV7131_REG_APBV		0x34
648c2ecf20Sopenharmony_ci#define HV7131_REG_ASLP		0x54
658c2ecf20Sopenharmony_ci/* Offset Registers: */
668c2ecf20Sopenharmony_ci#define HV7131_REG_OFSR		0x50
678c2ecf20Sopenharmony_ci#define HV7131_REG_OFSG		0x51
688c2ecf20Sopenharmony_ci#define HV7131_REG_OFSB		0x52
698c2ecf20Sopenharmony_ci/* REset level statistics registers: */
708c2ecf20Sopenharmony_ci#define HV7131_REG_LOREFNOH	0x57
718c2ecf20Sopenharmony_ci#define HV7131_REG_LOREFNOL	0x58
728c2ecf20Sopenharmony_ci#define HV7131_REG_HIREFNOH	0x59
738c2ecf20Sopenharmony_ci#define HV7131_REG_HIREFNOL	0x5a
748c2ecf20Sopenharmony_ci
758c2ecf20Sopenharmony_ci/* se401 registers */
768c2ecf20Sopenharmony_ci#define SE401_OPERATINGMODE	0x2000
77