Lines Matching full:core

68 static void hdmi_cec_received_msg(struct hdmi_core_data *core)  in hdmi_cec_received_msg()  argument
70 u32 cnt = hdmi_read_reg(core->base, HDMI_CEC_RX_COUNT) & 0xff; in hdmi_cec_received_msg()
83 msg.msg[0] = hdmi_read_reg(core->base, in hdmi_cec_received_msg()
85 msg.msg[1] = hdmi_read_reg(core->base, in hdmi_cec_received_msg()
91 hdmi_read_reg(core->base, reg); in hdmi_cec_received_msg()
94 cec_received_msg(core->adap, &msg); in hdmi_cec_received_msg()
97 hdmi_write_reg(core->base, HDMI_CEC_RX_CONTROL, 1); in hdmi_cec_received_msg()
99 while (hdmi_read_reg(core->base, HDMI_CEC_RX_CONTROL) & 1) in hdmi_cec_received_msg()
105 cnt = hdmi_read_reg(core->base, HDMI_CEC_RX_COUNT) & 0xff; in hdmi_cec_received_msg()
109 void hdmi4_cec_irq(struct hdmi_core_data *core) in hdmi4_cec_irq() argument
111 u32 stat0 = hdmi_read_reg(core->base, HDMI_CEC_INT_STATUS_0); in hdmi4_cec_irq()
112 u32 stat1 = hdmi_read_reg(core->base, HDMI_CEC_INT_STATUS_1); in hdmi4_cec_irq()
114 hdmi_write_reg(core->base, HDMI_CEC_INT_STATUS_0, stat0); in hdmi4_cec_irq()
115 hdmi_write_reg(core->base, HDMI_CEC_INT_STATUS_1, stat1); in hdmi4_cec_irq()
118 cec_transmit_done(core->adap, CEC_TX_STATUS_OK, in hdmi4_cec_irq()
120 REG_FLD_MOD(core->base, HDMI_CEC_DBG_3, 0x1, 7, 7); in hdmi4_cec_irq()
122 u32 dbg3 = hdmi_read_reg(core->base, HDMI_CEC_DBG_3); in hdmi4_cec_irq()
124 cec_transmit_done(core->adap, in hdmi4_cec_irq()
128 REG_FLD_MOD(core->base, HDMI_CEC_DBG_3, 0x1, 7, 7); in hdmi4_cec_irq()
131 hdmi_cec_received_msg(core); in hdmi4_cec_irq()
136 struct hdmi_core_data *core = cec_get_drvdata(adap); in hdmi_cec_clear_tx_fifo() local
140 REG_FLD_MOD(core->base, HDMI_CEC_DBG_3, 0x1, 7, 7); in hdmi_cec_clear_tx_fifo()
142 temp = hdmi_read_reg(core->base, HDMI_CEC_DBG_3); in hdmi_cec_clear_tx_fifo()
152 struct hdmi_core_data *core = cec_get_drvdata(adap); in hdmi_cec_clear_rx_fifo() local
156 hdmi_write_reg(core->base, HDMI_CEC_RX_CONTROL, 0x3); in hdmi_cec_clear_rx_fifo()
159 temp = hdmi_read_reg(core->base, HDMI_CEC_RX_CONTROL); in hdmi_cec_clear_rx_fifo()
169 struct hdmi_core_data *core = cec_get_drvdata(adap); in hdmi_cec_adap_enable() local
173 hdmi_write_reg(core->base, HDMI_CEC_INT_ENABLE_0, 0); in hdmi_cec_adap_enable()
174 hdmi_write_reg(core->base, HDMI_CEC_INT_ENABLE_1, 0); in hdmi_cec_adap_enable()
175 REG_FLD_MOD(core->base, HDMI_CORE_SYS_INTR_UNMASK4, 0, 3, 3); in hdmi_cec_adap_enable()
176 hdmi_wp_clear_irqenable(core->wp, HDMI_IRQ_CORE); in hdmi_cec_adap_enable()
177 hdmi_wp_set_irqstatus(core->wp, HDMI_IRQ_CORE); in hdmi_cec_adap_enable()
178 REG_FLD_MOD(core->wp->base, HDMI_WP_CLK, 0, 5, 0); in hdmi_cec_adap_enable()
179 hdmi4_core_disable(core); in hdmi_cec_adap_enable()
182 err = hdmi4_core_enable(core); in hdmi_cec_adap_enable()
190 REG_FLD_MOD(core->wp->base, HDMI_WP_CLK, 0x18, 5, 0); in hdmi_cec_adap_enable()
207 hdmi_write_reg(core->base, HDMI_CEC_INT_STATUS_1, in hdmi_cec_adap_enable()
208 hdmi_read_reg(core->base, HDMI_CEC_INT_STATUS_1)); in hdmi_cec_adap_enable()
209 hdmi_write_reg(core->base, HDMI_CEC_INT_STATUS_0, in hdmi_cec_adap_enable()
210 hdmi_read_reg(core->base, HDMI_CEC_INT_STATUS_0)); in hdmi_cec_adap_enable()
212 /* Enable HDMI core interrupts */ in hdmi_cec_adap_enable()
213 hdmi_wp_set_irqenable(core->wp, HDMI_IRQ_CORE); in hdmi_cec_adap_enable()
215 REG_FLD_MOD(core->base, HDMI_CORE_SYS_INTR_UNMASK4, 0x1, 3, 3); in hdmi_cec_adap_enable()
221 hdmi_write_reg(core->base, HDMI_CEC_INT_ENABLE_0, 0x22); in hdmi_cec_adap_enable()
226 hdmi_write_reg(core->base, HDMI_CEC_INT_ENABLE_1, 0x02); in hdmi_cec_adap_enable()
229 hdmi_write_reg(core->base, HDMI_CEC_SETUP, 0x03); in hdmi_cec_adap_enable()
231 hdmi_write_reg(core->base, HDMI_CEC_SETUP, 0x04); in hdmi_cec_adap_enable()
233 temp = hdmi_read_reg(core->base, HDMI_CEC_SETUP); in hdmi_cec_adap_enable()
236 hdmi_write_reg(core->base, HDMI_CEC_SETUP, temp); in hdmi_cec_adap_enable()
243 temp = hdmi_read_reg(core->base, HDMI_CEC_INT_STATUS_1); in hdmi_cec_adap_enable()
245 hdmi_write_reg(core->base, HDMI_CEC_INT_STATUS_1, temp); in hdmi_cec_adap_enable()
250 REG_FLD_MOD(core->wp->base, HDMI_WP_CLK, 0, 5, 0); in hdmi_cec_adap_enable()
251 hdmi4_core_disable(core); in hdmi_cec_adap_enable()
258 struct hdmi_core_data *core = cec_get_drvdata(adap); in hdmi_cec_adap_log_addr() local
262 hdmi_write_reg(core->base, HDMI_CEC_CA_7_0, 0); in hdmi_cec_adap_log_addr()
263 hdmi_write_reg(core->base, HDMI_CEC_CA_15_8, 0); in hdmi_cec_adap_log_addr()
267 v = hdmi_read_reg(core->base, HDMI_CEC_CA_7_0); in hdmi_cec_adap_log_addr()
269 hdmi_write_reg(core->base, HDMI_CEC_CA_7_0, v); in hdmi_cec_adap_log_addr()
271 v = hdmi_read_reg(core->base, HDMI_CEC_CA_15_8); in hdmi_cec_adap_log_addr()
273 hdmi_write_reg(core->base, HDMI_CEC_CA_15_8, v); in hdmi_cec_adap_log_addr()
281 struct hdmi_core_data *core = cec_get_drvdata(adap); in hdmi_cec_adap_transmit() local
293 hdmi_write_reg(core->base, HDMI_CEC_INT_STATUS_0, in hdmi_cec_adap_transmit()
296 hdmi_write_reg(core->base, HDMI_CEC_INT_STATUS_1, in hdmi_cec_adap_transmit()
300 REG_FLD_MOD(core->base, HDMI_CEC_DBG_3, attempts - 1, 6, 4); in hdmi_cec_adap_transmit()
303 hdmi_write_reg(core->base, HDMI_CEC_TX_INIT, cec_msg_initiator(msg)); in hdmi_cec_adap_transmit()
309 hdmi_write_reg(core->base, HDMI_CEC_TX_DEST, temp); in hdmi_cec_adap_transmit()
314 hdmi_write_reg(core->base, HDMI_CEC_TX_COMMAND, msg->msg[1]); in hdmi_cec_adap_transmit()
317 hdmi_write_reg(core->base, HDMI_CEC_TX_OPERAND + i * 4, in hdmi_cec_adap_transmit()
321 hdmi_write_reg(core->base, HDMI_CEC_TRANSMIT_DATA, in hdmi_cec_adap_transmit()
332 void hdmi4_cec_set_phys_addr(struct hdmi_core_data *core, u16 pa) in hdmi4_cec_set_phys_addr() argument
334 cec_s_phys_addr(core->adap, pa, false); in hdmi4_cec_set_phys_addr()
337 int hdmi4_cec_init(struct platform_device *pdev, struct hdmi_core_data *core, in hdmi4_cec_init() argument
344 core->adap = cec_allocate_adapter(&hdmi_cec_adap_ops, core, in hdmi4_cec_init()
346 ret = PTR_ERR_OR_ZERO(core->adap); in hdmi4_cec_init()
349 core->wp = wp; in hdmi4_cec_init()
352 REG_FLD_MOD(core->wp->base, HDMI_WP_CLK, 0, 5, 0); in hdmi4_cec_init()
354 ret = cec_register_adapter(core->adap, &pdev->dev); in hdmi4_cec_init()
356 cec_delete_adapter(core->adap); in hdmi4_cec_init()
362 void hdmi4_cec_uninit(struct hdmi_core_data *core) in hdmi4_cec_uninit() argument
364 cec_unregister_adapter(core->adap); in hdmi4_cec_uninit()