diff options
Diffstat (limited to 'drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/eventq')
-rw-r--r-- | drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/eventq/interface/ia_css_eventq.h | 69 | ||||
-rw-r--r-- | drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/eventq/src/eventq.c | 77 |
2 files changed, 0 insertions, 146 deletions
diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/eventq/interface/ia_css_eventq.h b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/eventq/interface/ia_css_eventq.h deleted file mode 100644 index 67eb8fd..0000000 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/eventq/interface/ia_css_eventq.h +++ /dev/null @@ -1,69 +0,0 @@ -#ifndef ISP2401 -/* - * 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. - */ -#else -/** -Support for Intel Camera Imaging ISP subsystem. -Copyright (c) 2010 - 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. -*/ -#endif - -#ifndef _IA_CSS_EVENTQ_H -#define _IA_CSS_EVENTQ_H - -#include "ia_css_queue.h" /* queue APIs */ - -/** - * @brief HOST receives event from SP. - * - * @param[in] eventq_handle eventq_handle. - * @param[in] payload The event payload. - * @return 0 - Successfully dequeue. - * @return EINVAL - Invalid argument. - * @return ENODATA - Queue is empty. - */ -int ia_css_eventq_recv( - ia_css_queue_t *eventq_handle, - uint8_t *payload); - -/** - * @brief The Host sends the event to SP. - * The caller of this API will be blocked until the event - * is sent. - * - * @param[in] eventq_handle eventq_handle. - * @param[in] evt_id The event ID. - * @param[in] evt_payload_0 The event payload. - * @param[in] evt_payload_1 The event payload. - * @param[in] evt_payload_2 The event payload. - * @return 0 - Successfully enqueue. - * @return EINVAL - Invalid argument. - * @return ENOBUFS - Queue is full. - */ -int ia_css_eventq_send( - ia_css_queue_t *eventq_handle, - uint8_t evt_id, - uint8_t evt_payload_0, - uint8_t evt_payload_1, - uint8_t evt_payload_2); -#endif /* _IA_CSS_EVENTQ_H */ diff --git a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/eventq/src/eventq.c b/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/eventq/src/eventq.c deleted file mode 100644 index 913a4bf..0000000 --- a/drivers/staging/media/atomisp/pci/atomisp2/css2400/runtime/eventq/src/eventq.c +++ /dev/null @@ -1,77 +0,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. - */ - -#include "ia_css_types.h" -#include "assert_support.h" -#include "ia_css_queue.h" /* sp2host_dequeue_irq_event() */ -#include "ia_css_eventq.h" -#include "ia_css_event.h" /* ia_css_event_encode() - ia_css_event_decode() - */ -#include "platform_support.h" /* hrt_sleep() */ - -int ia_css_eventq_recv( - ia_css_queue_t *eventq_handle, - uint8_t *payload) -{ - uint32_t sp_event; - int error; - - /* dequeue the IRQ event */ - error = ia_css_queue_dequeue(eventq_handle, &sp_event); - - /* check whether the IRQ event is available or not */ - if (!error) - ia_css_event_decode(sp_event, payload); - return error; -} - -/* - * @brief The Host sends the event to the SP. - * Refer to "sh_css_sp.h" for details. - */ -int ia_css_eventq_send( - ia_css_queue_t *eventq_handle, - uint8_t evt_id, - uint8_t evt_payload_0, - uint8_t evt_payload_1, - uint8_t evt_payload_2) -{ - uint8_t tmp[4]; - uint32_t sw_event; - int error = ENOSYS; - - /* - * Encode the queue type, the thread ID and - * the queue ID into the event. - */ - tmp[0] = evt_id; - tmp[1] = evt_payload_0; - tmp[2] = evt_payload_1; - tmp[3] = evt_payload_2; - ia_css_event_encode(tmp, 4, &sw_event); - - /* queue the software event (busy-waiting) */ - for ( ; ; ) { - error = ia_css_queue_enqueue(eventq_handle, sw_event); - if (ENOBUFS != error) { - /* We were able to successfully send the event - or had a real failure. return the status*/ - break; - } - /* Wait for the queue to be not full and try again*/ - hrt_sleep(); - } - return error; -} |