Lines Matching refs:cl
35 void ssi_waketest(struct hsi_client *cl, unsigned int enable);
141 struct hsi_client *cl; member
219 struct ssi_protocol *ssi = hsi_client_drvdata(msg->cl); in ssip_release_cmd()
221 dev_dbg(&msg->cl->device, "Release cmd 0x%08x\n", ssip_get_cmd(msg)); in ssip_release_cmd()
333 if (slave->device.parent == ssi->cl->device.parent) { in ssip_slave_get_master()
334 master = ssi->cl; in ssip_slave_get_master()
387 static void ssip_reset(struct hsi_client *cl) in ssip_reset() argument
389 struct ssi_protocol *ssi = hsi_client_drvdata(cl); in ssip_reset()
395 hsi_flush(cl); in ssip_reset()
398 hsi_stop_tx(cl); in ssip_reset()
401 ssi_waketest(cl, 0); /* FIXME: To be removed */ in ssip_reset()
414 dev_dbg(&cl->device, "Pending TX data\n"); in ssip_reset()
422 static void ssip_dump_state(struct hsi_client *cl) in ssip_dump_state() argument
424 struct ssi_protocol *ssi = hsi_client_drvdata(cl); in ssip_dump_state()
428 dev_err(&cl->device, "Main state: %d\n", ssi->main_state); in ssip_dump_state()
429 dev_err(&cl->device, "Recv state: %d\n", ssi->recv_state); in ssip_dump_state()
430 dev_err(&cl->device, "Send state: %d\n", ssi->send_state); in ssip_dump_state()
431 dev_err(&cl->device, "CMT %s\n", (ssi->main_state == ACTIVE) ? in ssip_dump_state()
433 dev_err(&cl->device, "Wake test %d\n", in ssip_dump_state()
435 dev_err(&cl->device, "Data RX id: %d\n", ssi->rxid); in ssip_dump_state()
436 dev_err(&cl->device, "Data TX id: %d\n", ssi->txid); in ssip_dump_state()
439 dev_err(&cl->device, "pending TX data (%p)\n", msg); in ssip_dump_state()
443 static void ssip_error(struct hsi_client *cl) in ssip_error() argument
445 struct ssi_protocol *ssi = hsi_client_drvdata(cl); in ssip_error()
448 ssip_dump_state(cl); in ssip_error()
449 ssip_reset(cl); in ssip_error()
452 hsi_async_read(cl, msg); in ssip_error()
458 struct hsi_client *cl = ssi->cl; in ssip_keep_alive() local
460 dev_dbg(&cl->device, "Keep alive kick in: m(%d) r(%d) s(%d)\n", in ssip_keep_alive()
485 struct hsi_client *cl = ssi->cl; in ssip_rx_wd() local
487 dev_err(&cl->device, "Watchdog triggered\n"); in ssip_rx_wd()
488 ssip_error(cl); in ssip_rx_wd()
494 struct hsi_client *cl = ssi->cl; in ssip_tx_wd() local
496 dev_err(&cl->device, "Watchdog triggered\n"); in ssip_tx_wd()
497 ssip_error(cl); in ssip_tx_wd()
500 static void ssip_send_bootinfo_req_cmd(struct hsi_client *cl) in ssip_send_bootinfo_req_cmd() argument
502 struct ssi_protocol *ssi = hsi_client_drvdata(cl); in ssip_send_bootinfo_req_cmd()
505 dev_dbg(&cl->device, "Issuing BOOT INFO REQ command\n"); in ssip_send_bootinfo_req_cmd()
509 hsi_async_write(cl, msg); in ssip_send_bootinfo_req_cmd()
510 dev_dbg(&cl->device, "Issuing RX command\n"); in ssip_send_bootinfo_req_cmd()
513 hsi_async_read(cl, msg); in ssip_send_bootinfo_req_cmd()
516 static void ssip_start_rx(struct hsi_client *cl) in ssip_start_rx() argument
518 struct ssi_protocol *ssi = hsi_client_drvdata(cl); in ssip_start_rx()
521 dev_dbg(&cl->device, "RX start M(%d) R(%d)\n", ssi->main_state, in ssip_start_rx()
538 dev_dbg(&cl->device, "Send READY\n"); in ssip_start_rx()
539 hsi_async_write(cl, msg); in ssip_start_rx()
542 static void ssip_stop_rx(struct hsi_client *cl) in ssip_stop_rx() argument
544 struct ssi_protocol *ssi = hsi_client_drvdata(cl); in ssip_stop_rx()
546 dev_dbg(&cl->device, "RX stop M(%d)\n", ssi->main_state); in ssip_stop_rx()
561 struct hsi_client *cl = msg->cl; in ssip_strans_complete() local
562 struct ssi_protocol *ssi = hsi_client_drvdata(cl); in ssip_strans_complete()
570 hsi_async_write(cl, data); in ssip_strans_complete()
573 static int ssip_xmit(struct hsi_client *cl) in ssip_xmit() argument
575 struct ssi_protocol *ssi = hsi_client_drvdata(cl); in ssip_xmit()
602 dev_dbg(&cl->device, "Send STRANS (%d frames)\n", in ssip_xmit()
605 return hsi_async_write(cl, msg); in ssip_xmit()
642 struct hsi_client *cl = msg->cl; in ssip_rx_data_complete() local
643 struct ssi_protocol *ssi = hsi_client_drvdata(cl); in ssip_rx_data_complete()
647 dev_err(&cl->device, "RX data error\n"); in ssip_rx_data_complete()
649 ssip_error(cl); in ssip_rx_data_complete()
658 static void ssip_rx_bootinforeq(struct hsi_client *cl, u32 cmd) in ssip_rx_bootinforeq() argument
660 struct ssi_protocol *ssi = hsi_client_drvdata(cl); in ssip_rx_bootinforeq()
669 dev_err(&cl->device, "Boot info req on active state\n"); in ssip_rx_bootinforeq()
670 ssip_error(cl); in ssip_rx_bootinforeq()
679 ssi_waketest(cl, 1); /* FIXME: To be removed */ in ssip_rx_bootinforeq()
685 dev_dbg(&cl->device, "Send BOOTINFO_RESP\n"); in ssip_rx_bootinforeq()
687 dev_warn(&cl->device, "boot info req verid mismatch\n"); in ssip_rx_bootinforeq()
691 hsi_async_write(cl, msg); in ssip_rx_bootinforeq()
694 dev_dbg(&cl->device, "Wrong state M(%d)\n", ssi->main_state); in ssip_rx_bootinforeq()
699 static void ssip_rx_bootinforesp(struct hsi_client *cl, u32 cmd) in ssip_rx_bootinforesp() argument
701 struct ssi_protocol *ssi = hsi_client_drvdata(cl); in ssip_rx_bootinforesp()
704 dev_warn(&cl->device, "boot info resp verid mismatch\n"); in ssip_rx_bootinforesp()
711 dev_dbg(&cl->device, "boot info resp ignored M(%d)\n", in ssip_rx_bootinforesp()
716 static void ssip_rx_waketest(struct hsi_client *cl, u32 cmd) in ssip_rx_waketest() argument
718 struct ssi_protocol *ssi = hsi_client_drvdata(cl); in ssip_rx_waketest()
723 dev_dbg(&cl->device, "wake lines test ignored M(%d)\n", in ssip_rx_waketest()
731 ssi_waketest(cl, 0); /* FIXME: To be removed */ in ssip_rx_waketest()
738 dev_notice(&cl->device, "WAKELINES TEST %s\n", in ssip_rx_waketest()
741 ssip_error(cl); in ssip_rx_waketest()
744 dev_dbg(&cl->device, "CMT is ONLINE\n"); in ssip_rx_waketest()
749 static void ssip_rx_ready(struct hsi_client *cl) in ssip_rx_ready() argument
751 struct ssi_protocol *ssi = hsi_client_drvdata(cl); in ssip_rx_ready()
755 dev_dbg(&cl->device, "READY on wrong state: S(%d) M(%d)\n", in ssip_rx_ready()
761 dev_dbg(&cl->device, "Ignore spurious READY command\n"); in ssip_rx_ready()
767 ssip_xmit(cl); in ssip_rx_ready()
770 static void ssip_rx_strans(struct hsi_client *cl, u32 cmd) in ssip_rx_strans() argument
772 struct ssi_protocol *ssi = hsi_client_drvdata(cl); in ssip_rx_strans()
777 dev_dbg(&cl->device, "RX strans: %d frames\n", len); in ssip_rx_strans()
780 dev_err(&cl->device, "START TRANS wrong state: S(%d) M(%d)\n", in ssip_rx_strans()
787 dev_err(&cl->device, "START TRANS id %d expected %d\n", in ssip_rx_strans()
796 dev_err(&cl->device, "No memory for rx skb\n"); in ssip_rx_strans()
802 dev_err(&cl->device, "No memory for RX data msg\n"); in ssip_rx_strans()
806 hsi_async_read(cl, msg); in ssip_rx_strans()
812 ssip_error(cl); in ssip_rx_strans()
817 struct hsi_client *cl = msg->cl; in ssip_rxcmd_complete() local
822 dev_err(&cl->device, "RX error detected\n"); in ssip_rxcmd_complete()
824 ssip_error(cl); in ssip_rxcmd_complete()
827 hsi_async_read(cl, msg); in ssip_rxcmd_complete()
828 dev_dbg(&cl->device, "RX cmd: 0x%08x\n", cmd); in ssip_rxcmd_complete()
834 ssip_rx_bootinforeq(cl, cmd); in ssip_rxcmd_complete()
837 ssip_rx_bootinforesp(cl, cmd); in ssip_rxcmd_complete()
840 ssip_rx_waketest(cl, cmd); in ssip_rxcmd_complete()
843 ssip_rx_strans(cl, cmd); in ssip_rxcmd_complete()
846 ssip_rx_ready(cl); in ssip_rxcmd_complete()
849 dev_warn(&cl->device, "command 0x%08x not supported\n", cmd); in ssip_rxcmd_complete()
856 struct hsi_client *cl = msg->cl; in ssip_swbreak_complete() local
857 struct ssi_protocol *ssi = hsi_client_drvdata(cl); in ssip_swbreak_complete()
866 hsi_stop_tx(cl); in ssip_swbreak_complete()
871 ssip_xmit(cl); in ssip_swbreak_complete()
878 struct hsi_client *cl = msg->cl; in ssip_tx_data_complete() local
879 struct ssi_protocol *ssi = hsi_client_drvdata(cl); in ssip_tx_data_complete()
883 dev_err(&cl->device, "TX data error\n"); in ssip_tx_data_complete()
884 ssip_error(cl); in ssip_tx_data_complete()
894 dev_dbg(&cl->device, "Send SWBREAK\n"); in ssip_tx_data_complete()
895 hsi_async_write(cl, cmsg); in ssip_tx_data_complete()
898 ssip_xmit(cl); in ssip_tx_data_complete()
904 static void ssip_port_event(struct hsi_client *cl, unsigned long event) in ssip_port_event() argument
908 ssip_start_rx(cl); in ssip_port_event()
911 ssip_stop_rx(cl); in ssip_port_event()
920 struct hsi_client *cl = to_hsi_client(dev->dev.parent); in ssip_pn_open() local
921 struct ssi_protocol *ssi = hsi_client_drvdata(cl); in ssip_pn_open()
924 err = hsi_claim_port(cl, 1); in ssip_pn_open()
926 dev_err(&cl->device, "SSI port already claimed\n"); in ssip_pn_open()
929 err = hsi_register_port_event(cl, ssip_port_event); in ssip_pn_open()
931 dev_err(&cl->device, "Register HSI port event failed (%d)\n", in ssip_pn_open()
933 hsi_release_port(cl); in ssip_pn_open()
936 dev_dbg(&cl->device, "Configuring SSI port\n"); in ssip_pn_open()
937 hsi_setup(cl); in ssip_pn_open()
940 ssi_waketest(cl, 1); /* FIXME: To be removed */ in ssip_pn_open()
946 ssip_send_bootinfo_req_cmd(cl); in ssip_pn_open()
953 struct hsi_client *cl = to_hsi_client(dev->dev.parent); in ssip_pn_stop() local
955 ssip_reset(cl); in ssip_pn_stop()
956 hsi_unregister_port_event(cl); in ssip_pn_stop()
957 hsi_release_port(cl); in ssip_pn_stop()
966 struct hsi_client *cl = ssi->cl; in ssip_xmit_work() local
968 ssip_xmit(cl); in ssip_xmit_work()
973 struct hsi_client *cl = to_hsi_client(dev->dev.parent); in ssip_pn_xmit() local
974 struct ssi_protocol *ssi = hsi_client_drvdata(cl); in ssip_pn_xmit()
996 dev_dbg(&cl->device, "Dropping tx data: No memory\n"); in ssip_pn_xmit()
1004 dev_dbg(&cl->device, "Dropping tx data: CMT is OFFLINE\n"); in ssip_pn_xmit()
1010 dev_info(&cl->device, "TX queue full %d\n", ssi->txqueue_len); in ssip_pn_xmit()
1016 dev_dbg(&cl->device, "Start TX qlen %d\n", ssi->txqueue_len); in ssip_pn_xmit()
1017 hsi_start_tx(cl); in ssip_pn_xmit()
1020 dev_dbg(&cl->device, "Start TX on SEND READY qlen %d\n", in ssip_pn_xmit()
1045 dev_err(&ssi->cl->device, "CMT reset detected!\n"); in ssip_reset_event()
1046 ssip_error(ssi->cl); in ssip_reset_event()
1077 struct hsi_client *cl = to_hsi_client(dev); in ssi_protocol_probe() local
1092 hsi_client_set_drvdata(cl, ssi); in ssi_protocol_probe()
1093 ssi->cl = cl; in ssi_protocol_probe()
1096 ssi->channel_id_cmd = hsi_get_channel_id_by_name(cl, "mcsaab-control"); in ssi_protocol_probe()
1103 ssi->channel_id_data = hsi_get_channel_id_by_name(cl, "mcsaab-data"); in ssi_protocol_probe()
1153 struct hsi_client *cl = to_hsi_client(dev); in ssi_protocol_remove() local
1154 struct ssi_protocol *ssi = hsi_client_drvdata(cl); in ssi_protocol_remove()
1159 hsi_client_set_drvdata(cl, NULL); in ssi_protocol_remove()