Skip to content

Commit dbbf983

Browse files
ambarusalexandrebelloni
authored andcommitted
memory: atmel-ebi: move NUM_CS definition inside EBI driver
The total number of EBI CS lines is described by the EBI controller and not by the Matrix. Move the definition for the number of CS inside EBI driver. Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com> Link: https://lore.kernel.org/r/20190906150632.19039-1-tudor.ambarus@microchip.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
1 parent 02c1c37 commit dbbf983

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

‎drivers/memory/atmel-ebi.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
#include <linux/regmap.h>
2020
#include <soc/at91/atmel-sfr.h>
2121

22+
#define AT91_EBI_NUM_CS 8
23+
2224
struct atmel_ebi_dev_config {
2325
int cs;
2426
struct atmel_smc_cs_conf smcconf;
@@ -314,7 +316,7 @@ static int atmel_ebi_dev_setup(struct atmel_ebi *ebi, struct device_node *np,
314316
if (ret)
315317
return ret;
316318

317-
if (cs >= AT91_MATRIX_EBI_NUM_CS ||
319+
if (cs >= AT91_EBI_NUM_CS ||
318320
!(ebi->caps->available_cs & BIT(cs))) {
319321
dev_err(dev, "invalid reg property in %pOF\n", np);
320322
return -EINVAL;
@@ -344,7 +346,7 @@ static int atmel_ebi_dev_setup(struct atmel_ebi *ebi, struct device_node *np,
344346
apply = true;
345347

346348
i = 0;
347-
for_each_set_bit(cs, &cslines, AT91_MATRIX_EBI_NUM_CS) {
349+
for_each_set_bit(cs, &cslines, AT91_EBI_NUM_CS) {
348350
ebid->configs[i].cs = cs;
349351

350352
if (apply) {

‎include/linux/mfd/syscon/atmel-matrix.h‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@
106106
#define AT91_MATRIX_DDR_IOSR BIT(18)
107107
#define AT91_MATRIX_NFD0_SELECT BIT(24)
108108
#define AT91_MATRIX_DDR_MP_EN BIT(25)
109-
#define AT91_MATRIX_EBI_NUM_CS 8
110109

111110
#define AT91_MATRIX_USBPUCR_PUON BIT(30)
112111

0 commit comments

Comments
 (0)