Commit d78efbaa authored by Oleg Dzhimiev's avatar Oleg Dzhimiev
Browse files

fixed: moved interrupt enabling to membridge_start

parent d1be8f30
Loading
Loading
Loading
Loading
+18 −18
Original line number Original line Diff line number Diff line
@@ -14,7 +14,7 @@
*  You should have received a copy of the GNU General Public License
*  You should have received a copy of the GNU General Public License
*  along with this program.  If not, see <http://www.gnu.org/licenses/>.
*  along with this program.  If not, see <http://www.gnu.org/licenses/>.
*******************************************************************************/
*******************************************************************************/
//#define DEBUG
#define DEBUG
#include <linux/interrupt.h>
#include <linux/interrupt.h>
#include <linux/platform_device.h>
#include <linux/platform_device.h>
#include <linux/of_device.h>
#include <linux/of_device.h>
@@ -694,6 +694,23 @@ int membridge_start(int sensor_port, unsigned long target_frame){


	x393_status_membridge_t status;
	x393_status_membridge_t status;


	// to enable interrupt
    x393_membridge_ctrl_irq_t membridge_irq_en = {.d32=0};
	membridge_irq_en.interrupt_cmd = MEMBRIDGE_CMD_IRQ_EN;

	// check fpga
	if (!is_fpga_programmed()){
		pr_err("*** Attempted to access hardware without bitsteram ***\n");
	    return - ENODEV;
	}

	// extra variable
	if (!hardware_initialized){
	    // enable interrupt
	    x393_membridge_ctrl_irq(membridge_irq_en);
	    hardware_initialized = 1;
	}

	// wait for target frame here
	// wait for target frame here
	waitFrame(sensor_port,target_frame);
	waitFrame(sensor_port,target_frame);


@@ -915,23 +932,6 @@ int videomem_open(struct inode *inode, struct file *filp)
	int minor;
	int minor;
	int sensor_port;
	int sensor_port;


	// to enable interrupt
    x393_membridge_ctrl_irq_t membridge_irq_en = {.d32=0};
	membridge_irq_en.interrupt_cmd = MEMBRIDGE_CMD_IRQ_EN;

	// check fpga
	if (!is_fpga_programmed()){
		pr_err("*** Attempted to access hardware without bitsteram ***\n");
	    return - ENODEV;
	}

	// extra variable
	if (!hardware_initialized){
	    // enable interrupt
	    x393_membridge_ctrl_irq(membridge_irq_en);
	    hardware_initialized = 1;
	}

	pr_debug("VIDEOMEM_OPEN \n");
	pr_debug("VIDEOMEM_OPEN \n");


	privData = (struct raw_priv_t*)kmalloc(sizeof(struct raw_priv_t), GFP_KERNEL);
	privData = (struct raw_priv_t*)kmalloc(sizeof(struct raw_priv_t), GFP_KERNEL);