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.
Unified · Split
| @@ -19,6 +19,8 @@ · 18 unmodified lines | ||
| 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; |
| @@ -314,7 +316,7 @@ static int atmel_ebi_dev_setup(struct atmel_ebi *ebi, struct device_node *np, · 289 unmodified lines | ||
| 314 | 316 | if (ret) |
| 315 | 317 | return ret; |
| 316 | 318 | |
| 317 | − if (cs >= AT91_MATRIX_EBI_NUM_CS || | |
| 319 | + if (cs >= AT91_EBI_NUM_CS || | |
| 318 | 320 | !(ebi->caps->available_cs & BIT(cs))) { |
| 319 | 321 | dev_err(dev, "invalid reg property in %pOF\n", np); |
| 320 | 322 | return -EINVAL; |
| @@ -344,7 +346,7 @@ static int atmel_ebi_dev_setup(struct atmel_ebi *ebi, struct device_node *np, · 23 unmodified lines | ||
| 344 | 346 | apply = true; |
| 345 | 347 | |
| 346 | 348 | 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) { | |
| 348 | 350 | ebid->configs[i].cs = cs; |
| 349 | 351 | |
| 350 | 352 | if (apply) { |
| @@ -106,7 +106,6 @@ · 105 unmodified lines | ||
| 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 | |