Exemplo n.º 1
0
static int dev_open(struct fp_img_dev *dev, unsigned long driver_data)
{
    struct fpi_ssm *init_ssm;
    struct vfs0050_dev *vdev = NULL;
    int r;
    fp_dbg("dev_open called");
    //TODO: this is probably frowned upon :/ but right now a reset is the only
    // way for me to know I'm working with a clean slate and the rest of this will work.
    // Will be trying to reverse engineer more of the protocol so I can avoid resetting
    // the device each time it's opened.
    libusb_reset_device(dev->udev);

    r = libusb_claim_interface(dev->udev, 0);
    if (r < 0) {
        fp_err("could not claim interface 0");
        return r;
    }
    libusb_control_transfer(dev->udev, 0x00, 0x09, 0x0001, 0, NULL, 0, 100);


    vdev = g_malloc0(sizeof(struct vfs0050_dev));
    vdev->scanbuf = g_malloc0(VFS0050_INITIAL_SCANBUF_SIZE);
    vdev->scanbuf_sz = VFS0050_INITIAL_SCANBUF_SIZE;
    vdev->calbuf = g_malloc0(VFS0050_INITIAL_SCANBUF_SIZE);
    vdev->calbuf_sz = VFS0050_INITIAL_SCANBUF_SIZE;
    dev->priv = vdev;
    init_ssm = fpi_ssm_new(dev->dev, state_init, M_INIT_NUMSTATES);
    init_ssm->priv = dev;
    fpi_ssm_start(init_ssm, state_init_complete);

    return 0;
}
Exemplo n.º 2
0
static int dev_activate(struct fp_img_dev *dev, enum fp_imgdev_state state)
{
	struct fpi_ssm *ssm = fpi_ssm_new(dev->dev, activate_run_state,ET_ACTIVATE_STATES);
	ssm->priv = dev;
	fpi_ssm_start(ssm, activate_sm_complete);
	return 0;
}
Exemplo n.º 3
0
static int dev_activate(struct fp_img_dev *dev, enum fp_imgdev_state state)
{
    fp_dbg("dev_activate called");
    struct fpi_ssm *activate_ssm;
    activate_ssm = fpi_ssm_new(dev->dev, state_activate, M_ACTIVATE_NUMSTATES);
    activate_ssm->priv = dev;
    fpi_ssm_start(activate_ssm, state_activate_complete);
    return 0;
}
Exemplo n.º 4
0
static int dev_activate(struct fp_img_dev *dev, enum fp_imgdev_state state)
{
	struct upektc_dev *upekdev = dev->priv;
	struct fpi_ssm *ssm = fpi_ssm_new(dev->dev, activate_run_state,
		ACTIVATE_NUM_STATES);
	ssm->priv = dev;
	upekdev->init_idx = 0;
	fpi_ssm_start(ssm, activate_sm_complete);
	return 0;
}
Exemplo n.º 5
0
/* Activate device */
static int dev_activate(struct fp_img_dev *dev, enum fp_imgdev_state state)
{
	struct fpi_ssm *ssm;

	/* Start init ssm */
	ssm = fpi_ssm_new(dev->dev, m_init_state, 1);
	ssm->priv = dev;
	fpi_ssm_start(ssm, m_init_complete);

	return 0;
}
Exemplo n.º 6
0
static int dev_activate(struct fp_img_dev *dev, enum fp_imgdev_state state)
{
	struct v5s_dev *vdev = dev->priv;
	struct fpi_ssm *ssm = fpi_ssm_new(dev->dev, loop_run_state,
		LOOP_NUM_STATES);
	ssm->priv = dev;
	vdev->deactivating = FALSE;
	fpi_ssm_start(ssm, loopsm_complete);
	vdev->loop_running = TRUE;
	fpi_imgdev_activate_complete(dev, 0);
	return 0;
}
Exemplo n.º 7
0
static void start_finger_detection(struct fp_img_dev *dev)
{
	struct fpi_ssm *ssm;
	struct aesX660_dev *aesdev = dev->priv;

	if (aesdev->deactivating) {
		complete_deactivation(dev);
		return;
	}

	ssm = fpi_ssm_new(dev->dev, finger_det_run_state, FINGER_DET_NUM_STATES);
	ssm->priv = dev;
	fpi_ssm_start(ssm, finger_det_sm_complete);
}
Exemplo n.º 8
0
static void start_capture(struct fp_img_dev *dev)
{
	struct upektc_dev *upekdev = dev->priv;
	struct fpi_ssm *ssm;

	if (upekdev->deactivating) {
		complete_deactivation(dev);
		return;
	}

	ssm = fpi_ssm_new(dev->dev, capture_run_state, CAPTURE_NUM_STATES);
	fp_dbg("");
	ssm->priv = dev;
	fpi_ssm_start(ssm, capture_sm_complete);
}
Exemplo n.º 9
0
static void start_capture(struct fp_img_dev *dev)
{
	struct etss801u_dev *etdev = dev->priv;
	struct fpi_ssm *ssm;

	if (etdev->deactivating) {
		complete_deactivation(dev);
		return;
	}

	ssm = fpi_ssm_new(dev->dev, capture_run_state, ET_CAPTURE_STATES);
	fp_dbg("");
	ssm->priv = dev;
	fpi_ssm_start(ssm, capture_sm_complete);
}
Exemplo n.º 10
0
/* Complete init sequential state machine */
static void m_init_complete(struct fpi_ssm *ssm)
{
	struct fp_img_dev *dev = ssm->priv;
	struct fpi_ssm *ssm_loop;

	if (!ssm->error) {
		/* Notify activate complete */
		fpi_imgdev_activate_complete(dev, 0);

		/* Start loop ssm */
		ssm_loop = fpi_ssm_new(dev->dev, m_loop_state, M_LOOP_NUM_STATES);
		ssm_loop->priv = dev;
		fpi_ssm_start(ssm_loop, m_loop_complete);
	}

	/* Free sequential state machine */
	fpi_ssm_free(ssm);
}