upload tizen1.0 source
[kernel/linux-2.6.36.git] / drivers / media / video / s5p-tv / mhl_v1 / si_RegioCbus.c
1 /***************************************************************************
2
3
4
5 *   SiI9244 - MHL Transmitter Driver
6
7 *
8
9 * Copyright (C) (2011, Silicon Image Inc)
10
11 *
12
13 * This program is free software; you can redistribute it and/or modify
14
15 * it under the terms of the GNU General Public License as published by
16
17 * the Free Software Foundation version 2.
18
19 *
20
21 * This program is distributed ¡°as is¡± WITHOUT ANY WARRANTY of any
22
23 * kind, whether express or implied; without even the implied warranty
24
25 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
26
27 * GNU General Public License for more details.
28
29 *
30
31 *****************************************************************************/
32
33 #include <linux/types.h>
34
35 #include "SiI9234_I2C_master.h"
36 #include "SiI9234_I2C_slave_add.h"
37
38
39 static byte l_cbusPortOffsets [ MHD_MAX_CHANNELS ] = { 0x00 };
40
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 //------------------------------------------------------------------------------
48
49
50 byte SiIRegioCbusRead ( word regAddr, byte channel )
51 {
52     return(I2C_ReadByte(SA_TX_CBUS_Primary + l_cbusPortOffsets[channel], regAddr));
53 }
54
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 //------------------------------------------------------------------------------
62
63 void SiIRegioCbusWrite ( word regAddr, byte channel, byte value )
64 {
65
66     I2C_WriteByte(SA_TX_CBUS_Primary + l_cbusPortOffsets[channel], regAddr, value);
67 }
68