Lines Matching full:rc

127 	int rc;  in mchp_set_clock_reload()  local
129 rc = mchp_rds_phy_write_mmd(clock, in mchp_set_clock_reload()
133 if (rc < 0) in mchp_set_clock_reload()
134 return rc; in mchp_set_clock_reload()
136 rc = mchp_rds_phy_write_mmd(clock, in mchp_set_clock_reload()
140 if (rc < 0) in mchp_set_clock_reload()
141 return rc; in mchp_set_clock_reload()
143 rc = mchp_rds_phy_write_mmd(clock, in mchp_set_clock_reload()
147 if (rc < 0) in mchp_set_clock_reload()
148 return rc; in mchp_set_clock_reload()
159 int rc; in mchp_set_clock_target() local
162 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_CLK_TRGT_SEC_LO, in mchp_set_clock_target()
165 if (rc < 0) in mchp_set_clock_target()
166 return rc; in mchp_set_clock_target()
168 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_CLK_TRGT_SEC_HI, in mchp_set_clock_target()
171 if (rc < 0) in mchp_set_clock_target()
172 return rc; in mchp_set_clock_target()
174 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_CLK_TRGT_NS_LO, in mchp_set_clock_target()
177 if (rc < 0) in mchp_set_clock_target()
178 return rc; in mchp_set_clock_target()
188 int rc; in mchp_rds_ptp_perout_off() local
191 rc = mchp_set_clock_target(clock, 0xFFFFFFFF, 0); in mchp_rds_ptp_perout_off()
192 if (rc < 0) in mchp_rds_ptp_perout_off()
193 return rc; in mchp_rds_ptp_perout_off()
198 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_GEN_CFG, in mchp_rds_ptp_perout_off()
200 if (rc < 0) in mchp_rds_ptp_perout_off()
201 return rc; in mchp_rds_ptp_perout_off()
297 int rc; in mchp_rds_ptp_flush_fifo() local
305 rc = mchp_rds_phy_read_mmd(clock, in mchp_rds_ptp_flush_fifo()
310 if (rc < 0) in mchp_rds_ptp_flush_fifo()
311 return rc; in mchp_rds_ptp_flush_fifo()
378 bool rc = false; in mchp_rds_ptp_match_skb() local
391 rc = true; in mchp_rds_ptp_match_skb()
396 if (rc) { in mchp_rds_ptp_match_skb()
402 return rc; in mchp_rds_ptp_match_skb()
493 int rc; in mchp_rds_ptp_hwtstamp() local
538 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_RX_PARSE_CONFIG, in mchp_rds_ptp_hwtstamp()
540 if (rc < 0) in mchp_rds_ptp_hwtstamp()
541 return rc; in mchp_rds_ptp_hwtstamp()
543 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_TX_PARSE_CONFIG, in mchp_rds_ptp_hwtstamp()
545 if (rc < 0) in mchp_rds_ptp_hwtstamp()
546 return rc; in mchp_rds_ptp_hwtstamp()
548 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_RX_TIMESTAMP_EN, in mchp_rds_ptp_hwtstamp()
551 if (rc < 0) in mchp_rds_ptp_hwtstamp()
552 return rc; in mchp_rds_ptp_hwtstamp()
554 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_TX_TIMESTAMP_EN, in mchp_rds_ptp_hwtstamp()
557 if (rc < 0) in mchp_rds_ptp_hwtstamp()
558 return rc; in mchp_rds_ptp_hwtstamp()
562 rc = mchp_rds_phy_modify_mmd(clock, MCHP_RDS_PTP_TX_MOD, in mchp_rds_ptp_hwtstamp()
567 rc = mchp_rds_phy_modify_mmd(clock, MCHP_RDS_PTP_TX_MOD, in mchp_rds_ptp_hwtstamp()
572 if (rc < 0) in mchp_rds_ptp_hwtstamp()
573 return rc; in mchp_rds_ptp_hwtstamp()
583 rc = mchp_rds_ptp_flush_fifo(clock, MCHP_RDS_PTP_INGRESS_FIFO); in mchp_rds_ptp_hwtstamp()
584 if (rc < 0) in mchp_rds_ptp_hwtstamp()
585 return rc; in mchp_rds_ptp_hwtstamp()
587 rc = mchp_rds_ptp_flush_fifo(clock, MCHP_RDS_PTP_EGRESS_FIFO); in mchp_rds_ptp_hwtstamp()
588 if (rc < 0) in mchp_rds_ptp_hwtstamp()
589 return rc; in mchp_rds_ptp_hwtstamp()
592 rc = mchp_rds_ptp_config_intr(clock, in mchp_rds_ptp_hwtstamp()
595 return rc < 0 ? rc : 0; in mchp_rds_ptp_hwtstamp()
629 int rc = 0; in mchp_rds_ptp_ltc_adjtime() local
680 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_STEP_ADJ_LO, in mchp_rds_ptp_ltc_adjtime()
682 if (rc < 0) in mchp_rds_ptp_ltc_adjtime()
685 rc = mchp_rds_phy_set_bits_mmd(clock, MCHP_RDS_PTP_STEP_ADJ_HI, in mchp_rds_ptp_ltc_adjtime()
691 if (rc < 0) in mchp_rds_ptp_ltc_adjtime()
694 rc = mchp_rds_phy_set_bits_mmd(clock, MCHP_RDS_PTP_CMD_CTL, in mchp_rds_ptp_ltc_adjtime()
697 if (rc < 0) in mchp_rds_ptp_ltc_adjtime()
702 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_STEP_ADJ_LO, in mchp_rds_ptp_ltc_adjtime()
705 if (rc < 0) in mchp_rds_ptp_ltc_adjtime()
708 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_STEP_ADJ_HI, in mchp_rds_ptp_ltc_adjtime()
711 if (rc < 0) in mchp_rds_ptp_ltc_adjtime()
714 rc = mchp_rds_phy_set_bits_mmd(clock, MCHP_RDS_PTP_CMD_CTL, in mchp_rds_ptp_ltc_adjtime()
732 return rc; in mchp_rds_ptp_ltc_adjtime()
744 int rc; in mchp_rds_ptp_ltc_adjfine() local
764 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_LTC_RATE_ADJ_HI, in mchp_rds_ptp_ltc_adjfine()
766 if (rc < 0) in mchp_rds_ptp_ltc_adjfine()
769 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_LTC_RATE_ADJ_LO, in mchp_rds_ptp_ltc_adjfine()
771 if (rc > 0) in mchp_rds_ptp_ltc_adjfine()
772 rc = 0; in mchp_rds_ptp_ltc_adjfine()
776 return rc; in mchp_rds_ptp_ltc_adjfine()
786 int rc = 0; in mchp_rds_ptp_ltc_gettime64() local
793 rc = mchp_rds_phy_set_bits_mmd(clock, MCHP_RDS_PTP_CMD_CTL, in mchp_rds_ptp_ltc_gettime64()
796 if (rc < 0) in mchp_rds_ptp_ltc_gettime64()
800 rc = mchp_rds_phy_read_mmd(clock, MCHP_RDS_PTP_LTC_READ_SEC_HI, in mchp_rds_ptp_ltc_gettime64()
802 if (rc < 0) in mchp_rds_ptp_ltc_gettime64()
804 secs = rc << 16; in mchp_rds_ptp_ltc_gettime64()
806 rc = mchp_rds_phy_read_mmd(clock, MCHP_RDS_PTP_LTC_READ_SEC_MID, in mchp_rds_ptp_ltc_gettime64()
808 if (rc < 0) in mchp_rds_ptp_ltc_gettime64()
810 secs |= rc; in mchp_rds_ptp_ltc_gettime64()
813 rc = mchp_rds_phy_read_mmd(clock, MCHP_RDS_PTP_LTC_READ_SEC_LO, in mchp_rds_ptp_ltc_gettime64()
815 if (rc < 0) in mchp_rds_ptp_ltc_gettime64()
817 secs |= rc; in mchp_rds_ptp_ltc_gettime64()
819 rc = mchp_rds_phy_read_mmd(clock, MCHP_RDS_PTP_LTC_READ_NS_HI, in mchp_rds_ptp_ltc_gettime64()
821 if (rc < 0) in mchp_rds_ptp_ltc_gettime64()
823 nsecs = (rc & GENMASK(13, 0)); in mchp_rds_ptp_ltc_gettime64()
826 rc = mchp_rds_phy_read_mmd(clock, MCHP_RDS_PTP_LTC_READ_NS_LO, in mchp_rds_ptp_ltc_gettime64()
828 if (rc < 0) in mchp_rds_ptp_ltc_gettime64()
830 nsecs |= rc; in mchp_rds_ptp_ltc_gettime64()
834 if (rc > 0) in mchp_rds_ptp_ltc_gettime64()
835 rc = 0; in mchp_rds_ptp_ltc_gettime64()
839 return rc; in mchp_rds_ptp_ltc_gettime64()
848 int rc; in mchp_rds_ptp_ltc_settime64() local
851 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_LTC_SEC_LO, in mchp_rds_ptp_ltc_settime64()
854 if (rc < 0) in mchp_rds_ptp_ltc_settime64()
857 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_LTC_SEC_MID, in mchp_rds_ptp_ltc_settime64()
860 if (rc < 0) in mchp_rds_ptp_ltc_settime64()
863 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_LTC_SEC_HI, in mchp_rds_ptp_ltc_settime64()
866 if (rc < 0) in mchp_rds_ptp_ltc_settime64()
869 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_LTC_NS_LO, in mchp_rds_ptp_ltc_settime64()
872 if (rc < 0) in mchp_rds_ptp_ltc_settime64()
875 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_LTC_NS_HI, in mchp_rds_ptp_ltc_settime64()
878 if (rc < 0) in mchp_rds_ptp_ltc_settime64()
884 rc = mchp_rds_phy_set_bits_mmd(clock, MCHP_RDS_PTP_CMD_CTL, in mchp_rds_ptp_ltc_settime64()
887 if (rc > 0) in mchp_rds_ptp_ltc_settime64()
888 rc = 0; in mchp_rds_ptp_ltc_settime64()
892 return rc; in mchp_rds_ptp_ltc_settime64()
919 bool rc = false; in mchp_rds_ptp_match_tx_skb() local
931 rc = true; in mchp_rds_ptp_match_tx_skb()
936 if (rc) { in mchp_rds_ptp_match_tx_skb()
948 int rc; in mchp_rds_ptp_get_rx_ts() local
950 rc = mchp_rds_phy_read_mmd(clock, MCHP_RDS_PTP_RX_INGRESS_NS_HI, in mchp_rds_ptp_get_rx_ts()
952 if (rc < 0) in mchp_rds_ptp_get_rx_ts()
954 if (!(rc & MCHP_RDS_PTP_RX_INGRESS_NS_HI_TS_VALID)) { in mchp_rds_ptp_get_rx_ts()
958 nsec = (rc & GENMASK(13, 0)) << 16; in mchp_rds_ptp_get_rx_ts()
960 rc = mchp_rds_phy_read_mmd(clock, MCHP_RDS_PTP_RX_INGRESS_NS_LO, in mchp_rds_ptp_get_rx_ts()
962 if (rc < 0) in mchp_rds_ptp_get_rx_ts()
964 nsec |= rc; in mchp_rds_ptp_get_rx_ts()
966 rc = mchp_rds_phy_read_mmd(clock, MCHP_RDS_PTP_RX_INGRESS_SEC_HI, in mchp_rds_ptp_get_rx_ts()
968 if (rc < 0) in mchp_rds_ptp_get_rx_ts()
970 sec = rc << 16; in mchp_rds_ptp_get_rx_ts()
972 rc = mchp_rds_phy_read_mmd(clock, MCHP_RDS_PTP_RX_INGRESS_SEC_LO, in mchp_rds_ptp_get_rx_ts()
974 if (rc < 0) in mchp_rds_ptp_get_rx_ts()
976 sec |= rc; in mchp_rds_ptp_get_rx_ts()
978 rc = mchp_rds_phy_read_mmd(clock, MCHP_RDS_PTP_RX_MSG_HDR2, in mchp_rds_ptp_get_rx_ts()
980 if (rc < 0) in mchp_rds_ptp_get_rx_ts()
989 rx_ts->seq_id = rc; in mchp_rds_ptp_get_rx_ts()
1016 int rc; in mchp_rds_ptp_get_tx_ts() local
1018 rc = mchp_rds_phy_read_mmd(clock, MCHP_RDS_PTP_TX_EGRESS_NS_HI, in mchp_rds_ptp_get_tx_ts()
1020 if (rc < 0) in mchp_rds_ptp_get_tx_ts()
1022 if (!(rc & MCHP_RDS_PTP_TX_EGRESS_NS_HI_TS_VALID)) in mchp_rds_ptp_get_tx_ts()
1024 *nsec = (rc & GENMASK(13, 0)) << 16; in mchp_rds_ptp_get_tx_ts()
1026 rc = mchp_rds_phy_read_mmd(clock, MCHP_RDS_PTP_TX_EGRESS_NS_LO, in mchp_rds_ptp_get_tx_ts()
1028 if (rc < 0) in mchp_rds_ptp_get_tx_ts()
1030 *nsec = *nsec | rc; in mchp_rds_ptp_get_tx_ts()
1032 rc = mchp_rds_phy_read_mmd(clock, MCHP_RDS_PTP_TX_EGRESS_SEC_HI, in mchp_rds_ptp_get_tx_ts()
1034 if (rc < 0) in mchp_rds_ptp_get_tx_ts()
1036 *sec = rc << 16; in mchp_rds_ptp_get_tx_ts()
1038 rc = mchp_rds_phy_read_mmd(clock, MCHP_RDS_PTP_TX_EGRESS_SEC_LO, in mchp_rds_ptp_get_tx_ts()
1040 if (rc < 0) in mchp_rds_ptp_get_tx_ts()
1042 *sec = *sec | rc; in mchp_rds_ptp_get_tx_ts()
1044 rc = mchp_rds_phy_read_mmd(clock, MCHP_RDS_PTP_TX_MSG_HDR2, in mchp_rds_ptp_get_tx_ts()
1046 if (rc < 0) in mchp_rds_ptp_get_tx_ts()
1049 *seq = rc; in mchp_rds_ptp_get_tx_ts()
1122 int rc; in mchp_rds_ptp_init() local
1125 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_CMD_CTL, in mchp_rds_ptp_init()
1128 if (rc < 0) in mchp_rds_ptp_init()
1129 return rc; in mchp_rds_ptp_init()
1132 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_TSU_GEN_CONFIG, in mchp_rds_ptp_init()
1134 if (rc < 0) in mchp_rds_ptp_init()
1135 return rc; in mchp_rds_ptp_init()
1138 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_TSU_HARD_RESET, in mchp_rds_ptp_init()
1141 if (rc < 0) in mchp_rds_ptp_init()
1142 return rc; in mchp_rds_ptp_init()
1145 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_LATENCY_CORRECTION_CTL, in mchp_rds_ptp_init()
1148 if (rc < 0) in mchp_rds_ptp_init()
1149 return rc; in mchp_rds_ptp_init()
1152 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_OP_MODE, in mchp_rds_ptp_init()
1155 if (rc < 0) in mchp_rds_ptp_init()
1156 return rc; in mchp_rds_ptp_init()
1159 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_REF_CLK_CFG, in mchp_rds_ptp_init()
1162 if (rc < 0) in mchp_rds_ptp_init()
1163 return rc; in mchp_rds_ptp_init()
1166 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_RX_PARSE_CONFIG, in mchp_rds_ptp_init()
1168 if (rc < 0) in mchp_rds_ptp_init()
1169 return rc; in mchp_rds_ptp_init()
1171 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_TX_PARSE_CONFIG, in mchp_rds_ptp_init()
1173 if (rc < 0) in mchp_rds_ptp_init()
1174 return rc; in mchp_rds_ptp_init()
1176 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_TX_PARSE_L2_ADDR_EN, in mchp_rds_ptp_init()
1178 if (rc < 0) in mchp_rds_ptp_init()
1179 return rc; in mchp_rds_ptp_init()
1181 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_RX_PARSE_L2_ADDR_EN, in mchp_rds_ptp_init()
1183 if (rc < 0) in mchp_rds_ptp_init()
1184 return rc; in mchp_rds_ptp_init()
1186 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_RX_PARSE_IPV4_ADDR_EN, in mchp_rds_ptp_init()
1188 if (rc < 0) in mchp_rds_ptp_init()
1189 return rc; in mchp_rds_ptp_init()
1191 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_TX_PARSE_IPV4_ADDR_EN, in mchp_rds_ptp_init()
1193 if (rc < 0) in mchp_rds_ptp_init()
1194 return rc; in mchp_rds_ptp_init()
1196 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_RX_VERSION, in mchp_rds_ptp_init()
1200 if (rc < 0) in mchp_rds_ptp_init()
1201 return rc; in mchp_rds_ptp_init()
1203 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_TX_VERSION, in mchp_rds_ptp_init()
1207 if (rc < 0) in mchp_rds_ptp_init()
1208 return rc; in mchp_rds_ptp_init()
1211 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_TSU_GEN_CONFIG, in mchp_rds_ptp_init()
1214 if (rc < 0) in mchp_rds_ptp_init()
1215 return rc; in mchp_rds_ptp_init()
1228 int rc; in mchp_rds_ptp_probe() local
1299 rc = mchp_rds_ptp_init(clock); in mchp_rds_ptp_probe()
1300 if (rc < 0) in mchp_rds_ptp_probe()
1301 return ERR_PTR(rc); in mchp_rds_ptp_probe()