106 lines · c
1/* SPDX-License-Identifier: GPL-2.0-only */2/*3 * Driver for the ov7660 sensor4 *5 * Copyright (C) 2009 Erik Andrén6 * Copyright (C) 2007 Ilyes Gouta. Based on the m5603x Linux Driver Project.7 * Copyright (C) 2005 m5603x Linux Driver Project <m5602@x3ng.com.br>8 *9 * Portions of code to USB interface and ALi driver software,10 * Copyright (c) 2006 Willem Duinker11 * v4l2 interface modeled after the V4L2 driver12 * for SN9C10x PC Camera Controllers13 */14 15#ifndef M5602_OV7660_H_16#define M5602_OV7660_H_17 18#include "m5602_sensor.h"19 20#define OV7660_GAIN 0x0021#define OV7660_BLUE_GAIN 0x0122#define OV7660_RED_GAIN 0x0223#define OV7660_VREF 0x0324#define OV7660_COM1 0x0425#define OV7660_BAVE 0x0526#define OV7660_GEAVE 0x0627#define OV7660_AECHH 0x0728#define OV7660_RAVE 0x0829#define OV7660_COM2 0x0930#define OV7660_PID 0x0a31#define OV7660_VER 0x0b32#define OV7660_COM3 0x0c33#define OV7660_COM4 0x0d34#define OV7660_COM5 0x0e35#define OV7660_COM6 0x0f36#define OV7660_AECH 0x1037#define OV7660_CLKRC 0x1138#define OV7660_COM7 0x1239#define OV7660_COM8 0x1340#define OV7660_COM9 0x1441#define OV7660_COM10 0x1542#define OV7660_RSVD16 0x1643#define OV7660_HSTART 0x1744#define OV7660_HSTOP 0x1845#define OV7660_VSTART 0x1946#define OV7660_VSTOP 0x1a47#define OV7660_PSHFT 0x1b48#define OV7660_MIDH 0x1c49#define OV7660_MIDL 0x1d50#define OV7660_MVFP 0x1e51#define OV7660_LAEC 0x1f52#define OV7660_BOS 0x2053#define OV7660_GBOS 0x2154#define OV7660_GROS 0x2255#define OV7660_ROS 0x2356#define OV7660_AEW 0x2457#define OV7660_AEB 0x2558#define OV7660_VPT 0x2659#define OV7660_BBIAS 0x2760#define OV7660_GbBIAS 0x2861#define OV7660_RSVD29 0x2962#define OV7660_RBIAS 0x2c63#define OV7660_HREF 0x3264#define OV7660_ADC 0x3765#define OV7660_OFON 0x3966#define OV7660_TSLB 0x3a67#define OV7660_COM12 0x3c68#define OV7660_COM13 0x3d69#define OV7660_LCC1 0x6270#define OV7660_LCC2 0x6371#define OV7660_LCC3 0x6472#define OV7660_LCC4 0x6573#define OV7660_LCC5 0x6674#define OV7660_HV 0x6975#define OV7660_RSVDA1 0xa176 77#define OV7660_DEFAULT_GAIN 0x0e78#define OV7660_DEFAULT_RED_GAIN 0x8079#define OV7660_DEFAULT_BLUE_GAIN 0x8080#define OV7660_DEFAULT_SATURATION 0x0081#define OV7660_DEFAULT_EXPOSURE 0x2082 83/* Kernel module parameters */84extern int force_sensor;85extern bool dump_sensor;86 87int ov7660_probe(struct sd *sd);88int ov7660_init(struct sd *sd);89int ov7660_init_controls(struct sd *sd);90int ov7660_start(struct sd *sd);91int ov7660_stop(struct sd *sd);92void ov7660_disconnect(struct sd *sd);93 94static const struct m5602_sensor ov7660 = {95 .name = "ov7660",96 .i2c_slave_id = 0x42,97 .i2c_regW = 1,98 .probe = ov7660_probe,99 .init = ov7660_init,100 .init_controls = ov7660_init_controls,101 .start = ov7660_start,102 .stop = ov7660_stop,103 .disconnect = ov7660_disconnect,104};105#endif106