hc
2024-05-10 61598093bbdd283a7edc367d900f223070ead8d2
kernel/drivers/net/ethernet/microchip/lan743x_ptp.h
....@@ -7,6 +7,18 @@
77 #include "linux/ptp_clock_kernel.h"
88 #include "linux/netdevice.h"
99
10
+#define LAN7430_N_LED 4
11
+#define LAN7430_N_GPIO 4 /* multiplexed with PHY LEDs */
12
+#define LAN7431_N_GPIO 12
13
+
14
+#define LAN743X_PTP_N_GPIO LAN7431_N_GPIO
15
+
16
+/* the number of periodic outputs is limited by number of
17
+ * PTP clock event channels
18
+ */
19
+#define LAN743X_PTP_N_EVENT_CHAN 2
20
+#define LAN743X_PTP_N_PEROUT LAN743X_PTP_N_EVENT_CHAN
21
+
1022 struct lan743x_adapter;
1123
1224 /* GPIO */
....@@ -40,8 +52,13 @@
4052
4153 #define LAN743X_PTP_NUMBER_OF_TX_TIMESTAMPS (4)
4254
43
-#define PTP_FLAG_PTP_CLOCK_REGISTERED BIT(1)
55
+#define PTP_FLAG_PTP_CLOCK_REGISTERED BIT(1)
4456 #define PTP_FLAG_ISR_ENABLED BIT(2)
57
+
58
+struct lan743x_ptp_perout {
59
+ int event_ch; /* PTP event channel (0=channel A, 1=channel B) */
60
+ int gpio_pin; /* GPIO pin where output appears */
61
+};
4562
4663 struct lan743x_ptp {
4764 int flags;
....@@ -51,13 +68,13 @@
5168
5269 struct ptp_clock *ptp_clock;
5370 struct ptp_clock_info ptp_clock_info;
54
- struct ptp_pin_desc pin_config[1];
71
+ struct ptp_pin_desc pin_config[LAN743X_PTP_N_GPIO];
5572
56
-#define LAN743X_PTP_NUMBER_OF_EVENT_CHANNELS (2)
5773 unsigned long used_event_ch;
74
+ struct lan743x_ptp_perout perout[LAN743X_PTP_N_PEROUT];
5875
59
- int perout_event_ch;
60
- int perout_gpio_bit;
76
+ bool leds_multiplexed;
77
+ bool led_enabled[LAN7430_N_LED];
6178
6279 /* tx_ts_lock: used to prevent concurrent access to timestamp arrays */
6380 spinlock_t tx_ts_lock;