1*b843c749SSergey Zigachev /*
2*b843c749SSergey Zigachev  * Copyright 2012-15 Advanced Micro Devices, Inc.
3*b843c749SSergey Zigachev  *
4*b843c749SSergey Zigachev  * Permission is hereby granted, free of charge, to any person obtaining a
5*b843c749SSergey Zigachev  * copy of this software and associated documentation files (the "Software"),
6*b843c749SSergey Zigachev  * to deal in the Software without restriction, including without limitation
7*b843c749SSergey Zigachev  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8*b843c749SSergey Zigachev  * and/or sell copies of the Software, and to permit persons to whom the
9*b843c749SSergey Zigachev  * Software is furnished to do so, subject to the following conditions:
10*b843c749SSergey Zigachev  *
11*b843c749SSergey Zigachev  * The above copyright notice and this permission notice shall be included in
12*b843c749SSergey Zigachev  * all copies or substantial portions of the Software.
13*b843c749SSergey Zigachev  *
14*b843c749SSergey Zigachev  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15*b843c749SSergey Zigachev  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16*b843c749SSergey Zigachev  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
17*b843c749SSergey Zigachev  * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18*b843c749SSergey Zigachev  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19*b843c749SSergey Zigachev  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20*b843c749SSergey Zigachev  * OTHER DEALINGS IN THE SOFTWARE.
21*b843c749SSergey Zigachev  *
22*b843c749SSergey Zigachev  * Authors: AMD
23*b843c749SSergey Zigachev  *
24*b843c749SSergey Zigachev  */
25*b843c749SSergey Zigachev 
26*b843c749SSergey Zigachev #include "dm_services.h"
27*b843c749SSergey Zigachev 
28*b843c749SSergey Zigachev #include "include/logger_interface.h"
29*b843c749SSergey Zigachev 
30*b843c749SSergey Zigachev #include "irq_service_dce80.h"
31*b843c749SSergey Zigachev #include "../dce110/irq_service_dce110.h"
32*b843c749SSergey Zigachev 
33*b843c749SSergey Zigachev #include "dce/dce_8_0_d.h"
34*b843c749SSergey Zigachev #include "dce/dce_8_0_sh_mask.h"
35*b843c749SSergey Zigachev 
36*b843c749SSergey Zigachev #include "ivsrcid/ivsrcid_vislands30.h"
37*b843c749SSergey Zigachev 
38*b843c749SSergey Zigachev #include "dc_types.h"
39*b843c749SSergey Zigachev 
hpd_ack(struct irq_service * irq_service,const struct irq_source_info * info)40*b843c749SSergey Zigachev static bool hpd_ack(
41*b843c749SSergey Zigachev 	struct irq_service *irq_service,
42*b843c749SSergey Zigachev 	const struct irq_source_info *info)
43*b843c749SSergey Zigachev {
44*b843c749SSergey Zigachev 	uint32_t addr = info->status_reg;
45*b843c749SSergey Zigachev 	uint32_t value = dm_read_reg(irq_service->ctx, addr);
46*b843c749SSergey Zigachev 	uint32_t current_status =
47*b843c749SSergey Zigachev 		get_reg_field_value(
48*b843c749SSergey Zigachev 			value,
49*b843c749SSergey Zigachev 			DC_HPD1_INT_STATUS,
50*b843c749SSergey Zigachev 			DC_HPD1_SENSE_DELAYED);
51*b843c749SSergey Zigachev 
52*b843c749SSergey Zigachev 	dal_irq_service_ack_generic(irq_service, info);
53*b843c749SSergey Zigachev 
54*b843c749SSergey Zigachev 	value = dm_read_reg(irq_service->ctx, info->enable_reg);
55*b843c749SSergey Zigachev 
56*b843c749SSergey Zigachev 	set_reg_field_value(
57*b843c749SSergey Zigachev 		value,
58*b843c749SSergey Zigachev 		current_status ? 0 : 1,
59*b843c749SSergey Zigachev 		DC_HPD1_INT_CONTROL,
60*b843c749SSergey Zigachev 		DC_HPD1_INT_POLARITY);
61*b843c749SSergey Zigachev 
62*b843c749SSergey Zigachev 	dm_write_reg(irq_service->ctx, info->enable_reg, value);
63*b843c749SSergey Zigachev 
64*b843c749SSergey Zigachev 	return true;
65*b843c749SSergey Zigachev }
66*b843c749SSergey Zigachev 
67*b843c749SSergey Zigachev static const struct irq_source_info_funcs hpd_irq_info_funcs = {
68*b843c749SSergey Zigachev 	.set = NULL,
69*b843c749SSergey Zigachev 	.ack = hpd_ack
70*b843c749SSergey Zigachev };
71*b843c749SSergey Zigachev 
72*b843c749SSergey Zigachev static const struct irq_source_info_funcs hpd_rx_irq_info_funcs = {
73*b843c749SSergey Zigachev 	.set = NULL,
74*b843c749SSergey Zigachev 	.ack = NULL
75*b843c749SSergey Zigachev };
76*b843c749SSergey Zigachev 
77*b843c749SSergey Zigachev static const struct irq_source_info_funcs pflip_irq_info_funcs = {
78*b843c749SSergey Zigachev 	.set = NULL,
79*b843c749SSergey Zigachev 	.ack = NULL
80*b843c749SSergey Zigachev };
81*b843c749SSergey Zigachev 
82*b843c749SSergey Zigachev static const struct irq_source_info_funcs vblank_irq_info_funcs = {
83*b843c749SSergey Zigachev 	.set = dce110_vblank_set,
84*b843c749SSergey Zigachev 	.ack = NULL
85*b843c749SSergey Zigachev };
86*b843c749SSergey Zigachev 
87*b843c749SSergey Zigachev 
88*b843c749SSergey Zigachev #define hpd_int_entry(reg_num)\
89*b843c749SSergey Zigachev 	[DC_IRQ_SOURCE_INVALID + reg_num] = {\
90*b843c749SSergey Zigachev 		.enable_reg = mmDC_HPD ## reg_num ## _INT_CONTROL,\
91*b843c749SSergey Zigachev 		.enable_mask = DC_HPD1_INT_CONTROL__DC_HPD1_INT_EN_MASK,\
92*b843c749SSergey Zigachev 		.enable_value = {\
93*b843c749SSergey Zigachev 			DC_HPD1_INT_CONTROL__DC_HPD1_INT_EN_MASK,\
94*b843c749SSergey Zigachev 			~DC_HPD1_INT_CONTROL__DC_HPD1_INT_EN_MASK\
95*b843c749SSergey Zigachev 		},\
96*b843c749SSergey Zigachev 		.ack_reg = mmDC_HPD ## reg_num ## _INT_CONTROL,\
97*b843c749SSergey Zigachev 		.ack_mask = DC_HPD1_INT_CONTROL__DC_HPD1_INT_ACK_MASK,\
98*b843c749SSergey Zigachev 		.ack_value = DC_HPD1_INT_CONTROL__DC_HPD1_INT_ACK_MASK,\
99*b843c749SSergey Zigachev 		.status_reg = mmDC_HPD ## reg_num ## _INT_STATUS,\
100*b843c749SSergey Zigachev 		.funcs = &hpd_irq_info_funcs\
101*b843c749SSergey Zigachev 	}
102*b843c749SSergey Zigachev 
103*b843c749SSergey Zigachev #define hpd_rx_int_entry(reg_num)\
104*b843c749SSergey Zigachev 	[DC_IRQ_SOURCE_HPD6 + reg_num] = {\
105*b843c749SSergey Zigachev 		.enable_reg = mmDC_HPD ## reg_num ## _INT_CONTROL,\
106*b843c749SSergey Zigachev 		.enable_mask = DC_HPD1_INT_CONTROL__DC_HPD1_RX_INT_EN_MASK,\
107*b843c749SSergey Zigachev 		.enable_value = {\
108*b843c749SSergey Zigachev 				DC_HPD1_INT_CONTROL__DC_HPD1_RX_INT_EN_MASK,\
109*b843c749SSergey Zigachev 			~DC_HPD1_INT_CONTROL__DC_HPD1_RX_INT_EN_MASK },\
110*b843c749SSergey Zigachev 		.ack_reg = mmDC_HPD ## reg_num ## _INT_CONTROL,\
111*b843c749SSergey Zigachev 		.ack_mask = DC_HPD1_INT_CONTROL__DC_HPD1_RX_INT_ACK_MASK,\
112*b843c749SSergey Zigachev 		.ack_value = DC_HPD1_INT_CONTROL__DC_HPD1_RX_INT_ACK_MASK,\
113*b843c749SSergey Zigachev 		.status_reg = mmDC_HPD ## reg_num ## _INT_STATUS,\
114*b843c749SSergey Zigachev 		.funcs = &hpd_rx_irq_info_funcs\
115*b843c749SSergey Zigachev 	}
116*b843c749SSergey Zigachev 
117*b843c749SSergey Zigachev #define pflip_int_entry(reg_num)\
118*b843c749SSergey Zigachev 	[DC_IRQ_SOURCE_PFLIP1 + reg_num] = {\
119*b843c749SSergey Zigachev 		.enable_reg = mmDCP ## reg_num ## _GRPH_INTERRUPT_CONTROL,\
120*b843c749SSergey Zigachev 		.enable_mask =\
121*b843c749SSergey Zigachev 		GRPH_INTERRUPT_CONTROL__GRPH_PFLIP_INT_MASK_MASK,\
122*b843c749SSergey Zigachev 		.enable_value = {\
123*b843c749SSergey Zigachev 			GRPH_INTERRUPT_CONTROL__GRPH_PFLIP_INT_MASK_MASK,\
124*b843c749SSergey Zigachev 			~GRPH_INTERRUPT_CONTROL__GRPH_PFLIP_INT_MASK_MASK},\
125*b843c749SSergey Zigachev 		.ack_reg = mmDCP ## reg_num ## _GRPH_INTERRUPT_STATUS,\
126*b843c749SSergey Zigachev 		.ack_mask = GRPH_INTERRUPT_STATUS__GRPH_PFLIP_INT_CLEAR_MASK,\
127*b843c749SSergey Zigachev 		.ack_value = GRPH_INTERRUPT_STATUS__GRPH_PFLIP_INT_CLEAR_MASK,\
128*b843c749SSergey Zigachev 		.status_reg = mmDCP ## reg_num ##_GRPH_INTERRUPT_STATUS,\
129*b843c749SSergey Zigachev 		.funcs = &pflip_irq_info_funcs\
130*b843c749SSergey Zigachev  	}
131*b843c749SSergey Zigachev 
132*b843c749SSergey Zigachev #define vupdate_int_entry(reg_num)\
133*b843c749SSergey Zigachev 	[DC_IRQ_SOURCE_VUPDATE1 + reg_num] = {\
134*b843c749SSergey Zigachev 		.enable_reg = mmCRTC ## reg_num ## _CRTC_INTERRUPT_CONTROL,\
135*b843c749SSergey Zigachev 		.enable_mask =\
136*b843c749SSergey Zigachev 		CRTC_INTERRUPT_CONTROL__CRTC_V_UPDATE_INT_MSK_MASK,\
137*b843c749SSergey Zigachev 		.enable_value = {\
138*b843c749SSergey Zigachev 			CRTC_INTERRUPT_CONTROL__CRTC_V_UPDATE_INT_MSK_MASK,\
139*b843c749SSergey Zigachev 			~CRTC_INTERRUPT_CONTROL__CRTC_V_UPDATE_INT_MSK_MASK},\
140*b843c749SSergey Zigachev 		.ack_reg = mmCRTC ## reg_num ## _CRTC_V_UPDATE_INT_STATUS,\
141*b843c749SSergey Zigachev 		.ack_mask =\
142*b843c749SSergey Zigachev 		CRTC_V_UPDATE_INT_STATUS__CRTC_V_UPDATE_INT_CLEAR_MASK,\
143*b843c749SSergey Zigachev 		.ack_value =\
144*b843c749SSergey Zigachev 		CRTC_V_UPDATE_INT_STATUS__CRTC_V_UPDATE_INT_CLEAR_MASK,\
145*b843c749SSergey Zigachev 		.funcs = &vblank_irq_info_funcs\
146*b843c749SSergey Zigachev 	}
147*b843c749SSergey Zigachev 
148*b843c749SSergey Zigachev #define vblank_int_entry(reg_num)\
149*b843c749SSergey Zigachev 	[DC_IRQ_SOURCE_VBLANK1 + reg_num] = {\
150*b843c749SSergey Zigachev 		.enable_reg = mmCRTC ## reg_num ## _CRTC_VERTICAL_INTERRUPT0_CONTROL,\
151*b843c749SSergey Zigachev 		.enable_mask =\
152*b843c749SSergey Zigachev 		CRTC_VERTICAL_INTERRUPT0_CONTROL__CRTC_VERTICAL_INTERRUPT0_INT_ENABLE_MASK,\
153*b843c749SSergey Zigachev 		.enable_value = {\
154*b843c749SSergey Zigachev 			CRTC_VERTICAL_INTERRUPT0_CONTROL__CRTC_VERTICAL_INTERRUPT0_INT_ENABLE_MASK,\
155*b843c749SSergey Zigachev 			~CRTC_VERTICAL_INTERRUPT0_CONTROL__CRTC_VERTICAL_INTERRUPT0_INT_ENABLE_MASK},\
156*b843c749SSergey Zigachev 		.ack_reg = mmCRTC ## reg_num ## _CRTC_VERTICAL_INTERRUPT0_CONTROL,\
157*b843c749SSergey Zigachev 		.ack_mask =\
158*b843c749SSergey Zigachev 		CRTC_VERTICAL_INTERRUPT0_CONTROL__CRTC_VERTICAL_INTERRUPT0_CLEAR_MASK,\
159*b843c749SSergey Zigachev 		.ack_value =\
160*b843c749SSergey Zigachev 		CRTC_VERTICAL_INTERRUPT0_CONTROL__CRTC_VERTICAL_INTERRUPT0_CLEAR_MASK,\
161*b843c749SSergey Zigachev 		.funcs = &vblank_irq_info_funcs,\
162*b843c749SSergey Zigachev 		.src_id = VISLANDS30_IV_SRCID_D1_VERTICAL_INTERRUPT0 + reg_num\
163*b843c749SSergey Zigachev 	}
164*b843c749SSergey Zigachev 
165*b843c749SSergey Zigachev #define dummy_irq_entry() \
166*b843c749SSergey Zigachev 	{\
167*b843c749SSergey Zigachev 		.funcs = &dummy_irq_info_funcs\
168*b843c749SSergey Zigachev 	}
169*b843c749SSergey Zigachev 
170*b843c749SSergey Zigachev #define i2c_int_entry(reg_num) \
171*b843c749SSergey Zigachev 	[DC_IRQ_SOURCE_I2C_DDC ## reg_num] = dummy_irq_entry()
172*b843c749SSergey Zigachev 
173*b843c749SSergey Zigachev #define dp_sink_int_entry(reg_num) \
174*b843c749SSergey Zigachev 	[DC_IRQ_SOURCE_DPSINK ## reg_num] = dummy_irq_entry()
175*b843c749SSergey Zigachev 
176*b843c749SSergey Zigachev #define gpio_pad_int_entry(reg_num) \
177*b843c749SSergey Zigachev 	[DC_IRQ_SOURCE_GPIOPAD ## reg_num] = dummy_irq_entry()
178*b843c749SSergey Zigachev 
179*b843c749SSergey Zigachev #define dc_underflow_int_entry(reg_num) \
180*b843c749SSergey Zigachev 	[DC_IRQ_SOURCE_DC ## reg_num ## UNDERFLOW] = dummy_irq_entry()
181*b843c749SSergey Zigachev 
182*b843c749SSergey Zigachev 
183*b843c749SSergey Zigachev static const struct irq_source_info_funcs dummy_irq_info_funcs = {
184*b843c749SSergey Zigachev 	.set = dal_irq_service_dummy_set,
185*b843c749SSergey Zigachev 	.ack = dal_irq_service_dummy_ack
186*b843c749SSergey Zigachev };
187*b843c749SSergey Zigachev 
188*b843c749SSergey Zigachev static const struct irq_source_info
189*b843c749SSergey Zigachev irq_source_info_dce80[DAL_IRQ_SOURCES_NUMBER] = {
190*b843c749SSergey Zigachev 	[DC_IRQ_SOURCE_INVALID] = dummy_irq_entry(),
191*b843c749SSergey Zigachev 	hpd_int_entry(1),
192*b843c749SSergey Zigachev 	hpd_int_entry(2),
193*b843c749SSergey Zigachev 	hpd_int_entry(3),
194*b843c749SSergey Zigachev 	hpd_int_entry(4),
195*b843c749SSergey Zigachev 	hpd_int_entry(5),
196*b843c749SSergey Zigachev 	hpd_int_entry(6),
197*b843c749SSergey Zigachev 	hpd_rx_int_entry(1),
198*b843c749SSergey Zigachev 	hpd_rx_int_entry(2),
199*b843c749SSergey Zigachev 	hpd_rx_int_entry(3),
200*b843c749SSergey Zigachev 	hpd_rx_int_entry(4),
201*b843c749SSergey Zigachev 	hpd_rx_int_entry(5),
202*b843c749SSergey Zigachev 	hpd_rx_int_entry(6),
203*b843c749SSergey Zigachev 	i2c_int_entry(1),
204*b843c749SSergey Zigachev 	i2c_int_entry(2),
205*b843c749SSergey Zigachev 	i2c_int_entry(3),
206*b843c749SSergey Zigachev 	i2c_int_entry(4),
207*b843c749SSergey Zigachev 	i2c_int_entry(5),
208*b843c749SSergey Zigachev 	i2c_int_entry(6),
209*b843c749SSergey Zigachev 	dp_sink_int_entry(1),
210*b843c749SSergey Zigachev 	dp_sink_int_entry(2),
211*b843c749SSergey Zigachev 	dp_sink_int_entry(3),
212*b843c749SSergey Zigachev 	dp_sink_int_entry(4),
213*b843c749SSergey Zigachev 	dp_sink_int_entry(5),
214*b843c749SSergey Zigachev 	dp_sink_int_entry(6),
215*b843c749SSergey Zigachev 	[DC_IRQ_SOURCE_TIMER] = dummy_irq_entry(),
216*b843c749SSergey Zigachev 	pflip_int_entry(0),
217*b843c749SSergey Zigachev 	pflip_int_entry(1),
218*b843c749SSergey Zigachev 	pflip_int_entry(2),
219*b843c749SSergey Zigachev 	pflip_int_entry(3),
220*b843c749SSergey Zigachev 	pflip_int_entry(4),
221*b843c749SSergey Zigachev 	pflip_int_entry(5),
222*b843c749SSergey Zigachev 	[DC_IRQ_SOURCE_PFLIP_UNDERLAY0] = dummy_irq_entry(),
223*b843c749SSergey Zigachev 	gpio_pad_int_entry(0),
224*b843c749SSergey Zigachev 	gpio_pad_int_entry(1),
225*b843c749SSergey Zigachev 	gpio_pad_int_entry(2),
226*b843c749SSergey Zigachev 	gpio_pad_int_entry(3),
227*b843c749SSergey Zigachev 	gpio_pad_int_entry(4),
228*b843c749SSergey Zigachev 	gpio_pad_int_entry(5),
229*b843c749SSergey Zigachev 	gpio_pad_int_entry(6),
230*b843c749SSergey Zigachev 	gpio_pad_int_entry(7),
231*b843c749SSergey Zigachev 	gpio_pad_int_entry(8),
232*b843c749SSergey Zigachev 	gpio_pad_int_entry(9),
233*b843c749SSergey Zigachev 	gpio_pad_int_entry(10),
234*b843c749SSergey Zigachev 	gpio_pad_int_entry(11),
235*b843c749SSergey Zigachev 	gpio_pad_int_entry(12),
236*b843c749SSergey Zigachev 	gpio_pad_int_entry(13),
237*b843c749SSergey Zigachev 	gpio_pad_int_entry(14),
238*b843c749SSergey Zigachev 	gpio_pad_int_entry(15),
239*b843c749SSergey Zigachev 	gpio_pad_int_entry(16),
240*b843c749SSergey Zigachev 	gpio_pad_int_entry(17),
241*b843c749SSergey Zigachev 	gpio_pad_int_entry(18),
242*b843c749SSergey Zigachev 	gpio_pad_int_entry(19),
243*b843c749SSergey Zigachev 	gpio_pad_int_entry(20),
244*b843c749SSergey Zigachev 	gpio_pad_int_entry(21),
245*b843c749SSergey Zigachev 	gpio_pad_int_entry(22),
246*b843c749SSergey Zigachev 	gpio_pad_int_entry(23),
247*b843c749SSergey Zigachev 	gpio_pad_int_entry(24),
248*b843c749SSergey Zigachev 	gpio_pad_int_entry(25),
249*b843c749SSergey Zigachev 	gpio_pad_int_entry(26),
250*b843c749SSergey Zigachev 	gpio_pad_int_entry(27),
251*b843c749SSergey Zigachev 	gpio_pad_int_entry(28),
252*b843c749SSergey Zigachev 	gpio_pad_int_entry(29),
253*b843c749SSergey Zigachev 	gpio_pad_int_entry(30),
254*b843c749SSergey Zigachev 	dc_underflow_int_entry(1),
255*b843c749SSergey Zigachev 	dc_underflow_int_entry(2),
256*b843c749SSergey Zigachev 	dc_underflow_int_entry(3),
257*b843c749SSergey Zigachev 	dc_underflow_int_entry(4),
258*b843c749SSergey Zigachev 	dc_underflow_int_entry(5),
259*b843c749SSergey Zigachev 	dc_underflow_int_entry(6),
260*b843c749SSergey Zigachev 	[DC_IRQ_SOURCE_DMCU_SCP] = dummy_irq_entry(),
261*b843c749SSergey Zigachev 	[DC_IRQ_SOURCE_VBIOS_SW] = dummy_irq_entry(),
262*b843c749SSergey Zigachev 	vupdate_int_entry(0),
263*b843c749SSergey Zigachev 	vupdate_int_entry(1),
264*b843c749SSergey Zigachev 	vupdate_int_entry(2),
265*b843c749SSergey Zigachev 	vupdate_int_entry(3),
266*b843c749SSergey Zigachev 	vupdate_int_entry(4),
267*b843c749SSergey Zigachev 	vupdate_int_entry(5),
268*b843c749SSergey Zigachev 	vblank_int_entry(0),
269*b843c749SSergey Zigachev 	vblank_int_entry(1),
270*b843c749SSergey Zigachev 	vblank_int_entry(2),
271*b843c749SSergey Zigachev 	vblank_int_entry(3),
272*b843c749SSergey Zigachev 	vblank_int_entry(4),
273*b843c749SSergey Zigachev 	vblank_int_entry(5),
274*b843c749SSergey Zigachev };
275*b843c749SSergey Zigachev 
276*b843c749SSergey Zigachev static const struct irq_service_funcs irq_service_funcs_dce80 = {
277*b843c749SSergey Zigachev 		.to_dal_irq_source = to_dal_irq_source_dce110
278*b843c749SSergey Zigachev };
279*b843c749SSergey Zigachev 
construct(struct irq_service * irq_service,struct irq_service_init_data * init_data)280*b843c749SSergey Zigachev static void construct(
281*b843c749SSergey Zigachev 	struct irq_service *irq_service,
282*b843c749SSergey Zigachev 	struct irq_service_init_data *init_data)
283*b843c749SSergey Zigachev {
284*b843c749SSergey Zigachev 	dal_irq_service_construct(irq_service, init_data);
285*b843c749SSergey Zigachev 
286*b843c749SSergey Zigachev 	irq_service->info = irq_source_info_dce80;
287*b843c749SSergey Zigachev 	irq_service->funcs = &irq_service_funcs_dce80;
288*b843c749SSergey Zigachev }
289*b843c749SSergey Zigachev 
dal_irq_service_dce80_create(struct irq_service_init_data * init_data)290*b843c749SSergey Zigachev struct irq_service *dal_irq_service_dce80_create(
291*b843c749SSergey Zigachev 	struct irq_service_init_data *init_data)
292*b843c749SSergey Zigachev {
293*b843c749SSergey Zigachev 	struct irq_service *irq_service = kzalloc(sizeof(*irq_service),
294*b843c749SSergey Zigachev 						  GFP_KERNEL);
295*b843c749SSergey Zigachev 
296*b843c749SSergey Zigachev 	if (!irq_service)
297*b843c749SSergey Zigachev 		return NULL;
298*b843c749SSergey Zigachev 
299*b843c749SSergey Zigachev 	construct(irq_service, init_data);
300*b843c749SSergey Zigachev 	return irq_service;
301*b843c749SSergey Zigachev }
302*b843c749SSergey Zigachev 
303*b843c749SSergey Zigachev 
304