Path: blob/master/drivers/i2c/busses/i2c-parport.h
15111 views
/* ------------------------------------------------------------------------ *1* i2c-parport.h I2C bus over parallel port *2* ------------------------------------------------------------------------ *3Copyright (C) 2003-2010 Jean Delvare <[email protected]>45This program is free software; you can redistribute it and/or modify6it under the terms of the GNU General Public License as published by7the Free Software Foundation; either version 2 of the License, or8(at your option) any later version.910This program is distributed in the hope that it will be useful,11but WITHOUT ANY WARRANTY; without even the implied warranty of12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the13GNU General Public License for more details.1415You should have received a copy of the GNU General Public License16along with this program; if not, write to the Free Software17Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.18* ------------------------------------------------------------------------ */1920#define PORT_DATA 021#define PORT_STAT 122#define PORT_CTRL 22324struct lineop {25u8 val;26u8 port;27u8 inverted;28};2930struct adapter_parm {31struct lineop setsda;32struct lineop setscl;33struct lineop getsda;34struct lineop getscl;35struct lineop init;36unsigned int smbus_alert:1;37};3839static const struct adapter_parm adapter_parm[] = {40/* type 0: Philips adapter */41{42.setsda = { 0x80, PORT_DATA, 1 },43.setscl = { 0x08, PORT_CTRL, 0 },44.getsda = { 0x80, PORT_STAT, 0 },45.getscl = { 0x08, PORT_STAT, 0 },46},47/* type 1: home brew teletext adapter */48{49.setsda = { 0x02, PORT_DATA, 0 },50.setscl = { 0x01, PORT_DATA, 0 },51.getsda = { 0x80, PORT_STAT, 1 },52},53/* type 2: Velleman K8000 adapter */54{55.setsda = { 0x02, PORT_CTRL, 1 },56.setscl = { 0x08, PORT_CTRL, 1 },57.getsda = { 0x10, PORT_STAT, 0 },58},59/* type 3: ELV adapter */60{61.setsda = { 0x02, PORT_DATA, 1 },62.setscl = { 0x01, PORT_DATA, 1 },63.getsda = { 0x40, PORT_STAT, 1 },64.getscl = { 0x08, PORT_STAT, 1 },65},66/* type 4: ADM1032 evaluation board */67{68.setsda = { 0x02, PORT_DATA, 1 },69.setscl = { 0x01, PORT_DATA, 1 },70.getsda = { 0x10, PORT_STAT, 1 },71.init = { 0xf0, PORT_DATA, 0 },72.smbus_alert = 1,73},74/* type 5: ADM1025, ADM1030 and ADM1031 evaluation boards */75{76.setsda = { 0x02, PORT_DATA, 1 },77.setscl = { 0x01, PORT_DATA, 1 },78.getsda = { 0x10, PORT_STAT, 1 },79},80/* type 6: Barco LPT->DVI (K5800236) adapter */81{82.setsda = { 0x02, PORT_DATA, 1 },83.setscl = { 0x01, PORT_DATA, 1 },84.getsda = { 0x20, PORT_STAT, 0 },85.getscl = { 0x40, PORT_STAT, 0 },86.init = { 0xfc, PORT_DATA, 0 },87},88/* type 7: One For All JP1 parallel port adapter */89{90.setsda = { 0x01, PORT_DATA, 0 },91.setscl = { 0x02, PORT_DATA, 0 },92.getsda = { 0x80, PORT_STAT, 1 },93.init = { 0x04, PORT_DATA, 1 },94},95};9697static int type = -1;98module_param(type, int, 0);99MODULE_PARM_DESC(type,100"Type of adapter:\n"101" 0 = Philips adapter\n"102" 1 = home brew teletext adapter\n"103" 2 = Velleman K8000 adapter\n"104" 3 = ELV adapter\n"105" 4 = ADM1032 evaluation board\n"106" 5 = ADM1025, ADM1030 and ADM1031 evaluation boards\n"107" 6 = Barco LPT->DVI (K5800236) adapter\n"108" 7 = One For All JP1 parallel port adapter\n"109);110111112