1 /***************************************************************************
5 * SiI9244 - MHL Transmitter Driver
9 * Copyright (C) (2011, Silicon Image Inc)
13 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation version 2.
21 * This program is distributed ¡°as is¡± WITHOUT ANY WARRANTY of any
23 * kind, whether express or implied; without even the implied warranty
25 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27 * GNU General Public License for more details.
31 *****************************************************************************/
33 #include <linux/types.h>
35 #include "SiI9234_I2C_master.h"
36 #include "SiI9234_I2C_slave_add.h"
39 static byte l_cbusPortOffsets [ MHD_MAX_CHANNELS ] = { 0x00 };
41 //------------------------------------------------------------------------------
42 // Function: SiIRegioCbusRead
43 // Description: Read a one byte CBUS register with port offset.
44 // The register address parameter is translated into an I2C slave
45 // address and offset. The I2C slave address and offset are used
46 // to perform an I2C read operation.
47 //------------------------------------------------------------------------------
50 byte SiIRegioCbusRead ( word regAddr, byte channel )
52 return(I2C_ReadByte(SA_TX_CBUS_Primary + l_cbusPortOffsets[channel], regAddr));
55 //------------------------------------------------------------------------------
56 // Function: SiIRegioCbusWrite
57 // Description: Write a one byte CBUS register with port offset.
58 // The register address parameter is translated into an I2C
59 // slave address and offset. The I2C slave address and offset
60 // are used to perform an I2C write operation.
61 //------------------------------------------------------------------------------
63 void SiIRegioCbusWrite ( word regAddr, byte channel, byte value )
66 I2C_WriteByte(SA_TX_CBUS_Primary + l_cbusPortOffsets[channel], regAddr, value);