Skip to content

Commit 8f88c07

Browse files
danish-tikuba-moo
authored andcommitted
net: ti: icss-iep: Move icss_iep structure
Move icss_iep structure definition and to icss_iep.h file so that the structure members can be used / accessed by all icssg driver files. Reviewed-by: Simon Horman <[email protected]> Reviewed-by: Jacob Keller <[email protected]> Reviewed-by: Roger Quadros <[email protected]> Signed-off-by: MD Danish Anwar <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 34c44eb commit 8f88c07

File tree

2 files changed

+72
-73
lines changed

2 files changed

+72
-73
lines changed

drivers/net/ethernet/ti/icssg/icss_iep.c

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -53,78 +53,6 @@
5353
#define IEP_CAP_CFG_CAPNR_1ST_EVENT_EN(n) BIT(LATCH_INDEX(n))
5454
#define IEP_CAP_CFG_CAP_ASYNC_EN(n) BIT(LATCH_INDEX(n) + 10)
5555

56-
enum {
57-
ICSS_IEP_GLOBAL_CFG_REG,
58-
ICSS_IEP_GLOBAL_STATUS_REG,
59-
ICSS_IEP_COMPEN_REG,
60-
ICSS_IEP_SLOW_COMPEN_REG,
61-
ICSS_IEP_COUNT_REG0,
62-
ICSS_IEP_COUNT_REG1,
63-
ICSS_IEP_CAPTURE_CFG_REG,
64-
ICSS_IEP_CAPTURE_STAT_REG,
65-
66-
ICSS_IEP_CAP6_RISE_REG0,
67-
ICSS_IEP_CAP6_RISE_REG1,
68-
69-
ICSS_IEP_CAP7_RISE_REG0,
70-
ICSS_IEP_CAP7_RISE_REG1,
71-
72-
ICSS_IEP_CMP_CFG_REG,
73-
ICSS_IEP_CMP_STAT_REG,
74-
ICSS_IEP_CMP0_REG0,
75-
ICSS_IEP_CMP0_REG1,
76-
ICSS_IEP_CMP1_REG0,
77-
ICSS_IEP_CMP1_REG1,
78-
79-
ICSS_IEP_CMP8_REG0,
80-
ICSS_IEP_CMP8_REG1,
81-
ICSS_IEP_SYNC_CTRL_REG,
82-
ICSS_IEP_SYNC0_STAT_REG,
83-
ICSS_IEP_SYNC1_STAT_REG,
84-
ICSS_IEP_SYNC_PWIDTH_REG,
85-
ICSS_IEP_SYNC0_PERIOD_REG,
86-
ICSS_IEP_SYNC1_DELAY_REG,
87-
ICSS_IEP_SYNC_START_REG,
88-
ICSS_IEP_MAX_REGS,
89-
};
90-
91-
/**
92-
* struct icss_iep_plat_data - Plat data to handle SoC variants
93-
* @config: Regmap configuration data
94-
* @reg_offs: register offsets to capture offset differences across SoCs
95-
* @flags: Flags to represent IEP properties
96-
*/
97-
struct icss_iep_plat_data {
98-
const struct regmap_config *config;
99-
u32 reg_offs[ICSS_IEP_MAX_REGS];
100-
u32 flags;
101-
};
102-
103-
struct icss_iep {
104-
struct device *dev;
105-
void __iomem *base;
106-
const struct icss_iep_plat_data *plat_data;
107-
struct regmap *map;
108-
struct device_node *client_np;
109-
unsigned long refclk_freq;
110-
int clk_tick_time; /* one refclk tick time in ns */
111-
struct ptp_clock_info ptp_info;
112-
struct ptp_clock *ptp_clock;
113-
struct mutex ptp_clk_mutex; /* PHC access serializer */
114-
u32 def_inc;
115-
s16 slow_cmp_inc;
116-
u32 slow_cmp_count;
117-
const struct icss_iep_clockops *ops;
118-
void *clockops_data;
119-
u32 cycle_time_ns;
120-
u32 perout_enabled;
121-
bool pps_enabled;
122-
int cap_cmp_irq;
123-
u64 period;
124-
u32 latch_enable;
125-
struct work_struct work;
126-
};
127-
12856
/**
12957
* icss_iep_get_count_hi() - Get the upper 32 bit IEP counter
13058
* @iep: Pointer to structure representing IEP.

drivers/net/ethernet/ti/icssg/icss_iep.h

Lines changed: 72 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,78 @@
1212
#include <linux/ptp_clock_kernel.h>
1313
#include <linux/regmap.h>
1414

15-
struct icss_iep;
15+
enum {
16+
ICSS_IEP_GLOBAL_CFG_REG,
17+
ICSS_IEP_GLOBAL_STATUS_REG,
18+
ICSS_IEP_COMPEN_REG,
19+
ICSS_IEP_SLOW_COMPEN_REG,
20+
ICSS_IEP_COUNT_REG0,
21+
ICSS_IEP_COUNT_REG1,
22+
ICSS_IEP_CAPTURE_CFG_REG,
23+
ICSS_IEP_CAPTURE_STAT_REG,
24+
25+
ICSS_IEP_CAP6_RISE_REG0,
26+
ICSS_IEP_CAP6_RISE_REG1,
27+
28+
ICSS_IEP_CAP7_RISE_REG0,
29+
ICSS_IEP_CAP7_RISE_REG1,
30+
31+
ICSS_IEP_CMP_CFG_REG,
32+
ICSS_IEP_CMP_STAT_REG,
33+
ICSS_IEP_CMP0_REG0,
34+
ICSS_IEP_CMP0_REG1,
35+
ICSS_IEP_CMP1_REG0,
36+
ICSS_IEP_CMP1_REG1,
37+
38+
ICSS_IEP_CMP8_REG0,
39+
ICSS_IEP_CMP8_REG1,
40+
ICSS_IEP_SYNC_CTRL_REG,
41+
ICSS_IEP_SYNC0_STAT_REG,
42+
ICSS_IEP_SYNC1_STAT_REG,
43+
ICSS_IEP_SYNC_PWIDTH_REG,
44+
ICSS_IEP_SYNC0_PERIOD_REG,
45+
ICSS_IEP_SYNC1_DELAY_REG,
46+
ICSS_IEP_SYNC_START_REG,
47+
ICSS_IEP_MAX_REGS,
48+
};
49+
50+
/**
51+
* struct icss_iep_plat_data - Plat data to handle SoC variants
52+
* @config: Regmap configuration data
53+
* @reg_offs: register offsets to capture offset differences across SoCs
54+
* @flags: Flags to represent IEP properties
55+
*/
56+
struct icss_iep_plat_data {
57+
const struct regmap_config *config;
58+
u32 reg_offs[ICSS_IEP_MAX_REGS];
59+
u32 flags;
60+
};
61+
62+
struct icss_iep {
63+
struct device *dev;
64+
void __iomem *base;
65+
const struct icss_iep_plat_data *plat_data;
66+
struct regmap *map;
67+
struct device_node *client_np;
68+
unsigned long refclk_freq;
69+
int clk_tick_time; /* one refclk tick time in ns */
70+
struct ptp_clock_info ptp_info;
71+
struct ptp_clock *ptp_clock;
72+
struct mutex ptp_clk_mutex; /* PHC access serializer */
73+
u32 def_inc;
74+
s16 slow_cmp_inc;
75+
u32 slow_cmp_count;
76+
const struct icss_iep_clockops *ops;
77+
void *clockops_data;
78+
u32 cycle_time_ns;
79+
u32 perout_enabled;
80+
bool pps_enabled;
81+
int cap_cmp_irq;
82+
u64 period;
83+
u32 latch_enable;
84+
struct work_struct work;
85+
};
86+
1687
extern const struct icss_iep_clockops prueth_iep_clockops;
1788

1889
/* Firmware specific clock operations */

0 commit comments

Comments
 (0)