hc
2023-12-06 08f87f769b595151be1afeff53e144f543faa614
kernel/drivers/net/ethernet/cavium/common/cavium_ptp.c
....@@ -13,6 +13,9 @@
1313 #define DRV_NAME "cavium_ptp"
1414
1515 #define PCI_DEVICE_ID_CAVIUM_PTP 0xA00C
16
+#define PCI_SUBSYS_DEVID_88XX_PTP 0xA10C
17
+#define PCI_SUBSYS_DEVID_81XX_PTP 0XA20C
18
+#define PCI_SUBSYS_DEVID_83XX_PTP 0xA30C
1619 #define PCI_DEVICE_ID_CAVIUM_RST 0xA00E
1720
1821 #define PCI_PTP_BAR_NO 0
....@@ -83,7 +86,7 @@
8386
8487 /**
8588 * cavium_ptp_adjfine() - Adjust ptp frequency
86
- * @ptp: PTP clock info
89
+ * @ptp_info: PTP clock info
8790 * @scaled_ppm: how much to adjust by, in parts per million, but with a
8891 * 16 bit binary fractional field
8992 */
....@@ -131,7 +134,7 @@
131134
132135 /**
133136 * cavium_ptp_adjtime() - Adjust ptp time
134
- * @ptp: PTP clock info
137
+ * @ptp_info: PTP clock info
135138 * @delta: how much to adjust by, in nanosecs
136139 */
137140 static int cavium_ptp_adjtime(struct ptp_clock_info *ptp_info, s64 delta)
....@@ -152,7 +155,7 @@
152155
153156 /**
154157 * cavium_ptp_gettime() - Get hardware clock time with adjustment
155
- * @ptp: PTP clock info
158
+ * @ptp_info: PTP clock info
156159 * @ts: timespec
157160 */
158161 static int cavium_ptp_gettime(struct ptp_clock_info *ptp_info,
....@@ -174,7 +177,7 @@
174177
175178 /**
176179 * cavium_ptp_settime() - Set hardware clock time. Reset adjustment
177
- * @ptp: PTP clock info
180
+ * @ptp_info: PTP clock info
178181 * @ts: timespec
179182 */
180183 static int cavium_ptp_settime(struct ptp_clock_info *ptp_info,
....@@ -196,7 +199,7 @@
196199
197200 /**
198201 * cavium_ptp_enable() - Request to enable or disable an ancillary feature.
199
- * @ptp: PTP clock info
202
+ * @ptp_info: PTP clock info
200203 * @rq: request
201204 * @on: is it on
202205 */
....@@ -277,10 +280,6 @@
277280 writeq(clock_comp, clock->reg_base + PTP_CLOCK_COMP);
278281
279282 clock->ptp_clock = ptp_clock_register(&clock->ptp_info, dev);
280
- if (!clock->ptp_clock) {
281
- err = -ENODEV;
282
- goto error_stop;
283
- }
284283 if (IS_ERR(clock->ptp_clock)) {
285284 err = PTR_ERR(clock->ptp_clock);
286285 goto error_stop;
....@@ -325,7 +324,12 @@
325324 }
326325
327326 static const struct pci_device_id cavium_ptp_id_table[] = {
328
- { PCI_DEVICE(PCI_VENDOR_ID_CAVIUM, PCI_DEVICE_ID_CAVIUM_PTP) },
327
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_CAVIUM, PCI_DEVICE_ID_CAVIUM_PTP,
328
+ PCI_VENDOR_ID_CAVIUM, PCI_SUBSYS_DEVID_88XX_PTP) },
329
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_CAVIUM, PCI_DEVICE_ID_CAVIUM_PTP,
330
+ PCI_VENDOR_ID_CAVIUM, PCI_SUBSYS_DEVID_81XX_PTP) },
331
+ { PCI_DEVICE_SUB(PCI_VENDOR_ID_CAVIUM, PCI_DEVICE_ID_CAVIUM_PTP,
332
+ PCI_VENDOR_ID_CAVIUM, PCI_SUBSYS_DEVID_83XX_PTP) },
329333 { 0, }
330334 };
331335