r.c « sn9c102 « video « media « drivers - litmus-rt-budgetable-locks.git/.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogblamecommitdiffstats
path: root/drivers/media/video/sn9c102/sn9c102_hv7131r.c
blob: 4295887ff6098b610a50acddfd46a8a3e2f023d4 (plain) (tree)





















                                                                             
                             







                                                   















                                                                               


                            











































































                                                                               

































































































































                                                                              
                                              
























































































                                                                             




                                                                       
 
                                                          
                             








                                             
/***************************************************************************
 * Plug-in for HV7131R image sensor connected to the SN9C1xx PC Camera     *
 * Controllers                                                             *
 *                                                                         *
 * Copyright (C) 2007 by Luca Risolia <luca.risolia@studio.unibo.it>       *
 *                                                                         *
 * This program is free software; you can redistribute it and/or modify    *
 * it under the terms of the GNU General Public License as published by    *
 * the Free Software Foundation; either version 2 of the License, or       *
 * (at your option) any later version.                                     *
 *                                                                         *
 * This program is distributed in the hope that it will be useful,         *
 * but WITHOUT ANY WARRANTY; without even the implied warranty of          *
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           *
 * GNU General Public License for more details.                            *
 *                                                                         *
 * You should have received a copy of the GNU General Public License       *
 * along with this program; if not, write to the Free Software             *
 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.               *
 ***************************************************************************/

#include "sn9c102_sensor.h"
#include "sn9c102_devtable.h"


static int hv7131r_init(struct sn9c102_device* cam)
{
	int err = 0;

	switch (sn9c102_get_bridge(cam)) {
	case BRIDGE_SN9C103:
		err = sn9c102_write_const_regs(cam, {0x00, 0x03}, {0x1a, 0x04},
					       {0x20, 0x05}, {0x20, 0x06},
					       {0x03, 0x10}, {0x00, 0x14},
					       {0x60, 0x17}, {0x0a, 0x18},
					       {0xf0, 0x19}, {0x1d, 0x1a},
					       {0x10, 0x1b}, {0x02, 0x1c},
					       {0x03, 0x1d}, {0x0f, 0x1e},
					       {0x0c, 0x1f}, {0x00, 0x20},
					       {0x10, 0x21}, {0x20, 0x22},
					       {0x30, 0x23}, {0x40, 0x24},
					       {0x50, 0x25}, {0x60, 0x26},
					       {0x70, 0x27}, {0x80, 0x28},
					       {0x90, 0x29}, {0xa0, 0x2a},
					       {0xb0, 0x2b}, {0xc0, 0x2c},
					       {0xd0, 0x2d}, {0xe0, 0x2e},
					       {0xf0, 0x2f}, {0xff, 0x30});
		break;
	case BRIDGE_SN9C105:
	case BRIDGE_SN9C120:
		err = sn9c102_write_const_regs(cam, {0x44, 0x01}, {0x40, 0x02},
					       {0x00, 0x03}, {0x1a, 0x04},
					       {0x44, 0x05}, {0x3e, 0x06},
					       {0x1a, 0x07}, {0x03, 0x10},