DS90UB940为解串器,在整个投屏传输通路中起到开关作用。在未与同轴电缆上输入信号的时钟同步前(可能未连接,也可能连接后时钟未同步),LOCK引脚和PASS引脚均为高阻态,电气特性呈现为高电平,没有数据输出。时钟同步后,LOCK引脚输出1,可以正常输出数据。PASS引脚则用于检测输入信号的时序(比如DE length、VSync length)是否有异常;输出1表示OK,输出0表示有异常。LINK ERROR COUNT寄存器:提供“串行链路数据完整性”错误计数门限设置,可以设置容错数,即多少个错误后才释放LOCK;默认不设置是1个。上面三个功能均提供了文件系统节点来动态控制。除此之外,作为sensor,DS90UB940在V4L2框架中注册为slave设备,master设备会通过DS90注册到V4L2框架的ioctl函数操作DS90UB940设备。
STATUS PINS:
引脚 | 描述 | 取值含义 |
BISTEN | Bist Enable Pin | 0: BIST Mode is disabled. 1: BIST Mode is enabled. See Built-In Self Test (BIST) for more information |
LOCK | Lock Status Output | LOCK = 1: PLL acquired lock to the reference clock input; DPHY outputs are active LOCK = 0: PLL is unlocked |
PASS | Normal mode status output pin (BISTEN = 0) | PASS = 1: No fault detected on input display timing PASS = 0: Indicates an error condition or corruption in display timing. Fault condition occurs: 1. DE length value mismatch measured once in succession 2. VSync length value mismatch measured twice in succession |
BIST mode status output pin (BISTEN = 1) | PASS = 1: No error detected PASS = 0: Error detected | |
PDB | Power down |
|
I2C寄存器
0x1C General Status bit0指示lock状态
0x25 BIST ERROR COUNT
0x41 LINK ERROR COUNT
ds90ub940_probe函数:
主要是解析设备树,获取gpio、clk,并使能clk、重启设备、创建文件节点等。其中的异常路径暂时先忽略。
ds90ub940_ioctl_desc数组提供v4l2框架下的ioctl函数组,如下:
IOCTL command numbers | 实现函数 | 函数内容 |
vidioc_int_dev_init_num | ioctl_dev_init | 描述:Initialise the device when slave attaches to the master。
|
vidioc_int_dev_exit_num | ioctl_dev_exit | mipi_csi2_disable |
vidioc_int_s_power_num | ioctl_s_power | 描述:Turns the power on or off |
vidioc_int_g_ifparm_num | ioctl_g_ifparm | 描述:获取参数 |
vidioc_int_init_num | ioctl_init | 描述:空 |
vidioc_int_enum_fmt_cap_num | ioctl_enum_fmt_cap | 描述:获取pixel格式 |
vidioc_int_g_fmt_cap_num | ioctl_g_fmt_cap | 描述:获取v4l2_format中的pix成员 |
vidioc_int_s_fmt_cap_num | ioctl_s_fmt_cap | 描述:设置v4l2_format中的pix成员 |
vidioc_int_g_parm_num | ioctl_g_parm | 描述:Returns the sensor's video CAPTURE parameters |
vidioc_int_s_parm_num | ioctl_s_parm | 描述:设置parm |
vidioc_int_g_ctrl_num | ioctl_g_ctrl | 描述:空 |
vidioc_int_s_ctrl_num | ioctl_s_ctrl | 描述:空 |
vidioc_int_enum_framesizes_num | ioctl_enum_framesizes | 描述:获取framesize |
vidioc_int_enum_frameintervals_num | ioctl_enum_frameintervals | 描述:获取frameinterval |
vidioc_int_g_chip_ident_num | ioctl_g_chip_ident | 描述:设置chip id |
|
|
|