xref: /linux/drivers/staging/media/atomisp/pci/hive_isp_css_common/host/sp.c (revision 0ea5c948cb64bab5bc7a5516774eb8536f05aa0d)
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3  * Support for Intel Camera Imaging ISP subsystem.
4  * Copyright (c) 2010-2015, Intel Corporation.
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms and conditions of the GNU General Public License,
8  * version 2, as published by the Free Software Foundation.
9  *
10  * This program is distributed in the hope it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
13  * more details.
14  */
15 
16 #include "sp.h"
17 
18 #ifndef __INLINE_SP__
19 #include "sp_private.h"
20 #endif /* __INLINE_SP__ */
21 
22 #include "assert_support.h"
23 
cnd_sp_irq_enable(const sp_ID_t ID,const bool cnd)24 void cnd_sp_irq_enable(
25     const sp_ID_t		ID,
26     const bool		cnd)
27 {
28 	if (cnd) {
29 		sp_ctrl_setbit(ID, SP_IRQ_READY_REG, SP_IRQ_READY_BIT);
30 		/* Enabling the IRQ immediately triggers an interrupt, clear it */
31 		sp_ctrl_setbit(ID, SP_IRQ_CLEAR_REG, SP_IRQ_CLEAR_BIT);
32 	} else {
33 		sp_ctrl_clearbit(ID, SP_IRQ_READY_REG, SP_IRQ_READY_BIT);
34 	}
35 }
36