Skip to content

Commit 4688594

Browse files
committed
PCI: ls-gen4: Rename ls_pcie_g4 to ls_g4_pcie
Rename struct ls_pcie_g4 to ls_g4_pcie to match the convention of <driver>_pcie. No functional change intended. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Bjorn Helgaas <[email protected]> Cc: Hou Zhiqiang <[email protected]>
1 parent 05463a7 commit 4688594

File tree

1 file changed

+42
-42
lines changed

1 file changed

+42
-42
lines changed

drivers/pci/controller/mobiveil/pcie-layerscape-gen4.c

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -34,31 +34,31 @@
3434
#define PF_DBG_WE BIT(31)
3535
#define PF_DBG_PABR BIT(27)
3636

37-
#define to_ls_pcie_g4(x) platform_get_drvdata((x)->pdev)
37+
#define to_ls_g4_pcie(x) platform_get_drvdata((x)->pdev)
3838

39-
struct ls_pcie_g4 {
39+
struct ls_g4_pcie {
4040
struct mobiveil_pcie pci;
4141
struct delayed_work dwork;
4242
int irq;
4343
};
4444

45-
static inline u32 ls_pcie_g4_pf_readl(struct ls_pcie_g4 *pcie, u32 off)
45+
static inline u32 ls_g4_pcie_pf_readl(struct ls_g4_pcie *pcie, u32 off)
4646
{
4747
return ioread32(pcie->pci.csr_axi_slave_base + PCIE_PF_OFF + off);
4848
}
4949

50-
static inline void ls_pcie_g4_pf_writel(struct ls_pcie_g4 *pcie,
50+
static inline void ls_g4_pcie_pf_writel(struct ls_g4_pcie *pcie,
5151
u32 off, u32 val)
5252
{
5353
iowrite32(val, pcie->pci.csr_axi_slave_base + PCIE_PF_OFF + off);
5454
}
5555

56-
static int ls_pcie_g4_link_up(struct mobiveil_pcie *pci)
56+
static int ls_g4_pcie_link_up(struct mobiveil_pcie *pci)
5757
{
58-
struct ls_pcie_g4 *pcie = to_ls_pcie_g4(pci);
58+
struct ls_g4_pcie *pcie = to_ls_g4_pcie(pci);
5959
u32 state;
6060

61-
state = ls_pcie_g4_pf_readl(pcie, PCIE_PF_DBG);
61+
state = ls_g4_pcie_pf_readl(pcie, PCIE_PF_DBG);
6262
state = state & PF_DBG_LTSSM_MASK;
6363

6464
if (state == PF_DBG_LTSSM_L0)
@@ -67,14 +67,14 @@ static int ls_pcie_g4_link_up(struct mobiveil_pcie *pci)
6767
return 0;
6868
}
6969

70-
static void ls_pcie_g4_disable_interrupt(struct ls_pcie_g4 *pcie)
70+
static void ls_g4_pcie_disable_interrupt(struct ls_g4_pcie *pcie)
7171
{
7272
struct mobiveil_pcie *mv_pci = &pcie->pci;
7373

7474
mobiveil_csr_writel(mv_pci, 0, PAB_INTP_AMBA_MISC_ENB);
7575
}
7676

77-
static void ls_pcie_g4_enable_interrupt(struct ls_pcie_g4 *pcie)
77+
static void ls_g4_pcie_enable_interrupt(struct ls_g4_pcie *pcie)
7878
{
7979
struct mobiveil_pcie *mv_pci = &pcie->pci;
8080
u32 val;
@@ -87,7 +87,7 @@ static void ls_pcie_g4_enable_interrupt(struct ls_pcie_g4 *pcie)
8787
mobiveil_csr_writel(mv_pci, val, PAB_INTP_AMBA_MISC_ENB);
8888
}
8989

90-
static int ls_pcie_g4_reinit_hw(struct ls_pcie_g4 *pcie)
90+
static int ls_g4_pcie_reinit_hw(struct ls_g4_pcie *pcie)
9191
{
9292
struct mobiveil_pcie *mv_pci = &pcie->pci;
9393
struct device *dev = &mv_pci->pdev->dev;
@@ -97,7 +97,7 @@ static int ls_pcie_g4_reinit_hw(struct ls_pcie_g4 *pcie)
9797
/* Poll for pab_csb_reset to set and PAB activity to clear */
9898
do {
9999
usleep_range(10, 15);
100-
val = ls_pcie_g4_pf_readl(pcie, PCIE_PF_INT_STAT);
100+
val = ls_g4_pcie_pf_readl(pcie, PCIE_PF_INT_STAT);
101101
act_stat = mobiveil_csr_readl(mv_pci, PAB_ACTIVITY_STAT);
102102
} while (((val & PF_INT_STAT_PABRST) == 0 || act_stat) && to--);
103103
if (to < 0) {
@@ -106,22 +106,22 @@ static int ls_pcie_g4_reinit_hw(struct ls_pcie_g4 *pcie)
106106
}
107107

108108
/* clear PEX_RESET bit in PEX_PF0_DBG register */
109-
val = ls_pcie_g4_pf_readl(pcie, PCIE_PF_DBG);
109+
val = ls_g4_pcie_pf_readl(pcie, PCIE_PF_DBG);
110110
val |= PF_DBG_WE;
111-
ls_pcie_g4_pf_writel(pcie, PCIE_PF_DBG, val);
111+
ls_g4_pcie_pf_writel(pcie, PCIE_PF_DBG, val);
112112

113-
val = ls_pcie_g4_pf_readl(pcie, PCIE_PF_DBG);
113+
val = ls_g4_pcie_pf_readl(pcie, PCIE_PF_DBG);
114114
val |= PF_DBG_PABR;
115-
ls_pcie_g4_pf_writel(pcie, PCIE_PF_DBG, val);
115+
ls_g4_pcie_pf_writel(pcie, PCIE_PF_DBG, val);
116116

117-
val = ls_pcie_g4_pf_readl(pcie, PCIE_PF_DBG);
117+
val = ls_g4_pcie_pf_readl(pcie, PCIE_PF_DBG);
118118
val &= ~PF_DBG_WE;
119-
ls_pcie_g4_pf_writel(pcie, PCIE_PF_DBG, val);
119+
ls_g4_pcie_pf_writel(pcie, PCIE_PF_DBG, val);
120120

121121
mobiveil_host_init(mv_pci, true);
122122

123123
to = 100;
124-
while (!ls_pcie_g4_link_up(mv_pci) && to--)
124+
while (!ls_g4_pcie_link_up(mv_pci) && to--)
125125
usleep_range(200, 250);
126126
if (to < 0) {
127127
dev_err(dev, "PCIe link training timeout\n");
@@ -131,9 +131,9 @@ static int ls_pcie_g4_reinit_hw(struct ls_pcie_g4 *pcie)
131131
return 0;
132132
}
133133

134-
static irqreturn_t ls_pcie_g4_isr(int irq, void *dev_id)
134+
static irqreturn_t ls_g4_pcie_isr(int irq, void *dev_id)
135135
{
136-
struct ls_pcie_g4 *pcie = (struct ls_pcie_g4 *)dev_id;
136+
struct ls_g4_pcie *pcie = (struct ls_g4_pcie *)dev_id;
137137
struct mobiveil_pcie *mv_pci = &pcie->pci;
138138
u32 val;
139139

@@ -142,7 +142,7 @@ static irqreturn_t ls_pcie_g4_isr(int irq, void *dev_id)
142142
return IRQ_NONE;
143143

144144
if (val & PAB_INTP_RESET) {
145-
ls_pcie_g4_disable_interrupt(pcie);
145+
ls_g4_pcie_disable_interrupt(pcie);
146146
schedule_delayed_work(&pcie->dwork, msecs_to_jiffies(1));
147147
}
148148

@@ -151,9 +151,9 @@ static irqreturn_t ls_pcie_g4_isr(int irq, void *dev_id)
151151
return IRQ_HANDLED;
152152
}
153153

154-
static int ls_pcie_g4_interrupt_init(struct mobiveil_pcie *mv_pci)
154+
static int ls_g4_pcie_interrupt_init(struct mobiveil_pcie *mv_pci)
155155
{
156-
struct ls_pcie_g4 *pcie = to_ls_pcie_g4(mv_pci);
156+
struct ls_g4_pcie *pcie = to_ls_g4_pcie(mv_pci);
157157
struct platform_device *pdev = mv_pci->pdev;
158158
struct device *dev = &pdev->dev;
159159
int ret;
@@ -162,7 +162,7 @@ static int ls_pcie_g4_interrupt_init(struct mobiveil_pcie *mv_pci)
162162
if (pcie->irq < 0)
163163
return pcie->irq;
164164

165-
ret = devm_request_irq(dev, pcie->irq, ls_pcie_g4_isr,
165+
ret = devm_request_irq(dev, pcie->irq, ls_g4_pcie_isr,
166166
IRQF_SHARED, pdev->name, pcie);
167167
if (ret) {
168168
dev_err(dev, "Can't register PCIe IRQ, errno = %d\n", ret);
@@ -172,38 +172,38 @@ static int ls_pcie_g4_interrupt_init(struct mobiveil_pcie *mv_pci)
172172
return 0;
173173
}
174174

175-
static void ls_pcie_g4_reset(struct work_struct *work)
175+
static void ls_g4_pcie_reset(struct work_struct *work)
176176
{
177177
struct delayed_work *dwork = container_of(work, struct delayed_work,
178178
work);
179-
struct ls_pcie_g4 *pcie = container_of(dwork, struct ls_pcie_g4, dwork);
179+
struct ls_g4_pcie *pcie = container_of(dwork, struct ls_g4_pcie, dwork);
180180
struct mobiveil_pcie *mv_pci = &pcie->pci;
181181
u16 ctrl;
182182

183183
ctrl = mobiveil_csr_readw(mv_pci, PCI_BRIDGE_CONTROL);
184184
ctrl &= ~PCI_BRIDGE_CTL_BUS_RESET;
185185
mobiveil_csr_writew(mv_pci, ctrl, PCI_BRIDGE_CONTROL);
186186

187-
if (!ls_pcie_g4_reinit_hw(pcie))
187+
if (!ls_g4_pcie_reinit_hw(pcie))
188188
return;
189189

190-
ls_pcie_g4_enable_interrupt(pcie);
190+
ls_g4_pcie_enable_interrupt(pcie);
191191
}
192192

193-
static struct mobiveil_rp_ops ls_pcie_g4_rp_ops = {
194-
.interrupt_init = ls_pcie_g4_interrupt_init,
193+
static struct mobiveil_rp_ops ls_g4_pcie_rp_ops = {
194+
.interrupt_init = ls_g4_pcie_interrupt_init,
195195
};
196196

197-
static const struct mobiveil_pab_ops ls_pcie_g4_pab_ops = {
198-
.link_up = ls_pcie_g4_link_up,
197+
static const struct mobiveil_pab_ops ls_g4_pcie_pab_ops = {
198+
.link_up = ls_g4_pcie_link_up,
199199
};
200200

201-
static int __init ls_pcie_g4_probe(struct platform_device *pdev)
201+
static int __init ls_g4_pcie_probe(struct platform_device *pdev)
202202
{
203203
struct device *dev = &pdev->dev;
204204
struct pci_host_bridge *bridge;
205205
struct mobiveil_pcie *mv_pci;
206-
struct ls_pcie_g4 *pcie;
206+
struct ls_g4_pcie *pcie;
207207
struct device_node *np = dev->of_node;
208208
int ret;
209209

@@ -220,36 +220,36 @@ static int __init ls_pcie_g4_probe(struct platform_device *pdev)
220220
mv_pci = &pcie->pci;
221221

222222
mv_pci->pdev = pdev;
223-
mv_pci->ops = &ls_pcie_g4_pab_ops;
224-
mv_pci->rp.ops = &ls_pcie_g4_rp_ops;
223+
mv_pci->ops = &ls_g4_pcie_pab_ops;
224+
mv_pci->rp.ops = &ls_g4_pcie_rp_ops;
225225
mv_pci->rp.bridge = bridge;
226226

227227
platform_set_drvdata(pdev, pcie);
228228

229-
INIT_DELAYED_WORK(&pcie->dwork, ls_pcie_g4_reset);
229+
INIT_DELAYED_WORK(&pcie->dwork, ls_g4_pcie_reset);
230230

231231
ret = mobiveil_pcie_host_probe(mv_pci);
232232
if (ret) {
233233
dev_err(dev, "Fail to probe\n");
234234
return ret;
235235
}
236236

237-
ls_pcie_g4_enable_interrupt(pcie);
237+
ls_g4_pcie_enable_interrupt(pcie);
238238

239239
return 0;
240240
}
241241

242-
static const struct of_device_id ls_pcie_g4_of_match[] = {
242+
static const struct of_device_id ls_g4_pcie_of_match[] = {
243243
{ .compatible = "fsl,lx2160a-pcie", },
244244
{ },
245245
};
246246

247-
static struct platform_driver ls_pcie_g4_driver = {
247+
static struct platform_driver ls_g4_pcie_driver = {
248248
.driver = {
249249
.name = "layerscape-pcie-gen4",
250-
.of_match_table = ls_pcie_g4_of_match,
250+
.of_match_table = ls_g4_pcie_of_match,
251251
.suppress_bind_attrs = true,
252252
},
253253
};
254254

255-
builtin_platform_driver_probe(ls_pcie_g4_driver, ls_pcie_g4_probe);
255+
builtin_platform_driver_probe(ls_g4_pcie_driver, ls_g4_pcie_probe);

0 commit comments

Comments
 (0)