brintos

brintos / linux-shallow public Read only

0
0
Text · 2.3 KiB · 1789cd0 Raw
85 lines · c
1/* SPDX-License-Identifier: GPL-2.0-only */2/*3 * Driver for the s5k4aa sensor4 *5 * Copyright (C) 2008 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_S5K4AA_H_16#define M5602_S5K4AA_H_17 18#include <linux/dmi.h>19 20#include "m5602_sensor.h"21 22/*****************************************************************************/23 24#define S5K4AA_PAGE_MAP			0xec25 26#define S5K4AA_PAGE_MAP_0		0x0027#define S5K4AA_PAGE_MAP_1		0x0128#define S5K4AA_PAGE_MAP_2		0x0229 30/* Sensor register definitions for page 0x02 */31#define S5K4AA_READ_MODE		0x0332#define S5K4AA_ROWSTART_HI		0x0433#define S5K4AA_ROWSTART_LO		0x0534#define S5K4AA_COLSTART_HI		0x0635#define S5K4AA_COLSTART_LO		0x0736#define S5K4AA_WINDOW_HEIGHT_HI		0x0837#define S5K4AA_WINDOW_HEIGHT_LO		0x0938#define S5K4AA_WINDOW_WIDTH_HI		0x0a39#define S5K4AA_WINDOW_WIDTH_LO		0x0b40#define S5K4AA_GLOBAL_GAIN__		0x0f41/* sync lost, if too low, reduces frame rate if too high */42#define S5K4AA_H_BLANK_HI__		0x1d43#define S5K4AA_H_BLANK_LO__		0x1e44#define S5K4AA_EXPOSURE_HI		0x1745#define S5K4AA_EXPOSURE_LO		0x1846#define S5K4AA_BRIGHTNESS		0x1f /* (digital?) gain : 5 bits */47#define S5K4AA_GAIN			0x20 /* (analogue?) gain : 7 bits */48#define S5K4AA_NOISE_SUPP		0x3749 50#define S5K4AA_RM_ROW_SKIP_4X		0x0851#define S5K4AA_RM_ROW_SKIP_2X		0x0452#define S5K4AA_RM_COL_SKIP_4X		0x0253#define S5K4AA_RM_COL_SKIP_2X		0x0154#define S5K4AA_RM_H_FLIP		0x4055#define S5K4AA_RM_V_FLIP		0x8056 57#define S5K4AA_DEFAULT_GAIN		0x5f58#define S5K4AA_DEFAULT_BRIGHTNESS	0x1059 60/*****************************************************************************/61 62/* Kernel module parameters */63extern int force_sensor;64extern bool dump_sensor;65 66int s5k4aa_probe(struct sd *sd);67int s5k4aa_init(struct sd *sd);68int s5k4aa_init_controls(struct sd *sd);69int s5k4aa_start(struct sd *sd);70void s5k4aa_disconnect(struct sd *sd);71 72static const struct m5602_sensor s5k4aa = {73	.name = "S5K4AA",74	.i2c_slave_id = 0x5a,75	.i2c_regW = 2,76 77	.probe = s5k4aa_probe,78	.init = s5k4aa_init,79	.init_controls = s5k4aa_init_controls,80	.start = s5k4aa_start,81	.disconnect = s5k4aa_disconnect,82};83 84#endif85