@@ -1339,6 +1339,7 @@ const struct ksz_chip_data ksz_switch_chips[] = {
1339
1339
.supports_rgmii = {false, false, true},
1340
1340
.internal_phy = {true, true, false},
1341
1341
.gbit_capable = {false, false, true},
1342
+ .ptp_capable = true,
1342
1343
.wr_table = & ksz8563_register_set ,
1343
1344
.rd_table = & ksz8563_register_set ,
1344
1345
},
@@ -1550,6 +1551,7 @@ const struct ksz_chip_data ksz_switch_chips[] = {
1550
1551
.internal_phy = {true, true, true, true,
1551
1552
true, false, false},
1552
1553
.gbit_capable = {true, true, true, true, true, true, true},
1554
+ .ptp_capable = true,
1553
1555
.wr_table = & ksz9477_register_set ,
1554
1556
.rd_table = & ksz9477_register_set ,
1555
1557
},
@@ -1677,6 +1679,7 @@ const struct ksz_chip_data ksz_switch_chips[] = {
1677
1679
.supports_rgmii = {false, false, true},
1678
1680
.internal_phy = {true, true, false},
1679
1681
.gbit_capable = {true, true, true},
1682
+ .ptp_capable = true,
1680
1683
},
1681
1684
1682
1685
[KSZ8567 ] = {
@@ -1712,6 +1715,7 @@ const struct ksz_chip_data ksz_switch_chips[] = {
1712
1715
true, false, false},
1713
1716
.gbit_capable = {false, false, false, false, false,
1714
1717
true, true},
1718
+ .ptp_capable = true,
1715
1719
},
1716
1720
1717
1721
[KSZ9567 ] = {
@@ -1744,6 +1748,7 @@ const struct ksz_chip_data ksz_switch_chips[] = {
1744
1748
.internal_phy = {true, true, true, true,
1745
1749
true, false, false},
1746
1750
.gbit_capable = {true, true, true, true, true, true, true},
1751
+ .ptp_capable = true,
1747
1752
},
1748
1753
1749
1754
[LAN9370 ] = {
@@ -1773,6 +1778,7 @@ const struct ksz_chip_data ksz_switch_chips[] = {
1773
1778
.supports_rmii = {false, false, false, false, true},
1774
1779
.supports_rgmii = {false, false, false, false, true},
1775
1780
.internal_phy = {true, true, true, true, false},
1781
+ .ptp_capable = true,
1776
1782
},
1777
1783
1778
1784
[LAN9371 ] = {
@@ -1802,6 +1808,7 @@ const struct ksz_chip_data ksz_switch_chips[] = {
1802
1808
.supports_rmii = {false, false, false, false, true, true},
1803
1809
.supports_rgmii = {false, false, false, false, true, true},
1804
1810
.internal_phy = {true, true, true, true, false, false},
1811
+ .ptp_capable = true,
1805
1812
},
1806
1813
1807
1814
[LAN9372 ] = {
@@ -1835,6 +1842,7 @@ const struct ksz_chip_data ksz_switch_chips[] = {
1835
1842
true, true, false, false},
1836
1843
.internal_phy = {true, true, true, true,
1837
1844
false, false, true, true},
1845
+ .ptp_capable = true,
1838
1846
},
1839
1847
1840
1848
[LAN9373 ] = {
@@ -1868,6 +1876,7 @@ const struct ksz_chip_data ksz_switch_chips[] = {
1868
1876
true, true, false, false},
1869
1877
.internal_phy = {true, true, true, false,
1870
1878
false, false, true, true},
1879
+ .ptp_capable = true,
1871
1880
},
1872
1881
1873
1882
[LAN9374 ] = {
@@ -1901,6 +1910,7 @@ const struct ksz_chip_data ksz_switch_chips[] = {
1901
1910
true, true, false, false},
1902
1911
.internal_phy = {true, true, true, true,
1903
1912
false, false, true, true},
1913
+ .ptp_capable = true,
1904
1914
},
1905
1915
1906
1916
[LAN9646 ] = {
@@ -2809,16 +2819,21 @@ static int ksz_setup(struct dsa_switch *ds)
2809
2819
if (ret )
2810
2820
goto out_girq ;
2811
2821
2812
- ret = ksz_ptp_irq_setup (ds , dp -> index );
2813
- if (ret )
2814
- goto out_pirq ;
2822
+ if (dev -> info -> ptp_capable ) {
2823
+ ret = ksz_ptp_irq_setup (ds , dp -> index );
2824
+ if (ret )
2825
+ goto out_pirq ;
2826
+ }
2815
2827
}
2816
2828
}
2817
2829
2818
- ret = ksz_ptp_clock_register (ds );
2819
- if (ret ) {
2820
- dev_err (dev -> dev , "Failed to register PTP clock: %d\n" , ret );
2821
- goto out_ptpirq ;
2830
+ if (dev -> info -> ptp_capable ) {
2831
+ ret = ksz_ptp_clock_register (ds );
2832
+ if (ret ) {
2833
+ dev_err (dev -> dev , "Failed to register PTP clock: %d\n" ,
2834
+ ret );
2835
+ goto out_ptpirq ;
2836
+ }
2822
2837
}
2823
2838
2824
2839
ret = ksz_mdio_register (dev );
@@ -2838,9 +2853,10 @@ static int ksz_setup(struct dsa_switch *ds)
2838
2853
return 0 ;
2839
2854
2840
2855
out_ptp_clock_unregister :
2841
- ksz_ptp_clock_unregister (ds );
2856
+ if (dev -> info -> ptp_capable )
2857
+ ksz_ptp_clock_unregister (ds );
2842
2858
out_ptpirq :
2843
- if (dev -> irq > 0 )
2859
+ if (dev -> irq > 0 && dev -> info -> ptp_capable )
2844
2860
dsa_switch_for_each_user_port (dp , dev -> ds )
2845
2861
ksz_ptp_irq_free (ds , dp -> index );
2846
2862
out_pirq :
@@ -2859,11 +2875,13 @@ static void ksz_teardown(struct dsa_switch *ds)
2859
2875
struct ksz_device * dev = ds -> priv ;
2860
2876
struct dsa_port * dp ;
2861
2877
2862
- ksz_ptp_clock_unregister (ds );
2878
+ if (dev -> info -> ptp_capable )
2879
+ ksz_ptp_clock_unregister (ds );
2863
2880
2864
2881
if (dev -> irq > 0 ) {
2865
2882
dsa_switch_for_each_user_port (dp , dev -> ds ) {
2866
- ksz_ptp_irq_free (ds , dp -> index );
2883
+ if (dev -> info -> ptp_capable )
2884
+ ksz_ptp_irq_free (ds , dp -> index );
2867
2885
2868
2886
ksz_irq_free (& dev -> ports [dp -> index ].pirq );
2869
2887
}
0 commit comments