├── sigmastar ├── infinity6 │ ├── sensor_config.ko │ ├── sensor_gc2053_mipi.ko │ ├── sensor_imx307_mipi.ko │ ├── sensor_sc2239_mipi.ko │ ├── sensor_sc2239_parl.ko │ ├── sensor_sc2335_mipi.ko │ ├── sensor_sc2335_parl.ko │ └── sensor_sc3335_mipi.ko ├── infinity6c │ ├── sensor_config.ko │ ├── sensor_gc4653_mipi.ko │ ├── sensor_imx335_mipi.ko │ ├── sensor_imx415_mipi.ko │ ├── sensor_os04a10_mipi.ko │ ├── sensor_sc401ai_mipi.ko │ ├── sensor_sc4336p_mipi.ko │ ├── sensor_sc501ai_mipi.ko │ ├── sensor_sc830ai_mipi.ko │ └── sensor_sc850sl_mipi.ko ├── infinity6e │ ├── sensor_config.ko │ ├── sensor_gc2053_mipi.ko │ ├── sensor_gc4653_mipi.ko │ ├── sensor_imx307_mipi.ko │ ├── sensor_imx335_mipi.ko │ ├── sensor_imx347_mipi.ko │ ├── sensor_imx415_mipi.ko │ ├── sensor_sc8235_mipi.ko │ ├── sensor_os04a10_mipi.ko │ ├── sensor_os04c10_mipi.ko │ └── sensor_sc501ai_mipi.ko └── infinity6b0 │ ├── sensor_config.ko │ ├── sensor_jxf37_mipi.ko │ ├── sensor_jxq03_mipi.ko │ ├── sensor_gc2053_mipi.ko │ ├── sensor_gc2083_mipi.ko │ ├── sensor_gc4023_mipi.ko │ ├── sensor_gc4653_mipi.ko │ ├── sensor_imx307_mipi.ko │ ├── sensor_imx335_mipi.ko │ ├── sensor_os02g10_mipi.ko │ ├── sensor_sc200ai_mipi.ko │ ├── sensor_sc2239_mipi.ko │ ├── sensor_sc223a_mipi.ko │ ├── sensor_sc2335_mipi.ko │ ├── sensor_sc2336_mipi.ko │ ├── sensor_sc3335_mipi.ko │ ├── sensor_sc3338_mipi.ko │ └── sensor_sc401ai_mipi.ko ├── hisilicon ├── binary │ ├── gk7205v200 │ │ ├── libsns_f37.so │ │ ├── libsns_ar0237.so │ │ ├── libsns_gc2053.so │ │ ├── libsns_imx290.so │ │ ├── libsns_imx307.so │ │ ├── libsns_imx327.so │ │ ├── libsns_imx335.so │ │ ├── libsns_os05a.so │ │ ├── libsns_ov2718.so │ │ ├── libsns_sc2231.so │ │ ├── libsns_sc2235.so │ │ ├── libsns_sc3235.so │ │ ├── libsns_sc3335.so │ │ ├── libsns_sc4236.so │ │ ├── libsns_sc500ai.so │ │ ├── libsns_gc4653_2l.so │ │ ├── libsns_imx307_2l.so │ │ ├── libsns_imx327_2l.so │ │ └── libsns_gc2053_forcar.so │ ├── hi3516ev200 │ │ ├── libsns_f23.so │ │ ├── libsns_gc2053.so │ │ ├── libsns_sc2232h.so │ │ ├── libsns_imx307_2l.so │ │ └── libsns_sc2335_mipi.so │ ├── hi3516av100 │ │ ├── libsns_imx123.so │ │ ├── libsns_imx335.so │ │ ├── libsns_sc5235.so │ │ ├── libsns_ar0330_3M.so │ │ ├── libsns_imx326_5m.so │ │ ├── libsns_ov4689_4M.so │ │ ├── libsns_ov5658_5m.so │ │ └── libsns_sc5035_5M.so │ ├── hi3516cv300 │ │ ├── libsns_imx290.so │ │ ├── libsns_imx323.so │ │ └── libsns_sc5035_5M.so │ ├── hi3519v100 │ │ ├── libsns_imx226.so │ │ ├── libsns_imx274.so │ │ ├── libsns_imx290.so │ │ ├── libsns_imx307.so │ │ ├── libsns_imx335.so │ │ ├── libsns_sc2315.so │ │ ├── libsns_sc5235.so │ │ ├── libsns_ov4689_4M.so │ │ ├── libsns_scmars_4m.so │ │ └── libsns_ov12895_8m.so │ ├── hi3516ev200_rev2 │ │ ├── libsns_f23.so │ │ ├── libsns_gc2053.so │ │ ├── libsns_imx335.so │ │ ├── libsns_sc2232h.so │ │ └── libsns_imx307_2l.so │ ├── hi3516ev200_rev3 │ │ ├── libsns_f23.so │ │ ├── libsns_f37.so │ │ ├── libsns_q03.so │ │ ├── libsns_gc2053.so │ │ ├── libsns_sc2232h.so │ │ └── libsns_imx307_2l.so │ ├── hi3516ev200_rev4 │ │ ├── libsns_gc2053.so │ │ ├── libsns_imx307.so │ │ ├── libsns_imx327.so │ │ ├── libsns_imx335.so │ │ ├── libsns_os05a.so │ │ ├── libsns_sc2231.so │ │ ├── libsns_sc2235.so │ │ ├── libsns_sc3235.so │ │ ├── libsns_sc4236.so │ │ ├── libsns_sp2305.so │ │ ├── libsns_imx307_2l.so │ │ ├── libsns_imx327_2l.so │ │ └── libsns_gc2053_forcar.so │ ├── hi3519v100_rev2 │ │ ├── libsns_imx226.so │ │ ├── libsns_imx274.so │ │ ├── libsns_imx307.so │ │ ├── libsns_imx335.so │ │ ├── libsns_scmars_4m.so │ │ └── libsns_ov12895_8m.so │ ├── libsns_ar0237_i2c_unknown_hi3516cv300_rev1.so │ ├── libsns_ar0237_i2c_unknown_hi3516cv300_rev2.so │ ├── libsns_bg0806_i2c_unknown_hi3516cv300_rev1.so │ ├── libsns_gc2023_i2c_unknown_hi3516cv200_rev1.so │ ├── libsns_imx122_spi_unknown_hi3516cv200_rev1.so │ ├── libsns_imx122_spi_unknown_hi3516cv300_rev1.so │ ├── libsns_imx290_i2c_unknown_hi3516cv300_dvp.so │ ├── libsns_imx290_i2c_unknown_hi3516cv300_rev1.so │ ├── libsns_imx290_i2c_unknown_hi3516cv300_rev2.so │ ├── libsns_imx290_i2c_unknown_hi3516cv300_rev3.so │ ├── libsns_imx291_i2c_unknown_hi3516cv200_rev1.so │ ├── libsns_imx291_i2c_unknown_hi3516cv300_rev1.so │ ├── libsns_imx307_i2c_unknown_hi3516cv200_rev1.so │ ├── libsns_imx307_i2c_unknown_hi3516cv300_rev1.so │ ├── libsns_imx307_i2c_unknown_hi3516cv300_rev2.so │ ├── libsns_imx323_i2c_unknown_hi3516cv300_rev1.so │ ├── libsns_imx323_i2c_unknown_hi3516cv300_rev2.so │ ├── libsns_imx323_i2c_unknown_hi3516cv300_rev3.so │ ├── libsns_imx327_i2c_unknown_hi3516cv200_rev1.so │ ├── libsns_imx327_i2c_unknown_hi3516cv300_rev1.so │ ├── libsns_imx327_i2c_unknown_hi3516cv300_rev2.so │ ├── libsns_ov2718_i2c_unknown_hi3516cv300_rev1.so │ ├── libsns_ov2735_i2c_unknown_hi3516cv300_rev1.so │ └── MD5SUMS └── sources │ ├── os05a_i2c_unknown_hi3516av200_rev1 │ ├── Readme.txt │ ├── Makefile │ └── os05a_sensor_ctl.c │ ├── imx274_i2c_mipi_hi3516av200_rev1 │ ├── Readme.txt │ ├── Makefile │ ├── imx274_slave_priv.h │ └── imx274_sensor_ctl.c │ ├── imx290_i2c_unknown_hi3516av200_rev1 │ ├── Readme.txt │ └── Makefile │ ├── imx226_spi_unknown_hi3516av200_rev1 │ ├── Readme.txt │ ├── Makefile │ ├── imx226_slave_priv.h │ └── imx226_sensor_ctl.c │ ├── imx327_i2c_mipi_hi3516av200_rev1 │ └── Makefile │ ├── jxh42_i2c_hi3516cv100_rev1 │ ├── Makefile │ ├── jxh42_sensor_ctl.c │ └── jxh42_cmos.c │ ├── ov2710_i2c_mipi_hi3518ev200_rev1 │ ├── Makefile │ ├── ov2710_sensor_ctl.c │ └── ov2710_cmos.c │ ├── imx326_i2c_unknown_hi3516av200_rev1 │ ├── Makefile │ └── imx326_sensor_ctl.c │ └── ov4689_i2c_unknown_hi3516av200_rev1 │ ├── Makefile │ └── ov4689_slave_priv.h ├── README.md └── LICENSE /sigmastar/infinity6/sensor_config.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/sigmastar/infinity6/sensor_config.ko -------------------------------------------------------------------------------- /sigmastar/infinity6c/sensor_config.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/sigmastar/infinity6c/sensor_config.ko -------------------------------------------------------------------------------- /sigmastar/infinity6e/sensor_config.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/sigmastar/infinity6e/sensor_config.ko -------------------------------------------------------------------------------- /sigmastar/infinity6b0/sensor_config.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/sigmastar/infinity6b0/sensor_config.ko -------------------------------------------------------------------------------- /hisilicon/binary/gk7205v200/libsns_f37.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/gk7205v200/libsns_f37.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3516ev200/libsns_f23.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3516ev200/libsns_f23.so -------------------------------------------------------------------------------- /sigmastar/infinity6/sensor_gc2053_mipi.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/sigmastar/infinity6/sensor_gc2053_mipi.ko -------------------------------------------------------------------------------- /sigmastar/infinity6/sensor_imx307_mipi.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/sigmastar/infinity6/sensor_imx307_mipi.ko -------------------------------------------------------------------------------- /sigmastar/infinity6/sensor_sc2239_mipi.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/sigmastar/infinity6/sensor_sc2239_mipi.ko -------------------------------------------------------------------------------- /sigmastar/infinity6/sensor_sc2239_parl.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/sigmastar/infinity6/sensor_sc2239_parl.ko -------------------------------------------------------------------------------- /sigmastar/infinity6/sensor_sc2335_mipi.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/sigmastar/infinity6/sensor_sc2335_mipi.ko -------------------------------------------------------------------------------- /sigmastar/infinity6/sensor_sc2335_parl.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/sigmastar/infinity6/sensor_sc2335_parl.ko -------------------------------------------------------------------------------- /sigmastar/infinity6/sensor_sc3335_mipi.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/sigmastar/infinity6/sensor_sc3335_mipi.ko -------------------------------------------------------------------------------- /sigmastar/infinity6b0/sensor_jxf37_mipi.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/sigmastar/infinity6b0/sensor_jxf37_mipi.ko -------------------------------------------------------------------------------- /sigmastar/infinity6b0/sensor_jxq03_mipi.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/sigmastar/infinity6b0/sensor_jxq03_mipi.ko -------------------------------------------------------------------------------- /sigmastar/infinity6c/sensor_gc4653_mipi.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/sigmastar/infinity6c/sensor_gc4653_mipi.ko -------------------------------------------------------------------------------- /sigmastar/infinity6c/sensor_imx335_mipi.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/sigmastar/infinity6c/sensor_imx335_mipi.ko -------------------------------------------------------------------------------- /sigmastar/infinity6c/sensor_imx415_mipi.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/sigmastar/infinity6c/sensor_imx415_mipi.ko -------------------------------------------------------------------------------- /sigmastar/infinity6e/sensor_gc2053_mipi.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/sigmastar/infinity6e/sensor_gc2053_mipi.ko -------------------------------------------------------------------------------- /sigmastar/infinity6e/sensor_gc4653_mipi.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/sigmastar/infinity6e/sensor_gc4653_mipi.ko -------------------------------------------------------------------------------- /sigmastar/infinity6e/sensor_imx307_mipi.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/sigmastar/infinity6e/sensor_imx307_mipi.ko -------------------------------------------------------------------------------- /sigmastar/infinity6e/sensor_imx335_mipi.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/sigmastar/infinity6e/sensor_imx335_mipi.ko -------------------------------------------------------------------------------- /sigmastar/infinity6e/sensor_imx347_mipi.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/sigmastar/infinity6e/sensor_imx347_mipi.ko -------------------------------------------------------------------------------- /sigmastar/infinity6e/sensor_imx415_mipi.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/sigmastar/infinity6e/sensor_imx415_mipi.ko -------------------------------------------------------------------------------- /sigmastar/infinity6e/sensor_sc8235_mipi.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/sigmastar/infinity6e/sensor_sc8235_mipi.ko -------------------------------------------------------------------------------- /hisilicon/binary/gk7205v200/libsns_ar0237.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/gk7205v200/libsns_ar0237.so -------------------------------------------------------------------------------- /hisilicon/binary/gk7205v200/libsns_gc2053.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/gk7205v200/libsns_gc2053.so -------------------------------------------------------------------------------- /hisilicon/binary/gk7205v200/libsns_imx290.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/gk7205v200/libsns_imx290.so -------------------------------------------------------------------------------- /hisilicon/binary/gk7205v200/libsns_imx307.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/gk7205v200/libsns_imx307.so -------------------------------------------------------------------------------- /hisilicon/binary/gk7205v200/libsns_imx327.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/gk7205v200/libsns_imx327.so -------------------------------------------------------------------------------- /hisilicon/binary/gk7205v200/libsns_imx335.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/gk7205v200/libsns_imx335.so -------------------------------------------------------------------------------- /hisilicon/binary/gk7205v200/libsns_os05a.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/gk7205v200/libsns_os05a.so -------------------------------------------------------------------------------- /hisilicon/binary/gk7205v200/libsns_ov2718.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/gk7205v200/libsns_ov2718.so -------------------------------------------------------------------------------- /hisilicon/binary/gk7205v200/libsns_sc2231.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/gk7205v200/libsns_sc2231.so -------------------------------------------------------------------------------- /hisilicon/binary/gk7205v200/libsns_sc2235.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/gk7205v200/libsns_sc2235.so -------------------------------------------------------------------------------- /hisilicon/binary/gk7205v200/libsns_sc3235.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/gk7205v200/libsns_sc3235.so -------------------------------------------------------------------------------- /hisilicon/binary/gk7205v200/libsns_sc3335.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/gk7205v200/libsns_sc3335.so -------------------------------------------------------------------------------- /hisilicon/binary/gk7205v200/libsns_sc4236.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/gk7205v200/libsns_sc4236.so -------------------------------------------------------------------------------- /hisilicon/binary/gk7205v200/libsns_sc500ai.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/gk7205v200/libsns_sc500ai.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3516av100/libsns_imx123.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3516av100/libsns_imx123.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3516av100/libsns_imx335.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3516av100/libsns_imx335.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3516av100/libsns_sc5235.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3516av100/libsns_sc5235.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3516cv300/libsns_imx290.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3516cv300/libsns_imx290.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3516cv300/libsns_imx323.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3516cv300/libsns_imx323.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3516ev200/libsns_gc2053.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3516ev200/libsns_gc2053.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3519v100/libsns_imx226.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3519v100/libsns_imx226.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3519v100/libsns_imx274.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3519v100/libsns_imx274.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3519v100/libsns_imx290.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3519v100/libsns_imx290.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3519v100/libsns_imx307.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3519v100/libsns_imx307.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3519v100/libsns_imx335.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3519v100/libsns_imx335.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3519v100/libsns_sc2315.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3519v100/libsns_sc2315.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3519v100/libsns_sc5235.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3519v100/libsns_sc5235.so -------------------------------------------------------------------------------- /sigmastar/infinity6b0/sensor_gc2053_mipi.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/sigmastar/infinity6b0/sensor_gc2053_mipi.ko -------------------------------------------------------------------------------- /sigmastar/infinity6b0/sensor_gc2083_mipi.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/sigmastar/infinity6b0/sensor_gc2083_mipi.ko -------------------------------------------------------------------------------- /sigmastar/infinity6b0/sensor_gc4023_mipi.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/sigmastar/infinity6b0/sensor_gc4023_mipi.ko -------------------------------------------------------------------------------- /sigmastar/infinity6b0/sensor_gc4653_mipi.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/sigmastar/infinity6b0/sensor_gc4653_mipi.ko -------------------------------------------------------------------------------- /sigmastar/infinity6b0/sensor_imx307_mipi.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/sigmastar/infinity6b0/sensor_imx307_mipi.ko -------------------------------------------------------------------------------- /sigmastar/infinity6b0/sensor_imx335_mipi.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/sigmastar/infinity6b0/sensor_imx335_mipi.ko -------------------------------------------------------------------------------- /sigmastar/infinity6b0/sensor_os02g10_mipi.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/sigmastar/infinity6b0/sensor_os02g10_mipi.ko -------------------------------------------------------------------------------- /sigmastar/infinity6b0/sensor_sc200ai_mipi.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/sigmastar/infinity6b0/sensor_sc200ai_mipi.ko -------------------------------------------------------------------------------- /sigmastar/infinity6b0/sensor_sc2239_mipi.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/sigmastar/infinity6b0/sensor_sc2239_mipi.ko -------------------------------------------------------------------------------- /sigmastar/infinity6b0/sensor_sc223a_mipi.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/sigmastar/infinity6b0/sensor_sc223a_mipi.ko -------------------------------------------------------------------------------- /sigmastar/infinity6b0/sensor_sc2335_mipi.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/sigmastar/infinity6b0/sensor_sc2335_mipi.ko -------------------------------------------------------------------------------- /sigmastar/infinity6b0/sensor_sc2336_mipi.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/sigmastar/infinity6b0/sensor_sc2336_mipi.ko -------------------------------------------------------------------------------- /sigmastar/infinity6b0/sensor_sc3335_mipi.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/sigmastar/infinity6b0/sensor_sc3335_mipi.ko -------------------------------------------------------------------------------- /sigmastar/infinity6b0/sensor_sc3338_mipi.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/sigmastar/infinity6b0/sensor_sc3338_mipi.ko -------------------------------------------------------------------------------- /sigmastar/infinity6b0/sensor_sc401ai_mipi.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/sigmastar/infinity6b0/sensor_sc401ai_mipi.ko -------------------------------------------------------------------------------- /sigmastar/infinity6c/sensor_os04a10_mipi.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/sigmastar/infinity6c/sensor_os04a10_mipi.ko -------------------------------------------------------------------------------- /sigmastar/infinity6c/sensor_sc401ai_mipi.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/sigmastar/infinity6c/sensor_sc401ai_mipi.ko -------------------------------------------------------------------------------- /sigmastar/infinity6c/sensor_sc4336p_mipi.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/sigmastar/infinity6c/sensor_sc4336p_mipi.ko -------------------------------------------------------------------------------- /sigmastar/infinity6c/sensor_sc501ai_mipi.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/sigmastar/infinity6c/sensor_sc501ai_mipi.ko -------------------------------------------------------------------------------- /sigmastar/infinity6c/sensor_sc830ai_mipi.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/sigmastar/infinity6c/sensor_sc830ai_mipi.ko -------------------------------------------------------------------------------- /sigmastar/infinity6c/sensor_sc850sl_mipi.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/sigmastar/infinity6c/sensor_sc850sl_mipi.ko -------------------------------------------------------------------------------- /sigmastar/infinity6e/sensor_os04a10_mipi.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/sigmastar/infinity6e/sensor_os04a10_mipi.ko -------------------------------------------------------------------------------- /sigmastar/infinity6e/sensor_os04c10_mipi.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/sigmastar/infinity6e/sensor_os04c10_mipi.ko -------------------------------------------------------------------------------- /sigmastar/infinity6e/sensor_sc501ai_mipi.ko: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/sigmastar/infinity6e/sensor_sc501ai_mipi.ko -------------------------------------------------------------------------------- /hisilicon/binary/gk7205v200/libsns_gc4653_2l.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/gk7205v200/libsns_gc4653_2l.so -------------------------------------------------------------------------------- /hisilicon/binary/gk7205v200/libsns_imx307_2l.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/gk7205v200/libsns_imx307_2l.so -------------------------------------------------------------------------------- /hisilicon/binary/gk7205v200/libsns_imx327_2l.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/gk7205v200/libsns_imx327_2l.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3516ev200/libsns_sc2232h.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3516ev200/libsns_sc2232h.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3516ev200_rev2/libsns_f23.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3516ev200_rev2/libsns_f23.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3516ev200_rev3/libsns_f23.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3516ev200_rev3/libsns_f23.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3516ev200_rev3/libsns_f37.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3516ev200_rev3/libsns_f37.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3516ev200_rev3/libsns_q03.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3516ev200_rev3/libsns_q03.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3519v100/libsns_ov4689_4M.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3519v100/libsns_ov4689_4M.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3519v100/libsns_scmars_4m.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3519v100/libsns_scmars_4m.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3516av100/libsns_ar0330_3M.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3516av100/libsns_ar0330_3M.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3516av100/libsns_imx326_5m.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3516av100/libsns_imx326_5m.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3516av100/libsns_ov4689_4M.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3516av100/libsns_ov4689_4M.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3516av100/libsns_ov5658_5m.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3516av100/libsns_ov5658_5m.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3516av100/libsns_sc5035_5M.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3516av100/libsns_sc5035_5M.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3516cv300/libsns_sc5035_5M.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3516cv300/libsns_sc5035_5M.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3516ev200/libsns_imx307_2l.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3516ev200/libsns_imx307_2l.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3516ev200/libsns_sc2335_mipi.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3516ev200/libsns_sc2335_mipi.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3516ev200_rev2/libsns_gc2053.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3516ev200_rev2/libsns_gc2053.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3516ev200_rev2/libsns_imx335.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3516ev200_rev2/libsns_imx335.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3516ev200_rev3/libsns_gc2053.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3516ev200_rev3/libsns_gc2053.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3516ev200_rev4/libsns_gc2053.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3516ev200_rev4/libsns_gc2053.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3516ev200_rev4/libsns_imx307.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3516ev200_rev4/libsns_imx307.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3516ev200_rev4/libsns_imx327.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3516ev200_rev4/libsns_imx327.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3516ev200_rev4/libsns_imx335.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3516ev200_rev4/libsns_imx335.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3516ev200_rev4/libsns_os05a.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3516ev200_rev4/libsns_os05a.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3516ev200_rev4/libsns_sc2231.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3516ev200_rev4/libsns_sc2231.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3516ev200_rev4/libsns_sc2235.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3516ev200_rev4/libsns_sc2235.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3516ev200_rev4/libsns_sc3235.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3516ev200_rev4/libsns_sc3235.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3516ev200_rev4/libsns_sc4236.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3516ev200_rev4/libsns_sc4236.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3516ev200_rev4/libsns_sp2305.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3516ev200_rev4/libsns_sp2305.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3519v100/libsns_ov12895_8m.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3519v100/libsns_ov12895_8m.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3519v100_rev2/libsns_imx226.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3519v100_rev2/libsns_imx226.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3519v100_rev2/libsns_imx274.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3519v100_rev2/libsns_imx274.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3519v100_rev2/libsns_imx307.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3519v100_rev2/libsns_imx307.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3519v100_rev2/libsns_imx335.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3519v100_rev2/libsns_imx335.so -------------------------------------------------------------------------------- /hisilicon/binary/gk7205v200/libsns_gc2053_forcar.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/gk7205v200/libsns_gc2053_forcar.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3516ev200_rev2/libsns_sc2232h.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3516ev200_rev2/libsns_sc2232h.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3516ev200_rev3/libsns_sc2232h.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3516ev200_rev3/libsns_sc2232h.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3519v100_rev2/libsns_scmars_4m.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3519v100_rev2/libsns_scmars_4m.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3516ev200_rev2/libsns_imx307_2l.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3516ev200_rev2/libsns_imx307_2l.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3516ev200_rev3/libsns_imx307_2l.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3516ev200_rev3/libsns_imx307_2l.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3516ev200_rev4/libsns_imx307_2l.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3516ev200_rev4/libsns_imx307_2l.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3516ev200_rev4/libsns_imx327_2l.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3516ev200_rev4/libsns_imx327_2l.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3519v100_rev2/libsns_ov12895_8m.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3519v100_rev2/libsns_ov12895_8m.so -------------------------------------------------------------------------------- /hisilicon/binary/hi3516ev200_rev4/libsns_gc2053_forcar.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/hi3516ev200_rev4/libsns_gc2053_forcar.so -------------------------------------------------------------------------------- /hisilicon/binary/libsns_ar0237_i2c_unknown_hi3516cv300_rev1.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/libsns_ar0237_i2c_unknown_hi3516cv300_rev1.so -------------------------------------------------------------------------------- /hisilicon/binary/libsns_ar0237_i2c_unknown_hi3516cv300_rev2.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/libsns_ar0237_i2c_unknown_hi3516cv300_rev2.so -------------------------------------------------------------------------------- /hisilicon/binary/libsns_bg0806_i2c_unknown_hi3516cv300_rev1.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/libsns_bg0806_i2c_unknown_hi3516cv300_rev1.so -------------------------------------------------------------------------------- /hisilicon/binary/libsns_gc2023_i2c_unknown_hi3516cv200_rev1.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/libsns_gc2023_i2c_unknown_hi3516cv200_rev1.so -------------------------------------------------------------------------------- /hisilicon/binary/libsns_imx122_spi_unknown_hi3516cv200_rev1.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/libsns_imx122_spi_unknown_hi3516cv200_rev1.so -------------------------------------------------------------------------------- /hisilicon/binary/libsns_imx122_spi_unknown_hi3516cv300_rev1.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/libsns_imx122_spi_unknown_hi3516cv300_rev1.so -------------------------------------------------------------------------------- /hisilicon/binary/libsns_imx290_i2c_unknown_hi3516cv300_dvp.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/libsns_imx290_i2c_unknown_hi3516cv300_dvp.so -------------------------------------------------------------------------------- /hisilicon/binary/libsns_imx290_i2c_unknown_hi3516cv300_rev1.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/libsns_imx290_i2c_unknown_hi3516cv300_rev1.so -------------------------------------------------------------------------------- /hisilicon/binary/libsns_imx290_i2c_unknown_hi3516cv300_rev2.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/libsns_imx290_i2c_unknown_hi3516cv300_rev2.so -------------------------------------------------------------------------------- /hisilicon/binary/libsns_imx290_i2c_unknown_hi3516cv300_rev3.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/libsns_imx290_i2c_unknown_hi3516cv300_rev3.so -------------------------------------------------------------------------------- /hisilicon/binary/libsns_imx291_i2c_unknown_hi3516cv200_rev1.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/libsns_imx291_i2c_unknown_hi3516cv200_rev1.so -------------------------------------------------------------------------------- /hisilicon/binary/libsns_imx291_i2c_unknown_hi3516cv300_rev1.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/libsns_imx291_i2c_unknown_hi3516cv300_rev1.so -------------------------------------------------------------------------------- /hisilicon/binary/libsns_imx307_i2c_unknown_hi3516cv200_rev1.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/libsns_imx307_i2c_unknown_hi3516cv200_rev1.so -------------------------------------------------------------------------------- /hisilicon/binary/libsns_imx307_i2c_unknown_hi3516cv300_rev1.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/libsns_imx307_i2c_unknown_hi3516cv300_rev1.so -------------------------------------------------------------------------------- /hisilicon/binary/libsns_imx307_i2c_unknown_hi3516cv300_rev2.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/libsns_imx307_i2c_unknown_hi3516cv300_rev2.so -------------------------------------------------------------------------------- /hisilicon/binary/libsns_imx323_i2c_unknown_hi3516cv300_rev1.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/libsns_imx323_i2c_unknown_hi3516cv300_rev1.so -------------------------------------------------------------------------------- /hisilicon/binary/libsns_imx323_i2c_unknown_hi3516cv300_rev2.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/libsns_imx323_i2c_unknown_hi3516cv300_rev2.so -------------------------------------------------------------------------------- /hisilicon/binary/libsns_imx323_i2c_unknown_hi3516cv300_rev3.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/libsns_imx323_i2c_unknown_hi3516cv300_rev3.so -------------------------------------------------------------------------------- /hisilicon/binary/libsns_imx327_i2c_unknown_hi3516cv200_rev1.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/libsns_imx327_i2c_unknown_hi3516cv200_rev1.so -------------------------------------------------------------------------------- /hisilicon/binary/libsns_imx327_i2c_unknown_hi3516cv300_rev1.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/libsns_imx327_i2c_unknown_hi3516cv300_rev1.so -------------------------------------------------------------------------------- /hisilicon/binary/libsns_imx327_i2c_unknown_hi3516cv300_rev2.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/libsns_imx327_i2c_unknown_hi3516cv300_rev2.so -------------------------------------------------------------------------------- /hisilicon/binary/libsns_ov2718_i2c_unknown_hi3516cv300_rev1.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/libsns_ov2718_i2c_unknown_hi3516cv300_rev1.so -------------------------------------------------------------------------------- /hisilicon/binary/libsns_ov2735_i2c_unknown_hi3516cv300_rev1.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/OpenIPC/sensors/master/hisilicon/binary/libsns_ov2735_i2c_unknown_hi3516cv300_rev1.so -------------------------------------------------------------------------------- /hisilicon/sources/os05a_i2c_unknown_hi3516av200_rev1/Readme.txt: -------------------------------------------------------------------------------- 1 | OS05A : 2 | When uesd 5M@30 2to1_line WDR,frame rate of VI is up to 30 you must set the VI clock to 600MHz or more,set isp clock to 214MHz or more. 3 | Modefy mpp_xxx/ko/clkcfg_hi3519v101.sh "himm 0x1201004c 0x00094821" to corresponding value 4 | -------------------------------------------------------------------------------- /hisilicon/sources/imx274_i2c_mipi_hi3516av200_rev1/Readme.txt: -------------------------------------------------------------------------------- 1 | IMX274 : 2 | When uesd 4K*2k 2to1_frame WDR,frame rate of VI is up to 60 you must set the VI clock to 600MHz , set isp clock to 300M or more. 3 | Modefy mpp_xxx/ko/clkcfg_hi3519v101.sh "himm 0x1201004c 0x00094821,himm 0x12010054 0x4041" to corresponding value 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![OpenIPC logo][logo] 2 | 3 | ## OpenIPC sensors 4 | 5 | [![Telegram][chat]][telegram_en] 6 | 7 | Source code and ready-to-use drivers for video camera sensors 8 | 9 | * Hisilicon 10 | * SigmaStar 11 | 12 | [logo]: https://openipc.org/assets/openipc-logo-black.svg 13 | [chat]: https://openipc.org/images/telegram_button.svg 14 | [telegram_en]: https://t.me/OpenIPC 15 | -------------------------------------------------------------------------------- /hisilicon/sources/imx290_i2c_unknown_hi3516av200_rev1/Readme.txt: -------------------------------------------------------------------------------- 1 | IMX290 : 2 | When uesd 1080P@30 2to1_line WDR,frame rate of VI is up to 60 you must set the VI clock to 300MHz or more,set isp clock to 214MHz or more. 3 | When uesd 1080P@30 3to1_line WDR,frame rate of VI is up to 90 you must set the VI clock to 340MHz or more,set isp clock to 214MHz or more. 4 | Modefy mpp_xxx/ko/clkcfg_hi3519v101.sh "himm 0x1201004c 0x00094821" to corresponding value 5 | -------------------------------------------------------------------------------- /hisilicon/sources/imx226_spi_unknown_hi3516av200_rev1/Readme.txt: -------------------------------------------------------------------------------- 1 | IMX226 : 2 | 4000*3000@30fps or 3840*2160@60fps you must set the VI clock to 500MHz or more. 3 | Replace "himm 0x12010054 0x00004043" with "himm 0x12010054 0x00024043" in mpp_xxx/ko/clkcfg_hi3519v101.sh. 4 | When uesd 4K*2k 2to1_frame WDR, frame rate of VI is up to 60 you must set the VI and isp clock to 600MHz. 5 | When uesd 4K*3k 2to1_frame WDR,frame rate of VI is up to 30 you must set the VI and isp clock to 500MHz or more 6 | When uesd 4K*3K@30 you must set the VI and ISP clock to 500MHz or more 7 | Modefy mpp_xxx/ko/clkcfg_hi3519v101.sh "himm 0x1201004c 0x00094821,himm 0x12010054 0x4041" to corresponding value 8 | -------------------------------------------------------------------------------- /hisilicon/sources/imx226_spi_unknown_hi3516av200_rev1/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # sensor lib Makefile 3 | # 4 | export TOP_DIR=../../../../ 5 | include ../../../../Rules.make 6 | 7 | TARGETS := libsns_imx226.a 8 | TARGETS_SO := libsns_imx226.so 9 | 10 | SRC :=$(wildcard *.c) 11 | SRC += $(wildcard *.cpp) 12 | 13 | OBJS := $(patsubst %.cpp,%.o,$(patsubst %.c,%.o,$(SRC))) 14 | 15 | CXXFLAGS := -Wall -I./ 16 | CXXFLAGS += -I../../mpp_include 17 | 18 | all:$(TARGETS) $(TARGETS_SO) 19 | 20 | $(TARGETS):$(OBJS) 21 | $(AR) rcs $@ $^ 22 | $(TARGETS_SO):$(OBJS) 23 | $(CC) -shared -fPIC -o $@ $^ 24 | 25 | %.o: %.cpp 26 | $(CXX) -c $(CXXFLAGS) -o $@ $< 27 | 28 | %.o: %.c 29 | $(CC) -c $(CXXFLAGS) -o $@ $< 30 | 31 | clean: 32 | rm -r $(TARGETS) $(TARGETS_SO);rm *.o 33 | 34 | -------------------------------------------------------------------------------- /hisilicon/sources/imx274_i2c_mipi_hi3516av200_rev1/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # sensor lib Makefile 3 | # 4 | export TOP_DIR=../../../../ 5 | include ../../../../Rules.make 6 | 7 | TARGETS := libsns_imx274.a 8 | TARGETS_SO := libsns_imx274.so 9 | 10 | SRC :=$(wildcard *.c) 11 | SRC += $(wildcard *.cpp) 12 | 13 | OBJS := $(patsubst %.cpp,%.o,$(patsubst %.c,%.o,$(SRC))) 14 | 15 | CXXFLAGS := -Wall -I./ 16 | CXXFLAGS += -I../../mpp_include 17 | 18 | all:$(TARGETS) $(TARGETS_SO) 19 | 20 | $(TARGETS):$(OBJS) 21 | $(AR) rcs $@ $^ 22 | $(TARGETS_SO):$(OBJS) 23 | $(CC) -shared -fPIC -o $@ $^ 24 | 25 | %.o: %.cpp 26 | $(CXX) -c $(CXXFLAGS) -o $@ $< 27 | 28 | %.o: %.c 29 | $(CC) -c $(CXXFLAGS) -o $@ $< 30 | 31 | clean: 32 | rm -r $(TARGETS) $(TARGETS_SO);rm *.o 33 | 34 | -------------------------------------------------------------------------------- /hisilicon/sources/imx327_i2c_mipi_hi3516av200_rev1/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # sensor lib Makefile 3 | # 4 | export TOP_DIR=../../../../ 5 | include ../../../../Rules.make 6 | 7 | TARGETS := libsns_imx327.a 8 | TARGETS_SO := libsns_imx327.so 9 | 10 | SRC :=$(wildcard *.c) 11 | SRC += $(wildcard *.cpp) 12 | 13 | OBJS := $(patsubst %.cpp,%.o,$(patsubst %.c,%.o,$(SRC))) 14 | 15 | CXXFLAGS := -Wall -I./ 16 | CXXFLAGS += -I../../mpp_include 17 | 18 | all:$(TARGETS) $(TARGETS_SO) 19 | 20 | $(TARGETS):$(OBJS) 21 | $(AR) rcs $@ $^ 22 | $(TARGETS_SO):$(OBJS) 23 | $(CC) -shared -fPIC -o $@ $^ 24 | 25 | %.o: %.cpp 26 | $(CXX) -c $(CXXFLAGS) -o $@ $< 27 | 28 | %.o: %.c 29 | $(CC) -c $(CXXFLAGS) -o $@ $< 30 | 31 | clean: 32 | rm -r $(TARGETS) $(TARGETS_SO);rm *.o 33 | 34 | -------------------------------------------------------------------------------- /hisilicon/sources/jxh42_i2c_hi3516cv100_rev1/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # sensor lib Makefile 3 | # 4 | export TOP_DIR=../../../../ 5 | include ../../../../Rules.make 6 | 7 | TARGETS := libsns_jxh42_i2c.a 8 | TARGETS_SO := libsns_jxh42_i2c.so 9 | 10 | SRC :=$(wildcard *.c) 11 | SRC += $(wildcard *.cpp) 12 | 13 | OBJS := $(patsubst %.cpp,%.o,$(patsubst %.c,%.o,$(SRC))) 14 | 15 | CXXFLAGS := -Wall -I./ 16 | CXXFLAGS += -I../../mpp_include 17 | 18 | all:$(TARGETS) $(TARGETS_SO) 19 | 20 | $(TARGETS):$(OBJS) 21 | $(AR) rcs $@ $^ 22 | $(TARGETS_SO):$(OBJS) 23 | $(CC) -shared -fPIC -o $@ $^ 24 | 25 | %.o: %.cpp 26 | $(CXX) -c $(CXXFLAGS) -o $@ $< 27 | 28 | %.o: %.c 29 | $(CC) -c $(CXXFLAGS) -o $@ $< 30 | 31 | clean: 32 | rm -r $(TARGETS) $(TARGETS_SO);rm *.o 33 | 34 | -------------------------------------------------------------------------------- /hisilicon/sources/ov2710_i2c_mipi_hi3518ev200_rev1/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # sensor lib Makefile 3 | # 4 | export TOP_DIR=../../../../ 5 | include ../../../../Rules.make 6 | 7 | TARGETS := libsns_ov2710.a 8 | TARGETS_SO := libsns_ov2710.so 9 | 10 | SRC :=$(wildcard *.c) 11 | SRC += $(wildcard *.cpp) 12 | 13 | OBJS := $(patsubst %.cpp,%.o,$(patsubst %.c,%.o,$(SRC))) 14 | 15 | CXXFLAGS := -Wall -I./ 16 | CXXFLAGS += -I../../mpp_include 17 | 18 | all:$(TARGETS) $(TARGETS_SO) 19 | 20 | $(TARGETS):$(OBJS) 21 | $(AR) rcs $@ $^ 22 | $(TARGETS_SO):$(OBJS) 23 | $(CC) -shared -fPIC -o $@ $^ 24 | 25 | %.o: %.cpp 26 | $(CXX) -c $(CXXFLAGS) -o $@ $< 27 | 28 | %.o: %.c 29 | $(CC) -c $(CXXFLAGS) -o $@ $< 30 | 31 | clean: 32 | rm -r $(TARGETS) $(TARGETS_SO);rm *.o 33 | 34 | -------------------------------------------------------------------------------- /hisilicon/sources/imx290_i2c_unknown_hi3516av200_rev1/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # sensor lib Makefile 3 | # 4 | 5 | include ../../../../Rules.make 6 | 7 | TARGETS := libsns_ov2710.a 8 | TARGETS_SO := libsns_ov2710.so 9 | PRINTF := @printf "\033[31;1m\t%s\033[0m\n" 10 | 11 | SRC :=$(wildcard *.c) 12 | SRC += $(wildcard *.cpp) 13 | 14 | OBJS := $(patsubst %.cpp,%.o,$(patsubst %.c,%.o,$(SRC))) 15 | 16 | CXXFLAGS := -Wall -I./ 17 | CXXFLAGS += -I../../mpp_include 18 | 19 | all:$(TARGETS) $(TARGETS_SO) 20 | 21 | $(TARGETS):$(OBJS) 22 | $(PRINTF) "AR $@";$(AR) rcs $@ $^ 23 | $(TARGETS_SO):$(OBJS) 24 | $(PRINTF) "CC $@";$(CC) -shared -fPIC -o $@ $^ 25 | 26 | %.o: %.cpp 27 | $(PRINTF) "$(CXX) $@";$(CXX) -c $(CXXFLAGS) -o $@ $< 28 | 29 | %.o: %.c 30 | $(PRINTF) "$(CC) $@";$(CC) -c $(CXXFLAGS) -o $@ $< 31 | 32 | clean: 33 | $(PRINTF) "RM $(TARGETS) $(TARGETS_SO)";rm -r $(TARGETS) $(TARGETS_SO);rm *.o 34 | 35 | -------------------------------------------------------------------------------- /hisilicon/sources/imx326_i2c_unknown_hi3516av200_rev1/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # sensor lib Makefile 3 | # 4 | 5 | include ../../../../Rules.make 6 | 7 | TARGETS := libsns_ov2710.a 8 | TARGETS_SO := libsns_ov2710.so 9 | PRINTF := @printf "\033[31;1m\t%s\033[0m\n" 10 | 11 | SRC :=$(wildcard *.c) 12 | SRC += $(wildcard *.cpp) 13 | 14 | OBJS := $(patsubst %.cpp,%.o,$(patsubst %.c,%.o,$(SRC))) 15 | 16 | CXXFLAGS := -Wall -I./ 17 | CXXFLAGS += -I../../mpp_include 18 | 19 | all:$(TARGETS) $(TARGETS_SO) 20 | 21 | $(TARGETS):$(OBJS) 22 | $(PRINTF) "AR $@";$(AR) rcs $@ $^ 23 | $(TARGETS_SO):$(OBJS) 24 | $(PRINTF) "CC $@";$(CC) -shared -fPIC -o $@ $^ 25 | 26 | %.o: %.cpp 27 | $(PRINTF) "$(CXX) $@";$(CXX) -c $(CXXFLAGS) -o $@ $< 28 | 29 | %.o: %.c 30 | $(PRINTF) "$(CC) $@";$(CC) -c $(CXXFLAGS) -o $@ $< 31 | 32 | clean: 33 | $(PRINTF) "RM $(TARGETS) $(TARGETS_SO)";rm -r $(TARGETS) $(TARGETS_SO);rm *.o 34 | 35 | -------------------------------------------------------------------------------- /hisilicon/sources/os05a_i2c_unknown_hi3516av200_rev1/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # sensor lib Makefile 3 | # 4 | 5 | include ../../../../Rules.make 6 | 7 | TARGETS := libsns_ov2710.a 8 | TARGETS_SO := libsns_ov2710.so 9 | PRINTF := @printf "\033[31;1m\t%s\033[0m\n" 10 | 11 | SRC :=$(wildcard *.c) 12 | SRC += $(wildcard *.cpp) 13 | 14 | OBJS := $(patsubst %.cpp,%.o,$(patsubst %.c,%.o,$(SRC))) 15 | 16 | CXXFLAGS := -Wall -I./ 17 | CXXFLAGS += -I../../mpp_include 18 | 19 | all:$(TARGETS) $(TARGETS_SO) 20 | 21 | $(TARGETS):$(OBJS) 22 | $(PRINTF) "AR $@";$(AR) rcs $@ $^ 23 | $(TARGETS_SO):$(OBJS) 24 | $(PRINTF) "CC $@";$(CC) -shared -fPIC -o $@ $^ 25 | 26 | %.o: %.cpp 27 | $(PRINTF) "$(CXX) $@";$(CXX) -c $(CXXFLAGS) -o $@ $< 28 | 29 | %.o: %.c 30 | $(PRINTF) "$(CC) $@";$(CC) -c $(CXXFLAGS) -o $@ $< 31 | 32 | clean: 33 | $(PRINTF) "RM $(TARGETS) $(TARGETS_SO)";rm -r $(TARGETS) $(TARGETS_SO);rm *.o 34 | 35 | -------------------------------------------------------------------------------- /hisilicon/sources/ov4689_i2c_unknown_hi3516av200_rev1/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # sensor lib Makefile 3 | # 4 | 5 | include ../../../../Rules.make 6 | 7 | TARGETS := libsns_ov2710.a 8 | TARGETS_SO := libsns_ov2710.so 9 | PRINTF := @printf "\033[31;1m\t%s\033[0m\n" 10 | 11 | SRC :=$(wildcard *.c) 12 | SRC += $(wildcard *.cpp) 13 | 14 | OBJS := $(patsubst %.cpp,%.o,$(patsubst %.c,%.o,$(SRC))) 15 | 16 | CXXFLAGS := -Wall -I./ 17 | CXXFLAGS += -I../../mpp_include 18 | 19 | all:$(TARGETS) $(TARGETS_SO) 20 | 21 | $(TARGETS):$(OBJS) 22 | $(PRINTF) "AR $@";$(AR) rcs $@ $^ 23 | $(TARGETS_SO):$(OBJS) 24 | $(PRINTF) "CC $@";$(CC) -shared -fPIC -o $@ $^ 25 | 26 | %.o: %.cpp 27 | $(PRINTF) "$(CXX) $@";$(CXX) -c $(CXXFLAGS) -o $@ $< 28 | 29 | %.o: %.c 30 | $(PRINTF) "$(CC) $@";$(CC) -c $(CXXFLAGS) -o $@ $< 31 | 32 | clean: 33 | $(PRINTF) "RM $(TARGETS) $(TARGETS_SO)";rm -r $(TARGETS) $(TARGETS_SO);rm *.o 34 | 35 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2025 OpenIPC 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /hisilicon/sources/ov4689_i2c_unknown_hi3516av200_rev1/ov4689_slave_priv.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2001-2016, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : OV4689_slave_priv.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software group 9 | Created : 2016/03/07 10 | Description : this file was private for OV4689 slave mode sensor 11 | History : 12 | 1.Date : 13 | Author : xgl 14 | Modification: Created file 15 | ******************************************************************************/ 16 | #ifndef __OV4689_SLAVE_PRIV_H_ 17 | #define __OV4689_SLAVE_PRIV_H_ 18 | 19 | #ifdef __cplusplus 20 | #if __cplusplus 21 | extern "C"{ 22 | #endif 23 | #endif 24 | 25 | // usefull macro 26 | #define HIGH_8BITS(x) ((x & 0xff00) >> 8) 27 | #define LOW_8BITS(x) (x & 0x00ff) 28 | #ifndef MAX 29 | #define MAX(a, b) (((a) < (b)) ? (b) : (a)) 30 | #endif 31 | 32 | #ifndef MIN 33 | #define MIN(a, b) (((a) > (b)) ? (b) : (a)) 34 | #endif 35 | 36 | #define OV4689_RES_IS_4M(w, h) (w <= 2592 && h <= 1520) 37 | #define OV4689_RES_IS_2K(w, h) (w <= 1920 && h <= 1080) 38 | 39 | 40 | #define CHECK_RET(express)\ 41 | do{\ 42 | HI_S32 s32Ret;\ 43 | s32Ret = express;\ 44 | if (HI_SUCCESS != s32Ret)\ 45 | {\ 46 | printf("Failed at %s: LINE: %d with %#x!\n", __FUNCTION__, __LINE__, s32Ret);\ 47 | }\ 48 | }while(0) 49 | 50 | 51 | /* 52 | -------------------------------------------------------------------------------- 53 | - Structure For Slave Mode Sensor Using 54 | -------------------------------------------------------------------------------- 55 | */ 56 | 57 | // difference registers 58 | #define OV4689_FULL_LINES_MAX (0x7FFF) 59 | 60 | // registers to control exposure and gain 61 | #define OV4689_EXPO_L (0x3502) 62 | #define OV4689_EXPO_M (0x3501) 63 | #define OV4689_EXPO_H (0x3500) 64 | #define OV4689_VMAX_L (0x380F) 65 | #define OV4689_VMAX_H (0x380E) 66 | #define OV4689_AGAIN_REG (0x3508) 67 | #define OV4689_AGAIN (0x3509) 68 | #define OV4689_R_RST_FSIN_H (0x3826) 69 | #define OV4689_R_RST_FSIN_L (0x3827) 70 | #define OV4689_FSIN_ENABLE (0x3823) 71 | 72 | typedef enum { 73 | OV4689_MODE0 = 0, // mode 0: 1920x1080 12bit 30fps 74 | OV4689_MODE1, // mode 1: 2592x1520 12bit 30fps 75 | 76 | OV4689_MODE_BUTT 77 | 78 | } OV4689_RES_MODE_E; 79 | 80 | typedef struct hiOV4689_VIDEO_MODE_TBL_S 81 | { 82 | HI_U32 u32InckPerVs; 83 | HI_U32 u32VertiLines; 84 | HI_U32 u32MaxFps; 85 | const char *pszModeName; 86 | 87 | } OV4689_VIDEO_MODE_TBL_S; 88 | 89 | #endif /* __OV4689_SLAVE_PRIV_H_ */ 90 | 91 | -------------------------------------------------------------------------------- /hisilicon/sources/imx274_i2c_mipi_hi3516av200_rev1/imx274_slave_priv.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2001-2015, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : imx274_slave_priv.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software group 9 | Created : 2015/06/18 10 | Description : this file was private for imx226 slave mode sensor 11 | History : 12 | 1.Date : 13 | Author : 14 | Modification: Created file 15 | ******************************************************************************/ 16 | #ifndef __IMX274_SLAVE_PRIV_H_ 17 | #define __IMX274_SLAVE_PRIV_H_ 18 | 19 | #ifdef __cplusplus 20 | #if __cplusplus 21 | extern "C"{ 22 | #endif 23 | #endif 24 | 25 | 26 | // usefull macro 27 | #define HIGH_8BITS(x) ((x & 0xff00) >> 8) 28 | #define LOW_8BITS(x) (x & 0x00ff) 29 | #ifndef MAX 30 | #define MAX(a, b) (((a) < (b)) ? (b) : (a)) 31 | #endif 32 | 33 | #ifndef MIN 34 | #define MIN(a, b) (((a) > (b)) ? (b) : (a)) 35 | #endif 36 | 37 | #define IMX274_RES_IS_4K(w, h) (w <= 3840 && h <= 2160) 38 | #define IMX274_RES_IS_12M(w, h) (w <= 4000 && h <= 3000) 39 | #define IMX274_RES_IS_2K(w, h) (w <= 2048 && h <= 1080) 40 | 41 | #define CHECK_RET(express)\ 42 | do{\ 43 | HI_S32 s32Ret;\ 44 | s32Ret = express;\ 45 | if (HI_SUCCESS != s32Ret)\ 46 | {\ 47 | printf("Failed at %s: LINE: %d with %#x!\n", __FUNCTION__, __LINE__, s32Ret);\ 48 | }\ 49 | }while(0) 50 | 51 | /* 52 | -------------------------------------------------------------------------------- 53 | - Structure For Slave Mode Sensor Using 54 | -------------------------------------------------------------------------------- 55 | */ 56 | #define FULL_LINES_MAX (0xFFFF) 57 | 58 | // registers to control exposure 59 | #define IMX274_SHR_LINEAR (0x300C) 60 | #define IMX274_PGC (0x300A) 61 | #define IMX274_SVR (0x300E) 62 | #define IMX274_DGAIN (0x3012) 63 | #define IMX274_SHR_DOL1 (0x302E) // Shutter 1 for DOL For short exposure frame 64 | #define IMX274_SHR_DOL2 (0x3030) // Shutter 2 for DOL For long exposure frame 65 | #define IMX274_RHS1 (0x3032) // Designate the readout for DOL HDR For short exposure frame 66 | #define IMX274_VMAX (0x30F8) 67 | 68 | 69 | typedef struct hiIMX274_SENSOR_REG_S{ 70 | 71 | HI_U16 u16Addr; 72 | HI_U8 u8Data; 73 | } IMX274_SENSOR_REG_S; 74 | 75 | typedef enum { 76 | IMX274_MODE0 = 0, // mode 0: 3840x2160 4ch 12bit 29.97fps. 77 | IMX274_MODE1_DOL, // mode 1 DOL: 3840x2160 4ch 10bit 60fps to 30fps. 78 | 79 | IMX274_MODE_BUTT 80 | 81 | } IMX274_RES_MODE_E; 82 | 83 | typedef struct hiIMX274_VIDEO_MODE_TBL_S 84 | { 85 | HI_U32 u32Inck; 86 | HI_U32 u32InckPerHs; 87 | HI_U32 u32InckPerVs; 88 | HI_U32 u32VertiLines; 89 | 90 | HI_U32 u32MaxFps; 91 | const char *pszModeName; 92 | 93 | } IMX274_VIDEO_MODE_TBL_S; 94 | 95 | 96 | #endif /* __IMX274_SLAVE_PRIV_H_ */ 97 | -------------------------------------------------------------------------------- /hisilicon/sources/jxh42_i2c_hi3516cv100_rev1/jxh42_sensor_ctl.c: -------------------------------------------------------------------------------- 1 | #include 2 | // #include 3 | // #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include "hi_i2c.h" 9 | 10 | int sensor_write_register(int addr, int data) 11 | { 12 | int fd = open("/dev/hi_i2c", 0); 13 | if (fd < 0) 14 | { 15 | fprintf(stderr, "Open /dev/hi_i2c error!"); 16 | return -1; 17 | } 18 | 19 | I2C_DATA_S i2c_data; 20 | i2c_data.data = data; 21 | i2c_data.dev_addr = 0x60; 22 | i2c_data.reg_addr = addr; 23 | i2c_data.addr_byte_num = 1; 24 | i2c_data.data_byte_num = 1; 25 | 26 | //fprintf(stderr, "DBG: sensor_write_register(0x%x, 0x%x)\n", i2c_data.reg_addr, i2c_data.data); 27 | 28 | int ret = ioctl(fd, CMD_I2C_WRITE, &i2c_data); 29 | if (ret) 30 | { 31 | fprintf(stderr, "\tERROR write!\n"); 32 | } 33 | 34 | close(fd); 35 | 36 | return ret; 37 | } 38 | 39 | void sensor_init() 40 | { 41 | sensor_write_register(0x12, 0x40); 42 | sensor_write_register(0xD, 0x40); 43 | sensor_write_register(0x1F, 4); 44 | sensor_write_register(0xE, 0x1D); 45 | sensor_write_register(0xF, 9); 46 | sensor_write_register(0x10, 0x1E); 47 | sensor_write_register(0x11, 0x80); 48 | sensor_write_register(0x20, 0x40); 49 | sensor_write_register(0x21, 6); 50 | sensor_write_register(0x22, 0xF0); 51 | sensor_write_register(0x23, 2); 52 | sensor_write_register(0x24, 0); 53 | sensor_write_register(0x25, 0xDC); 54 | sensor_write_register(0x26, 0x25); 55 | sensor_write_register(0x27, 0x3B); 56 | sensor_write_register(0x28, 9); 57 | sensor_write_register(0x29, 1); 58 | sensor_write_register(0x2A, 0x24); 59 | sensor_write_register(0x2B, 0x29); 60 | sensor_write_register(0x2C, 4); 61 | sensor_write_register(0x2D, 0); 62 | sensor_write_register(0x2E, 0xBB); 63 | sensor_write_register(0x2F, 0); 64 | sensor_write_register(0x30, 0x92); 65 | sensor_write_register(0x31, 0xA); 66 | sensor_write_register(0x32, 0xAA); 67 | sensor_write_register(0x33, 0x14); 68 | sensor_write_register(0x34, 0x38); 69 | sensor_write_register(0x35, 0x54); 70 | sensor_write_register(0x42, 0x41); 71 | sensor_write_register(0x43, 0x50); 72 | sensor_write_register(0x1D, 0xFF); 73 | sensor_write_register(0x1E, 0x9F); 74 | sensor_write_register(0x6C, 0x90); 75 | sensor_write_register(0x73, 0xB3); 76 | sensor_write_register(0x70, 0x68); 77 | sensor_write_register(0x76, 0x40); 78 | sensor_write_register(0x77, 6); 79 | sensor_write_register(0x60, 0xA4); 80 | sensor_write_register(0x61, 0xFF); 81 | sensor_write_register(0x62, 0x40); 82 | sensor_write_register(0x63, 0x51); 83 | sensor_write_register(0x65, 0); 84 | sensor_write_register(0x66, 0x20); 85 | sensor_write_register(0x67, 0x30); 86 | sensor_write_register(0x68, 4); 87 | sensor_write_register(0x69, 0x74); 88 | sensor_write_register(0x6A, 9); 89 | sensor_write_register(0x6F, 4); 90 | sensor_write_register(0x13, 0x87); 91 | sensor_write_register(0x14, 0x80); 92 | sensor_write_register(0x16, 0xC0); 93 | sensor_write_register(0x17, 0x40); 94 | sensor_write_register(0x18, 0xE1); 95 | sensor_write_register(0x38, 0x38); 96 | sensor_write_register(0x39, 0x92); 97 | sensor_write_register(0x4A, 3); 98 | sensor_write_register(0x48, 0x40); 99 | sensor_write_register(0x49, 4); 100 | sensor_write_register(0xD, 0x40); 101 | sensor_write_register(0x12, 0); 102 | puts("soih42 sensor 720p init success!"); 103 | } 104 | 105 | -------------------------------------------------------------------------------- /hisilicon/sources/imx226_spi_unknown_hi3516av200_rev1/imx226_slave_priv.h: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2001-2015, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : imx226_slave_priv.h 7 | Version : Initial Draft 8 | Author : Hisilicon multimedia software group 9 | Created : 2015/06/18 10 | Description : this file was private for imx226 slave mode sensor 11 | History : 12 | 1.Date : 13 | Author : 14 | Modification: Created file 15 | ******************************************************************************/ 16 | #ifndef __IMX226_SLAVE_PRIV_H_ 17 | #define __IMX226_SLAVE_PRIV_H_ 18 | 19 | #ifdef __cplusplus 20 | #if __cplusplus 21 | extern "C"{ 22 | #endif 23 | #endif 24 | 25 | 26 | // usefull macro 27 | #define HIGH_8BITS(x) ((x & 0xff00) >> 8) 28 | #define LOW_8BITS(x) (x & 0x00ff) 29 | #ifndef MAX 30 | #define MAX(a, b) (((a) < (b)) ? (b) : (a)) 31 | #endif 32 | 33 | #ifndef MIN 34 | #define MIN(a, b) (((a) > (b)) ? (b) : (a)) 35 | #endif 36 | 37 | #define IMX226_RES_IS_4K30(w, h) (w <= 3840 && h <= 2160) 38 | #define IMX226_RES_IS_4K60(w, h) (w <= 4096 && h <= 2160) 39 | #define IMX226_RES_IS_12M(w, h) (w <= 4000 && h <= 3000) 40 | #define IMX226_RES_IS_2K(w, h) (w <= 2048 && h <= 1080) 41 | 42 | #define CHECK_RET(express)\ 43 | do{\ 44 | HI_S32 s32Ret;\ 45 | s32Ret = express;\ 46 | if (HI_SUCCESS != s32Ret)\ 47 | {\ 48 | printf("Failed at %s: LINE: %d with %#x!\n", __FUNCTION__, __LINE__, s32Ret);\ 49 | }\ 50 | }while(0) 51 | 52 | /* 53 | -------------------------------------------------------------------------------- 54 | - Structure For Slave Mode Sensor Using 55 | -------------------------------------------------------------------------------- 56 | */ 57 | #define FULL_LINES_MAX (0xFFFF) 58 | 59 | // difference registers in various mode 60 | #define IMX226_VIDEO_MODE_REG_NUM (0x0004) 61 | #define IMX226_03 (0x0003) 62 | #define IMX226_MDSEL1 (0x0004) 63 | #define IMX226_MDSEL2 (0x0005) 64 | #define IMX226_MDSEL6 (0x00B6) 65 | 66 | 67 | // registers to control exposure 68 | #define IMX226_SHR_L (0x000b) 69 | #define IMX226_SHR_H (0x000c) 70 | #define IMX226_PGC_L (0x0009) 71 | #define IMX226_PGC_H (0x000a) 72 | #define IMX226_APGC01_L (0x0352) 73 | #define IMX226_APGC01_H (0x0353) 74 | #define IMX226_APGC02_L (0x0356) 75 | #define IMX226_APGC02_H (0x0357) 76 | #define IMX226_SVR_L (0x000d) 77 | #define IMX226_SVR_H (0x000e) 78 | #define IMX226_DGAIN (0x0011) 79 | 80 | 81 | typedef struct hiIMX226_SENSOR_REG_S{ 82 | 83 | HI_U16 u16Addr; 84 | HI_U8 u8Data; 85 | } IMX226_SENSOR_REG_S; 86 | 87 | typedef enum { 88 | IMX226_MODE0 = 0, // mode 0: 4000x3000 10ch 12bit 34.97fps 89 | IMX226_MODE1, // mode 1: 4000x3000 10ch 10bit 39.96fps 90 | IMX226_MODE2, // mode 2: 4096X2160 8ch 12bit 29.97fps 91 | IMX226_MODE3, // mode 3: 4096X2160 4ch 12bit 14.99fps 92 | IMX226_MODE4, // mode 4: 4096X2160 10ch 10bit 59.94fps 93 | IMX226_MODE5, // mode 5: 2x2 binning 2048x1080 4ch 10bit 59.94fps 94 | 95 | IMX226_MODE_BUTT 96 | 97 | } IMX226_RES_MODE_E; 98 | 99 | typedef struct hiIMX226_VIDEO_MODE_TBL_S 100 | { 101 | HI_U32 u32Inck; 102 | HI_U32 u32InckPerHs; 103 | HI_U32 u32InckPerVs; 104 | HI_U32 u32VertiLines; 105 | 106 | IMX226_SENSOR_REG_S astVideoModeReg[IMX226_VIDEO_MODE_REG_NUM]; 107 | HI_U32 u32MaxFps; 108 | const char *pszModeName; 109 | 110 | } IMX226_VIDEO_MODE_TBL_S; 111 | 112 | 113 | #endif /* __IMX226_SLAVE_PRIV_H_ */ 114 | -------------------------------------------------------------------------------- /hisilicon/binary/MD5SUMS: -------------------------------------------------------------------------------- 1 | a25412a39dc49a576a5b9b1d1b18b9a4 ./gk7205v200/libsns_imx335.so 2 | a2eeccf48cc2e9b4ffe481f902f3bc38 ./hi3516ev200_rev4/libsns_imx335.so 3 | a448ce49617f57e78bcf2d6f2de683bc ./libsns_bg0806_i2c_unknown_hi3516cv300_rev1.so 4 | a6f0cb12ba2d5ba4788f9b21de5e53f7 ./hi3516ev200/libsns_imx307_2l.so 5 | a9daef1d3aaee5189660ab1c720497c5 ./gk7205v200/libsns_imx307_2l.so 6 | aa9ba82b00f9fb040258063a75bf878b ./libsns_imx291_i2c_unknown_hi3516cv300_rev1.so 7 | ae4e3f54410b60250a251d02acb83f59 ./libsns_imx327_i2c_unknown_hi3516cv300_rev1.so 8 | aeb19b7b44646deaebaf7c2ce9b6f164 ./libsns_imx122_spi_unknown_hi3516cv300_rev1.so 9 | b163ac1cb16f721561990eaf03b18957 ./libsns_imx122_spi_unknown_hi3516cv200_rev1.so 10 | b452c9e4082d3801fed02388277dd3ff ./hi3516ev200_rev4/libsns_imx327_2l.so 11 | b4a8da06a6173b01b353915871098f8f ./hi3516ev200_rev2/libsns_gc2053.so 12 | b935d58a73df38da3a617019dfec805a ./libsns_imx290_i2c_unknown_hi3516cv300_rev3.so 13 | b952d94965d8f90b5e4fbca9c9ae0256 ./gk7205v200/libsns_imx327.so 14 | c14c5b4ef074462b796e069a1c31fb5d ./gk7205v200/libsns_sc2235.so 15 | c42cfc91d7aa3335a06525911cb3e285 ./hi3516av100/libsns_ar0330_3M.so 16 | c4807ec6f42dacc54655af2cbb792cbd ./hi3519v100/libsns_imx226.so 17 | c4e89fee2589533b01ef5f07ff2063b1 ./gk7205v200/libsns_sc3235.so 18 | c923fb56e139cfbc0ccd8eac46fd40f1 ./libsns_imx327_i2c_unknown_hi3516cv300_rev2.so 19 | cc2c9a13e1f019b216fe73f9a82e5e2d ./libsns_imx323_i2c_unknown_hi3516cv300_rev2.so 20 | ce365beb6750779c7803be72fcca6f2e ./hi3519v100_rev2/libsns_imx335.so 21 | d052b2083f307978898fd4cb215c32c3 ./gk7205v200/libsns_sc3335.so 22 | d348b87bd1b813f1708b8fd2cf2394c7 ./hi3516ev200_rev4/libsns_sc2231.so 23 | daa584eac9f3dd65ec62b0f380baf3bf ./libsns_ar0237_i2c_unknown_hi3516cv300_rev1.so 24 | dbaba4b4826d35bc29bd2b5f689051e4 ./hi3516ev200_rev3/libsns_gc2053.so 25 | dcbd052c9410f9d01784effa3530dc61 ./hi3516ev200_rev2/libsns_f23.so 26 | e4a9e7e9cc44f99a81657e485899d5ea ./gk7205v200/libsns_os05a.so 27 | e6ac2e8fbcf0109e1dbfa0b7b7a003ac ./gk7205v200/libsns_sc4236.so 28 | e6bff6f6b42f0b11cf10e07747468550 ./hi3519v100/libsns_imx307.so 29 | e816ba1626bdf0dfa94dd74c89c11890 ./libsns_imx307_i2c_unknown_hi3516cv300_rev2.so 30 | e878e9f1e4c06915a978e630b66e943e ./gk7205v200/libsns_gc2053_forcar.so 31 | ea6349deb52577374a85b1c92bf1675b ./hi3516ev200_rev4/libsns_imx307.so 32 | edabda62994ca39fddd4b299b8c4dfa5 ./libsns_ov2735_i2c_unknown_hi3516cv300_rev1.so 33 | eed32fb0e49ba3fca25ee84a9a14ef92 ./hi3516av100/libsns_imx335.so 34 | efd2eec6a3829f338a01a2c9baf58275 ./gk7205v200/libsns_f37.so 35 | effd1d2cc1ee51eb3253347afee2a560 ./hi3519v100/libsns_imx290.so 36 | f1fab54446195fb1abdd2b8019fe1bdd ./hi3519v100_rev2/libsns_ov12895_8m.so 37 | f37e831b989a939a74b5f940714905b9 ./hi3516av100/libsns_sc5235.so 38 | f5580075d88cd35468653cfb2e4e76b9 ./hi3516ev200_rev4/libsns_sc3235.so 39 | f790d518172bb0828d1e6cb55934fe45 ./hi3516av100/libsns_ov4689_4M.so 40 | fb33ab0a891d32ba24d247b14b7760ed ./hi3519v100/libsns_sc2315.so 41 | fb37ae2e513989909a015aa573637899 ./hi3516ev200_rev4/libsns_os05a.so 42 | 1b1da757051f0cdd5501728c945183d5 ./gk7205v200/libsns_ov2718.so 43 | 1ce5483e2ce6b3235b7e4d8d95a46ee3 ./hi3516av100/libsns_sc5035_5M.so 44 | 1e2da5bac0b2378baa087a635f49be5d ./hi3519v100/libsns_scmars_4m.so 45 | 1e52c8b56923e4bd545c2be9f729a526 ./hi3516ev200_rev3/libsns_q03.so 46 | 2bcea4323ff93a0094304e565a6719dc ./hi3516av100/libsns_imx326_5m.so 47 | 2cc3e0486c6c84d7d0e752ec0477d347 ./libsns_imx307_i2c_unknown_hi3516cv200_rev1.so 48 | 2d0fa0f05b3eb87a7e847e518d3fe1d5 ./hi3519v100/libsns_sc5235.so 49 | 4dd37b3ecb77c59793e8d59d3b110d0d ./hi3519v100/libsns_imx335.so 50 | 4f36887c4ac73ec36951e73842850f13 ./hi3519v100_rev2/libsns_imx274.so 51 | 05b80c92bbc049a42399fd896ca289da ./libsns_imx290_i2c_unknown_hi3516cv300_rev2.so 52 | 5a92990c72686a14c770630ef0274cd6 ./gk7205v200/libsns_gc4653_2l.so 53 | 6b1af030906d15634bf6bffee157da55 ./gk7205v200/libsns_ar0237.so 54 | 6beaf9f51225485037a8c3b0f8de28f2 ./hi3516ev200_rev3/libsns_f37.so 55 | 6bf26e7cddf1123ac370a2f225b4d51c ./libsns_imx327_i2c_unknown_hi3516cv200_rev1.so 56 | 6ea4039f4348e97cc493d2bbd8da841a ./hi3516ev200/libsns_sc2335_mipi.so 57 | 6ec5592cc7bf5d97a03a63152e14bf1c ./gk7205v200/libsns_imx327_2l.so 58 | 6eebffad6bb870b6d9919cbbea94029c ./hi3516ev200_rev2/libsns_imx307_2l.so 59 | 7c03c28d234432917c6ea2c840f2652c ./hi3516ev200_rev4/libsns_sc2235.so 60 | 7c7f49ca2dbc419b8d75b5522e65f536 ./hi3516ev200/libsns_sc2232h.so 61 | 8bc9364b4b6998a233731ef4dd9151ae ./hi3516ev200_rev4/libsns_sc4236.so 62 | 9a65e2f3fd43830232ce7eb22d767b6b ./hi3519v100/libsns_ov12895_8m.so 63 | 9f30087dc7f5b7e36fe6199767a55e5c ./hi3519v100_rev2/libsns_imx226.so 64 | 10b3a448acc406ae7ff389d34061f4ae ./libsns_ov2718_i2c_unknown_hi3516cv300_rev1.so 65 | 29f3c18dac7648102cd9cdd65acbe8f4 ./hi3519v100/libsns_ov4689_4M.so 66 | 31aa67b951e7a7239d4d7929f35abdfe ./gk7205v200/libsns_sc2231.so 67 | 33b7f7f7f46585b34468d9b8f25b4ad6 ./hi3516ev200_rev3/libsns_f23.so 68 | 42eb8349b5c488d8f6cf2c6213f3bbd0 ./hi3516av100/libsns_imx123.so 69 | 43fa821b8eb7cf9d84a874e77dc4e7d6 ./hi3516ev200_rev3/libsns_imx307_2l.so 70 | 50a176dd509ef3b7d70bbdf5f41ea2a3 ./libsns_imx290_i2c_unknown_hi3516cv300_rev1.so 71 | 50b77e0f9eb7fcd8eebd1f86f7e3c220 ./hi3516cv300/libsns_imx290.so 72 | 51cd9756b2c39d8ef2b2261d4b04b820 ./libsns_imx307_i2c_unknown_hi3516cv300_rev1.so 73 | 77a78235fb36d063e0ffbd1dd1b7a26a ./hi3516ev200_rev4/libsns_imx307_2l.so 74 | 78b50a0ad36b267851c0c4e3dd69d816 ./hi3516ev200_rev4/libsns_gc2053_forcar.so 75 | 89bdd11dccf0744f27ca8591cbf6ab40 ./hi3516cv300/libsns_imx323.so 76 | 97c7ea32ca1db9f633612ba11d390e41 ./hi3519v100_rev2/libsns_scmars_4m.so 77 | 225fc0b0a980464a8de2893696a356b7 ./hi3516ev200_rev3/libsns_sc2232h.so 78 | 547d31fe9381df22419aea092f174fd9 ./hi3516ev200_rev4/libsns_sp2305.so 79 | 700a73cb2e02b60319642dd8ad8845ce ./hi3516cv300/libsns_sc5035_5M.so 80 | 1926f10f715dc7dac8c5ea280540e7a4 ./hi3519v100/libsns_imx274.so 81 | 6111cce0b19d889e14f3dcf9a3040d34 ./libsns_imx323_i2c_unknown_hi3516cv300_rev1.so 82 | 7563f35edbebc8158c2f5290c135fd4c ./gk7205v200/libsns_imx307.so 83 | 7717f32a6a393f36b08361492b028b2f ./libsns_imx291_i2c_unknown_hi3516cv200_rev1.so 84 | 7890c03da2a08b2cbee106a885936dd5 ./libsns_gc2023_i2c_unknown_hi3516cv200_rev1.so 85 | 8517ed87d974928ecd1de9e94a09e512 ./hi3516ev200_rev2/libsns_imx335.so 86 | 8584f179df98fa5fc72c45cec856ff54 ./gk7205v200/libsns_sc500ai.so 87 | 8974e05a3d8663de39fff9b865aa9f35 ./libsns_ar0237_i2c_unknown_hi3516cv300_rev2.so 88 | 9374b844e1cdd6428f4a72902287ab27 ./hi3519v100_rev2/libsns_imx307.so 89 | 09450faf40a5e6d0398bd3348b675820 ./gk7205v200/libsns_gc2053.so 90 | 11982c40e0b8fb2415f0586038542ef3 ./hi3516ev200_rev4/libsns_gc2053.so 91 | 67812a71ece609570a1ac3ff924ab86d ./hi3516ev200_rev2/libsns_sc2232h.so 92 | 97120a20ef85714f9b4ef4d463c641fd ./hi3516ev200_rev4/libsns_imx327.so 93 | 97492a6b391627fbd6ca62b64f734aac ./hi3516ev200/libsns_gc2053.so 94 | 0329580bd2d144d763ae377b2bdb20a0 ./hi3516ev200/libsns_f23.so 95 | 580572e95ab52fbec94aed0920280095 ./libsns_imx290_i2c_unknown_hi3516cv300_dvp.so 96 | 1850687aa7f281d0142cd079ea0564d0 ./libsns_imx323_i2c_unknown_hi3516cv300_rev3.so 97 | 47495038b1adf7ab0984ec064cfab756 ./hi3516av100/libsns_ov5658_5m.so 98 | 297218274f9606a5b02d15294edd15a9 ./gk7205v200/libsns_imx290.so 99 | -------------------------------------------------------------------------------- /hisilicon/sources/ov2710_i2c_mipi_hi3518ev200_rev1/ov2710_sensor_ctl.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include "hi_comm_video.h" 10 | 11 | #ifdef HI_GPIO_I2C 12 | #include "gpioi2c_ex.h" 13 | #else 14 | #include "hi_i2c.h" 15 | #endif 16 | 17 | const unsigned int sensor_i2c_addr = 0x6c; /* I2C Address of OV2710 */ 18 | const unsigned int read_dev_addr = 0x6d; 19 | const unsigned int sensor_addr_byte = 2; 20 | const unsigned int sensor_data_byte = 1; 21 | static int g_fd = -1; 22 | static int flag_init = 0; 23 | 24 | extern WDR_MODE_E genSensorMode; 25 | extern HI_U8 gu8SensorImageMode; 26 | extern HI_BOOL bSensorInit; 27 | 28 | int sensor_i2c_init(void) 29 | { 30 | if(g_fd >= 0) 31 | { 32 | return 0; 33 | } 34 | #ifdef HI_GPIO_I2C 35 | int ret; 36 | 37 | g_fd = open("/dev/gpioi2c_ex", 0); 38 | if(g_fd < 0) 39 | { 40 | printf("Open gpioi2c_ex error!\n"); 41 | return -1; 42 | } 43 | #else 44 | int ret; 45 | 46 | g_fd = open("/dev/i2c-0", O_RDWR); 47 | if(g_fd < 0) 48 | { 49 | printf("Open /dev/i2c-0 error!\n"); 50 | return -1; 51 | } 52 | 53 | ret = ioctl(g_fd, I2C_SLAVE_FORCE, sensor_i2c_addr); 54 | if (ret < 0) 55 | { 56 | printf("CMD_SET_DEV error!\n"); 57 | return ret; 58 | } 59 | #endif 60 | 61 | return 0; 62 | } 63 | 64 | int sensor_i2c_exit(void) 65 | { 66 | if (g_fd >= 0) 67 | { 68 | close(g_fd); 69 | g_fd = -1; 70 | return 0; 71 | } 72 | return -1; 73 | } 74 | 75 | int sensor_read_register(int addr) 76 | { 77 | if(flag_init == 0) 78 | { 79 | sensor_i2c_init(); 80 | flag_init = 1; 81 | } 82 | 83 | int ret = ioctl(g_fd, I2C_SLAVE_FORCE, read_dev_addr); 84 | if (ret < 0) 85 | { 86 | printf("ioctl device addr[%#x] error.\n", read_dev_addr); 87 | return -1; 88 | } 89 | 90 | if (sensor_addr_byte == 2) 91 | ioctl(g_fd, I2C_16BIT_REG, 1); 92 | else 93 | ioctl(g_fd, I2C_16BIT_REG, 0); 94 | 95 | if (sensor_data_byte == 2) 96 | ioctl(g_fd, I2C_16BIT_DATA, 1); 97 | else 98 | ioctl(g_fd, I2C_16BIT_DATA, 0); 99 | 100 | char recvbuf[4]; 101 | memset(recvbuf, 0, sizeof(recvbuf)); 102 | 103 | if (sensor_addr_byte == 2) 104 | { 105 | recvbuf[0] = addr & 0xff; 106 | recvbuf[1] = (addr >> 8) & 0xff; 107 | } 108 | else 109 | recvbuf[0] = addr & 0xff; 110 | 111 | ret = read(g_fd, recvbuf, sensor_addr_byte); 112 | if (ret < 0) 113 | { 114 | printf("CMD_I2C_READ error!\n"); 115 | return -1; 116 | } 117 | 118 | int data = 0; 119 | if (sensor_data_byte == 2) 120 | data = recvbuf[0] | (recvbuf[1] << 8); 121 | else 122 | data = recvbuf[0]; 123 | 124 | return data; 125 | 126 | } 127 | 128 | int sensor_write_register(int addr, int data) 129 | { 130 | #ifdef HI_GPIO_I2C 131 | i2c_data.dev_addr = sensor_i2c_addr; 132 | i2c_data.reg_addr = addr; 133 | i2c_data.addr_byte_num = sensor_addr_byte; 134 | i2c_data.data = data; 135 | i2c_data.data_byte_num = sensor_data_byte; 136 | 137 | ret = ioctl(g_fd, GPIO_I2C_WRITE, &i2c_data); 138 | 139 | if (ret) 140 | { 141 | printf("GPIO-I2C write faild!\n"); 142 | return ret; 143 | } 144 | #else 145 | if(flag_init == 0) 146 | { 147 | sensor_i2c_init(); 148 | flag_init = 1; 149 | } 150 | 151 | int idx = 0; 152 | int ret; 153 | char buf[8]; 154 | 155 | ret = ioctl(g_fd, I2C_SLAVE_FORCE, sensor_i2c_addr); 156 | if (ret < 0) 157 | { 158 | printf("ioctl device addr[%#x] error.\n", sensor_i2c_addr); 159 | return -1; 160 | } 161 | 162 | buf[idx++] = addr & 0xFF; 163 | if (sensor_addr_byte == 2) 164 | { 165 | ret = ioctl(g_fd, I2C_16BIT_REG, 1); 166 | buf[idx++] = addr >> 8; 167 | } 168 | else 169 | { 170 | ret = ioctl(g_fd, I2C_16BIT_REG, 0); 171 | } 172 | 173 | if (ret < 0) 174 | { 175 | printf("CMD_SET_REG_WIDTH error!\n"); 176 | return -1; 177 | } 178 | 179 | buf[idx++] = data; 180 | if (sensor_data_byte == 2) 181 | { 182 | ret = ioctl(g_fd, I2C_16BIT_DATA, 1); 183 | buf[idx++] = data >> 8; 184 | } 185 | else 186 | { 187 | ret = ioctl(g_fd, I2C_16BIT_DATA, 0); 188 | } 189 | 190 | if (ret) 191 | { 192 | printf("hi_i2c write faild!\n"); 193 | return -1; 194 | } 195 | 196 | ret = write(g_fd, buf, idx); 197 | if(ret < 0) 198 | { 199 | printf("I2C_WRITE error!\n"); 200 | return -1; 201 | } 202 | #endif 203 | return 0; 204 | } 205 | 206 | 207 | void sensor_linear_1080p30_init(); 208 | 209 | void sensor_init() 210 | { 211 | sensor_i2c_init(); 212 | 213 | sensor_linear_1080p30_init(); 214 | 215 | return ; 216 | } 217 | 218 | void sensor_exit() 219 | { 220 | sensor_i2c_exit(); 221 | flag_init = 0; 222 | return; 223 | } 224 | 225 | /* 1080P30*/ 226 | void sensor_linear_1080p30_init() 227 | { 228 | sensor_write_register(0x3103,0x93); 229 | sensor_write_register(0x3008,0x82); 230 | usleep(10*1000); 231 | sensor_write_register(0x3008,0x42); 232 | sensor_write_register(0x3017,0x00); 233 | sensor_write_register(0x3018,0x00); 234 | sensor_write_register(0x3706,0x61); 235 | sensor_write_register(0x3712,0x0c); 236 | sensor_write_register(0x3630,0x6d); 237 | sensor_write_register(0x3801,0xb4); 238 | sensor_write_register(0x3621,0x04); 239 | sensor_write_register(0x3604,0x60); 240 | sensor_write_register(0x3603,0xa7); 241 | sensor_write_register(0x3631,0x26); 242 | sensor_write_register(0x3600,0x04); 243 | sensor_write_register(0x3620,0x37); 244 | sensor_write_register(0x3623,0x00); 245 | sensor_write_register(0x3702,0x9e); 246 | sensor_write_register(0x3703,0x5c); 247 | sensor_write_register(0x3704,0x40); 248 | sensor_write_register(0x370d,0x0f); 249 | sensor_write_register(0x3713,0x9f); 250 | sensor_write_register(0x3714,0x4c); 251 | sensor_write_register(0x3710,0x9e); 252 | sensor_write_register(0x3801,0xc4); 253 | sensor_write_register(0x3605,0x05); 254 | sensor_write_register(0x3606,0x3f); 255 | sensor_write_register(0x302d,0x90); 256 | sensor_write_register(0x370b,0x40); 257 | sensor_write_register(0x3716,0x31); 258 | sensor_write_register(0x3707,0x52); 259 | sensor_write_register(0x380d,0x74); 260 | sensor_write_register(0x5181,0x20); 261 | sensor_write_register(0x518f,0x00); 262 | sensor_write_register(0x4301,0xff); 263 | sensor_write_register(0x4303,0x00); 264 | sensor_write_register(0x3a00,0x78); 265 | //sensor_write_register(0x300f,0x88); 266 | //sensor_write_register(0x3011,0x28); 267 | sensor_write_register(0x3a1a,0x06); 268 | sensor_write_register(0x3a18,0x00); 269 | sensor_write_register(0x3a19,0x7a); 270 | sensor_write_register(0x3a13,0x54); 271 | sensor_write_register(0x382e,0x0f); 272 | sensor_write_register(0x381a,0x1a); 273 | sensor_write_register(0x401d,0x02); 274 | sensor_write_register(0x5688,0x03); 275 | sensor_write_register(0x5684,0x07); 276 | sensor_write_register(0x5685,0xa0); 277 | sensor_write_register(0x5686,0x04); 278 | sensor_write_register(0x5687,0x43); 279 | 280 | //set for mipi 281 | sensor_write_register(0x3011,0x0a); 282 | sensor_write_register(0x300f,0xc3); 283 | 284 | usleep(10*1000); 285 | 286 | sensor_write_register(0x300e,0x04); 287 | sensor_write_register(0x3030,0x2b); 288 | sensor_write_register(0x4801,0x0f); 289 | 290 | sensor_write_register(0x3a0f,0x40); 291 | sensor_write_register(0x3a10,0x38); 292 | sensor_write_register(0x3a1b,0x48); 293 | // sensor_write_register(0x3a13,0x30); 294 | sensor_write_register(0x3a1e,0x30); 295 | sensor_write_register(0x3a11,0x90); 296 | sensor_write_register(0x3a1f,0x10); 297 | 298 | //set frame rate 299 | sensor_write_register(0x3010,0x00); //0x20,10fps;0x10,15fps;0x00,30fps 300 | 301 | //set AEC/AGC TO mannual model 302 | sensor_write_register(0x3503,0x07); 303 | 304 | //To close AE set: 305 | sensor_write_register(0x3503,0x7); 306 | sensor_write_register(0x3501,0x2e); 307 | sensor_write_register(0x3502,0x00); 308 | sensor_write_register(0x350b,0x10); 309 | 310 | //To Close AWB set: 311 | sensor_write_register(0x5001,0x4f); 312 | sensor_write_register(0x3406,0x01); 313 | sensor_write_register(0x3400,0x04); 314 | sensor_write_register(0x3401,0x00); 315 | sensor_write_register(0x3402,0x04); 316 | sensor_write_register(0x3403,0x00); 317 | sensor_write_register(0x3404,0x04); 318 | sensor_write_register(0x3405,0x00); 319 | 320 | /* modified blc */ 321 | sensor_write_register(0x4000,0x05); 322 | 323 | /*drive capacity*/ 324 | sensor_write_register(0x302c,0x00); 325 | 326 | //close shading 327 | sensor_write_register(0x5000,0x5f); //df bit[8]=0 328 | 329 | sensor_write_register(0x3008,0x02); 330 | 331 | bSensorInit = HI_TRUE; 332 | printf("======================================================================\n"); 333 | printf("===omnivision ov2710 sensor 1080P30fps(mipi port) init success!===\n"); 334 | printf("======================================================================\n"); 335 | return; 336 | } 337 | 338 | 339 | -------------------------------------------------------------------------------- /hisilicon/sources/imx274_i2c_mipi_hi3516av200_rev1/imx274_sensor_ctl.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2001-2013, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : imx274_sensor_ctl.c 7 | Version : Initial Draft 8 | Author : Hisilicon BVT ISP group 9 | Created : 2014/05/22 10 | Description : Sony IMX274 sensor driver 11 | History : 12 | 1.Date : 2014/05/22 13 | Author : 14 | Modification : Created file 15 | 16 | ******************************************************************************/ 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include "hi_comm_video.h" 26 | #include "hi_sns_ctrl.h" 27 | #include "mpi_sys.h" 28 | 29 | #include "hi_i2c.h" 30 | #include "imx274_slave_priv.h" 31 | #include "mpi_isp.h" 32 | 33 | extern const IMX274_VIDEO_MODE_TBL_S g_astImx274ModeTbl[]; 34 | extern ISP_SLAVE_SNS_SYNC_S gstImx274Sync[]; 35 | 36 | static int g_fd[ISP_MAX_DEV_NUM] = {-1,-1}; 37 | 38 | extern ISP_SNS_STATE_S g_astImx274[ISP_MAX_DEV_NUM]; 39 | extern ISP_SNS_COMMBUS_U g_aunImx274BusInfo[]; 40 | 41 | const unsigned char imx274_i2c_addr = 0x34; /* I2C Address of IMX274 */ 42 | const unsigned int imx274_addr_byte = 2; 43 | const unsigned int imx274_data_byte = 1; 44 | 45 | static const HI_U16 gs_au16SensorCfgSeq[][IMX274_MODE_BUTT+1] = { 46 | /* M0 M0_dol ADDR */ 47 | { 0x12, 0x12, 0x3000 }, 48 | { -1, -1, 0xFFFF }, 49 | { 0xf0, 0xf0, 0x3120 }, 50 | { 0x00, 0x00, 0x3121 }, 51 | { 0x02, 0x02, 0x3122 }, 52 | //{ 0x01, 0x03, 0x3123 }, 53 | { 0x9c, 0x9c, 0x3129 }, 54 | { 0x02, 0x02, 0x312a }, 55 | { 0x02, 0x02, 0x312d }, 56 | //{ 0x01, 0x01, 0x3ac4 }, 57 | { 0x00, 0x00, 0x310b }, 58 | 59 | { 0x00, 0x00, 0x304c }, 60 | { 0x03, 0x03, 0x304d }, 61 | { 0x1a, 0x1a, 0x331c }, 62 | { 0x00, 0x00, 0x331d }, 63 | { 0x02, 0x02, 0x3502 }, 64 | { 0x0e, 0x0e, 0x3529 }, 65 | { 0x0e, 0x0e, 0x352a }, 66 | { 0x0e, 0x0e, 0x352b }, 67 | { 0x0e, 0x0e, 0x3538 }, 68 | { 0x0e, 0x0e, 0x3539 }, 69 | { 0x00, 0x00, 0x3553 }, 70 | { 0x05, 0x05, 0x357d }, 71 | { 0x05, 0x05, 0x357f }, 72 | { 0x04, 0x04, 0x3581 }, 73 | { 0x76, 0x76, 0x3583 }, 74 | { 0x01, 0x01, 0x3587 }, 75 | { 0x0e, 0x0e, 0x35bb }, 76 | { 0x0e, 0x0e, 0x35bc }, 77 | { 0x0e, 0x0e, 0x35bd }, 78 | { 0x0e, 0x0e, 0x35be }, 79 | { 0x0e, 0x0e, 0x35bf }, 80 | { 0x00, 0x00, 0x366e }, 81 | { 0x00, 0x00, 0x366f }, 82 | { 0x00, 0x00, 0x3670 }, 83 | { 0x00, 0x00, 0x3671 }, 84 | 85 | { 0x32, 0x32, 0x3304 }, 86 | { 0x00, 0x00, 0x3305 }, 87 | { 0x32, 0x32, 0x3306 }, 88 | { 0x00, 0x00, 0x3307 }, 89 | { 0x32, 0x32, 0x3590 }, 90 | { 0x00, 0x00, 0x3591 }, 91 | { 0x32, 0x32, 0x3686 }, 92 | { 0x00, 0x00, 0x3687 }, 93 | 94 | { 0x00, 0x05, 0x3004 }, 95 | { 0x07, 0x01, 0x3005 }, 96 | { 0x00, 0x00, 0x3006 }, 97 | { 0x02, 0x02, 0x3007 }, 98 | { 0x10, 0x08, 0x3a41 }, 99 | 100 | { 0x00, 0x00, 0x300e }, 101 | { 0x00, 0x00, 0x300f }, 102 | { 0x10, 0x31, 0x3019 }, 103 | { 0x00, 0x00, 0x301a }, 104 | { 0x08, 0x40, 0x3032 }, 105 | { 0x00, 0x00, 0x3033 }, 106 | { 0x00, 0x00, 0x3037 }, 107 | { 0x00, 0x00, 0x3038 }, 108 | { 0x00, 0x00, 0x3039 }, 109 | { 0x00, 0x00, 0x303a }, 110 | { 0x00, 0x00, 0x303b }, 111 | { 0x30, 0x31, 0x3041 }, 112 | { 0x08, 0x07, 0x3042 }, 113 | { 0x01, 0x01, 0x3043 }, 114 | 115 | { 0x07, 0x05, 0x306b }, 116 | { 0x00, 0x00, 0x30dd }, 117 | { 0x00, 0x00, 0x30de }, 118 | { 0x00, 0x00, 0x30df }, 119 | { 0x00, 0x00, 0x30e0 }, 120 | { 0x00, 0x00, 0x30e1 }, 121 | { 0x00, 0x01, 0x30e2 }, 122 | { 0x00, 0x01, 0x30e9 }, 123 | { 0x01, 0x01, 0x30ee }, 124 | 125 | { 0x08, 0x20, 0x30f6 }, 126 | { 0x02, 0x04, 0x30f7 }, //524 127 | { 0x0c, 0xe3, 0x30f8 }, 128 | { 0x12, 0x08, 0x30f9 }, 129 | { 0x00, 0x00, 0x30fa }, //4620 130 | 131 | { 0xaa, 0x86, 0x3130 }, 132 | { 0x08, 0x08, 0x3131 }, 133 | { 0x9a, 0x7e, 0x3132 }, 134 | { 0x08, 0x08, 0x3133 }, 135 | 136 | { 0xff, 0x0a, 0x3342 }, 137 | { 0x01, 0x00, 0x3343 }, 138 | { 0xff, 0x16, 0x3344 }, 139 | { 0x01, 0x00, 0x3345 }, 140 | { 0x01, 0x01, 0x33a6 }, 141 | { 0x0f, 0x0e, 0x3528 }, 142 | { 0x00, 0x1f, 0x3554 }, 143 | { 0x00, 0x01, 0x3555 }, 144 | { 0x00, 0x01, 0x3556 }, 145 | { 0x00, 0x01, 0x3557 }, 146 | { 0x00, 0x01, 0x3558 }, 147 | { 0x1f, 0x00, 0x3559 }, 148 | { 0x1f, 0x00, 0x355a }, 149 | { 0x0f, 0x0e, 0x35ba }, 150 | { 0x00, 0x1b, 0x366a }, 151 | { 0x00, 0x1a, 0x366b }, 152 | { 0x00, 0x19, 0x366c }, 153 | { 0x00, 0x17, 0x366d }, 154 | 155 | { -1, -1, 0xFFFF }, 156 | 157 | { 0x00, 0x00, 0x3000 }, 158 | { 0x02, 0x02, 0x303e }, 159 | { -1, -1, 0xFFFF }, 160 | 161 | { 0x00, 0x00, 0x30f4 }, 162 | //{ 0xa2, 0xa2, 0x3018 }, 163 | }; 164 | 165 | 166 | 167 | int imx274_i2c_init(ISP_DEV IspDev) 168 | { 169 | char acDevFile[16] = {0}; 170 | HI_U8 u8DevNum; 171 | int ret; 172 | 173 | if(g_fd[IspDev] >= 0) 174 | { 175 | return 0; 176 | } 177 | 178 | u8DevNum = g_aunImx274BusInfo[IspDev].s8I2cDev; 179 | snprintf_s(acDevFile, sizeof(acDevFile), sizeof(acDevFile)-1, "/dev/i2c-%d", u8DevNum); 180 | 181 | g_fd[IspDev] = open(acDevFile, O_RDWR); 182 | if(g_fd[IspDev] < 0) 183 | { 184 | printf("Open /dev/i2c-%d error!\n", IspDev); 185 | return -1; 186 | } 187 | 188 | ret = ioctl(g_fd[IspDev], I2C_SLAVE_FORCE, (imx274_i2c_addr>>1)); 189 | if (ret < 0) 190 | { 191 | printf("CMD_SET_DEV error!\n"); 192 | return ret; 193 | } 194 | return 0; 195 | } 196 | 197 | int imx274_i2c_exit(ISP_DEV IspDev) 198 | { 199 | if (g_fd[IspDev] >= 0) 200 | { 201 | close(g_fd[IspDev]); 202 | g_fd[IspDev] = -1; 203 | return 0; 204 | } 205 | return -1; 206 | } 207 | 208 | int imx274_write_register(ISP_DEV IspDev,int addr, int data) 209 | { 210 | if (0 > g_fd[IspDev]) 211 | { 212 | return 0; 213 | } 214 | 215 | int idx = 0; 216 | int ret; 217 | char buf[8]; 218 | 219 | if (imx274_addr_byte == 2) 220 | { 221 | buf[idx] = (addr >> 8) & 0xff; 222 | idx++; 223 | buf[idx] = addr & 0xff; 224 | idx++; 225 | } 226 | else 227 | { 228 | //buf[idx] = addr & 0xff; 229 | //idx++; 230 | } 231 | 232 | if (imx274_data_byte == 2) 233 | { 234 | //buf[idx] = (data >> 8) & 0xff; 235 | //idx++; 236 | //buf[idx] = data & 0xff; 237 | //idx++; 238 | } 239 | else 240 | { 241 | buf[idx] = data & 0xff; 242 | idx++; 243 | } 244 | 245 | ret = write(g_fd[IspDev], buf, imx274_addr_byte + imx274_data_byte); 246 | if(ret < 0) 247 | { 248 | printf("I2C_WRITE error!\n"); 249 | return -1; 250 | } 251 | 252 | return 0; 253 | } 254 | 255 | int imx274_read_register(ISP_DEV IspDev,unsigned int addr) 256 | { 257 | int idx = 0; 258 | int ret; 259 | char buf[8]; 260 | 261 | imx274_i2c_init(IspDev); 262 | 263 | buf[idx++] = addr & 0xFF; 264 | if (imx274_addr_byte == 2) 265 | { 266 | ret = ioctl(g_fd[IspDev], I2C_16BIT_REG, 1); // 16 bit addr 267 | buf[idx++] = addr >> 8; 268 | } 269 | else 270 | { 271 | ret = ioctl(g_fd[IspDev], I2C_16BIT_REG, 0); 272 | } 273 | 274 | if (ret < 0) 275 | { 276 | printf("CMD_SET_REG_WIDTH error!\n"); 277 | return -1; 278 | } 279 | 280 | if (imx274_data_byte == 2) 281 | { 282 | ret = ioctl(g_fd[IspDev], I2C_16BIT_DATA, 1); 283 | } 284 | else 285 | { 286 | ret = ioctl(g_fd[IspDev], I2C_16BIT_DATA, 0); // 8 bit data 287 | } 288 | 289 | if (ret) 290 | { 291 | printf("hi_i2c read faild!\n"); 292 | return -1; 293 | } 294 | 295 | ret = read(g_fd[IspDev], buf, idx); 296 | if(ret < 0) 297 | { 298 | printf("I2C_READ error!\n"); 299 | return -1; 300 | } 301 | 302 | if (imx274_data_byte == 2) { 303 | ret = buf[0] | (buf[1] << 8); 304 | } else 305 | ret = buf[0]; 306 | 307 | return ret; 308 | } 309 | 310 | 311 | static void delay_ms(int ms) { 312 | hi_usleep(ms*1000); 313 | } 314 | 315 | void imx274_prog(ISP_DEV IspDev,int* rom) 316 | { 317 | int i = 0; 318 | while (1) { 319 | int lookup = rom[i++]; 320 | int addr = (lookup >> 16) & 0xFFFF; 321 | int data = lookup & 0xFFFF; 322 | if (addr == 0xFFFE) { 323 | delay_ms(data); 324 | } else if (addr == 0xFFFF) { 325 | return; 326 | } else { 327 | imx274_write_register(IspDev,addr, data); 328 | } 329 | } 330 | } 331 | 332 | void imx274_standby(ISP_DEV IspDev) 333 | { 334 | // TODO: 335 | return; 336 | } 337 | 338 | void imx274_restart(ISP_DEV IspDev) 339 | { 340 | // TODO: 341 | return; 342 | } 343 | 344 | 345 | void imx274_init(ISP_DEV IspDev) 346 | { 347 | HI_U8 u8ImgMode; 348 | u8ImgMode = g_astImx274[IspDev].u8ImgMode; 349 | 350 | HI_U16 u16RegData; 351 | HI_U16 u16RegAddr; 352 | HI_U32 i; 353 | HI_U32 u32SeqEntries; 354 | 355 | /* 2. sensor i2c init */ 356 | imx274_i2c_init(IspDev); 357 | 358 | /* When sensor first init, config all registers */ 359 | u32SeqEntries = sizeof(gs_au16SensorCfgSeq) / sizeof(gs_au16SensorCfgSeq[0]); 360 | 361 | for ( i = 0 ; i < u32SeqEntries; i++ ) 362 | { 363 | u16RegAddr = gs_au16SensorCfgSeq[i][IMX274_MODE_BUTT]; 364 | u16RegData = gs_au16SensorCfgSeq[i][u8ImgMode]; 365 | if (0xFFFF == u16RegAddr) 366 | { 367 | delay_ms(50); 368 | } 369 | else 370 | { 371 | imx274_write_register(IspDev,u16RegAddr, u16RegData); 372 | } 373 | } 374 | 375 | for (i=0; i 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include "hi_comm_video.h" 26 | #include "hi_sns_ctrl.h" 27 | #include "mpi_sys.h" 28 | 29 | #include "hi_spi.h" 30 | #include "imx226_slave_priv.h" 31 | #include "mpi_isp.h" 32 | 33 | extern const IMX226_VIDEO_MODE_TBL_S g_astImx226ModeTbl[]; 34 | extern ISP_SLAVE_SNS_SYNC_S gstImx226Sync[]; 35 | 36 | static int g_fd[ISP_MAX_DEV_NUM] = {-1,-1}; 37 | extern ISP_SNS_STATE_S g_astImx226[ISP_MAX_DEV_NUM]; 38 | extern ISP_SNS_COMMBUS_U g_aunImx226BusInfo[]; 39 | 40 | 41 | void imx226_sensor_linear_common_init(ISP_DEV IspDev); 42 | 43 | 44 | int imx226_spi_init(ISP_DEV IspDev) 45 | { 46 | char acDevFile[16] = {0}; 47 | HI_U8 u8DevNum, u8Cs; 48 | 49 | if(g_fd[IspDev] >= 0) 50 | { 51 | return 0; 52 | } 53 | unsigned int value; 54 | int ret = 0; 55 | 56 | u8DevNum = g_aunImx226BusInfo[IspDev].s8SspDev.bit4SspDev; 57 | u8Cs = g_aunImx226BusInfo[IspDev].s8SspDev.bit4SspCs; 58 | snprintf_s(acDevFile, sizeof(acDevFile), sizeof(acDevFile)-1, "/dev/spidev%d.%d", u8DevNum, u8Cs); 59 | 60 | g_fd[IspDev] = open(acDevFile, 0); 61 | if (g_fd[IspDev] < 0) 62 | { 63 | printf("Open %s error!\n",acDevFile); 64 | return -1; 65 | } 66 | 67 | value = SPI_MODE_3 | SPI_LSB_FIRST;// | SPI_LOOP; 68 | ret = ioctl(g_fd[IspDev], SPI_IOC_WR_MODE, &value); 69 | if (ret < 0) 70 | { 71 | printf("ioctl SPI_IOC_WR_MODE err, value = %d ret = %d\n", value, ret); 72 | return ret; 73 | } 74 | 75 | value = 8; 76 | ret = ioctl(g_fd[IspDev], SPI_IOC_WR_BITS_PER_WORD, &value); 77 | if (ret < 0) 78 | { 79 | printf("ioctl SPI_IOC_WR_BITS_PER_WORD err, value = %d ret = %d\n",value, ret); 80 | return ret; 81 | } 82 | 83 | value = 2000000; 84 | ret = ioctl(g_fd[IspDev], SPI_IOC_WR_MAX_SPEED_HZ, &value); 85 | if (ret < 0) 86 | { 87 | printf("ioctl SPI_IOC_WR_MAX_SPEED_HZ err, value = %d ret = %d\n",value, ret); 88 | return ret; 89 | } 90 | 91 | return 0; 92 | } 93 | 94 | int imx226_spi_exit(ISP_DEV IspDev) 95 | { 96 | if (g_fd[IspDev] >= 0) 97 | { 98 | close(g_fd[IspDev]); 99 | g_fd[IspDev] = -1; 100 | return 0; 101 | } 102 | return -1; 103 | } 104 | 105 | int imx226_write_register(ISP_DEV IspDev,unsigned int addr, unsigned char data) 106 | { 107 | int ret; 108 | struct spi_ioc_transfer mesg[1]; 109 | unsigned char tx_buf[8] = {0}; 110 | unsigned char rx_buf[8] = {0}; 111 | 112 | if (0 > g_fd[IspDev]) 113 | { 114 | return 0; 115 | } 116 | 117 | tx_buf[0] = 0x81; 118 | tx_buf[1] = addr >> 8; 119 | tx_buf[2] = addr & 0xff; 120 | tx_buf[3] = data; 121 | 122 | memset(mesg, 0, sizeof(mesg)); 123 | #ifdef __HuaweiLite__ 124 | mesg[0].tx_buf = (char *)tx_buf; 125 | mesg[0].rx_buf = (char *)rx_buf; 126 | #else 127 | mesg[0].tx_buf = (__u32)tx_buf; 128 | mesg[0].rx_buf = (__u32)rx_buf; 129 | #endif 130 | mesg[0].len = 4; 131 | mesg[0].cs_change = 1; 132 | 133 | ret = ioctl(g_fd[IspDev], SPI_IOC_MESSAGE(1), mesg); 134 | if (ret < 0) { 135 | printf("SPI_IOC_MESSAGE error \n"); 136 | return -1; 137 | } 138 | 139 | return 0; 140 | } 141 | 142 | int imx226_read_register(ISP_DEV IspDev,unsigned int addr) 143 | { 144 | int ret = 0; 145 | struct spi_ioc_transfer mesg[1]; 146 | unsigned char tx_buf[8] = {0}; 147 | unsigned char rx_buf[8] = {0}; 148 | 149 | 150 | tx_buf[0] = 0x80; 151 | tx_buf[1] = addr >> 8; 152 | tx_buf[2] = addr & 0xff; 153 | tx_buf[3] = 0; 154 | 155 | memset(mesg, 0, sizeof(mesg)); 156 | #ifdef __HuaweiLite__ 157 | mesg[0].tx_buf = (char *)tx_buf; 158 | mesg[0].rx_buf = (char *)rx_buf; 159 | #else 160 | mesg[0].tx_buf = (__u32)tx_buf; 161 | mesg[0].rx_buf = (__u32)rx_buf; 162 | #endif 163 | mesg[0].len = 4; 164 | mesg[0].cs_change = 1; 165 | 166 | ret = ioctl(g_fd[IspDev], SPI_IOC_MESSAGE(1), mesg); 167 | if (ret < 0) { 168 | printf("SPI_IOC_MESSAGE error \n"); 169 | return -1; 170 | } 171 | 172 | return rx_buf[3]; 173 | } 174 | 175 | static void delay_ms(int ms) { 176 | hi_usleep(ms*1000); 177 | } 178 | 179 | void imx226_standby(ISP_DEV IspDev) 180 | { 181 | // TODO: 182 | return; 183 | } 184 | 185 | void imx226_restart(ISP_DEV IspDev) 186 | { 187 | // TODO: 188 | return; 189 | } 190 | 191 | void imx226_init(ISP_DEV IspDev) 192 | { 193 | HI_U8 u8ImgMode; 194 | 195 | u8ImgMode = g_astImx226[IspDev].u8ImgMode; 196 | 197 | HI_U8 u8RegData; 198 | HI_U16 u16RegAddr; 199 | HI_U32 i; 200 | 201 | /* hold sync signal as fixed */ 202 | CHECK_RET(HI_MPI_ISP_GetHvSync(IspDev, &gstImx226Sync[IspDev])); 203 | gstImx226Sync[IspDev].unCfg.stBits.bitHEnable = 0; 204 | gstImx226Sync[IspDev].unCfg.stBits.bitVEnable = 0; 205 | CHECK_RET(HI_MPI_ISP_SetHvSync(IspDev, &gstImx226Sync[IspDev])); 206 | 207 | 208 | /* 2. imx226 spi init */ 209 | imx226_spi_init(IspDev); 210 | 211 | /* When sensor first init, config all registers */ 212 | 213 | 214 | // common part of init seq 215 | imx226_sensor_linear_common_init(IspDev); 216 | 217 | // diff part of each mode 218 | for ( i = 0 ; i < IMX226_VIDEO_MODE_REG_NUM; i++ ) 219 | { 220 | u16RegAddr = g_astImx226ModeTbl[u8ImgMode].astVideoModeReg[i].u16Addr; 221 | u8RegData = g_astImx226ModeTbl[u8ImgMode].astVideoModeReg[i].u8Data; 222 | imx226_write_register(IspDev,u16RegAddr, u8RegData); 223 | } 224 | 225 | imx226_write_register (IspDev,0x0000, 0x06 ); 226 | delay_ms(2); 227 | imx226_write_register (IspDev,0x0000, 0x04 ); 228 | delay_ms(200); 229 | 230 | // release hv sync 231 | gstImx226Sync[IspDev].u32HsTime = g_astImx226ModeTbl[u8ImgMode].u32InckPerHs; 232 | if(g_astImx226[IspDev].astRegsInfo[0].stSlvSync.u32SlaveVsTime == 0) 233 | { 234 | gstImx226Sync[IspDev].u32VsTime = g_astImx226ModeTbl[u8ImgMode].u32InckPerVs; 235 | } 236 | else 237 | { 238 | gstImx226Sync[IspDev].u32VsTime = g_astImx226[IspDev].astRegsInfo[0].stSlvSync.u32SlaveVsTime; 239 | } 240 | gstImx226Sync[IspDev].unCfg.u32Bytes = 0xc0030000; 241 | gstImx226Sync[IspDev].u32HsCyc = 0x3; 242 | gstImx226Sync[IspDev].u32VsCyc = 0x3; 243 | CHECK_RET(HI_MPI_ISP_SetHvSync(IspDev, &gstImx226Sync[IspDev])); 244 | 245 | for (i=0; i 5 | #include 6 | #include 7 | #include "hi_comm_sns.h" 8 | #include "hi_sns_ctrl.h" 9 | #include "mpi_isp.h" 10 | #include "mpi_ae.h" 11 | #include "mpi_awb.h" 12 | #include "mpi_af.h" 13 | #include "mpi_vpss.h" 14 | 15 | #ifdef __cplusplus 16 | #if __cplusplus 17 | extern "C"{ 18 | #endif 19 | #endif /* End of #ifdef __cplusplus */ 20 | 21 | #define FULL_LINES_DEFAULT 750 22 | 23 | #define JXH42_ID 42 24 | 25 | #define HIGH_8BITS(x) ((x & 0xff00) >> 8) 26 | #define LOW_8BITS(x) (x & 0x00ff) 27 | 28 | 29 | HI_U32 gu32FullLinesStd = FULL_LINES_DEFAULT; 30 | HI_U32 gu32FullLines = FULL_LINES_DEFAULT; 31 | 32 | HI_U8 gu8SensorMode = 0; // which WDR mode default? 33 | 34 | 35 | HI_VOID cmos_set_wdr_mode(HI_U8 u8Mode) 36 | { 37 | //fprintf(stderr, "DBG: cmos_set_wdr_mode(%d)\n", u8Mode); 38 | if (u8Mode >= 2) 39 | { 40 | fprintf(stderr, "NO support for this mode!"); 41 | } 42 | else 43 | { 44 | gu8SensorMode = u8Mode; 45 | } 46 | } 47 | 48 | static HI_S32 cmos_get_ae_default(AE_SENSOR_DEFAULT_S *pstAeSnsDft) 49 | { 50 | //fprintf(stderr, "DBG: cmos_get_ae_default(*)\n"); 51 | if (HI_NULL == pstAeSnsDft) 52 | { 53 | fprintf(stderr, "null pointer when get ae default value!\n"); 54 | return -1; 55 | } 56 | 57 | gu32FullLinesStd = FULL_LINES_DEFAULT; 58 | 59 | pstAeSnsDft->au8HistThresh[0] = 0xd; 60 | pstAeSnsDft->au8HistThresh[1] = 0x28; 61 | pstAeSnsDft->au8HistThresh[2] = 0x60; 62 | pstAeSnsDft->au8HistThresh[3] = 0x80; 63 | 64 | pstAeSnsDft->u8AeCompensation = 0x40; 65 | 66 | pstAeSnsDft->u32LinesPer500ms = 11265; // FULL_LINES_DEFAULT * FPS30 / 2 67 | pstAeSnsDft->u32FullLinesStd = gu32FullLinesStd; 68 | pstAeSnsDft->u32FlickerFreq = 0; 69 | 70 | pstAeSnsDft->stIntTimeAccu.enAccuType = AE_ACCURACY_LINEAR; 71 | pstAeSnsDft->stIntTimeAccu.f32Accuracy = 1; 72 | pstAeSnsDft->u32MaxIntTime = 747; // ??? FULL_LINES_DEFAULT - 1; 73 | pstAeSnsDft->u32MinIntTime = 8; 74 | pstAeSnsDft->u32MaxIntTimeTarget = 65535; 75 | pstAeSnsDft->u32MinIntTimeTarget = 2; 76 | 77 | pstAeSnsDft->stAgainAccu.enAccuType = AE_ACCURACY_DB; 78 | pstAeSnsDft->stAgainAccu.f32Accuracy = 6.0; 79 | pstAeSnsDft->stDgainAccu.enAccuType = AE_ACCURACY_LINEAR; 80 | pstAeSnsDft->stDgainAccu.f32Accuracy = 0.0625; 81 | 82 | pstAeSnsDft->u32MaxAgain = 3; 83 | pstAeSnsDft->u32MinAgain = 0; 84 | pstAeSnsDft->u32MaxDgain = 31; 85 | pstAeSnsDft->u32MinDgain = 16; 86 | 87 | pstAeSnsDft->u32MaxDgainTarget = 31; 88 | pstAeSnsDft->u32MinDgainTarget = 16; 89 | pstAeSnsDft->u32MaxAgainTarget = 3; 90 | pstAeSnsDft->u32MinAgainTarget = 0; 91 | 92 | pstAeSnsDft->u32ISPDgainShift = 8; 93 | pstAeSnsDft->u32MaxISPDgainTarget = 2 << pstAeSnsDft->u32ISPDgainShift; // 512 94 | pstAeSnsDft->u32MinISPDgainTarget = 1 << pstAeSnsDft->u32ISPDgainShift; // 256 95 | 96 | return 0; 97 | } 98 | 99 | HI_U32 cmos_get_isp_black_level(ISP_CMOS_BLACK_LEVEL_S *pstBlackLevel) 100 | { 101 | HI_S32 i; 102 | 103 | if (HI_NULL == pstBlackLevel) 104 | { 105 | fprintf(stderr, "null pointer when get isp black level value!\n"); 106 | return -1; 107 | } 108 | 109 | //fprintf(stderr, "DBG: cmos_get_isp_black_level(*)\n"); 110 | 111 | pstBlackLevel->bUpdate = HI_FALSE; 112 | pstBlackLevel->au16BlackLevel[0] = 0x14; 113 | pstBlackLevel->au16BlackLevel[1] = 0x14; 114 | pstBlackLevel->au16BlackLevel[2] = 0x14; 115 | pstBlackLevel->au16BlackLevel[3] = 0x14; 116 | 117 | return 0; 118 | } 119 | 120 | static unsigned old_gain_val = 0; 121 | 122 | unsigned int cmos_get_gaininfo() 123 | { 124 | ISP_INNER_STATE_INFO_EX_S inf; 125 | HI_MPI_ISP_QueryInnerStateInfoEx(&inf); 126 | // fprintf(stderr, "\tu32AnalogGain, u32ISPDigitalGain = %u, %u\n", inf.u32AnalogGain, inf.u32ISPDigitalGain); 127 | unsigned gain_val = (inf.u32AnalogGain * inf.u32ISPDigitalGain) >> 20; 128 | 129 | if (old_gain_val == gain_val) return 0; 130 | 131 | old_gain_val = gain_val; 132 | 133 | return gain_val; 134 | } 135 | 136 | void cmos_Set_DPC(HI_U16 pxThresh, HI_U16 pxSlope) 137 | { 138 | ISP_DP_ATTR_S dp; 139 | 140 | HI_MPI_ISP_GetDefectPixelAttr(&dp); 141 | dp.bEnableDynamic = HI_TRUE; 142 | dp.u16DynamicBadPixelThresh = pxThresh; 143 | dp.u16DynamicBadPixelSlope = pxSlope; 144 | HI_MPI_ISP_SetDefectPixelAttr(&dp); 145 | } 146 | 147 | void cmos_Set_DRC(HI_BOOL en, HI_BOOL manual, HI_U32 strength_target) 148 | { 149 | ISP_DRC_ATTR_S drc; 150 | 151 | HI_MPI_ISP_GetDRCAttr(&drc); 152 | drc.bDRCEnable = en; 153 | drc.bDRCManualEnable = manual; 154 | drc.u32StrengthTarget = strength_target; 155 | HI_MPI_ISP_SetDRCAttr(&drc); 156 | } 157 | 158 | void cmos_set_3Ddenoise(HI_U32 sf, HI_U32 tf, HI_U32 chroma) 159 | { 160 | VPSS_GRP_PARAM_S grp_param; 161 | 162 | HI_MPI_VPSS_GetGrpParam(0, &grp_param); 163 | grp_param.u32SfStrength = sf; 164 | grp_param.u32TfStrength = tf; 165 | grp_param.u32ChromaRange = chroma; 166 | HI_MPI_VPSS_SetGrpParam(0, &grp_param); 167 | } 168 | 169 | static HI_VOID cmos_inttime_update(HI_U32 u32IntTime) 170 | { 171 | unsigned gaininfo = cmos_get_gaininfo(); 172 | if (gaininfo) 173 | { 174 | //fprintf(stderr, "\tgaininfo = %u\n", gaininfo); 175 | cmos_Set_DPC(40 - gaininfo, 38 * gaininfo + 1111); 176 | 177 | if (gaininfo <= 2) 178 | { 179 | cmos_Set_DRC(HI_TRUE, HI_TRUE, 64); 180 | cmos_set_3Ddenoise(28, 7, 60); 181 | } 182 | else if (gaininfo <= 4) 183 | { 184 | cmos_Set_DRC(HI_TRUE, HI_TRUE, 48); 185 | cmos_set_3Ddenoise(32, 8, 80); 186 | } 187 | else if (gaininfo <= 6) 188 | { 189 | cmos_Set_DRC(HI_TRUE, HI_TRUE, 32); 190 | cmos_set_3Ddenoise(36, 9, 100); 191 | } 192 | else if (gaininfo <= 8) 193 | { 194 | cmos_Set_DRC(HI_TRUE, HI_TRUE, 16); 195 | cmos_set_3Ddenoise(40, 10, 120); 196 | } 197 | else if (gaininfo > 12) 198 | { 199 | cmos_Set_DRC(HI_FALSE, HI_FALSE, 0); 200 | cmos_set_3Ddenoise(60, 12, 160); 201 | } 202 | else // 9...11 203 | { 204 | cmos_Set_DRC(HI_TRUE, HI_TRUE, 8); 205 | cmos_set_3Ddenoise(50, 11, 140); 206 | } 207 | } 208 | 209 | //fprintf(stderr, "DBG: set explosure to %u\n", u32IntTime); 210 | unsigned explosure = u32IntTime; 211 | sensor_write_register(0x1, explosure & 0xFF); 212 | sensor_write_register(0x2, (explosure >> 8) & 0xFF); 213 | } 214 | 215 | static unsigned char additional_gain_vals[4] = { 0, 0x10, 0x20, 0x30 }; 216 | 217 | static HI_VOID cmos_gains_update(HI_U32 u32Again, HI_U32 u32Dgain) 218 | { 219 | //fprintf(stderr, "DBG: cmos_gains_update(%u, %u)\n", u32Again, u32Dgain); 220 | // TODO large work 221 | unsigned char new_gain_value = u32Dgain & 0xF; 222 | if (u32Again <= 3) 223 | { 224 | new_gain_value |= additional_gain_vals[u32Again]; 225 | } 226 | //fprintf(stderr, "DBG: podsovyvaem 0x%u gain\n", new_gain_value); 227 | sensor_write_register(0x0, new_gain_value); 228 | } 229 | 230 | void sensor_global_init() 231 | { 232 | gu8SensorMode = 0; 233 | } 234 | 235 | static ISP_CMOS_NOISE_TABLE_S g_stIspNoiseTable = 236 | { 237 | /* bvalid */ 238 | 1, 239 | 240 | //nosie_profile_weight_lut 241 | { 242 | 0x19, 0x20, 0x24, 0x27, 0x29, 0x2B, 0x2D, 0x2E, 0x2F, 0x31, 0x32, 0x33, 0x34, 0x34, 0x35, 0x36, 243 | 0x37, 0x37, 0x38, 0x38, 0x39, 0x3A, 0x3A, 0x3B, 0x3B, 0x3B, 0x3C, 0x3C, 0x3D, 0x3D, 0x3D, 0x3E, 244 | 0x3E, 0x3E, 0x3F, 0x3F, 0x3F, 0x40, 0x40, 0x40, 0x41, 0x41, 0x41, 0x41, 0x42, 0x42, 0x42, 0x42, 245 | 0x43, 0x43, 0x43, 0x43, 0x44, 0x44, 0x44, 0x44, 0x44, 0x45, 0x45, 0x45, 0x45, 0x45, 0x46, 0x46, 246 | 0x46, 0x46, 0x46, 0x46, 0x47, 0x47, 0x47, 0x47, 0x47, 0x47, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 247 | 0x48, 0x49, 0x49, 0x49, 0x49, 0x49, 0x49, 0x49, 0x4A, 0x4A, 0x4A, 0x4A, 0x4A, 0x4A, 0x4A, 0x4A, 248 | 0x4A, 0x4B, 0x4B, 0x4B, 0x4B, 0x4B, 0x4B, 0x4B, 0x4B, 0x4C, 0x4C, 0x4C, 0x4C, 0x4C, 0x4C, 0x4C, 249 | 0x4C, 0x4C, 0x4C, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4E, 0x4E, 0x4E 250 | }, 251 | 252 | //demosaic_weight_lut 253 | { 254 | 0x19, 0x20, 0x24, 0x27, 0x29, 0x2B, 0x2D, 0x2E, 0x2F, 0x31, 0x32, 0x33, 0x34, 0x34, 0x35, 0x36, 255 | 0x37, 0x37, 0x38, 0x38, 0x39, 0x3A, 0x3A, 0x3B, 0x3B, 0x3B, 0x3C, 0x3C, 0x3D, 0x3D, 0x3D, 0x3E, 256 | 0x3E, 0x3E, 0x3F, 0x3F, 0x3F, 0x40, 0x40, 0x40, 0x41, 0x41, 0x41, 0x41, 0x42, 0x42, 0x42, 0x42, 257 | 0x43, 0x43, 0x43, 0x43, 0x44, 0x44, 0x44, 0x44, 0x44, 0x45, 0x45, 0x45, 0x45, 0x45, 0x46, 0x46, 258 | 0x46, 0x46, 0x46, 0x46, 0x47, 0x47, 0x47, 0x47, 0x47, 0x47, 0x48, 0x48, 0x48, 0x48, 0x48, 0x48, 259 | 0x48, 0x49, 0x49, 0x49, 0x49, 0x49, 0x49, 0x49, 0x4A, 0x4A, 0x4A, 0x4A, 0x4A, 0x4A, 0x4A, 0x4A, 260 | 0x4A, 0x4B, 0x4B, 0x4B, 0x4B, 0x4B, 0x4B, 0x4B, 0x4B, 0x4C, 0x4C, 0x4C, 0x4C, 0x4C, 0x4C, 0x4C, 261 | 0x4C, 0x4C, 0x4C, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4D, 0x4E, 0x4E, 0x4E 262 | } 263 | 264 | }; 265 | 266 | static ISP_CMOS_AGC_TABLE_S g_stIspAgcTable = 267 | { 268 | /* bvalid */ 269 | 1, 270 | 271 | /* sharpen_alt_d */ 272 | {0x48, 0x40, 0x38, 0x30, 0x28, 0x20, 0x18, 0x10}, 273 | 274 | /* sharpen_alt_ud */ 275 | {0xb0, 0xa0, 0x90, 0x80, 0x70, 0x60, 0x50, 0x40}, 276 | 277 | /* snr_thresh */ 278 | {0x01, 0x09, 0x13, 0x1e, 0x28, 0x32, 0x3c, 0x46}, 279 | 280 | /* demosaic_lum_thresh */ 281 | {0x40,0x60,0x80,0x80,0x80,0x80,0x80,0x80}, 282 | 283 | /* demosaic_np_offset */ 284 | {0x02, 0x08, 0x12, 0x1a, 0x20, 0x28, 0x30, 0x30}, 285 | 286 | /* ge_strength */ 287 | {0x55,0x55,0x55,0x55,0x55,0x55,0x37,0x37} 288 | }; 289 | 290 | static ISP_CMOS_DEMOSAIC_S g_stIspDemosaic = 291 | { 292 | /* bvalid */ 293 | 1, 294 | 295 | /*vh_slope*/ 296 | 0xFF, 297 | 298 | /*aa_slope*/ 299 | 0xE4, 300 | 301 | /*va_slope*/ 302 | 0xEC, 303 | 304 | /*uu_slope*/ 305 | 0x9F, 306 | 307 | /*sat_slope*/ 308 | 0x5D, 309 | 310 | /*ac_slope*/ 311 | 0xCF, 312 | 313 | /*vh_thresh*/ 314 | 0x138, 315 | 316 | /*aa_thresh*/ 317 | 0xBA, 318 | 319 | /*va_thresh*/ 320 | 0xDA, 321 | 322 | /*uu_thresh*/ 323 | 0x148, 324 | 325 | /*sat_thresh*/ 326 | 0x171, 327 | 328 | /*ac_thresh*/ 329 | 0x1b3, 330 | }; 331 | 332 | HI_VOID cmos_set_pixel_detect(HI_BOOL bEnable) 333 | { 334 | fprintf(stderr, "DNG: cmos_set_pixel_detect(%s)\n", bEnable ? "TRUE" : "FALSE"); 335 | } 336 | 337 | static HI_S32 cmos_get_sensor_max_resolution(ISP_CMOS_SENSOR_MAX_RESOLUTION *pstSensorMaxResolution) 338 | { 339 | if (HI_NULL == pstSensorMaxResolution) 340 | { 341 | fprintf(stderr, "null pointer when get sensor max resolution \n"); 342 | return -1; 343 | } 344 | 345 | memset(pstSensorMaxResolution, 0, sizeof(ISP_CMOS_SENSOR_MAX_RESOLUTION)); 346 | 347 | pstSensorMaxResolution->u32MaxWidth = 1280; 348 | pstSensorMaxResolution->u32MaxHeight = 720; 349 | 350 | return 0; 351 | } 352 | 353 | HI_U32 cmos_get_isp_default(ISP_CMOS_DEFAULT_S *pstDef) 354 | { 355 | if (HI_NULL == pstDef) 356 | { 357 | fprintf(stderr, "null pointer when get isp default value!\n"); 358 | return -1; 359 | } 360 | 361 | memset(pstDef, 0, sizeof(ISP_CMOS_DEFAULT_S)); 362 | 363 | pstDef->stComm.u8Rggb = 3; 364 | pstDef->stComm.u8BalanceFe = 1; 365 | 366 | pstDef->stDenoise.u8SinterThresh = 21; 367 | pstDef->stDenoise.u8NoiseProfile = 0; 368 | pstDef->stDenoise.u16Nr0 = 0; 369 | pstDef->stDenoise.u16Nr1 = 0; 370 | 371 | pstDef->stDrc.u8DrcBlack = 0; 372 | pstDef->stDrc.u8DrcVs = 4; 373 | pstDef->stDrc.u8DrcVi = 8; 374 | pstDef->stDrc.u8DrcSm = -96; 375 | pstDef->stDrc.u16DrcWl = 1279; 376 | 377 | memcpy(&pstDef->stNoiseTbl, &g_stIspNoiseTable, sizeof(ISP_CMOS_NOISE_TABLE_S)); 378 | memcpy(&pstDef->stAgcTbl, &g_stIspAgcTable, sizeof(ISP_CMOS_AGC_TABLE_S)); 379 | memcpy(&pstDef->stDemosaic, &g_stIspDemosaic, sizeof(ISP_CMOS_DEMOSAIC_S)); 380 | } 381 | 382 | HI_S32 cmos_init_sensor_exp_function(ISP_SENSOR_EXP_FUNC_S *pstSensorExpFunc) 383 | { 384 | memset(pstSensorExpFunc, 0, sizeof(ISP_SENSOR_EXP_FUNC_S)); 385 | 386 | pstSensorExpFunc->pfn_cmos_sensor_init = sensor_init; 387 | pstSensorExpFunc->pfn_cmos_sensor_global_init = sensor_global_init; 388 | pstSensorExpFunc->pfn_cmos_get_isp_default = cmos_get_isp_default; 389 | pstSensorExpFunc->pfn_cmos_get_isp_black_level = cmos_get_isp_black_level; 390 | pstSensorExpFunc->pfn_cmos_set_pixel_detect = cmos_set_pixel_detect; 391 | pstSensorExpFunc->pfn_cmos_set_wdr_mode = cmos_set_wdr_mode; 392 | pstSensorExpFunc->pfn_cmos_get_sensor_max_resolution = cmos_get_sensor_max_resolution; 393 | 394 | return 0; 395 | } 396 | 397 | void cmos_fps_set(HI_U8 u8Fps, AE_SENSOR_DEFAULT_S *pstAeSnsDft) 398 | { 399 | //fprintf(stderr, "DBG: cmos_fps_set(u8Fps = %u)\n", u8Fps); 400 | int full_lines; // r0 401 | 402 | full_lines = 22530 / u8Fps; 403 | gu32FullLinesStd = full_lines; 404 | pstAeSnsDft->u32FullLinesStd = full_lines; 405 | pstAeSnsDft->u32MaxIntTime = full_lines - 2; 406 | pstAeSnsDft->u32LinesPer500ms = (unsigned int)(full_lines * u8Fps) >> 1; 407 | } 408 | 409 | static HI_VOID cmos_slow_framerate_set(HI_U16 u16FullLines, AE_SENSOR_DEFAULT_S *pstAeSnsDft) 410 | { 411 | //fprintf(stderr, "DBG: cmos_slow_framerate_set(u16FullLines = %u)\n", u16FullLines); 412 | HI_U16 full_lines = u16FullLines; 413 | if (full_lines > 2253) full_lines = 2253; 414 | 415 | gu32FullLines = full_lines; 416 | sensor_write_register(0x22, LOW_8BITS(gu32FullLines)); 417 | sensor_write_register(0x23, HIGH_8BITS(gu32FullLines)); 418 | 419 | pstAeSnsDft->u32MaxIntTime = gu32FullLines - 2; 420 | } 421 | 422 | HI_S32 cmos_init_ae_exp_function(AE_SENSOR_EXP_FUNC_S *pstExpFuncs) 423 | { 424 | memset(pstExpFuncs, 0, sizeof(AE_SENSOR_EXP_FUNC_S)); 425 | 426 | pstExpFuncs->pfn_cmos_get_ae_default = cmos_get_ae_default; 427 | pstExpFuncs->pfn_cmos_fps_set = cmos_fps_set; 428 | pstExpFuncs->pfn_cmos_slow_framerate_set= cmos_slow_framerate_set; 429 | pstExpFuncs->pfn_cmos_inttime_update = cmos_inttime_update; 430 | pstExpFuncs->pfn_cmos_gains_update = cmos_gains_update; 431 | 432 | return 0; 433 | } 434 | 435 | static AWB_CCM_S g_stAwbCcm = 436 | { 437 | 4930, 438 | { 439 | 0x1A3, 0x8073, 0x8030, 440 | 0x8042, 0x1C5, 0x8083, 441 | 0x8007, 0x80A6, 0x1AD, 442 | }, 443 | 3885, 444 | { 445 | 0x1FB, 0x80D4, 0x8027, 446 | 0x8058, 0x1B4, 0x805C, 447 | 0x8005, 0x80C0, 0x1C5, 448 | }, 449 | 2790, 450 | { 451 | 0x1A8, 0x805B, 0x804D, 452 | 0x8072, 0x19D, 0x802B, 453 | 0x80B3, 0x8366, 0x519, 454 | } 455 | 456 | }; 457 | 458 | static AWB_AGC_TABLE_S g_stAwbAgcTable = 459 | { 460 | /* bvalid */ 461 | 1, 462 | 463 | /* saturation */ 464 | {0x80,0x78,0x70,0x68,0x60,0x58,0x50,0x48} 465 | }; 466 | 467 | static HI_S32 cmos_get_awb_default(AWB_SENSOR_DEFAULT_S *pstAwbSnsDft) 468 | { 469 | //fprintf(stderr, "DBG: cmos_get_awb_default(*)\n"); 470 | if (HI_NULL == pstAwbSnsDft) 471 | { 472 | fprintf(stderr, "null pointer when get awb default value!\n"); 473 | return -1; 474 | } 475 | 476 | memset(pstAwbSnsDft, 0, sizeof(AWB_SENSOR_DEFAULT_S)); 477 | 478 | pstAwbSnsDft->u16WbRefTemp = 4930; 479 | 480 | pstAwbSnsDft->au16GainOffset[0] = 0x1d2; 481 | pstAwbSnsDft->au16GainOffset[1] = 0x100; 482 | pstAwbSnsDft->au16GainOffset[2] = 0x100; 483 | pstAwbSnsDft->au16GainOffset[3] = 0x199; 484 | 485 | pstAwbSnsDft->as32WbPara[0] = 99; 486 | pstAwbSnsDft->as32WbPara[1] = 47; 487 | pstAwbSnsDft->as32WbPara[2] = -110; 488 | pstAwbSnsDft->as32WbPara[3] = 152677; 489 | pstAwbSnsDft->as32WbPara[4] = 128; 490 | pstAwbSnsDft->as32WbPara[5] = -104036; 491 | 492 | memcpy(&pstAwbSnsDft->stCcm, &g_stAwbCcm, sizeof(AWB_CCM_S)); 493 | memcpy(&pstAwbSnsDft->stAgcTbl, &g_stAwbAgcTable, sizeof(AWB_AGC_TABLE_S)); 494 | 495 | return 0; 496 | } 497 | 498 | HI_S32 cmos_init_awb_exp_function(AWB_SENSOR_EXP_FUNC_S *pstExpFuncs) 499 | { 500 | memset(pstExpFuncs, 0, sizeof(AWB_SENSOR_EXP_FUNC_S)); 501 | 502 | pstExpFuncs->pfn_cmos_get_awb_default = cmos_get_awb_default; 503 | 504 | return 0; 505 | } 506 | 507 | int sensor_register_callback(void) 508 | { 509 | HI_S32 s32Ret; 510 | ALG_LIB_S stLib; 511 | ISP_SENSOR_REGISTER_S stIspRegister; 512 | AE_SENSOR_REGISTER_S stAeRegister; 513 | AWB_SENSOR_REGISTER_S stAwbRegister; 514 | 515 | cmos_init_sensor_exp_function(&stIspRegister.stSnsExp); 516 | s32Ret = HI_MPI_ISP_SensorRegCallBack(JXH42_ID, &stIspRegister); 517 | if (s32Ret) 518 | { 519 | fprintf(stderr, "sensor register callback function failed!\n"); 520 | return s32Ret; 521 | } 522 | 523 | stLib.s32Id = 0; 524 | strcpy(stLib.acLibName, HI_AE_LIB_NAME); 525 | cmos_init_ae_exp_function(&stAeRegister.stSnsExp); 526 | s32Ret = HI_MPI_AE_SensorRegCallBack(&stLib, JXH42_ID, &stAeRegister); 527 | if (s32Ret) 528 | { 529 | fprintf(stderr, "sensor register callback function to ae lib failed!\n"); 530 | return s32Ret; 531 | } 532 | 533 | stLib.s32Id = 0; 534 | strcpy(stLib.acLibName, HI_AWB_LIB_NAME); 535 | cmos_init_awb_exp_function(&stAwbRegister.stSnsExp); 536 | s32Ret = HI_MPI_AWB_SensorRegCallBack(&stLib, JXH42_ID, &stAwbRegister); 537 | if (s32Ret) 538 | { 539 | fprintf(stderr, "sensor register callback function to ae lib failed!\n"); 540 | return s32Ret; 541 | } 542 | 543 | return 0; 544 | } 545 | 546 | int sensor_unregister_callback(void) 547 | { 548 | HI_S32 s32Ret; 549 | ALG_LIB_S stLib; 550 | 551 | s32Ret = HI_MPI_ISP_SensorUnRegCallBack(JXH42_ID); 552 | if (s32Ret) 553 | { 554 | fprintf(stderr, "sensor unregister callback function failed!\n"); 555 | return s32Ret; 556 | } 557 | 558 | stLib.s32Id = 0; 559 | strcpy(stLib.acLibName, HI_AE_LIB_NAME); 560 | s32Ret = HI_MPI_AE_SensorUnRegCallBack(&stLib, JXH42_ID); 561 | if (s32Ret) 562 | { 563 | fprintf(stderr, "sensor unregister callback function to ae lib failed!\n"); 564 | return s32Ret; 565 | } 566 | 567 | stLib.s32Id = 0; 568 | strcpy(stLib.acLibName, HI_AWB_LIB_NAME); 569 | s32Ret = HI_MPI_AWB_SensorUnRegCallBack(&stLib, JXH42_ID); 570 | if (s32Ret) 571 | { 572 | fprintf(stderr, "sensor unregister callback function to ae lib failed!\n"); 573 | return s32Ret; 574 | } 575 | 576 | return 0; 577 | } 578 | 579 | 580 | 581 | #ifdef __cplusplus 582 | #if __cplusplus 583 | } 584 | #endif 585 | #endif /* End of #ifdef __cplusplus */ 586 | 587 | #endif 588 | 589 | 590 | -------------------------------------------------------------------------------- /hisilicon/sources/ov2710_i2c_mipi_hi3518ev200_rev1/ov2710_cmos.c: -------------------------------------------------------------------------------- 1 | #if !defined(__OV2710_CMOS_H_) 2 | #define __OV2710_CMOS_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include "hi_comm_sns.h" 8 | #include "hi_comm_video.h" 9 | #include "hi_sns_ctrl.h" 10 | #include "mpi_isp.h" 11 | #include "mpi_ae.h" 12 | #include "mpi_awb.h" 13 | #include "mpi_af.h" 14 | 15 | #ifdef __cplusplus 16 | #if __cplusplus 17 | extern "C"{ 18 | #endif 19 | #endif /* End of #ifdef __cplusplus */ 20 | 21 | 22 | #define OV2710_ID 2710 23 | 24 | 25 | /**************************************************************************** 26 | * local variables * 27 | ****************************************************************************/ 28 | 29 | #define FULL_LINES_MAX (0xFFF) 30 | 31 | extern const unsigned int sensor_i2c_addr; 32 | extern unsigned int sensor_addr_byte; 33 | extern unsigned int sensor_data_byte; 34 | 35 | #define SENSOR_1080P_30FPS_MODE (1) 36 | 37 | #define VMAX_OV2710_1080P30_LINEAR (1104) 38 | 39 | 40 | HI_U8 gu8SensorImageMode = SENSOR_1080P_30FPS_MODE; 41 | WDR_MODE_E genSensorMode = WDR_MODE_NONE; 42 | 43 | static HI_U32 gu32FullLinesStd = VMAX_OV2710_1080P30_LINEAR; 44 | static HI_U32 gu32FullLines = VMAX_OV2710_1080P30_LINEAR; 45 | 46 | static HI_BOOL bInit = HI_FALSE; 47 | HI_BOOL bSensorInit = HI_FALSE; 48 | ISP_SNS_REGS_INFO_S g_stSnsRegsInfo = {0}; 49 | ISP_SNS_REGS_INFO_S g_stPreSnsRegsInfo = {0}; 50 | 51 | /* Piris attr */ 52 | static ISP_PIRIS_ATTR_S gstPirisAttr= 53 | { 54 | 0, // bStepFNOTableChange 55 | 1, // bZeroIsMax 56 | 93, // u16TotalStep 57 | 62, // u16StepCount 58 | /* Step-F number mapping table. Must be from small to large. F1.0 is 1024 and F32.0 is 1 */ 59 | {30,35,40,45,50,56,61,67,73,79,85,92,98,105,112,120,127,135,143,150,158,166,174,183,191,200,208,217,225,234,243,252,261,270,279,289,298,307,316,325,335,344,353,362,372,381,390,399,408,417,426,435,444,453,462,470,478,486,493,500,506,512}, 60 | ISP_IRIS_F_NO_1_4, // enMaxIrisFNOTarget 61 | ISP_IRIS_F_NO_5_6 // enMinIrisFNOTarget 62 | }; 63 | 64 | 65 | 66 | /* AE default parameter and function */ 67 | static HI_S32 cmos_get_ae_default(AE_SENSOR_DEFAULT_S *pstAeSnsDft) 68 | { 69 | if (HI_NULL == pstAeSnsDft) 70 | { 71 | printf("null pointer when get ae default value!\n"); 72 | return -1; 73 | } 74 | 75 | pstAeSnsDft->u32LinesPer500ms = VMAX_OV2710_1080P30_LINEAR * 30 / 2; 76 | pstAeSnsDft->u32FullLinesStd = gu32FullLinesStd; 77 | pstAeSnsDft->u32FlickerFreq = 0; 78 | pstAeSnsDft->u32FullLinesMax = FULL_LINES_MAX; 79 | 80 | pstAeSnsDft->au8HistThresh[0] = 0xd; 81 | pstAeSnsDft->au8HistThresh[1] = 0x28; 82 | pstAeSnsDft->au8HistThresh[2] = 0x60; 83 | pstAeSnsDft->au8HistThresh[3] = 0x80; 84 | 85 | pstAeSnsDft->u8AeCompensation = 0x38; 86 | 87 | pstAeSnsDft->stIntTimeAccu.enAccuType = AE_ACCURACY_LINEAR; 88 | pstAeSnsDft->stIntTimeAccu.f32Accuracy = 1; 89 | pstAeSnsDft->stIntTimeAccu.f32Offset = 0; 90 | pstAeSnsDft->u32MaxIntTime = gu32FullLinesStd - 3; 91 | pstAeSnsDft->u32MinIntTime = 2; 92 | pstAeSnsDft->u32MaxIntTimeTarget = 65535; 93 | pstAeSnsDft->u32MinIntTimeTarget = pstAeSnsDft->u32MinIntTime; 94 | 95 | 96 | pstAeSnsDft->stAgainAccu.enAccuType = AE_ACCURACY_TABLE; 97 | pstAeSnsDft->stAgainAccu.f32Accuracy = 1; 98 | pstAeSnsDft->u32MaxAgain = 32768; 99 | pstAeSnsDft->u32MinAgain = 1024; 100 | pstAeSnsDft->u32MaxAgainTarget = pstAeSnsDft->u32MaxAgain; 101 | pstAeSnsDft->u32MinAgainTarget = pstAeSnsDft->u32MinAgain; 102 | 103 | pstAeSnsDft->stDgainAccu.enAccuType = AE_ACCURACY_LINEAR; 104 | pstAeSnsDft->stDgainAccu.f32Accuracy = 0.0625; 105 | pstAeSnsDft->u32MaxDgain = 31; 106 | pstAeSnsDft->u32MinDgain = 16; 107 | pstAeSnsDft->u32MaxDgainTarget = pstAeSnsDft->u32MaxDgain; 108 | pstAeSnsDft->u32MinDgainTarget = pstAeSnsDft->u32MinDgain; 109 | 110 | pstAeSnsDft->u32ISPDgainShift = 8; 111 | pstAeSnsDft->u32MinISPDgainTarget = 1 << pstAeSnsDft->u32ISPDgainShift; 112 | pstAeSnsDft->u32MaxISPDgainTarget = 256 << pstAeSnsDft->u32ISPDgainShift; 113 | 114 | pstAeSnsDft->enIrisType = ISP_IRIS_DC_TYPE; 115 | memcpy(&pstAeSnsDft->stPirisAttr, &gstPirisAttr, sizeof(ISP_PIRIS_ATTR_S)); 116 | pstAeSnsDft->enMaxIrisFNO = ISP_IRIS_F_NO_1_4; 117 | pstAeSnsDft->enMinIrisFNO = ISP_IRIS_F_NO_5_6; 118 | 119 | pstAeSnsDft->u8AERunInterval = 1; 120 | 121 | return 0; 122 | } 123 | 124 | /* the function of sensor set fps */ 125 | static HI_VOID cmos_fps_set(HI_FLOAT f32Fps, AE_SENSOR_DEFAULT_S *pstAeSnsDft) 126 | { 127 | if ((f32Fps <= 30) && (f32Fps >= 8.1)) 128 | { 129 | if(SENSOR_1080P_30FPS_MODE == gu8SensorImageMode) 130 | { 131 | gu32FullLinesStd = VMAX_OV2710_1080P30_LINEAR * 30 / f32Fps; 132 | gu32FullLinesStd = (gu32FullLinesStd > FULL_LINES_MAX) ? FULL_LINES_MAX : gu32FullLinesStd; 133 | 134 | g_stSnsRegsInfo.astI2cData[8].u32Data = (gu32FullLinesStd >> 8) & 0xff; 135 | g_stSnsRegsInfo.astI2cData[9].u32Data = gu32FullLinesStd & 0xff; 136 | 137 | pstAeSnsDft->u32MaxIntTime = gu32FullLinesStd - 3; 138 | 139 | pstAeSnsDft->u32FullLinesStd = gu32FullLinesStd; 140 | } 141 | } 142 | else 143 | { 144 | printf("Not support Fps: %f\n", f32Fps); 145 | return; 146 | } 147 | 148 | return; 149 | } 150 | 151 | static HI_VOID cmos_slow_framerate_set(HI_U32 u32FullLines, 152 | AE_SENSOR_DEFAULT_S *pstAeSnsDft) 153 | { 154 | u32FullLines = (u32FullLines > FULL_LINES_MAX) ? FULL_LINES_MAX : u32FullLines; 155 | gu32FullLines = u32FullLines; 156 | 157 | g_stSnsRegsInfo.astI2cData[8].u32Data = (gu32FullLines >> 8) & 0xff; 158 | g_stSnsRegsInfo.astI2cData[9].u32Data = gu32FullLines & 0xff; 159 | 160 | pstAeSnsDft->u32MaxIntTime = gu32FullLines - 3; 161 | 162 | return; 163 | } 164 | 165 | /* while isp notify ae to update sensor regs, ae call these funcs. */ 166 | static HI_VOID cmos_inttime_update(HI_U32 u32IntTime) 167 | { 168 | g_stSnsRegsInfo.astI2cData[0].u32Data = (u32IntTime >> 12) & 0x0F; 169 | g_stSnsRegsInfo.astI2cData[1].u32Data = (u32IntTime >> 4) & 0xFF; 170 | g_stSnsRegsInfo.astI2cData[2].u32Data = (u32IntTime << 4) & 0xFF; 171 | 172 | 173 | return; 174 | } 175 | 176 | static HI_U32 analog_gain_table[6] = 177 | { 178 | 1024, 2048, 4096, 8192, 16384, 32768 179 | }; 180 | 181 | 182 | static HI_VOID cmos_again_calc_table(HI_U32 *pu32AgainLin, HI_U32 *pu32AgainDb) 183 | { 184 | int i; 185 | 186 | if (*pu32AgainLin >= analog_gain_table[5]) 187 | { 188 | *pu32AgainLin = analog_gain_table[5]; 189 | *pu32AgainDb = 5; 190 | return ; 191 | } 192 | 193 | for (i = 1; i < 6; i++) 194 | { 195 | if (*pu32AgainLin < analog_gain_table[i]) 196 | { 197 | *pu32AgainLin = analog_gain_table[i - 1]; 198 | *pu32AgainDb = i - 1; 199 | break; 200 | } 201 | } 202 | 203 | return; 204 | 205 | } 206 | 207 | static HI_VOID cmos_gains_update(HI_U32 u32Again, HI_U32 u32Dgain) 208 | { 209 | HI_U16 u16RegValue; 210 | 211 | u16RegValue = (((1 << u32Again) - 1) << 4) | ((u32Dgain - 16) & 0xf); 212 | 213 | g_stSnsRegsInfo.astI2cData[4].u32Data = (u16RegValue >> 8) & 0x1; 214 | g_stSnsRegsInfo.astI2cData[5].u32Data = u16RegValue & 0xff; 215 | 216 | 217 | return; 218 | } 219 | 220 | HI_S32 cmos_init_ae_exp_function(AE_SENSOR_EXP_FUNC_S *pstExpFuncs) 221 | { 222 | memset(pstExpFuncs, 0, sizeof(AE_SENSOR_EXP_FUNC_S)); 223 | 224 | pstExpFuncs->pfn_cmos_get_ae_default = cmos_get_ae_default; 225 | pstExpFuncs->pfn_cmos_fps_set = cmos_fps_set; 226 | pstExpFuncs->pfn_cmos_slow_framerate_set= cmos_slow_framerate_set; 227 | pstExpFuncs->pfn_cmos_inttime_update = cmos_inttime_update; 228 | pstExpFuncs->pfn_cmos_gains_update = cmos_gains_update; 229 | pstExpFuncs->pfn_cmos_again_calc_table = cmos_again_calc_table; 230 | pstExpFuncs->pfn_cmos_dgain_calc_table = NULL; 231 | 232 | return 0; 233 | } 234 | 235 | 236 | /* AWB default parameter and function */ 237 | static AWB_CCM_S g_stAwbCcm = 238 | { 239 | 4850, 240 | { 0x0201, 0x80a7, 0x805a, 241 | 0x8040, 0x019d, 0x805d, 242 | 0x8010, 0x8150, 0x0260 243 | }, 244 | 3160, 245 | { 246 | 0x018e, 0x8018, 0x8076, 247 | 0x8045, 0x0184, 0x803e, 248 | 0x8035, 0x8134, 0x026a 249 | }, 250 | 2470, 251 | { 252 | 0x019d, 0x8017, 0x8086, 253 | 0x8031, 0x017e, 0x804c, 254 | 0x8047, 0x819b, 0x02e2 255 | } 256 | }; 257 | 258 | static AWB_AGC_TABLE_S g_stAwbAgcTable = 259 | { 260 | /* bvalid */ 261 | 1, 262 | 263 | /*1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768*/ 264 | /* saturation */ 265 | {0x80,0x80,0x7a,0x78,0x70,0x68,0x60,0x58,0x50,0x48,0x40,0x38,0x38,0x38,0x38,0x38} 266 | 267 | }; 268 | 269 | static HI_S32 cmos_get_awb_default(AWB_SENSOR_DEFAULT_S *pstAwbSnsDft) 270 | { 271 | if (HI_NULL == pstAwbSnsDft) 272 | { 273 | printf("null pointer when get awb default value!\n"); 274 | return -1; 275 | } 276 | 277 | memset(pstAwbSnsDft, 0, sizeof(AWB_SENSOR_DEFAULT_S)); 278 | 279 | pstAwbSnsDft->u16WbRefTemp = 5000; 280 | pstAwbSnsDft->au16GainOffset[0] = 0x154; 281 | pstAwbSnsDft->au16GainOffset[1] = 0x100; 282 | pstAwbSnsDft->au16GainOffset[2] = 0x100; 283 | pstAwbSnsDft->au16GainOffset[3] = 0X1bd; 284 | pstAwbSnsDft->as32WbPara[0] = 156; 285 | pstAwbSnsDft->as32WbPara[1] = -71; 286 | pstAwbSnsDft->as32WbPara[2] = -170; 287 | pstAwbSnsDft->as32WbPara[3] = 198034; 288 | pstAwbSnsDft->as32WbPara[4] = 128; 289 | pstAwbSnsDft->as32WbPara[5] = -147889; 290 | 291 | memcpy(&pstAwbSnsDft->stCcm, &g_stAwbCcm, sizeof(AWB_CCM_S)); 292 | memcpy(&pstAwbSnsDft->stAgcTbl, &g_stAwbAgcTable, sizeof(AWB_AGC_TABLE_S)); 293 | 294 | return 0; 295 | } 296 | 297 | HI_S32 cmos_init_awb_exp_function(AWB_SENSOR_EXP_FUNC_S *pstExpFuncs) 298 | { 299 | memset(pstExpFuncs, 0, sizeof(AWB_SENSOR_EXP_FUNC_S)); 300 | 301 | pstExpFuncs->pfn_cmos_get_awb_default = cmos_get_awb_default; 302 | 303 | return 0; 304 | } 305 | 306 | #define DMNR_CALIB_CARVE_NUM_OV2710 9 307 | 308 | float g_coef_calib_ov2710[DMNR_CALIB_CARVE_NUM_OV2710][4] = 309 | { 310 | {100.000000f, 2.000000f, 0.036470f, 6.872425f, }, 311 | {200.000000f, 2.301030f, 0.039808f, 6.327385f, }, 312 | {400.000000f, 2.602060f, 0.041653f, 6.645809f, }, 313 | {800.000000f, 2.903090f, 0.043177f, 7.786633f, }, 314 | {1600.000000f, 3.204120f, 0.046225f, 8.775841f, }, 315 | {3200.000000f, 3.505150f, 0.058395f, 9.478638f, }, 316 | {6200.000000f, 3.792392f, 0.062279f, 16.687279f, }, 317 | {12400.000000f, 4.093422f, 0.073368f, 27.761475f, }, 318 | {24800.000000f, 4.394452f, 0.088682f, 46.984421f, }, 319 | 320 | }; 321 | 322 | 323 | 324 | static ISP_NR_ISO_PARA_TABLE_S g_stNrIsoParaTab[HI_ISP_NR_ISO_LEVEL_MAX] = 325 | { 326 | //u16Threshold//u8varStrength//u8fixStrength//u8LowFreqSlope 327 | {1500, 160, 256-256, 0 }, //100 // // 328 | {1500, 120, 256-256, 0 }, //200 // ISO // ISO //u8LowFreqSlope 329 | {1500, 100, 256-256, 0 }, //400 //{400, 1200, 96,256}, //{400 , 0 } 330 | {1750, 80, 256-256, 8 }, //800 //{800, 1400, 80,256}, //{600 , 2 } 331 | {1500, 255, 256-256, 6 }, //1600 //{1600, 1200, 72,256}, //{800 , 8 } 332 | {1500, 255, 256-256, 0 }, //3200 //{3200, 1200, 64,256}, //{1000, 12 } 333 | {1375, 255, 256-256, 0 }, //6400 //{6400, 1100, 56,256}, //{1600, 6 } 334 | {1375, 255, 256-256, 0 }, //12800 //{12000,1100, 48,256}, //{2400, 0 } 335 | {1375, 255, 256-256, 0 }, //25600 //{36000,1100, 48,256}, // 336 | {1375, 255, 256-256, 0 }, //51200 //{64000,1100, 96,256}, // 337 | {1250, 255, 256-256, 0 }, //102400 //{82000,1000,240,256}, // 338 | {1250, 255, 256-256, 0 }, //204800 // // 339 | {1250, 255, 256-256, 0 }, //409600 // // 340 | {1250, 255, 256-256, 0 }, //819200 // // 341 | {1250, 255, 256-256, 0 }, //1638400// // 342 | {1250, 255, 256-256, 0 }, //3276800// // 343 | }; 344 | 345 | static ISP_CMOS_DEMOSAIC_S g_stIspDemosaic = 346 | { 347 | /*For Demosaic*/ 348 | 1, /*bEnable*/ 349 | 24,/*u16VhLimit*/ 350 | 40-24,/*u16VhOffset*/ 351 | 24, /*u16VhSlope*/ 352 | /*False Color*/ 353 | 1, /*bFcrEnable*/ 354 | { 8, 8, 8, 8, 8, 8, 8, 8, 3, 0, 0, 0, 0, 0, 0, 0}, /*au8FcrStrength[ISP_AUTO_ISO_STENGTH_NUM]*/ 355 | {24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24}, /*au8FcrThreshold[ISP_AUTO_ISO_STENGTH_NUM]*/ 356 | /*For Ahd*/ 357 | 400, /*u16UuSlope*/ 358 | {512,512,512,512,512,512,512, 400, 0,0,0,0,0,0,0,0} /*au16NpOffset[ISP_AUTO_ISO_STENGTH_NUM]*/ 359 | }; 360 | 361 | static ISP_CMOS_GE_S g_stIspGe = 362 | { 363 | /*For GE*/ 364 | 1, /*bEnable*/ 365 | 7, /*u8Slope*/ 366 | 7, /*u8Sensitivity*/ 367 | 8192, /*u16Threshold*/ 368 | 8192, /*u16SensiThreshold*/ 369 | {1024,1024,1024,2048,2048,2048,2048, 2048, 2048,2048,2048,2048,2048,2048,2048,2048} /*au16Strength[ISP_AUTO_ISO_STENGTH_NUM]*/ 370 | }; 371 | 372 | static ISP_CMOS_RGBSHARPEN_S g_stIspRgbSharpen = 373 | { 374 | //{100,200,400,800,1600,3200,6400,12800,25600,51200,102400,204800,409600,819200,1638400,3276800}; 375 | {0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1},/* enPixSel = ~bEnLowLumaShoot */ 376 | 377 | {120, 64, 64, 43, 43, 43, 18, 18, 18, 200, 250, 250, 250, 250, 250, 250},/*maxSharpAmt1 = SharpenUD*16 */ 378 | {128, 200, 103, 86, 86, 86, 80, 80, 80, 250, 250, 250, 250, 250, 250, 250},/*maxEdgeAmt = SharpenD*16 */ 379 | 380 | {0, 0, 0, 0, 0, 0, 0, 40, 190, 200, 220, 250, 250, 250, 250, 250},/*sharpThd2 = TextureNoiseThd*4 */ 381 | {0, 0, 0, 0, 0, 0, 0, 60, 140, 0, 0, 0, 0, 0, 0, 0},/*edgeThd2 = EdgeNoiseThd*4 */ 382 | {59, 59, 59, 59, 59, 59, 59, 59, 101, 0, 0, 0, 0, 0, 0, 0},/*overshootAmt*/ 383 | {117, 117, 117, 108, 108, 108, 122, 122, 139, 0, 0, 0, 0, 0, 0, 0},/*undershootAmt*/ 384 | }; 385 | 386 | static ISP_CMOS_UVNR_S g_stIspUVNR = 387 | { 388 | //{100, 200, 400, 800, 1600, 3200, 6400, 12800, 25600, 51200, 102400, 204800, 409600, 819200, 1638400, 3276800}; 389 | {1, 2, 4, 5, 7, 48, 32, 16, 16, 16, 16, 16, 16, 16, 16, 16}, /*UVNRThreshold*/ 390 | {0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 2, 2, 2, 2, 2}, /*Coring_lutLimit*/ 391 | {0, 0, 0, 16, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34, 34} /*UVNR_blendRatio*/ 392 | }; 393 | 394 | static ISP_CMOS_DPC_S g_stCmosDpc = 395 | { 396 | //1,/*IR_channel*/ 397 | //1,/*IR_position*/ 398 | {0,0,0,1,1,1,2,2,2,3,3,3,3,3,3,3},/*au16Strength[16]*/ 399 | {0,0,0,0,0,0,0,0,0x24,0x80,0x80,0x80,0xE5,0xE5,0xE5,0xE5},/*au16BlendRatio[16]*/ 400 | }; 401 | 402 | static ISP_CMOS_DRC_S g_stIspDrc = 403 | { 404 | 0, 405 | 10, 406 | 0, 407 | 2, 408 | 192, 409 | 60, 410 | 0, 411 | 0, 412 | 0, 413 | {1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024,1024} 414 | }; 415 | 416 | 417 | HI_U32 cmos_get_isp_default(ISP_CMOS_DEFAULT_S *pstDef) 418 | { 419 | if (HI_NULL == pstDef) 420 | { 421 | printf("null pointer when get isp default value!\n"); 422 | return -1; 423 | } 424 | 425 | memset(pstDef, 0, sizeof(ISP_CMOS_DEFAULT_S)); 426 | #if 0 427 | pstDef->stDrc.bEnable = HI_FALSE; 428 | pstDef->stDrc.u8Asymmetry = 0x02; 429 | pstDef->stDrc.u8SecondPole = 0xC0; 430 | pstDef->stDrc.u8Stretch = 0x3C; 431 | pstDef->stDrc.u8LocalMixingBrigtht = 0x2D; 432 | pstDef->stDrc.u8LocalMixingDark = 0x2D; 433 | pstDef->stDrc.u8LocalMixingThres = 0x02; 434 | pstDef->stDrc.u16BrightGainLmt = 0x7F; 435 | pstDef->stDrc.u16DarkGainLmtC = 0x7F; 436 | pstDef->stDrc.u16DarkGainLmtY = 0x7F; 437 | pstDef->stDrc.u8RangeVar = 0x00; 438 | pstDef->stDrc.u8SpatialVar = 0x0A; 439 | #endif 440 | memcpy(&pstDef->stDrc, &g_stIspDrc, sizeof(ISP_CMOS_DRC_S)); 441 | memcpy(&pstDef->stDemosaic, &g_stIspDemosaic, sizeof(ISP_CMOS_DEMOSAIC_S)); 442 | memcpy(&pstDef->stRgbSharpen, &g_stIspRgbSharpen, sizeof(ISP_CMOS_RGBSHARPEN_S)); 443 | memcpy(&pstDef->stGe, &g_stIspGe, sizeof(ISP_CMOS_GE_S)); 444 | pstDef->stNoiseTbl.stNrCaliPara.u8CalicoefRow = DMNR_CALIB_CARVE_NUM_OV2710; 445 | pstDef->stNoiseTbl.stNrCaliPara.pCalibcoef = (HI_FLOAT (*)[4])g_coef_calib_ov2710; 446 | 447 | memcpy(&pstDef->stNoiseTbl.stIsoParaTable[0], &g_stNrIsoParaTab[0],sizeof(ISP_NR_ISO_PARA_TABLE_S)*HI_ISP_NR_ISO_LEVEL_MAX); 448 | 449 | memcpy(&pstDef->stUvnr, &g_stIspUVNR, sizeof(ISP_CMOS_UVNR_S)); 450 | memcpy(&pstDef->stDpc, &g_stCmosDpc, sizeof(ISP_CMOS_DPC_S)); 451 | 452 | pstDef->stSensorMaxResolution.u32MaxWidth = 1920; 453 | pstDef->stSensorMaxResolution.u32MaxHeight = 1080; 454 | 455 | return 0; 456 | } 457 | 458 | HI_U32 cmos_get_isp_black_level(ISP_CMOS_BLACK_LEVEL_S *pstBlackLevel) 459 | { 460 | if (HI_NULL == pstBlackLevel) 461 | { 462 | printf("null pointer when get isp black level value!\n"); 463 | return -1; 464 | } 465 | 466 | /* Don't need to update black level when iso change */ 467 | pstBlackLevel->bUpdate = HI_FALSE; 468 | 469 | pstBlackLevel->au16BlackLevel[0] = 64; 470 | pstBlackLevel->au16BlackLevel[1] = 64; 471 | pstBlackLevel->au16BlackLevel[2] = 64; 472 | pstBlackLevel->au16BlackLevel[3] = 64; 473 | 474 | 475 | return 0; 476 | 477 | } 478 | 479 | HI_VOID cmos_set_pixel_detect(HI_BOOL bEnable) 480 | { 481 | if (bEnable) /* setup for ISP pixel calibration mode */ 482 | { 483 | //set frame rate 484 | sensor_write_register(0x380E, 0x19); 485 | sensor_write_register(0x380F, 0xE0); 486 | 487 | //set exposure time 488 | sensor_write_register(0x3500, 0x01); 489 | sensor_write_register(0x3501, 0x9D); 490 | sensor_write_register(0x3502, 0x00); 491 | 492 | //set gain 493 | sensor_write_register(0x350A, 0x00); 494 | sensor_write_register(0x350B, 0x00); 495 | 496 | } 497 | else /* setup for ISP 'normal mode' */ 498 | { 499 | sensor_write_register(0x380E, 0x04); 500 | sensor_write_register(0x380F, 0x50); 501 | 502 | sensor_write_register(0x3500, 0x00); 503 | sensor_write_register(0x3501, 0x44); 504 | sensor_write_register(0x3502, 0x00); 505 | 506 | bInit = HI_FALSE; 507 | } 508 | 509 | return; 510 | } 511 | 512 | HI_VOID cmos_set_wdr_mode(HI_U8 u8Mode) 513 | { 514 | bInit = HI_FALSE; 515 | 516 | switch(u8Mode) 517 | { 518 | case WDR_MODE_NONE: 519 | if (SENSOR_1080P_30FPS_MODE == gu8SensorImageMode) 520 | { 521 | gu32FullLinesStd = VMAX_OV2710_1080P30_LINEAR; 522 | } 523 | genSensorMode = WDR_MODE_NONE; 524 | printf("linear mode\n"); 525 | break; 526 | default: 527 | printf("NOT support this mode!\n"); 528 | return; 529 | break; 530 | } 531 | 532 | return; 533 | } 534 | 535 | HI_U32 cmos_get_sns_regs_info(ISP_SNS_REGS_INFO_S *pstSnsRegsInfo) 536 | { 537 | HI_S32 i; 538 | 539 | if (HI_FALSE == bInit) 540 | { 541 | g_stSnsRegsInfo.enSnsType = ISP_SNS_I2C_TYPE; 542 | g_stSnsRegsInfo.u8Cfg2ValidDelayMax = 2; 543 | g_stSnsRegsInfo.u32RegNum = 10; 544 | 545 | for (i = 0; i < g_stSnsRegsInfo.u32RegNum; i++) 546 | { 547 | g_stSnsRegsInfo.astI2cData[i].bUpdate = HI_TRUE; 548 | g_stSnsRegsInfo.astI2cData[i].u8DevAddr = sensor_i2c_addr; 549 | g_stSnsRegsInfo.astI2cData[i].u32AddrByteNum = sensor_addr_byte; 550 | g_stSnsRegsInfo.astI2cData[i].u32DataByteNum = sensor_data_byte; 551 | } 552 | 553 | g_stSnsRegsInfo.astI2cData[0].u8DelayFrmNum = 0; //exposure time 554 | g_stSnsRegsInfo.astI2cData[0].u32RegAddr = 0x3500; 555 | g_stSnsRegsInfo.astI2cData[1].u8DelayFrmNum = 0; //exposure time 556 | g_stSnsRegsInfo.astI2cData[1].u32RegAddr = 0x3501; 557 | g_stSnsRegsInfo.astI2cData[2].u8DelayFrmNum = 0; 558 | g_stSnsRegsInfo.astI2cData[2].u32RegAddr = 0x3502; 559 | g_stSnsRegsInfo.astI2cData[3].u8DelayFrmNum = 1; 560 | g_stSnsRegsInfo.astI2cData[3].u32RegAddr = 0x3212; 561 | g_stSnsRegsInfo.astI2cData[3].u32Data = 0x00; 562 | g_stSnsRegsInfo.astI2cData[4].u8DelayFrmNum = 1; 563 | g_stSnsRegsInfo.astI2cData[4].u32RegAddr = 0x350a; //gain 564 | g_stSnsRegsInfo.astI2cData[5].u8DelayFrmNum = 1; 565 | g_stSnsRegsInfo.astI2cData[5].u32RegAddr = 0x350b; 566 | g_stSnsRegsInfo.astI2cData[6].u8DelayFrmNum = 1; 567 | g_stSnsRegsInfo.astI2cData[6].u32RegAddr = 0x3212; 568 | g_stSnsRegsInfo.astI2cData[6].u32Data = 0x10; 569 | g_stSnsRegsInfo.astI2cData[7].u8DelayFrmNum = 1; 570 | g_stSnsRegsInfo.astI2cData[7].u32RegAddr = 0x3212; 571 | g_stSnsRegsInfo.astI2cData[7].u32Data = 0xA0; 572 | 573 | g_stSnsRegsInfo.astI2cData[8].u8DelayFrmNum = 0; 574 | g_stSnsRegsInfo.astI2cData[8].u32RegAddr = 0x380e; 575 | g_stSnsRegsInfo.astI2cData[9].u8DelayFrmNum = 0; 576 | g_stSnsRegsInfo.astI2cData[9].u32RegAddr = 0x380f; 577 | 578 | bInit = HI_TRUE; 579 | } 580 | else 581 | { 582 | for (i = 0; i < g_stSnsRegsInfo.u32RegNum; i++) 583 | { 584 | if (g_stSnsRegsInfo.astI2cData[i].u32Data == g_stPreSnsRegsInfo.astI2cData[i].u32Data) 585 | { 586 | g_stSnsRegsInfo.astI2cData[i].bUpdate = HI_FALSE; 587 | } 588 | else 589 | { 590 | g_stSnsRegsInfo.astI2cData[i].bUpdate = HI_TRUE; 591 | } 592 | } 593 | 594 | g_stSnsRegsInfo.astI2cData[3].bUpdate = g_stSnsRegsInfo.astI2cData[4].bUpdate 595 | | g_stSnsRegsInfo.astI2cData[5].bUpdate; 596 | g_stSnsRegsInfo.astI2cData[6].bUpdate = g_stSnsRegsInfo.astI2cData[3].bUpdate; 597 | g_stSnsRegsInfo.astI2cData[7].bUpdate = g_stSnsRegsInfo.astI2cData[3].bUpdate; 598 | } 599 | 600 | if (HI_NULL == pstSnsRegsInfo) 601 | { 602 | printf("null pointer when get sns reg info!\n"); 603 | return -1; 604 | } 605 | 606 | memcpy(pstSnsRegsInfo, &g_stSnsRegsInfo, sizeof(ISP_SNS_REGS_INFO_S)); 607 | memcpy(&g_stPreSnsRegsInfo, &g_stSnsRegsInfo, sizeof(ISP_SNS_REGS_INFO_S)); 608 | 609 | return 0; 610 | } 611 | 612 | static HI_S32 cmos_set_image_mode(ISP_CMOS_SENSOR_IMAGE_MODE_S *pstSensorImageMode) 613 | { 614 | HI_U8 u8SensorImageMode = gu8SensorImageMode; 615 | 616 | bInit = HI_FALSE; 617 | 618 | if (HI_NULL == pstSensorImageMode ) 619 | { 620 | printf("null pointer when set image mode\n"); 621 | return -1; 622 | } 623 | 624 | if ((pstSensorImageMode->u16Width <= 1920) && (pstSensorImageMode->u16Height <= 1080)) 625 | { 626 | if (WDR_MODE_NONE == genSensorMode) 627 | { 628 | if (pstSensorImageMode->f32Fps <= 30) 629 | { 630 | u8SensorImageMode = SENSOR_1080P_30FPS_MODE; 631 | } 632 | else 633 | { 634 | printf("Not support! Width:%d, Height:%d, Fps:%f, WDRMode:%d\n", 635 | pstSensorImageMode->u16Width, 636 | pstSensorImageMode->u16Height, 637 | pstSensorImageMode->f32Fps, 638 | genSensorMode); 639 | 640 | return -1; 641 | } 642 | } 643 | else 644 | { 645 | printf("Not support! Width:%d, Height:%d, Fps:%f, WDRMode:%d\n", 646 | pstSensorImageMode->u16Width, 647 | pstSensorImageMode->u16Height, 648 | pstSensorImageMode->f32Fps, 649 | genSensorMode); 650 | 651 | return -1; 652 | } 653 | } 654 | else 655 | { 656 | printf("Not support! Width:%d, Height:%d, Fps:%f, WDRMode:%d\n", 657 | pstSensorImageMode->u16Width, 658 | pstSensorImageMode->u16Height, 659 | pstSensorImageMode->f32Fps, 660 | genSensorMode); 661 | 662 | return -1; 663 | } 664 | 665 | /* Sensor first init */ 666 | if (HI_FALSE == bSensorInit) 667 | { 668 | gu8SensorImageMode = u8SensorImageMode; 669 | 670 | return 0; 671 | } 672 | 673 | /* Switch SensorImageMode */ 674 | if (u8SensorImageMode == gu8SensorImageMode) 675 | { 676 | /* Don't need to switch SensorImageMode */ 677 | return -1; 678 | } 679 | 680 | gu8SensorImageMode = u8SensorImageMode; 681 | 682 | return 0; 683 | } 684 | 685 | HI_VOID sensor_global_init() 686 | { 687 | gu8SensorImageMode = SENSOR_1080P_30FPS_MODE; 688 | genSensorMode = WDR_MODE_NONE; 689 | gu32FullLinesStd = VMAX_OV2710_1080P30_LINEAR; 690 | gu32FullLines = VMAX_OV2710_1080P30_LINEAR; 691 | bInit = HI_FALSE; 692 | bSensorInit = HI_FALSE; 693 | 694 | memset(&g_stSnsRegsInfo, 0, sizeof(ISP_SNS_REGS_INFO_S)); 695 | memset(&g_stPreSnsRegsInfo, 0, sizeof(ISP_SNS_REGS_INFO_S)); 696 | } 697 | 698 | HI_S32 cmos_init_sensor_exp_function(ISP_SENSOR_EXP_FUNC_S *pstSensorExpFunc) 699 | { 700 | memset(pstSensorExpFunc, 0, sizeof(ISP_SENSOR_EXP_FUNC_S)); 701 | 702 | pstSensorExpFunc->pfn_cmos_sensor_init = sensor_init; 703 | pstSensorExpFunc->pfn_cmos_sensor_exit = sensor_exit; 704 | pstSensorExpFunc->pfn_cmos_sensor_global_init = sensor_global_init; 705 | pstSensorExpFunc->pfn_cmos_set_image_mode = cmos_set_image_mode; 706 | pstSensorExpFunc->pfn_cmos_set_wdr_mode = cmos_set_wdr_mode; 707 | 708 | pstSensorExpFunc->pfn_cmos_get_isp_default = cmos_get_isp_default; 709 | pstSensorExpFunc->pfn_cmos_get_isp_black_level = cmos_get_isp_black_level; 710 | pstSensorExpFunc->pfn_cmos_set_pixel_detect = cmos_set_pixel_detect; 711 | pstSensorExpFunc->pfn_cmos_get_sns_reg_info = cmos_get_sns_regs_info; 712 | 713 | return 0; 714 | } 715 | 716 | /**************************************************************************** 717 | * callback structure * 718 | ****************************************************************************/ 719 | 720 | int sensor_register_callback(void) 721 | { 722 | ISP_DEV IspDev = 0; 723 | HI_S32 s32Ret; 724 | ALG_LIB_S stLib; 725 | ISP_SENSOR_REGISTER_S stIspRegister; 726 | AE_SENSOR_REGISTER_S stAeRegister; 727 | AWB_SENSOR_REGISTER_S stAwbRegister; 728 | 729 | cmos_init_sensor_exp_function(&stIspRegister.stSnsExp); 730 | s32Ret = HI_MPI_ISP_SensorRegCallBack(IspDev, OV2710_ID, &stIspRegister); 731 | if (s32Ret) 732 | { 733 | printf("sensor register callback function failed!\n"); 734 | return s32Ret; 735 | } 736 | 737 | stLib.s32Id = 0; 738 | strncpy(stLib.acLibName, HI_AE_LIB_NAME, sizeof(HI_AE_LIB_NAME)); 739 | cmos_init_ae_exp_function(&stAeRegister.stSnsExp); 740 | s32Ret = HI_MPI_AE_SensorRegCallBack(IspDev, &stLib, OV2710_ID, &stAeRegister); 741 | if (s32Ret) 742 | { 743 | printf("sensor register callback function to ae lib failed!\n"); 744 | return s32Ret; 745 | } 746 | 747 | stLib.s32Id = 0; 748 | strncpy(stLib.acLibName, HI_AWB_LIB_NAME, sizeof(HI_AWB_LIB_NAME)); 749 | cmos_init_awb_exp_function(&stAwbRegister.stSnsExp); 750 | s32Ret = HI_MPI_AWB_SensorRegCallBack(IspDev, &stLib, OV2710_ID, &stAwbRegister); 751 | if (s32Ret) 752 | { 753 | printf("sensor register callback function to ae lib failed!\n"); 754 | return s32Ret; 755 | } 756 | 757 | return 0; 758 | } 759 | 760 | int sensor_unregister_callback(void) 761 | { 762 | ISP_DEV IspDev = 0; 763 | HI_S32 s32Ret; 764 | ALG_LIB_S stLib; 765 | 766 | s32Ret = HI_MPI_ISP_SensorUnRegCallBack(IspDev, OV2710_ID); 767 | if (s32Ret) 768 | { 769 | printf("sensor unregister callback function failed!\n"); 770 | return s32Ret; 771 | } 772 | 773 | stLib.s32Id = 0; 774 | strncpy(stLib.acLibName, HI_AE_LIB_NAME, sizeof(HI_AE_LIB_NAME)); 775 | s32Ret = HI_MPI_AE_SensorUnRegCallBack(IspDev, &stLib, OV2710_ID); 776 | if (s32Ret) 777 | { 778 | printf("sensor unregister callback function to ae lib failed!\n"); 779 | return s32Ret; 780 | } 781 | 782 | stLib.s32Id = 0; 783 | strncpy(stLib.acLibName, HI_AWB_LIB_NAME, sizeof(HI_AWB_LIB_NAME)); 784 | s32Ret = HI_MPI_AWB_SensorUnRegCallBack(IspDev, &stLib, OV2710_ID); 785 | if (s32Ret) 786 | { 787 | printf("sensor unregister callback function to ae lib failed!\n"); 788 | return s32Ret; 789 | } 790 | 791 | return 0; 792 | } 793 | 794 | #ifdef __cplusplus 795 | #if __cplusplus 796 | } 797 | #endif 798 | #endif /* End of #ifdef __cplusplus */ 799 | 800 | #endif /* __SOIOV2710_CMOS_H_ */ 801 | -------------------------------------------------------------------------------- /hisilicon/sources/os05a_i2c_unknown_hi3516av200_rev1/os05a_sensor_ctl.c: -------------------------------------------------------------------------------- 1 | /****************************************************************************** 2 | 3 | Copyright (C), 2001-2013, Hisilicon Tech. Co., Ltd. 4 | 5 | ****************************************************************************** 6 | File Name : os05a_sensor_ctl.c 7 | Version : Initial Draft 8 | Author : Hisilicon BVT ISP group 9 | Created : 2017/08/22 10 | Description : Sony os05a sensor driver 11 | History : 12 | 1.Date : 2017/08/22 13 | Author : yy 14 | Modification : Created file 15 | 16 | ******************************************************************************/ 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | #include "hi_comm_video.h" 27 | #include "hi_sns_ctrl.h" 28 | #include "mpi_sys.h" 29 | 30 | #ifdef HI_GPIO_I2C 31 | #include "gpioi2c_ex.h" 32 | #else 33 | #include "hi_i2c.h" 34 | #endif 35 | 36 | const unsigned char os05a_i2c_addr = 0x6c; /* I2C Address of OS05a */ //0x6c or 0x20 37 | const unsigned int os05a_addr_byte = 2; 38 | const unsigned int os05a_data_byte = 1; 39 | 40 | static int g_fd[ISP_MAX_DEV_NUM] = {-1, -1}; 41 | extern ISP_SNS_STATE_S g_astOs05a[ISP_MAX_DEV_NUM]; 42 | extern ISP_SNS_COMMBUS_U g_aunOs05aBusInfo[]; 43 | 44 | #define Os05a_5M_2688x1944_12bit_linear30 (0) 45 | #define Os05a_5M_2688x1944_10bit_wdr30 (1) 46 | 47 | /* VI 297M */ 48 | void os05a_init_5M_2688x1944_10bit_wdr30(ISP_DEV IspDev); 49 | /* VI 250M */ 50 | void os05a_init_5M_2688x1944_12bit_linear30(ISP_DEV IspDev); 51 | 52 | int os05a_i2c_init(ISP_DEV IspDev) 53 | { 54 | char acDevFile[16] = {0}; 55 | HI_U8 u8DevNum; 56 | 57 | if(g_fd[IspDev] >= 0) 58 | { 59 | return 0; 60 | } 61 | #ifdef HI_GPIO_I2C 62 | int ret; 63 | 64 | g_fd[IspDev] = open("/dev/gpioi2c_ex", 0); 65 | if(g_fd[IspDev] < 0) 66 | { 67 | printf("Open gpioi2c_ex error!\n"); 68 | return -1; 69 | } 70 | #else 71 | int ret; 72 | u8DevNum = g_aunOs05aBusInfo[IspDev].s8I2cDev; 73 | snprintf_s(acDevFile, sizeof(acDevFile), sizeof(acDevFile)-1, "/dev/i2c-%d", u8DevNum); 74 | 75 | g_fd[IspDev] = open(acDevFile, O_RDWR); 76 | if(g_fd[IspDev] < 0) 77 | { 78 | printf("Open /dev/i2c-%d error!\n", IspDev); 79 | return -1; 80 | } 81 | 82 | ret = ioctl(g_fd[IspDev], I2C_SLAVE_FORCE, (os05a_i2c_addr>>1)); 83 | if (ret < 0) 84 | { 85 | printf("CMD_SET_DEV error!\n"); 86 | return ret; 87 | } 88 | #endif 89 | 90 | return 0; 91 | } 92 | 93 | int os05a_i2c_exit(ISP_DEV IspDev) 94 | { 95 | if (g_fd[IspDev] >= 0) 96 | { 97 | close(g_fd[IspDev]); 98 | g_fd[IspDev] = -1; 99 | return 0; 100 | } 101 | return -1; 102 | } 103 | 104 | #ifdef __HuaweiLite__ 105 | int os05a_write_register(ISP_DEV IspDev,int addr, int data) 106 | { 107 | if (0 > g_fd[IspDev]) 108 | { 109 | return 0; 110 | } 111 | 112 | #ifdef HI_GPIO_I2C 113 | i2c_data.dev_addr = os05a_i2c_addr; 114 | i2c_data.reg_addr = addr; 115 | i2c_data.addr_byte_num = os05a_addr_byte; 116 | i2c_data.data = data; 117 | i2c_data.data_byte_num = os05a_data_byte; 118 | 119 | ret = ioctl(g_fd[IspDev], GPIO_I2C_WRITE, &i2c_data); 120 | 121 | if (ret) 122 | { 123 | printf("GPIO-I2C write faild!\n"); 124 | return ret; 125 | } 126 | #else 127 | int idx = 0; 128 | int ret; 129 | char buf[8]; 130 | 131 | buf[idx++] = addr & 0xff; 132 | if (os05a_addr_byte == 2) 133 | { 134 | ret = ioctl(g_fd[IspDev], I2C_16BIT_REG, 1); 135 | buf[idx++] = (addr >> 8) & 0xff; 136 | } 137 | else 138 | { 139 | } 140 | 141 | buf[idx++] = data & 0xff; 142 | if (os05a_data_byte == 2) 143 | { 144 | } 145 | else 146 | { 147 | ret = ioctl(g_fd[IspDev], I2C_16BIT_DATA, 0); 148 | } 149 | 150 | ret = write(g_fd[IspDev], buf, os05a_addr_byte + os05a_data_byte); 151 | if(ret < 0) 152 | { 153 | printf("I2C_WRITE error!\n"); 154 | return -1; 155 | } 156 | 157 | #endif 158 | return 0; 159 | } 160 | #else 161 | int os05a_write_register(ISP_DEV IspDev, int addr, int data) 162 | { 163 | if (0 > g_fd[IspDev]) 164 | { 165 | printf("return\n"); 166 | return 0; 167 | } 168 | 169 | #ifdef HI_GPIO_I2C 170 | i2c_data.dev_addr = os05a_i2c_addr; 171 | i2c_data.reg_addr = addr; 172 | i2c_data.addr_byte_num = os05a_addr_byte; 173 | i2c_data.data = data; 174 | i2c_data.data_byte_num = os05a_data_byte; 175 | 176 | ret = ioctl(g_fd[IspDev], GPIO_I2C_WRITE, &i2c_data); 177 | 178 | if (ret) 179 | { 180 | printf("GPIO-I2C write faild!\n"); 181 | return ret; 182 | } 183 | #else 184 | int idx = 0; 185 | int ret; 186 | char buf[8]; 187 | 188 | if (os05a_addr_byte == 2) 189 | { 190 | buf[idx] = (addr >> 8) & 0xff; 191 | idx++; 192 | buf[idx] = addr & 0xff; 193 | idx++; 194 | } 195 | else 196 | { 197 | //buf[idx] = addr & 0xff; 198 | //idx++; 199 | } 200 | 201 | if (os05a_data_byte == 2) 202 | { 203 | //buf[idx] = (data >> 8) & 0xff; 204 | //idx++; 205 | //buf[idx] = data & 0xff; 206 | //idx++; 207 | } 208 | else 209 | { 210 | buf[idx] = data & 0xff; 211 | idx++; 212 | } 213 | 214 | ret = write(g_fd[IspDev], buf, os05a_addr_byte + os05a_data_byte); 215 | if(ret < 0) 216 | { 217 | printf("I2C_WRITE error!\n"); 218 | return -1; 219 | } 220 | 221 | #endif 222 | return 0; 223 | } 224 | #endif 225 | 226 | int os05a_read_register(ISP_DEV IspDev,int addr) 227 | { 228 | // TODO: 229 | return 0; 230 | } 231 | /* 232 | static void delay_ms(int ms) 233 | { 234 | hi_usleep(ms*1000); 235 | } 236 | */ 237 | void os05a_standby(ISP_DEV IspDev) 238 | { 239 | // TODO: 240 | return; 241 | } 242 | 243 | void os05a_restart(ISP_DEV IspDev) 244 | { 245 | // TODO: 246 | return; 247 | } 248 | 249 | void os05a_init(ISP_DEV IspDev) 250 | { 251 | HI_U8 u8ImgMode; 252 | HI_U32 i; 253 | u8ImgMode = g_astOs05a[IspDev].u8ImgMode; 254 | 255 | /* 2. imx326 i2c init */ 256 | os05a_i2c_init(IspDev); 257 | 258 | /* When sensor first init, config all registers */ 259 | switch(u8ImgMode) 260 | { 261 | case Os05a_5M_2688x1944_12bit_linear30: 262 | os05a_init_5M_2688x1944_12bit_linear30(IspDev); 263 | g_astOs05a[IspDev].bInit = HI_TRUE; 264 | break; 265 | 266 | case Os05a_5M_2688x1944_10bit_wdr30: 267 | os05a_init_5M_2688x1944_10bit_wdr30(IspDev); 268 | g_astOs05a[IspDev].bInit = HI_TRUE; 269 | break; 270 | 271 | default: 272 | printf("Not support this mode\n"); 273 | break; 274 | } 275 | 276 | for (i=0; i 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include "hi_comm_video.h" 26 | #include "hi_sns_ctrl.h" 27 | #include "mpi_sys.h" 28 | 29 | #ifdef HI_GPIO_I2C 30 | #include "gpioi2c_ex.h" 31 | #else 32 | #include "hi_i2c.h" 33 | #endif 34 | 35 | const unsigned char imx326_i2c_addr = 0x34; /* I2C Address of imx377 */ 36 | const unsigned int imx326_addr_byte = 2; 37 | const unsigned int imx326_data_byte = 1; 38 | 39 | static int g_fd[ISP_MAX_DEV_NUM] = {-1,-1}; 40 | extern ISP_SNS_STATE_S g_astImx326[ISP_MAX_DEV_NUM]; 41 | extern ISP_SNS_COMMBUS_U g_aunImx326BusInfo[]; 42 | 43 | #define IMX326_3072x1728_5M_30FPS_12BIT_LINEAR_MODE 1 44 | #define IMX326_2592x1944_5M_30FPS_12BIT_LINEAR_MODE 2 45 | #define IMX326_2560x1440_4M_30FPS_12BIT_LINEAR_MODE 3 46 | #define IMX326_1920x1080_2M_30FPS_12BIT_LINEAR_MODE 4 47 | 48 | void imx326_linear_3072x1728_5M30fps_init(ISP_DEV IspDev); 49 | void imx326_linear_2592x1944_5M30fps_init(ISP_DEV IspDev); 50 | void imx326_linear_2560x1440_4M30fps_init(ISP_DEV IspDev); 51 | void imx326_linear_1920x1080_2M30fps_init(ISP_DEV IspDev); 52 | 53 | int imx326_i2c_init(ISP_DEV IspDev) 54 | { 55 | char acDevFile[16] = {0}; 56 | HI_U8 u8DevNum; 57 | 58 | if(g_fd[IspDev] >= 0) 59 | { 60 | return 0; 61 | } 62 | #ifdef HI_GPIO_I2C 63 | int ret; 64 | 65 | g_fd[IspDev] = open("/dev/gpioi2c_ex", 0); 66 | if(g_fd[IspDev] < 0) 67 | { 68 | printf("Open gpioi2c_ex error!\n"); 69 | return -1; 70 | } 71 | #else 72 | int ret; 73 | u8DevNum = g_aunImx326BusInfo[IspDev].s8I2cDev; 74 | snprintf_s(acDevFile, sizeof(acDevFile), sizeof(acDevFile)-1, "/dev/i2c-%d", u8DevNum); 75 | 76 | g_fd[IspDev] = open(acDevFile, O_RDWR); 77 | if(g_fd[IspDev] < 0) 78 | { 79 | printf("Open /dev/i2c-%d error!\n", IspDev); 80 | return -1; 81 | } 82 | 83 | ret = ioctl(g_fd[IspDev], I2C_SLAVE_FORCE, (imx326_i2c_addr>>1)); 84 | if (ret < 0) 85 | { 86 | printf("CMD_SET_DEV error!\n"); 87 | return ret; 88 | } 89 | #endif 90 | 91 | return 0; 92 | } 93 | 94 | int imx326_i2c_exit(ISP_DEV IspDev) 95 | { 96 | if (g_fd[IspDev] >= 0) 97 | { 98 | close(g_fd[IspDev]); 99 | g_fd[IspDev] = -1; 100 | return 0; 101 | } 102 | return -1; 103 | } 104 | 105 | #ifdef __HuaweiLite__ 106 | int imx326_write_register(ISP_DEV IspDev,int addr, int data) 107 | { 108 | if (0 > g_fd[IspDev]) 109 | { 110 | return 0; 111 | } 112 | 113 | #ifdef HI_GPIO_I2C 114 | i2c_data.dev_addr = imx326_i2c_addr; 115 | i2c_data.reg_addr = addr; 116 | i2c_data.addr_byte_num = imx326_addr_byte; 117 | i2c_data.data = data; 118 | i2c_data.data_byte_num = imx326_data_byte; 119 | 120 | ret = ioctl(g_fd[IspDev], GPIO_I2C_WRITE, &i2c_data); 121 | 122 | if (ret) 123 | { 124 | printf("GPIO-I2C write faild!\n"); 125 | return ret; 126 | } 127 | #else 128 | int idx = 0; 129 | int ret; 130 | char buf[8]; 131 | 132 | buf[idx++] = addr & 0xff; 133 | if (imx326_addr_byte == 2) 134 | { 135 | ret = ioctl(g_fd[IspDev], I2C_16BIT_REG, 1); 136 | buf[idx++] = (addr >> 8) & 0xff; 137 | } 138 | else 139 | { 140 | } 141 | 142 | buf[idx++] = data & 0xff; 143 | if (imx326_data_byte == 2) 144 | { 145 | } 146 | else 147 | { 148 | ret = ioctl(g_fd[IspDev], I2C_16BIT_DATA, 0); 149 | } 150 | 151 | ret = write(g_fd[IspDev], buf, imx326_addr_byte + imx326_data_byte); 152 | if(ret < 0) 153 | { 154 | printf("I2C_WRITE error!\n"); 155 | return -1; 156 | } 157 | 158 | #endif 159 | return 0; 160 | } 161 | #else 162 | int imx326_write_register(ISP_DEV IspDev, int addr, int data) 163 | { 164 | if (0 > g_fd[IspDev]) 165 | { 166 | printf("return\n"); 167 | return 0; 168 | } 169 | 170 | #ifdef HI_GPIO_I2C 171 | i2c_data.dev_addr = imx326_i2c_addr; 172 | i2c_data.reg_addr = addr; 173 | i2c_data.addr_byte_num = imx326_addr_byte; 174 | i2c_data.data = data; 175 | i2c_data.data_byte_num = imx326_data_byte; 176 | 177 | ret = ioctl(g_fd[IspDev], GPIO_I2C_WRITE, &i2c_data); 178 | 179 | if (ret) 180 | { 181 | printf("GPIO-I2C write faild!\n"); 182 | return ret; 183 | } 184 | #else 185 | int idx = 0; 186 | int ret; 187 | char buf[8]; 188 | 189 | if (imx326_addr_byte == 2) 190 | { 191 | buf[idx] = (addr >> 8) & 0xff; 192 | idx++; 193 | buf[idx] = addr & 0xff; 194 | idx++; 195 | } 196 | else 197 | { 198 | //buf[idx] = addr & 0xff; 199 | //idx++; 200 | } 201 | 202 | if (imx326_data_byte == 2) 203 | { 204 | //buf[idx] = (data >> 8) & 0xff; 205 | //idx++; 206 | //buf[idx] = data & 0xff; 207 | //idx++; 208 | } 209 | else 210 | { 211 | buf[idx] = data & 0xff; 212 | idx++; 213 | } 214 | 215 | ret = write(g_fd[IspDev], buf, imx326_addr_byte + imx326_data_byte); 216 | if(ret < 0) 217 | { 218 | printf("I2C_WRITE error!\n"); 219 | return -1; 220 | } 221 | 222 | #endif 223 | return 0; 224 | } 225 | #endif 226 | 227 | int imx326_read_register(ISP_DEV IspDev,int addr) 228 | { 229 | // TODO: 230 | return 0; 231 | } 232 | 233 | static void delay_ms(int ms) 234 | { 235 | hi_usleep(ms*1000); 236 | } 237 | 238 | void imx326_standby(ISP_DEV IspDev) 239 | { 240 | // TODO: 241 | return; 242 | } 243 | 244 | void imx326_restart(ISP_DEV IspDev) 245 | { 246 | // TODO: 247 | return; 248 | } 249 | 250 | void imx326_init(ISP_DEV IspDev) 251 | { 252 | HI_U8 u8ImgMode; 253 | HI_U32 i; 254 | u8ImgMode = g_astImx326[IspDev].u8ImgMode; 255 | 256 | /* 2. imx326 spi init */ 257 | imx326_i2c_init(IspDev); 258 | 259 | /* When sensor first init, config all registers */ 260 | switch(u8ImgMode) 261 | { 262 | case IMX326_3072x1728_5M_30FPS_12BIT_LINEAR_MODE: 263 | imx326_linear_3072x1728_5M30fps_init(IspDev); 264 | break; 265 | 266 | case IMX326_2592x1944_5M_30FPS_12BIT_LINEAR_MODE: 267 | imx326_linear_2592x1944_5M30fps_init(IspDev); 268 | break; 269 | 270 | case IMX326_2560x1440_4M_30FPS_12BIT_LINEAR_MODE: 271 | imx326_linear_2560x1440_4M30fps_init(IspDev); 272 | break; 273 | 274 | case IMX326_1920x1080_2M_30FPS_12BIT_LINEAR_MODE: 275 | imx326_linear_1920x1080_2M30fps_init(IspDev); 276 | break; 277 | 278 | default: 279 | printf("Not support this mode\n"); 280 | return; 281 | break; 282 | } 283 | 284 | for (i=0; i