Skip to content

Commit 9453fa4

Browse files
Boris BrezillonLee Jones
authored andcommitted
memory: atmel-ebi: Change naming scheme
The EBI block is not only available on at91 SoCs, but also on avr32 ones. Change the structure and function prefixes from at91_ebi to atmel_ebi to match this fact and make the prefix and driver name consistent. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
1 parent 0d69080 commit 9453fa4

1 file changed

Lines changed: 60 additions & 60 deletions

File tree

‎drivers/memory/atmel-ebi.c‎

Lines changed: 60 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -18,34 +18,34 @@
1818
#include <linux/of_device.h>
1919
#include <linux/regmap.h>
2020

21-
struct at91_ebi_dev_config {
21+
struct atmel_ebi_dev_config {
2222
int cs;
2323
struct atmel_smc_cs_conf smcconf;
2424
};
2525

26-
struct at91_ebi;
26+
struct atmel_ebi;
2727

28-
struct at91_ebi_dev {
28+
struct atmel_ebi_dev {
2929
struct list_head node;
30-
struct at91_ebi *ebi;
30+
struct atmel_ebi *ebi;
3131
u32 mode;
3232
int numcs;
33-
struct at91_ebi_dev_config configs[];
33+
struct atmel_ebi_dev_config configs[];
3434
};
3535

36-
struct at91_ebi_caps {
36+
struct atmel_ebi_caps {
3737
unsigned int available_cs;
3838
unsigned int ebi_csa_offs;
39-
void (*get_config)(struct at91_ebi_dev *ebid,
40-
struct at91_ebi_dev_config *conf);
41-
int (*xlate_config)(struct at91_ebi_dev *ebid,
39+
void (*get_config)(struct atmel_ebi_dev *ebid,
40+
struct atmel_ebi_dev_config *conf);
41+
int (*xlate_config)(struct atmel_ebi_dev *ebid,
4242
struct device_node *configs_np,
43-
struct at91_ebi_dev_config *conf);
44-
void (*apply_config)(struct at91_ebi_dev *ebid,
45-
struct at91_ebi_dev_config *conf);
43+
struct atmel_ebi_dev_config *conf);
44+
void (*apply_config)(struct atmel_ebi_dev *ebid,
45+
struct atmel_ebi_dev_config *conf);
4646
};
4747

48-
struct at91_ebi {
48+
struct atmel_ebi {
4949
struct clk *clk;
5050
struct regmap *matrix;
5151
struct {
@@ -54,7 +54,7 @@ struct at91_ebi {
5454
} smc;
5555

5656
struct device *dev;
57-
const struct at91_ebi_caps *caps;
57+
const struct atmel_ebi_caps *caps;
5858
struct list_head devs;
5959
};
6060

@@ -74,15 +74,15 @@ struct atmel_smc_timing_xlate {
7474
#define ATMEL_SMC_CYCLE_XLATE(nm, pos) \
7575
{ .name = nm, .converter = atmel_smc_cs_conf_set_setup, .shift = pos}
7676

77-
static void at91sam9_ebi_get_config(struct at91_ebi_dev *ebid,
78-
struct at91_ebi_dev_config *conf)
77+
static void at91sam9_ebi_get_config(struct atmel_ebi_dev *ebid,
78+
struct atmel_ebi_dev_config *conf)
7979
{
8080
atmel_smc_cs_conf_get(ebid->ebi->smc.regmap, conf->cs,
8181
&conf->smcconf);
8282
}
8383

84-
static void sama5_ebi_get_config(struct at91_ebi_dev *ebid,
85-
struct at91_ebi_dev_config *conf)
84+
static void sama5_ebi_get_config(struct atmel_ebi_dev *ebid,
85+
struct atmel_ebi_dev_config *conf)
8686
{
8787
atmel_hsmc_cs_conf_get(ebid->ebi->smc.regmap, conf->cs,
8888
&conf->smcconf);
@@ -105,9 +105,9 @@ static const struct atmel_smc_timing_xlate timings_xlate_table[] = {
105105
ATMEL_SMC_CYCLE_XLATE("atmel,smc-nwe-cycle-ns", ATMEL_SMC_NWE_SHIFT),
106106
};
107107

108-
static int at91_ebi_xslate_smc_timings(struct at91_ebi_dev *ebid,
109-
struct device_node *np,
110-
struct atmel_smc_cs_conf *smcconf)
108+
static int atmel_ebi_xslate_smc_timings(struct atmel_ebi_dev *ebid,
109+
struct device_node *np,
110+
struct atmel_smc_cs_conf *smcconf)
111111
{
112112
unsigned int clk_rate = clk_get_rate(ebid->ebi->clk);
113113
unsigned int clk_period_ns = NSEC_PER_SEC / clk_rate;
@@ -164,9 +164,9 @@ static int at91_ebi_xslate_smc_timings(struct at91_ebi_dev *ebid,
164164
return required;
165165
}
166166

167-
static int at91_ebi_xslate_smc_config(struct at91_ebi_dev *ebid,
168-
struct device_node *np,
169-
struct at91_ebi_dev_config *conf)
167+
static int atmel_ebi_xslate_smc_config(struct atmel_ebi_dev *ebid,
168+
struct device_node *np,
169+
struct atmel_ebi_dev_config *conf)
170170
{
171171
struct atmel_smc_cs_conf *smcconf = &conf->smcconf;
172172
bool required = false;
@@ -262,7 +262,7 @@ static int at91_ebi_xslate_smc_config(struct at91_ebi_dev *ebid,
262262
required = true;
263263
}
264264

265-
ret = at91_ebi_xslate_smc_timings(ebid, np, &conf->smcconf);
265+
ret = atmel_ebi_xslate_smc_timings(ebid, np, &conf->smcconf);
266266
if (ret)
267267
return -EINVAL;
268268

@@ -275,27 +275,27 @@ static int at91_ebi_xslate_smc_config(struct at91_ebi_dev *ebid,
275275
return required;
276276
}
277277

278-
static void at91sam9_ebi_apply_config(struct at91_ebi_dev *ebid,
279-
struct at91_ebi_dev_config *conf)
278+
static void at91sam9_ebi_apply_config(struct atmel_ebi_dev *ebid,
279+
struct atmel_ebi_dev_config *conf)
280280
{
281281
atmel_smc_cs_conf_apply(ebid->ebi->smc.regmap, conf->cs,
282282
&conf->smcconf);
283283
}
284284

285-
static void sama5_ebi_apply_config(struct at91_ebi_dev *ebid,
286-
struct at91_ebi_dev_config *conf)
285+
static void sama5_ebi_apply_config(struct atmel_ebi_dev *ebid,
286+
struct atmel_ebi_dev_config *conf)
287287
{
288288
atmel_hsmc_cs_conf_apply(ebid->ebi->smc.regmap, conf->cs,
289289
&conf->smcconf);
290290
}
291291

292-
static int at91_ebi_dev_setup(struct at91_ebi *ebi, struct device_node *np,
293-
int reg_cells)
292+
static int atmel_ebi_dev_setup(struct atmel_ebi *ebi, struct device_node *np,
293+
int reg_cells)
294294
{
295-
const struct at91_ebi_caps *caps = ebi->caps;
296-
struct at91_ebi_dev_config conf = { };
295+
const struct atmel_ebi_caps *caps = ebi->caps;
296+
struct atmel_ebi_dev_config conf = { };
297297
struct device *dev = ebi->dev;
298-
struct at91_ebi_dev *ebid;
298+
struct atmel_ebi_dev *ebid;
299299
unsigned long cslines = 0;
300300
int ret, numcs = 0, nentries, i;
301301
bool apply = false;
@@ -367,70 +367,70 @@ static int at91_ebi_dev_setup(struct at91_ebi *ebi, struct device_node *np,
367367
return 0;
368368
}
369369

370-
static const struct at91_ebi_caps at91sam9260_ebi_caps = {
370+
static const struct atmel_ebi_caps at91sam9260_ebi_caps = {
371371
.available_cs = 0xff,
372372
.ebi_csa_offs = AT91SAM9260_MATRIX_EBICSA,
373373
.get_config = at91sam9_ebi_get_config,
374-
.xlate_config = at91_ebi_xslate_smc_config,
374+
.xlate_config = atmel_ebi_xslate_smc_config,
375375
.apply_config = at91sam9_ebi_apply_config,
376376
};
377377

378-
static const struct at91_ebi_caps at91sam9261_ebi_caps = {
378+
static const struct atmel_ebi_caps at91sam9261_ebi_caps = {
379379
.available_cs = 0xff,
380380
.ebi_csa_offs = AT91SAM9261_MATRIX_EBICSA,
381381
.get_config = at91sam9_ebi_get_config,
382-
.xlate_config = at91_ebi_xslate_smc_config,
382+
.xlate_config = atmel_ebi_xslate_smc_config,
383383
.apply_config = at91sam9_ebi_apply_config,
384384
};
385385

386-
static const struct at91_ebi_caps at91sam9263_ebi0_caps = {
386+
static const struct atmel_ebi_caps at91sam9263_ebi0_caps = {
387387
.available_cs = 0x3f,
388388
.ebi_csa_offs = AT91SAM9263_MATRIX_EBI0CSA,
389389
.get_config = at91sam9_ebi_get_config,
390-
.xlate_config = at91_ebi_xslate_smc_config,
390+
.xlate_config = atmel_ebi_xslate_smc_config,
391391
.apply_config = at91sam9_ebi_apply_config,
392392
};
393393

394-
static const struct at91_ebi_caps at91sam9263_ebi1_caps = {
394+
static const struct atmel_ebi_caps at91sam9263_ebi1_caps = {
395395
.available_cs = 0x7,
396396
.ebi_csa_offs = AT91SAM9263_MATRIX_EBI1CSA,
397397
.get_config = at91sam9_ebi_get_config,
398-
.xlate_config = at91_ebi_xslate_smc_config,
398+
.xlate_config = atmel_ebi_xslate_smc_config,
399399
.apply_config = at91sam9_ebi_apply_config,
400400
};
401401

402-
static const struct at91_ebi_caps at91sam9rl_ebi_caps = {
402+
static const struct atmel_ebi_caps at91sam9rl_ebi_caps = {
403403
.available_cs = 0x3f,
404404
.ebi_csa_offs = AT91SAM9RL_MATRIX_EBICSA,
405405
.get_config = at91sam9_ebi_get_config,
406-
.xlate_config = at91_ebi_xslate_smc_config,
406+
.xlate_config = atmel_ebi_xslate_smc_config,
407407
.apply_config = at91sam9_ebi_apply_config,
408408
};
409409

410-
static const struct at91_ebi_caps at91sam9g45_ebi_caps = {
410+
static const struct atmel_ebi_caps at91sam9g45_ebi_caps = {
411411
.available_cs = 0x3f,
412412
.ebi_csa_offs = AT91SAM9G45_MATRIX_EBICSA,
413413
.get_config = at91sam9_ebi_get_config,
414-
.xlate_config = at91_ebi_xslate_smc_config,
414+
.xlate_config = atmel_ebi_xslate_smc_config,
415415
.apply_config = at91sam9_ebi_apply_config,
416416
};
417417

418-
static const struct at91_ebi_caps at91sam9x5_ebi_caps = {
418+
static const struct atmel_ebi_caps at91sam9x5_ebi_caps = {
419419
.available_cs = 0x3f,
420420
.ebi_csa_offs = AT91SAM9X5_MATRIX_EBICSA,
421421
.get_config = at91sam9_ebi_get_config,
422-
.xlate_config = at91_ebi_xslate_smc_config,
422+
.xlate_config = atmel_ebi_xslate_smc_config,
423423
.apply_config = at91sam9_ebi_apply_config,
424424
};
425425

426-
static const struct at91_ebi_caps sama5d3_ebi_caps = {
426+
static const struct atmel_ebi_caps sama5d3_ebi_caps = {
427427
.available_cs = 0xf,
428428
.get_config = sama5_ebi_get_config,
429-
.xlate_config = at91_ebi_xslate_smc_config,
429+
.xlate_config = atmel_ebi_xslate_smc_config,
430430
.apply_config = sama5_ebi_apply_config,
431431
};
432432

433-
static const struct of_device_id at91_ebi_id_table[] = {
433+
static const struct of_device_id atmel_ebi_id_table[] = {
434434
{
435435
.compatible = "atmel,at91sam9260-ebi",
436436
.data = &at91sam9260_ebi_caps,
@@ -466,7 +466,7 @@ static const struct of_device_id at91_ebi_id_table[] = {
466466
{ /* sentinel */ }
467467
};
468468

469-
static int at91_ebi_dev_disable(struct at91_ebi *ebi, struct device_node *np)
469+
static int atmel_ebi_dev_disable(struct atmel_ebi *ebi, struct device_node *np)
470470
{
471471
struct device *dev = ebi->dev;
472472
struct property *newprop;
@@ -488,17 +488,17 @@ static int at91_ebi_dev_disable(struct at91_ebi *ebi, struct device_node *np)
488488
return of_update_property(np, newprop);
489489
}
490490

491-
static int at91_ebi_probe(struct platform_device *pdev)
491+
static int atmel_ebi_probe(struct platform_device *pdev)
492492
{
493493
struct device *dev = &pdev->dev;
494494
struct device_node *child, *np = dev->of_node, *smc_np;
495495
const struct of_device_id *match;
496-
struct at91_ebi *ebi;
496+
struct atmel_ebi *ebi;
497497
int ret, reg_cells;
498498
struct clk *clk;
499499
u32 val;
500500

501-
match = of_match_device(at91_ebi_id_table, dev);
501+
match = of_match_device(atmel_ebi_id_table, dev);
502502
if (!match || !match->data)
503503
return -EINVAL;
504504

@@ -564,12 +564,12 @@ static int at91_ebi_probe(struct platform_device *pdev)
564564
if (!of_find_property(child, "reg", NULL))
565565
continue;
566566

567-
ret = at91_ebi_dev_setup(ebi, child, reg_cells);
567+
ret = atmel_ebi_dev_setup(ebi, child, reg_cells);
568568
if (ret) {
569569
dev_err(dev, "failed to configure EBI bus for %s, disabling the device",
570570
child->full_name);
571571

572-
ret = at91_ebi_dev_disable(ebi, child);
572+
ret = atmel_ebi_dev_disable(ebi, child);
573573
if (ret)
574574
return ret;
575575
}
@@ -578,10 +578,10 @@ static int at91_ebi_probe(struct platform_device *pdev)
578578
return of_platform_populate(np, NULL, NULL, dev);
579579
}
580580

581-
static struct platform_driver at91_ebi_driver = {
581+
static struct platform_driver atmel_ebi_driver = {
582582
.driver = {
583583
.name = "atmel-ebi",
584-
.of_match_table = at91_ebi_id_table,
584+
.of_match_table = atmel_ebi_id_table,
585585
},
586586
};
587-
builtin_platform_driver_probe(at91_ebi_driver, at91_ebi_probe);
587+
builtin_platform_driver_probe(atmel_ebi_driver, atmel_ebi_probe);

0 commit comments

Comments
 (0)