1a10e763bSThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-only */ 20c0d06caSMauro Carvalho Chehab /* 30c0d06caSMauro Carvalho Chehab * Driver for the s5k83a sensor 40c0d06caSMauro Carvalho Chehab * 50c0d06caSMauro Carvalho Chehab * Copyright (C) 2008 Erik Andrén 60c0d06caSMauro Carvalho Chehab * Copyright (C) 2007 Ilyes Gouta. Based on the m5603x Linux Driver Project. 70c0d06caSMauro Carvalho Chehab * Copyright (C) 2005 m5603x Linux Driver Project <m5602@x3ng.com.br> 80c0d06caSMauro Carvalho Chehab * 90c0d06caSMauro Carvalho Chehab * Portions of code to USB interface and ALi driver software, 100c0d06caSMauro Carvalho Chehab * Copyright (c) 2006 Willem Duinker 110c0d06caSMauro Carvalho Chehab * v4l2 interface modeled after the V4L2 driver 120c0d06caSMauro Carvalho Chehab * for SN9C10x PC Camera Controllers 130c0d06caSMauro Carvalho Chehab */ 140c0d06caSMauro Carvalho Chehab 150c0d06caSMauro Carvalho Chehab #ifndef M5602_S5K83A_H_ 160c0d06caSMauro Carvalho Chehab #define M5602_S5K83A_H_ 170c0d06caSMauro Carvalho Chehab 180c0d06caSMauro Carvalho Chehab #include "m5602_sensor.h" 190c0d06caSMauro Carvalho Chehab 200c0d06caSMauro Carvalho Chehab #define S5K83A_FLIP 0x01 210c0d06caSMauro Carvalho Chehab #define S5K83A_HFLIP_TUNE 0x03 220c0d06caSMauro Carvalho Chehab #define S5K83A_VFLIP_TUNE 0x05 230c0d06caSMauro Carvalho Chehab #define S5K83A_BRIGHTNESS 0x0a 240c0d06caSMauro Carvalho Chehab #define S5K83A_EXPOSURE 0x18 250c0d06caSMauro Carvalho Chehab #define S5K83A_GAIN 0x1b 260c0d06caSMauro Carvalho Chehab #define S5K83A_PAGE_MAP 0xec 270c0d06caSMauro Carvalho Chehab 280c0d06caSMauro Carvalho Chehab #define S5K83A_DEFAULT_GAIN 0x71 290c0d06caSMauro Carvalho Chehab #define S5K83A_DEFAULT_BRIGHTNESS 0x7e 300c0d06caSMauro Carvalho Chehab #define S5K83A_DEFAULT_EXPOSURE 0x00 310c0d06caSMauro Carvalho Chehab #define S5K83A_MAXIMUM_EXPOSURE 0x3c 320c0d06caSMauro Carvalho Chehab #define S5K83A_FLIP_MASK 0x10 330c0d06caSMauro Carvalho Chehab #define S5K83A_GPIO_LED_MASK 0x10 340c0d06caSMauro Carvalho Chehab #define S5K83A_GPIO_ROTATION_MASK 0x40 350c0d06caSMauro Carvalho Chehab 360c0d06caSMauro Carvalho Chehab /*****************************************************************************/ 370c0d06caSMauro Carvalho Chehab 380c0d06caSMauro Carvalho Chehab /* Kernel module parameters */ 390c0d06caSMauro Carvalho Chehab extern int force_sensor; 400c0d06caSMauro Carvalho Chehab extern bool dump_sensor; 410c0d06caSMauro Carvalho Chehab 420c0d06caSMauro Carvalho Chehab int s5k83a_probe(struct sd *sd); 430c0d06caSMauro Carvalho Chehab int s5k83a_init(struct sd *sd); 44c84e412fSHans de Goede int s5k83a_init_controls(struct sd *sd); 450c0d06caSMauro Carvalho Chehab int s5k83a_start(struct sd *sd); 460c0d06caSMauro Carvalho Chehab int s5k83a_stop(struct sd *sd); 470c0d06caSMauro Carvalho Chehab void s5k83a_disconnect(struct sd *sd); 480c0d06caSMauro Carvalho Chehab 490c0d06caSMauro Carvalho Chehab static const struct m5602_sensor s5k83a = { 500c0d06caSMauro Carvalho Chehab .name = "S5K83A", 510c0d06caSMauro Carvalho Chehab .probe = s5k83a_probe, 520c0d06caSMauro Carvalho Chehab .init = s5k83a_init, 53c84e412fSHans de Goede .init_controls = s5k83a_init_controls, 540c0d06caSMauro Carvalho Chehab .start = s5k83a_start, 550c0d06caSMauro Carvalho Chehab .stop = s5k83a_stop, 560c0d06caSMauro Carvalho Chehab .disconnect = s5k83a_disconnect, 570c0d06caSMauro Carvalho Chehab .i2c_slave_id = 0x5a, 580c0d06caSMauro Carvalho Chehab .i2c_regW = 2, 590c0d06caSMauro Carvalho Chehab }; 600c0d06caSMauro Carvalho Chehab #endif 61