资源简介
sii9022 配置脚本, 这个代码是我自己在项目中实际测试并可以运行的。
代码片段和文件信息
/*
* Silicon Image SiI9022 Encoder Driver
*
* Copyright (C) 2014 Texas Instruments
* Author: Tomi Valkeinen
*
* This file is licensed under the terms of the GNU General Public License
* version 2. This program is licensed “as is“ without any warranty of any
* kind whether express or implied.
*
*/
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include “../dss/omapdss.h“
#include “encoder-sii9022.h“
const unsigned char sii9022_init[80+10]={
0xc7 0x00 //reset and initialize
0xbc 0x01
0xbd 0x82
0xbe 0x25
//0x1e 0x00 //enable active mode
0x00 0x30 //pixelClock 44 MHz --> 4400
0x01 0x11
//input setup operations
0x1a 0x19
0x1e 0x00
0x26 0x50
0x25 0x03
0x27 0x00
0x26 0x10
//
0x02 0x3c //vertical Frequency in HZ
0x03 0x00
0x04 0x80
0x05 0x04
0x06 0x40
0x07 0x02
0x08 0x70 //? -
0x09 0x08 //TPI AVI input and output format data: 00
0x0a 0x04 //00
0x0b 0x00
0x60 0x00
0x62 0x28 //hFrontPorch
0x63 0x70 //DE generator VSYNC polarity HSYNC polarity
0x64 0x0e //vFrontPorch
0x66 0x80 //the active display.
0x67 0x04
0x68 0x40
0x69 0x02
//AVI Infoframe Data
0x0c 0xc6
0x0d 0x12
0x0e 0x18
0x0f 0x00
0x10 0x00
0x11 0x00
0x12 0x00
0x13 0x00
0x14 0x59
0x15 0x02
0x16 0x00
0x17 0x00
0x18 0x21
0x19 0x03
//system control
0x1a 0x01 //Enable TMDS output
};
static const struct regmap_config sii9022_regmap_config = {
.reg_bits = 8
.val_bits = 8
};
static int sii9022_set_power_state(struct panel_drv_data *ddata
enum sii9022_power_state state)
{
unsigned pwr;
unsigned cold;
int r;
switch (state) {
case SII9022_POWER_STATE_D0:
pwr = 0;
cold = 0;
break;
case SII9022_POWER_STATE_D2:
pwr = 2;
cold = 0;
break;
case SII9022_POWER_STATE_D3_HOT:
pwr = 3;
cold = 0;
break;
case SII9022_POWER_STATE_D3_COLD:
pwr = 3;
cold = 1;
break;
default:
return -EINVAL;
}
r = regmap_update_bits(ddata->regmap SII9022_POWER_STATE_CTRL_REG
1 << 2 cold << 2);
if (r) {
dev_err(&ddata->i2c_client->dev “failed to set hot/cold bit\n“);
return r;
}
r = regmap_update_bits(ddata->regmap SII9022_POWER_STATE_CTRL_REG
0x3 pwr);
if (r) {
dev_err(&ddata->i2c_client->dev
“failed to set power state to %d\n“ pwr);
return r;
}
return 0;
}
static int sii9022_ddc_read(struct i2c_adapter *adapter
unsigned char *b
评论
共有 条评论