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

Configure Feed

Select the types of activity you want to include in your feed.

fpga: xilinx-core: add new gpio names for prog and init

Old names (prog_b and init-b) are used as a fallback for hardware
compatible with the "xlnx,fpga-slave-serial" string.

Signed-off-by: Charles Perry <charles.perry@savoirfairelinux.com>
Acked-by: Xu Yilun <yilun.xu@intel.com>
Link: https://lore.kernel.org/r/20240321220447.3260065-5-charles.perry@savoirfairelinux.com
Signed-off-by: Xu Yilun <yilun.xu@linux.intel.com>

authored by

Charles Perry and committed by
Xu Yilun
4a1f12b5 104712a0

+18 -2
+18 -2
drivers/fpga/xilinx-core.c
··· 171 171 return -ETIMEDOUT; 172 172 } 173 173 174 + static inline struct gpio_desc * 175 + xilinx_core_devm_gpiod_get(struct device *dev, const char *con_id, 176 + const char *legacy_con_id, enum gpiod_flags flags) 177 + { 178 + struct gpio_desc *desc; 179 + 180 + desc = devm_gpiod_get(dev, con_id, flags); 181 + if (IS_ERR(desc) && PTR_ERR(desc) == -ENOENT && 182 + of_device_is_compatible(dev->of_node, "xlnx,fpga-slave-serial")) 183 + desc = devm_gpiod_get(dev, legacy_con_id, flags); 184 + 185 + return desc; 186 + } 187 + 174 188 static const struct fpga_manager_ops xilinx_core_ops = { 175 189 .state = xilinx_core_state, 176 190 .write_init = xilinx_core_write_init, ··· 200 186 return -EINVAL; 201 187 202 188 /* PROGRAM_B is active low */ 203 - core->prog_b = devm_gpiod_get(core->dev, "prog_b", GPIOD_OUT_LOW); 189 + core->prog_b = xilinx_core_devm_gpiod_get(core->dev, "prog", "prog_b", 190 + GPIOD_OUT_LOW); 204 191 if (IS_ERR(core->prog_b)) 205 192 return dev_err_probe(core->dev, PTR_ERR(core->prog_b), 206 193 "Failed to get PROGRAM_B gpio\n"); 207 194 208 - core->init_b = devm_gpiod_get_optional(core->dev, "init-b", GPIOD_IN); 195 + core->init_b = xilinx_core_devm_gpiod_get(core->dev, "init", "init-b", 196 + GPIOD_IN); 209 197 if (IS_ERR(core->init_b)) 210 198 return dev_err_probe(core->dev, PTR_ERR(core->init_b), 211 199 "Failed to get INIT_B gpio\n");