Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Tudor Ambarus and committed by
Alexandre Belloni
dbbf9839 02c1c37f

+4 -3
+4 -2
drivers/memory/atmel-ebi.c
··· 19 19 #include <linux/regmap.h> 20 20 #include <soc/at91/atmel-sfr.h> 21 21 22 + #define AT91_EBI_NUM_CS 8 23 + 22 24 struct atmel_ebi_dev_config { 23 25 int cs; 24 26 struct atmel_smc_cs_conf smcconf; ··· 316 314 if (ret) 317 315 return ret; 318 316 319 - if (cs >= AT91_MATRIX_EBI_NUM_CS || 317 + if (cs >= AT91_EBI_NUM_CS || 320 318 !(ebi->caps->available_cs & BIT(cs))) { 321 319 dev_err(dev, "invalid reg property in %pOF\n", np); 322 320 return -EINVAL; ··· 346 344 apply = true; 347 345 348 346 i = 0; 349 - for_each_set_bit(cs, &cslines, AT91_MATRIX_EBI_NUM_CS) { 347 + for_each_set_bit(cs, &cslines, AT91_EBI_NUM_CS) { 350 348 ebid->configs[i].cs = cs; 351 349 352 350 if (apply) {
-1
include/linux/mfd/syscon/atmel-matrix.h
··· 106 106 #define AT91_MATRIX_DDR_IOSR BIT(18) 107 107 #define AT91_MATRIX_NFD0_SELECT BIT(24) 108 108 #define AT91_MATRIX_DDR_MP_EN BIT(25) 109 - #define AT91_MATRIX_EBI_NUM_CS 8 110 109 111 110 #define AT91_MATRIX_USBPUCR_PUON BIT(30) 112 111