Loading src/drivers/elphel/circbuf.c +2 −2 Original line number Diff line number Diff line Loading @@ -203,7 +203,7 @@ ssize_t circbuf_get_ptr(int sensor_port, size_t offset, size_t len, struct fvec return ret; } EXPORT_SYMBOL_GPL(circbuf_get_ptr); EXPORT_SYMBOL_GPL(circbuf_get_ptr); // @suppress("Unused function declaration") it is still needed /** * @brief Process circular buffer file opening and define further action in accordance Loading Loading @@ -1026,7 +1026,7 @@ static struct platform_driver elphel393_circbuf = { }, }; module_platform_driver(elphel393_circbuf); module_platform_driver(elphel393_circbuf); // @suppress("Unused variable declaration in file scope") because MODULE_LICENSE("GPL"); MODULE_AUTHOR("Andrey Filippov <andrey@elphel.com>."); Loading src/drivers/elphel/cxi2c.c +0 −1 Original line number Diff line number Diff line Loading @@ -100,7 +100,6 @@ //#include <linux/of_fdt.h> //#include <linux/of_net.h> #include <linux/sysfs.h> #include <linux/uaccess.h> #include <asm/delay.h> #include <asm/uaccess.h> Loading src/drivers/elphel/detect_sensors.c +15 −40 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ #include "mt9x001.h" #include "mt9f002.h" #include "multi10359.h" #include "lepton.h" #include "detect_sensors.h" #define DETECT_SENSORS_MODULE_DESCRIPTION "Detect sensor type(s) attached to each of the ports" Loading Loading @@ -78,6 +79,7 @@ const struct sensor_name_t sensor_names[] ={ {.name="mt9f002", .type=1, .iface=HISPI4, .code = SENSOR_MT9F002}, // MT9F002 {.name="ibis51300", .type=1, .iface=PARALLEL12, .code = SENSOR_IBIS51300}, // FillFactory IBIS51300 {.name="kai11002", .type=1, .iface=PARALLEL12, .code = SENSOR_KAI11000}, // Kodak KAI11002 {.name="lepton35", .type=1, .iface=VOSPI, .code = SENSOR_LEPTON35}, // Kodak KAI11002 {.name=NULL, .type=0, .iface=NONE, .code = 0} // end of list }; static sens_iface_t port_iface[SENSOR_PORTS]; Loading Loading @@ -182,7 +184,8 @@ void update_port_iface(int port) ///< Sensor port number (0..3) port_iface[port] = iface; return; } port_iface[port] = get_iface_by_code(get_detected_sensor_code(port,-1), DETECT_MUX); // '-1' - any subchannel //TODO: Check with 10359. was port_iface[port] = get_iface_by_code(get_detected_sensor_code(port,-1), DETECT_MUX); port_iface[port] = get_iface_by_code(get_detected_sensor_code(port,-1), DETECT_SENSOR); // '-1' - any subchannel } /** Get per-port interface type */ Loading Loading @@ -369,6 +372,7 @@ static int elphel393_detect_sensors_sysfs_register(struct platform_device *pdev) char names[4][80]; struct device_node *node = pdev->dev.of_node; int num_ports, port, num_sub, sub_chn; int scode; if (node) { config_string = of_get_property(node, OF_PREFIX_NAME",port-mux", NULL); // &len); pr_info ("Mux config_string = %s (was looking for '%s')\n",config_string, OF_PREFIX_NAME",port-mux"); Loading Loading @@ -396,6 +400,10 @@ static int elphel393_detect_sensors_sysfs_register(struct platform_device *pdev) num_sub = sscanf(config_string,"%79s %79s %79s %79s", names[0], names[1], names[2], names[3]); pr_info ("port %d : %d subchannels\n",port, num_sub); for (sub_chn = 0; sub_chn < num_sub; sub_chn++){ scode = get_code_by_name(names[sub_chn], DETECT_SENSOR); if (scode < 0){ pr_err("Invalid sensor/mux name found in device tree: %s\n",names[sub_chn]); } pr_info ("Setting sensor %d:%d '%s' (0x%x)\n",port, sub_chn, names[sub_chn], get_code_by_name(names[sub_chn], DETECT_SENSOR)); set_detected_sensor_code(port, sub_chn, get_code_by_name(names[sub_chn], DETECT_SENSOR)); init_port_ahead_table(port,sub_chn); Loading Loading @@ -458,7 +466,7 @@ int detect_sensors_par2addr_init(int port,int sub_chn){ u16 haddr2rec[MAX_SENSORS][MAX_FPGA_RECS]; ///< Big LUT (but almost empty). Sensor's page address (haddr of reg addr) to fpga i2c record number (fpga line#) }; */ dev_info(g_dev_ptr,"detect_sensors_par2addr_init(): sensorPortConfig[%d].sensor[%d] = 0x%x\n",port, sub_chn, sensorPortConfig[port].sensor[sub_chn]); switch (sensorPortConfig[port].sensor[sub_chn]) { case SENSOR_MT9P006: // get sensor table Loading @@ -472,6 +480,11 @@ int detect_sensors_par2addr_init(int port,int sub_chn){ pages = mt9f002_pages; atab = mt9f002_ahead_tab; break; case SENSOR_LEPTON35: par2addr = lepton_par2addr; pages = lepton_pages; atab = lepton_ahead_tab; break; } if (par2addr){ // convert to key-value Loading @@ -483,44 +496,6 @@ int detect_sensors_par2addr_init(int port,int sub_chn){ sensorPortConfig[port].ahead_tab[sub_chn] = atab; } /* // all .mux and .sensor are already filled out for (portx = 0; portx < SENSOR_PORTS; portx++){ // that's from device tree, fpga is not programmed yet dev_dbg(g_dev_ptr,"port: %d mux: %d sensors: %d %d %d %d\n", portx, sensorPortConfig[portx].mux, sensorPortConfig[portx].sensor[0], sensorPortConfig[portx].sensor[1], sensorPortConfig[portx].sensor[2], sensorPortConfig[portx].sensor[3] ); // sub_chn = 3 is never used for (sub_chn = 0; sub_chn < 4; sub_chn++){ //sensorPortConfig[port].sensor[sub_chn]; switch (sensorPortConfig[portx].sensor[sub_chn]) { case SENSOR_MT9P006: // get sensor table par2addr = mt9x001_par2addr; pages = mt9x001_pages; break; case SENSOR_MT9F002: // get sensor table par2addr = mt9f002_par2addr; pages = mt9f002_pages; break; } if (par2addr){ // convert to key-value par2addr_fill(par2addr,sensorPortConfig[portx].par2addr[sub_chn]); // save pointer to static LUT sensorPortConfig[portx].pages_ptr[sub_chn] = pages; } } } */ return 0; } Loading src/drivers/elphel/detect_sensors.h +1 −1 Original line number Diff line number Diff line Loading @@ -45,7 +45,7 @@ struct sensor_port_config_t { extern struct sensor_port_config_t *pSensorPortConfig; typedef enum {NONE,PARALLEL12,HISPI4} sens_iface_t; ///< Sensor port interface type typedef enum {NONE,PARALLEL12,HISPI4,VOSPI} sens_iface_t; ///< Sensor port interface type int get_code_by_name(const char * name, int type); const char * get_name_by_code(int code, int type); Loading src/drivers/elphel/elphel393-mem.c +11 −11 Original line number Diff line number Diff line Loading @@ -294,46 +294,46 @@ static int __init elphelmem_init(void) pr_err("ERROR allocating Bidirectional DMA memory buffer\n"); } pr_info("Coherent buffer vaddr: 0x%08X\n",(u32) pElphel_buf -> vaddr); pr_info("Coherent buffer paddr: 0x%08X\n",(u32) pElphel_buf -> paddr); pr_info("Coherent buffer length: 0x%08X\n",(u32) pElphel_buf -> size * PAGE_SIZE); pr_info("Coherent buffer vaddr: 0x%08x\n",(u32) pElphel_buf -> vaddr); pr_info("Coherent buffer paddr: 0x%08x\n",(u32) pElphel_buf -> paddr); pr_info("Coherent buffer length: 0x%08lx\n",(u32) pElphel_buf -> size * PAGE_SIZE); pr_info(" circbuf channel 0 vaddr: 0x%08X paddr: 0x%08X length 0x%08X\n", pr_info(" circbuf channel 0 vaddr: 0x%08x paddr: 0x%08x length 0x%08lx\n", (u32) pElphel_buf -> circbuf_chn0_vaddr, (u32) pElphel_buf -> circbuf_chn0_paddr, (u32) pElphel_buf-> circbuf_chn0_size * PAGE_SIZE); pr_info(" circbuf channel 1 vaddr: 0x%08X paddr: 0x%08X length 0x%08X\n", pr_info(" circbuf channel 1 vaddr: 0x%08x paddr: 0x%08x length 0x%08lx\n", (u32) pElphel_buf -> circbuf_chn1_vaddr, (u32) pElphel_buf -> circbuf_chn1_paddr, (u32) pElphel_buf-> circbuf_chn1_size * PAGE_SIZE); pr_info(" circbuf channel 2 vaddr: 0x%08X paddr: 0x%08X length 0x%08X\n", pr_info(" circbuf channel 2 vaddr: 0x%08x paddr: 0x%08x length 0x%08lx\n", (u32) pElphel_buf -> circbuf_chn2_vaddr, (u32) pElphel_buf -> circbuf_chn2_paddr, (u32) pElphel_buf-> circbuf_chn2_size * PAGE_SIZE); pr_info(" circbuf channel 3 vaddr: 0x%08X paddr: 0x%08X length 0x%08X\n", pr_info(" circbuf channel 3 vaddr: 0x%08x paddr: 0x%08x length 0x%08lx\n", (u32) pElphel_buf -> circbuf_chn3_vaddr, (u32) pElphel_buf -> circbuf_chn3_paddr, (u32) pElphel_buf-> circbuf_chn3_size * PAGE_SIZE); pr_info(" raw channel 0 vaddr: 0x%08X paddr: 0x%08X length 0x%08X\n", pr_info(" raw channel 0 vaddr: 0x%08x paddr: 0x%08x length 0x%08lx\n", (u32) pElphel_buf -> raw_chn0_vaddr, (u32) pElphel_buf -> raw_chn0_paddr, (u32) pElphel_buf-> raw_chn0_size * PAGE_SIZE); pr_info(" raw channel 1 vaddr: 0x%08X paddr: 0x%08X length 0x%08X\n", pr_info(" raw channel 1 vaddr: 0x%08x paddr: 0x%08x length 0x%08lx\n", (u32) pElphel_buf -> raw_chn1_vaddr, (u32) pElphel_buf -> raw_chn1_paddr, (u32) pElphel_buf-> raw_chn1_size * PAGE_SIZE); pr_info(" raw channel 2 vaddr: 0x%08X paddr: 0x%08X length 0x%08X\n", pr_info(" raw channel 2 vaddr: 0x%08x paddr: 0x%08x length 0x%08lx\n", (u32) pElphel_buf -> raw_chn2_vaddr, (u32) pElphel_buf -> raw_chn2_paddr, (u32) pElphel_buf-> raw_chn2_size * PAGE_SIZE); pr_info(" raw channel 3 vaddr: 0x%08X paddr: 0x%08X length 0x%08X\n", pr_info(" raw channel 3 vaddr: 0x%08x paddr: 0x%08x length 0x%08lx\n", (u32) pElphel_buf -> raw_chn3_vaddr, (u32) pElphel_buf -> raw_chn3_paddr, (u32) pElphel_buf-> raw_chn3_size * PAGE_SIZE); Loading Loading
src/drivers/elphel/circbuf.c +2 −2 Original line number Diff line number Diff line Loading @@ -203,7 +203,7 @@ ssize_t circbuf_get_ptr(int sensor_port, size_t offset, size_t len, struct fvec return ret; } EXPORT_SYMBOL_GPL(circbuf_get_ptr); EXPORT_SYMBOL_GPL(circbuf_get_ptr); // @suppress("Unused function declaration") it is still needed /** * @brief Process circular buffer file opening and define further action in accordance Loading Loading @@ -1026,7 +1026,7 @@ static struct platform_driver elphel393_circbuf = { }, }; module_platform_driver(elphel393_circbuf); module_platform_driver(elphel393_circbuf); // @suppress("Unused variable declaration in file scope") because MODULE_LICENSE("GPL"); MODULE_AUTHOR("Andrey Filippov <andrey@elphel.com>."); Loading
src/drivers/elphel/cxi2c.c +0 −1 Original line number Diff line number Diff line Loading @@ -100,7 +100,6 @@ //#include <linux/of_fdt.h> //#include <linux/of_net.h> #include <linux/sysfs.h> #include <linux/uaccess.h> #include <asm/delay.h> #include <asm/uaccess.h> Loading
src/drivers/elphel/detect_sensors.c +15 −40 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ #include "mt9x001.h" #include "mt9f002.h" #include "multi10359.h" #include "lepton.h" #include "detect_sensors.h" #define DETECT_SENSORS_MODULE_DESCRIPTION "Detect sensor type(s) attached to each of the ports" Loading Loading @@ -78,6 +79,7 @@ const struct sensor_name_t sensor_names[] ={ {.name="mt9f002", .type=1, .iface=HISPI4, .code = SENSOR_MT9F002}, // MT9F002 {.name="ibis51300", .type=1, .iface=PARALLEL12, .code = SENSOR_IBIS51300}, // FillFactory IBIS51300 {.name="kai11002", .type=1, .iface=PARALLEL12, .code = SENSOR_KAI11000}, // Kodak KAI11002 {.name="lepton35", .type=1, .iface=VOSPI, .code = SENSOR_LEPTON35}, // Kodak KAI11002 {.name=NULL, .type=0, .iface=NONE, .code = 0} // end of list }; static sens_iface_t port_iface[SENSOR_PORTS]; Loading Loading @@ -182,7 +184,8 @@ void update_port_iface(int port) ///< Sensor port number (0..3) port_iface[port] = iface; return; } port_iface[port] = get_iface_by_code(get_detected_sensor_code(port,-1), DETECT_MUX); // '-1' - any subchannel //TODO: Check with 10359. was port_iface[port] = get_iface_by_code(get_detected_sensor_code(port,-1), DETECT_MUX); port_iface[port] = get_iface_by_code(get_detected_sensor_code(port,-1), DETECT_SENSOR); // '-1' - any subchannel } /** Get per-port interface type */ Loading Loading @@ -369,6 +372,7 @@ static int elphel393_detect_sensors_sysfs_register(struct platform_device *pdev) char names[4][80]; struct device_node *node = pdev->dev.of_node; int num_ports, port, num_sub, sub_chn; int scode; if (node) { config_string = of_get_property(node, OF_PREFIX_NAME",port-mux", NULL); // &len); pr_info ("Mux config_string = %s (was looking for '%s')\n",config_string, OF_PREFIX_NAME",port-mux"); Loading Loading @@ -396,6 +400,10 @@ static int elphel393_detect_sensors_sysfs_register(struct platform_device *pdev) num_sub = sscanf(config_string,"%79s %79s %79s %79s", names[0], names[1], names[2], names[3]); pr_info ("port %d : %d subchannels\n",port, num_sub); for (sub_chn = 0; sub_chn < num_sub; sub_chn++){ scode = get_code_by_name(names[sub_chn], DETECT_SENSOR); if (scode < 0){ pr_err("Invalid sensor/mux name found in device tree: %s\n",names[sub_chn]); } pr_info ("Setting sensor %d:%d '%s' (0x%x)\n",port, sub_chn, names[sub_chn], get_code_by_name(names[sub_chn], DETECT_SENSOR)); set_detected_sensor_code(port, sub_chn, get_code_by_name(names[sub_chn], DETECT_SENSOR)); init_port_ahead_table(port,sub_chn); Loading Loading @@ -458,7 +466,7 @@ int detect_sensors_par2addr_init(int port,int sub_chn){ u16 haddr2rec[MAX_SENSORS][MAX_FPGA_RECS]; ///< Big LUT (but almost empty). Sensor's page address (haddr of reg addr) to fpga i2c record number (fpga line#) }; */ dev_info(g_dev_ptr,"detect_sensors_par2addr_init(): sensorPortConfig[%d].sensor[%d] = 0x%x\n",port, sub_chn, sensorPortConfig[port].sensor[sub_chn]); switch (sensorPortConfig[port].sensor[sub_chn]) { case SENSOR_MT9P006: // get sensor table Loading @@ -472,6 +480,11 @@ int detect_sensors_par2addr_init(int port,int sub_chn){ pages = mt9f002_pages; atab = mt9f002_ahead_tab; break; case SENSOR_LEPTON35: par2addr = lepton_par2addr; pages = lepton_pages; atab = lepton_ahead_tab; break; } if (par2addr){ // convert to key-value Loading @@ -483,44 +496,6 @@ int detect_sensors_par2addr_init(int port,int sub_chn){ sensorPortConfig[port].ahead_tab[sub_chn] = atab; } /* // all .mux and .sensor are already filled out for (portx = 0; portx < SENSOR_PORTS; portx++){ // that's from device tree, fpga is not programmed yet dev_dbg(g_dev_ptr,"port: %d mux: %d sensors: %d %d %d %d\n", portx, sensorPortConfig[portx].mux, sensorPortConfig[portx].sensor[0], sensorPortConfig[portx].sensor[1], sensorPortConfig[portx].sensor[2], sensorPortConfig[portx].sensor[3] ); // sub_chn = 3 is never used for (sub_chn = 0; sub_chn < 4; sub_chn++){ //sensorPortConfig[port].sensor[sub_chn]; switch (sensorPortConfig[portx].sensor[sub_chn]) { case SENSOR_MT9P006: // get sensor table par2addr = mt9x001_par2addr; pages = mt9x001_pages; break; case SENSOR_MT9F002: // get sensor table par2addr = mt9f002_par2addr; pages = mt9f002_pages; break; } if (par2addr){ // convert to key-value par2addr_fill(par2addr,sensorPortConfig[portx].par2addr[sub_chn]); // save pointer to static LUT sensorPortConfig[portx].pages_ptr[sub_chn] = pages; } } } */ return 0; } Loading
src/drivers/elphel/detect_sensors.h +1 −1 Original line number Diff line number Diff line Loading @@ -45,7 +45,7 @@ struct sensor_port_config_t { extern struct sensor_port_config_t *pSensorPortConfig; typedef enum {NONE,PARALLEL12,HISPI4} sens_iface_t; ///< Sensor port interface type typedef enum {NONE,PARALLEL12,HISPI4,VOSPI} sens_iface_t; ///< Sensor port interface type int get_code_by_name(const char * name, int type); const char * get_name_by_code(int code, int type); Loading
src/drivers/elphel/elphel393-mem.c +11 −11 Original line number Diff line number Diff line Loading @@ -294,46 +294,46 @@ static int __init elphelmem_init(void) pr_err("ERROR allocating Bidirectional DMA memory buffer\n"); } pr_info("Coherent buffer vaddr: 0x%08X\n",(u32) pElphel_buf -> vaddr); pr_info("Coherent buffer paddr: 0x%08X\n",(u32) pElphel_buf -> paddr); pr_info("Coherent buffer length: 0x%08X\n",(u32) pElphel_buf -> size * PAGE_SIZE); pr_info("Coherent buffer vaddr: 0x%08x\n",(u32) pElphel_buf -> vaddr); pr_info("Coherent buffer paddr: 0x%08x\n",(u32) pElphel_buf -> paddr); pr_info("Coherent buffer length: 0x%08lx\n",(u32) pElphel_buf -> size * PAGE_SIZE); pr_info(" circbuf channel 0 vaddr: 0x%08X paddr: 0x%08X length 0x%08X\n", pr_info(" circbuf channel 0 vaddr: 0x%08x paddr: 0x%08x length 0x%08lx\n", (u32) pElphel_buf -> circbuf_chn0_vaddr, (u32) pElphel_buf -> circbuf_chn0_paddr, (u32) pElphel_buf-> circbuf_chn0_size * PAGE_SIZE); pr_info(" circbuf channel 1 vaddr: 0x%08X paddr: 0x%08X length 0x%08X\n", pr_info(" circbuf channel 1 vaddr: 0x%08x paddr: 0x%08x length 0x%08lx\n", (u32) pElphel_buf -> circbuf_chn1_vaddr, (u32) pElphel_buf -> circbuf_chn1_paddr, (u32) pElphel_buf-> circbuf_chn1_size * PAGE_SIZE); pr_info(" circbuf channel 2 vaddr: 0x%08X paddr: 0x%08X length 0x%08X\n", pr_info(" circbuf channel 2 vaddr: 0x%08x paddr: 0x%08x length 0x%08lx\n", (u32) pElphel_buf -> circbuf_chn2_vaddr, (u32) pElphel_buf -> circbuf_chn2_paddr, (u32) pElphel_buf-> circbuf_chn2_size * PAGE_SIZE); pr_info(" circbuf channel 3 vaddr: 0x%08X paddr: 0x%08X length 0x%08X\n", pr_info(" circbuf channel 3 vaddr: 0x%08x paddr: 0x%08x length 0x%08lx\n", (u32) pElphel_buf -> circbuf_chn3_vaddr, (u32) pElphel_buf -> circbuf_chn3_paddr, (u32) pElphel_buf-> circbuf_chn3_size * PAGE_SIZE); pr_info(" raw channel 0 vaddr: 0x%08X paddr: 0x%08X length 0x%08X\n", pr_info(" raw channel 0 vaddr: 0x%08x paddr: 0x%08x length 0x%08lx\n", (u32) pElphel_buf -> raw_chn0_vaddr, (u32) pElphel_buf -> raw_chn0_paddr, (u32) pElphel_buf-> raw_chn0_size * PAGE_SIZE); pr_info(" raw channel 1 vaddr: 0x%08X paddr: 0x%08X length 0x%08X\n", pr_info(" raw channel 1 vaddr: 0x%08x paddr: 0x%08x length 0x%08lx\n", (u32) pElphel_buf -> raw_chn1_vaddr, (u32) pElphel_buf -> raw_chn1_paddr, (u32) pElphel_buf-> raw_chn1_size * PAGE_SIZE); pr_info(" raw channel 2 vaddr: 0x%08X paddr: 0x%08X length 0x%08X\n", pr_info(" raw channel 2 vaddr: 0x%08x paddr: 0x%08x length 0x%08lx\n", (u32) pElphel_buf -> raw_chn2_vaddr, (u32) pElphel_buf -> raw_chn2_paddr, (u32) pElphel_buf-> raw_chn2_size * PAGE_SIZE); pr_info(" raw channel 3 vaddr: 0x%08X paddr: 0x%08X length 0x%08X\n", pr_info(" raw channel 3 vaddr: 0x%08x paddr: 0x%08x length 0x%08lx\n", (u32) pElphel_buf -> raw_chn3_vaddr, (u32) pElphel_buf -> raw_chn3_paddr, (u32) pElphel_buf-> raw_chn3_size * PAGE_SIZE); Loading