/*
 * Realtek Semiconductor Corp.
 *
 * rts_camera_waitqueue.h
 *
 * Copyright (C) 2017      Ming Qian<ming_qian@realsil.com.cn>
 */
#ifndef _RTS_CAMERA_WAITQUEUE_H
#define _RTS_CAMERA_WAITQUEUE_H

struct rts_wait_queue {
	struct list_head queue;
	struct device *dev;
	int refcount;
	struct mutex lock;

	int value;
};

struct rts_wait_queue *rtscam_allocate_wait_queue(struct device *dev);
int rtscam_release_wait_queue(struct rts_wait_queue *queue);
int rtscam_init_wait_queue(struct rts_wait_queue *queue, int num);
int rtscam_wait_timeout(struct rts_wait_queue *queue, unsigned long timeout);
int rtscam_wait(struct rts_wait_queue *queue);
int rtscam_post(struct rts_wait_queue *queue);
#endif
