Lines Matching refs: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()
293 int rc; in mchp_rds_ptp_flush_fifo() local
301 rc = mchp_rds_phy_read_mmd(clock, in mchp_rds_ptp_flush_fifo()
306 if (rc < 0) in mchp_rds_ptp_flush_fifo()
307 return rc; in mchp_rds_ptp_flush_fifo()
374 bool rc = false; in mchp_rds_ptp_match_skb() local
387 rc = true; in mchp_rds_ptp_match_skb()
392 if (rc) { in mchp_rds_ptp_match_skb()
398 return rc; in mchp_rds_ptp_match_skb()
489 int rc; in mchp_rds_ptp_hwtstamp() local
534 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_RX_PARSE_CONFIG, in mchp_rds_ptp_hwtstamp()
536 if (rc < 0) in mchp_rds_ptp_hwtstamp()
537 return rc; in mchp_rds_ptp_hwtstamp()
539 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_TX_PARSE_CONFIG, in mchp_rds_ptp_hwtstamp()
541 if (rc < 0) in mchp_rds_ptp_hwtstamp()
542 return rc; in mchp_rds_ptp_hwtstamp()
544 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_RX_TIMESTAMP_EN, in mchp_rds_ptp_hwtstamp()
547 if (rc < 0) in mchp_rds_ptp_hwtstamp()
548 return rc; in mchp_rds_ptp_hwtstamp()
550 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_TX_TIMESTAMP_EN, in mchp_rds_ptp_hwtstamp()
553 if (rc < 0) in mchp_rds_ptp_hwtstamp()
554 return rc; in mchp_rds_ptp_hwtstamp()
558 rc = mchp_rds_phy_modify_mmd(clock, MCHP_RDS_PTP_TX_MOD, in mchp_rds_ptp_hwtstamp()
563 rc = mchp_rds_phy_modify_mmd(clock, MCHP_RDS_PTP_TX_MOD, in mchp_rds_ptp_hwtstamp()
568 if (rc < 0) in mchp_rds_ptp_hwtstamp()
569 return rc; in mchp_rds_ptp_hwtstamp()
579 rc = mchp_rds_ptp_flush_fifo(clock, MCHP_RDS_PTP_INGRESS_FIFO); in mchp_rds_ptp_hwtstamp()
580 if (rc < 0) in mchp_rds_ptp_hwtstamp()
581 return rc; in mchp_rds_ptp_hwtstamp()
583 rc = mchp_rds_ptp_flush_fifo(clock, MCHP_RDS_PTP_EGRESS_FIFO); in mchp_rds_ptp_hwtstamp()
584 if (rc < 0) in mchp_rds_ptp_hwtstamp()
585 return rc; in mchp_rds_ptp_hwtstamp()
588 rc = mchp_rds_ptp_config_intr(clock, in mchp_rds_ptp_hwtstamp()
591 return rc < 0 ? rc : 0; in mchp_rds_ptp_hwtstamp()
625 int rc = 0; in mchp_rds_ptp_ltc_adjtime() local
676 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_STEP_ADJ_LO, in mchp_rds_ptp_ltc_adjtime()
678 if (rc < 0) in mchp_rds_ptp_ltc_adjtime()
681 rc = mchp_rds_phy_set_bits_mmd(clock, MCHP_RDS_PTP_STEP_ADJ_HI, in mchp_rds_ptp_ltc_adjtime()
687 if (rc < 0) in mchp_rds_ptp_ltc_adjtime()
690 rc = mchp_rds_phy_set_bits_mmd(clock, MCHP_RDS_PTP_CMD_CTL, in mchp_rds_ptp_ltc_adjtime()
693 if (rc < 0) in mchp_rds_ptp_ltc_adjtime()
698 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_STEP_ADJ_LO, in mchp_rds_ptp_ltc_adjtime()
701 if (rc < 0) in mchp_rds_ptp_ltc_adjtime()
704 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_STEP_ADJ_HI, in mchp_rds_ptp_ltc_adjtime()
707 if (rc < 0) in mchp_rds_ptp_ltc_adjtime()
710 rc = mchp_rds_phy_set_bits_mmd(clock, MCHP_RDS_PTP_CMD_CTL, in mchp_rds_ptp_ltc_adjtime()
728 return rc; in mchp_rds_ptp_ltc_adjtime()
740 int rc; in mchp_rds_ptp_ltc_adjfine() local
760 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_LTC_RATE_ADJ_HI, in mchp_rds_ptp_ltc_adjfine()
762 if (rc < 0) in mchp_rds_ptp_ltc_adjfine()
765 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_LTC_RATE_ADJ_LO, in mchp_rds_ptp_ltc_adjfine()
767 if (rc > 0) in mchp_rds_ptp_ltc_adjfine()
768 rc = 0; in mchp_rds_ptp_ltc_adjfine()
772 return rc; in mchp_rds_ptp_ltc_adjfine()
782 int rc = 0; in mchp_rds_ptp_ltc_gettime64() local
789 rc = mchp_rds_phy_set_bits_mmd(clock, MCHP_RDS_PTP_CMD_CTL, in mchp_rds_ptp_ltc_gettime64()
792 if (rc < 0) in mchp_rds_ptp_ltc_gettime64()
796 rc = mchp_rds_phy_read_mmd(clock, MCHP_RDS_PTP_LTC_READ_SEC_HI, in mchp_rds_ptp_ltc_gettime64()
798 if (rc < 0) in mchp_rds_ptp_ltc_gettime64()
800 secs = rc << 16; in mchp_rds_ptp_ltc_gettime64()
802 rc = mchp_rds_phy_read_mmd(clock, MCHP_RDS_PTP_LTC_READ_SEC_MID, in mchp_rds_ptp_ltc_gettime64()
804 if (rc < 0) in mchp_rds_ptp_ltc_gettime64()
806 secs |= rc; in mchp_rds_ptp_ltc_gettime64()
809 rc = mchp_rds_phy_read_mmd(clock, MCHP_RDS_PTP_LTC_READ_SEC_LO, in mchp_rds_ptp_ltc_gettime64()
811 if (rc < 0) in mchp_rds_ptp_ltc_gettime64()
813 secs |= rc; in mchp_rds_ptp_ltc_gettime64()
815 rc = mchp_rds_phy_read_mmd(clock, MCHP_RDS_PTP_LTC_READ_NS_HI, in mchp_rds_ptp_ltc_gettime64()
817 if (rc < 0) in mchp_rds_ptp_ltc_gettime64()
819 nsecs = (rc & GENMASK(13, 0)); in mchp_rds_ptp_ltc_gettime64()
822 rc = mchp_rds_phy_read_mmd(clock, MCHP_RDS_PTP_LTC_READ_NS_LO, in mchp_rds_ptp_ltc_gettime64()
824 if (rc < 0) in mchp_rds_ptp_ltc_gettime64()
826 nsecs |= rc; in mchp_rds_ptp_ltc_gettime64()
830 if (rc > 0) in mchp_rds_ptp_ltc_gettime64()
831 rc = 0; in mchp_rds_ptp_ltc_gettime64()
835 return rc; in mchp_rds_ptp_ltc_gettime64()
844 int rc; in mchp_rds_ptp_ltc_settime64() local
847 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_LTC_SEC_LO, in mchp_rds_ptp_ltc_settime64()
850 if (rc < 0) in mchp_rds_ptp_ltc_settime64()
853 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_LTC_SEC_MID, in mchp_rds_ptp_ltc_settime64()
856 if (rc < 0) in mchp_rds_ptp_ltc_settime64()
859 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_LTC_SEC_HI, in mchp_rds_ptp_ltc_settime64()
862 if (rc < 0) in mchp_rds_ptp_ltc_settime64()
865 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_LTC_NS_LO, in mchp_rds_ptp_ltc_settime64()
868 if (rc < 0) in mchp_rds_ptp_ltc_settime64()
871 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_LTC_NS_HI, in mchp_rds_ptp_ltc_settime64()
874 if (rc < 0) in mchp_rds_ptp_ltc_settime64()
880 rc = mchp_rds_phy_set_bits_mmd(clock, MCHP_RDS_PTP_CMD_CTL, in mchp_rds_ptp_ltc_settime64()
883 if (rc > 0) in mchp_rds_ptp_ltc_settime64()
884 rc = 0; in mchp_rds_ptp_ltc_settime64()
888 return rc; in mchp_rds_ptp_ltc_settime64()
915 bool rc = false; in mchp_rds_ptp_match_tx_skb() local
927 rc = true; in mchp_rds_ptp_match_tx_skb()
932 if (rc) { in mchp_rds_ptp_match_tx_skb()
944 int rc; in mchp_rds_ptp_get_rx_ts() local
946 rc = mchp_rds_phy_read_mmd(clock, MCHP_RDS_PTP_RX_INGRESS_NS_HI, in mchp_rds_ptp_get_rx_ts()
948 if (rc < 0) in mchp_rds_ptp_get_rx_ts()
950 if (!(rc & MCHP_RDS_PTP_RX_INGRESS_NS_HI_TS_VALID)) { in mchp_rds_ptp_get_rx_ts()
954 nsec = (rc & GENMASK(13, 0)) << 16; in mchp_rds_ptp_get_rx_ts()
956 rc = mchp_rds_phy_read_mmd(clock, MCHP_RDS_PTP_RX_INGRESS_NS_LO, in mchp_rds_ptp_get_rx_ts()
958 if (rc < 0) in mchp_rds_ptp_get_rx_ts()
960 nsec |= rc; in mchp_rds_ptp_get_rx_ts()
962 rc = mchp_rds_phy_read_mmd(clock, MCHP_RDS_PTP_RX_INGRESS_SEC_HI, in mchp_rds_ptp_get_rx_ts()
964 if (rc < 0) in mchp_rds_ptp_get_rx_ts()
966 sec = rc << 16; in mchp_rds_ptp_get_rx_ts()
968 rc = mchp_rds_phy_read_mmd(clock, MCHP_RDS_PTP_RX_INGRESS_SEC_LO, in mchp_rds_ptp_get_rx_ts()
970 if (rc < 0) in mchp_rds_ptp_get_rx_ts()
972 sec |= rc; in mchp_rds_ptp_get_rx_ts()
974 rc = mchp_rds_phy_read_mmd(clock, MCHP_RDS_PTP_RX_MSG_HDR2, in mchp_rds_ptp_get_rx_ts()
976 if (rc < 0) in mchp_rds_ptp_get_rx_ts()
985 rx_ts->seq_id = rc; in mchp_rds_ptp_get_rx_ts()
1012 int rc; in mchp_rds_ptp_get_tx_ts() local
1014 rc = mchp_rds_phy_read_mmd(clock, MCHP_RDS_PTP_TX_EGRESS_NS_HI, in mchp_rds_ptp_get_tx_ts()
1016 if (rc < 0) in mchp_rds_ptp_get_tx_ts()
1018 if (!(rc & MCHP_RDS_PTP_TX_EGRESS_NS_HI_TS_VALID)) in mchp_rds_ptp_get_tx_ts()
1020 *nsec = (rc & GENMASK(13, 0)) << 16; in mchp_rds_ptp_get_tx_ts()
1022 rc = mchp_rds_phy_read_mmd(clock, MCHP_RDS_PTP_TX_EGRESS_NS_LO, in mchp_rds_ptp_get_tx_ts()
1024 if (rc < 0) in mchp_rds_ptp_get_tx_ts()
1026 *nsec = *nsec | rc; in mchp_rds_ptp_get_tx_ts()
1028 rc = mchp_rds_phy_read_mmd(clock, MCHP_RDS_PTP_TX_EGRESS_SEC_HI, in mchp_rds_ptp_get_tx_ts()
1030 if (rc < 0) in mchp_rds_ptp_get_tx_ts()
1032 *sec = rc << 16; in mchp_rds_ptp_get_tx_ts()
1034 rc = mchp_rds_phy_read_mmd(clock, MCHP_RDS_PTP_TX_EGRESS_SEC_LO, in mchp_rds_ptp_get_tx_ts()
1036 if (rc < 0) in mchp_rds_ptp_get_tx_ts()
1038 *sec = *sec | rc; in mchp_rds_ptp_get_tx_ts()
1040 rc = mchp_rds_phy_read_mmd(clock, MCHP_RDS_PTP_TX_MSG_HDR2, in mchp_rds_ptp_get_tx_ts()
1042 if (rc < 0) in mchp_rds_ptp_get_tx_ts()
1045 *seq = rc; in mchp_rds_ptp_get_tx_ts()
1118 int rc; in mchp_rds_ptp_init() local
1121 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_CMD_CTL, in mchp_rds_ptp_init()
1124 if (rc < 0) in mchp_rds_ptp_init()
1125 return rc; in mchp_rds_ptp_init()
1128 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_TSU_GEN_CONFIG, in mchp_rds_ptp_init()
1130 if (rc < 0) in mchp_rds_ptp_init()
1131 return rc; in mchp_rds_ptp_init()
1134 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_TSU_HARD_RESET, in mchp_rds_ptp_init()
1137 if (rc < 0) in mchp_rds_ptp_init()
1138 return rc; in mchp_rds_ptp_init()
1141 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_LATENCY_CORRECTION_CTL, in mchp_rds_ptp_init()
1144 if (rc < 0) in mchp_rds_ptp_init()
1145 return rc; in mchp_rds_ptp_init()
1148 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_OP_MODE, in mchp_rds_ptp_init()
1151 if (rc < 0) in mchp_rds_ptp_init()
1152 return rc; in mchp_rds_ptp_init()
1155 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_REF_CLK_CFG, in mchp_rds_ptp_init()
1158 if (rc < 0) in mchp_rds_ptp_init()
1159 return rc; in mchp_rds_ptp_init()
1162 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_RX_PARSE_CONFIG, in mchp_rds_ptp_init()
1164 if (rc < 0) in mchp_rds_ptp_init()
1165 return rc; in mchp_rds_ptp_init()
1167 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_TX_PARSE_CONFIG, in mchp_rds_ptp_init()
1169 if (rc < 0) in mchp_rds_ptp_init()
1170 return rc; in mchp_rds_ptp_init()
1172 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_TX_PARSE_L2_ADDR_EN, in mchp_rds_ptp_init()
1174 if (rc < 0) in mchp_rds_ptp_init()
1175 return rc; in mchp_rds_ptp_init()
1177 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_RX_PARSE_L2_ADDR_EN, in mchp_rds_ptp_init()
1179 if (rc < 0) in mchp_rds_ptp_init()
1180 return rc; in mchp_rds_ptp_init()
1182 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_RX_PARSE_IPV4_ADDR_EN, in mchp_rds_ptp_init()
1184 if (rc < 0) in mchp_rds_ptp_init()
1185 return rc; in mchp_rds_ptp_init()
1187 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_TX_PARSE_IPV4_ADDR_EN, in mchp_rds_ptp_init()
1189 if (rc < 0) in mchp_rds_ptp_init()
1190 return rc; in mchp_rds_ptp_init()
1192 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_RX_VERSION, in mchp_rds_ptp_init()
1196 if (rc < 0) in mchp_rds_ptp_init()
1197 return rc; in mchp_rds_ptp_init()
1199 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_TX_VERSION, in mchp_rds_ptp_init()
1203 if (rc < 0) in mchp_rds_ptp_init()
1204 return rc; in mchp_rds_ptp_init()
1207 rc = mchp_rds_phy_write_mmd(clock, MCHP_RDS_PTP_TSU_GEN_CONFIG, in mchp_rds_ptp_init()
1210 if (rc < 0) in mchp_rds_ptp_init()
1211 return rc; in mchp_rds_ptp_init()
1224 int rc; in mchp_rds_ptp_probe() local
1296 rc = mchp_rds_ptp_init(clock); in mchp_rds_ptp_probe()
1297 if (rc < 0) in mchp_rds_ptp_probe()
1298 return ERR_PTR(rc); in mchp_rds_ptp_probe()