linux/drivers/staging/media/atomisp/pci/ia_css_event_public.h

/* SPDX-License-Identifier: GPL-2.0 */
/*
 * Support for Intel Camera Imaging ISP subsystem.
 * Copyright (c) 2015, Intel Corporation.
 *
 * This program is free software; you can redistribute it and/or modify it
 * under the terms and conditions of the GNU General Public License,
 * version 2, as published by the Free Software Foundation.
 *
 * This program is distributed in the hope it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 */

#ifndef __IA_CSS_EVENT_PUBLIC_H
#define __IA_CSS_EVENT_PUBLIC_H

/* @file
 * This file contains CSS-API events functionality
 */

#include <type_support.h>	/* uint8_t */
#include <ia_css_err.h>		/* ia_css_err */
#include <ia_css_types.h>	/* ia_css_pipe */
#include <ia_css_timer.h>	/* ia_css_timer */
#include <linux/bits.h>

/* The event type, distinguishes the kind of events that
 * can are generated by the CSS system.
 *
 * !!!IMPORTANT!!! KEEP THE FOLLOWING IN SYNC:
 * 1) "enum ia_css_event_type"					(ia_css_event_public.h)
 * 2) "enum sh_css_sp_event_type"				(sh_css_internal.h)
 * 3) "enum ia_css_event_type event_id_2_event_mask"		(event_handler.sp.c)
 * 4) "enum ia_css_event_type convert_event_sp_to_host_domain"	(sh_css.c)
 */
enum ia_css_event_type {};

#define IA_CSS_EVENT_TYPE_NONE

/* IA_CSS_EVENT_TYPE_ALL is a mask for all pipe related events.
 * The other events (such as PORT_EOF) cannot be enabled/disabled
 * and are hence excluded from this macro.
 */
#define IA_CSS_EVENT_TYPE_ALL

/* The event struct, container for the event type and its related values.
 * Depending on the event type, either pipe or port will be filled.
 * Pipeline related events (like buffer/frame events) will return a valid and filled pipe handle.
 * For non pipeline related events (but i.e. stream specific, like EOF event), the port will be
 * filled.
 */
struct ia_css_event {};

/* @brief Dequeue a PSYS event from the CSS system.
 *
 * @param[out]	event   Pointer to the event struct which will be filled by
 *                      this function if an event is available.
 * @return		-ENODATA if no events are
 *			available or
 *			0 otherwise.
 *
 * This function dequeues an event from the PSYS event queue. The queue is
 * between the Host CPU and the CSS system. This function can be
 * called after an interrupt has been generated that signalled that a new event
 * was available and can be used in a polling-like situation where the NO_EVENT
 * return value is used to determine whether an event was available or not.
 */
int
ia_css_dequeue_psys_event(struct ia_css_event *event);

/* @brief Dequeue an ISYS event from the CSS system.
 *
 * @param[out]	event   Pointer to the event struct which will be filled by
 *                      this function if an event is available.
 * @return		-ENODATA if no events are
 *			available or
 *			0 otherwise.
 *
 * This function dequeues an event from the ISYS event queue. The queue is
 * between host and the CSS system.
 * Unlike the ia_css_dequeue_psys_event() function, this function can be called
 * directly from an interrupt service routine (ISR) and it is safe to call
 * this function in parallel with other CSS API functions (but only one
 * call to this function should be in flight at any point in time).
 *
 * The reason for having the ISYS events separate is to prevent them from
 * incurring additional latency due to locks being held by other CSS API
 * functions.
 */
int
ia_css_dequeue_isys_event(struct ia_css_event *event);

#endif /* __IA_CSS_EVENT_PUBLIC_H */