Lines Matching refs:conf
90 struct altera_ps_conf *conf = mgr->priv; in altera_ps_state() local
92 if (gpiod_get_value_cansleep(conf->status)) in altera_ps_state()
110 struct altera_ps_conf *conf = mgr->priv; in altera_ps_write_init() local
114 conf->info_flags = info->flags; in altera_ps_write_init()
121 gpiod_set_value_cansleep(conf->config, 1); in altera_ps_write_init()
124 altera_ps_delay(conf->data->t_cfg_us); in altera_ps_write_init()
126 if (!gpiod_get_value_cansleep(conf->status)) { in altera_ps_write_init()
131 gpiod_set_value_cansleep(conf->config, 0); in altera_ps_write_init()
133 min = conf->data->status_wait_min_us; in altera_ps_write_init()
134 max = conf->data->status_wait_max_us; in altera_ps_write_init()
142 if (!gpiod_get_value_cansleep(conf->status)) { in altera_ps_write_init()
144 altera_ps_delay(conf->data->t_st2ck_us); in altera_ps_write_init()
178 struct altera_ps_conf *conf = mgr->priv; in altera_ps_write() local
186 if (!(conf->info_flags & FPGA_MGR_BITSTREAM_LSB_FIRST)) in altera_ps_write()
189 ret = spi_write(conf->spi, fw_data, stride); in altera_ps_write()
204 struct altera_ps_conf *conf = mgr->priv; in altera_ps_write_complete() local
208 if (gpiod_get_value_cansleep(conf->status)) { in altera_ps_write_complete()
213 if (conf->confd) { in altera_ps_write_complete()
214 if (!gpiod_get_raw_value_cansleep(conf->confd)) { in altera_ps_write_complete()
224 ret = spi_write(conf->spi, dummy, 1); in altera_ps_write_complete()
258 struct altera_ps_conf *conf; in altera_ps_probe() local
262 conf = devm_kzalloc(&spi->dev, sizeof(*conf), GFP_KERNEL); in altera_ps_probe()
263 if (!conf) in altera_ps_probe()
270 conf->data = of_id->data; in altera_ps_probe()
272 conf->data = id_to_data(spi_get_device_id(spi)); in altera_ps_probe()
273 if (!conf->data) in altera_ps_probe()
277 conf->spi = spi; in altera_ps_probe()
278 conf->config = devm_gpiod_get(&spi->dev, "nconfig", GPIOD_OUT_LOW); in altera_ps_probe()
279 if (IS_ERR(conf->config)) { in altera_ps_probe()
281 PTR_ERR(conf->config)); in altera_ps_probe()
282 return PTR_ERR(conf->config); in altera_ps_probe()
285 conf->status = devm_gpiod_get(&spi->dev, "nstat", GPIOD_IN); in altera_ps_probe()
286 if (IS_ERR(conf->status)) { in altera_ps_probe()
288 PTR_ERR(conf->status)); in altera_ps_probe()
289 return PTR_ERR(conf->status); in altera_ps_probe()
292 conf->confd = devm_gpiod_get_optional(&spi->dev, "confd", GPIOD_IN); in altera_ps_probe()
293 if (IS_ERR(conf->confd)) { in altera_ps_probe()
295 PTR_ERR(conf->confd)); in altera_ps_probe()
296 return PTR_ERR(conf->confd); in altera_ps_probe()
297 } else if (!conf->confd) { in altera_ps_probe()
302 snprintf(conf->mgr_name, sizeof(conf->mgr_name), "%s %s", in altera_ps_probe()
305 mgr = devm_fpga_mgr_register(&spi->dev, conf->mgr_name, in altera_ps_probe()
306 &altera_ps_ops, conf); in altera_ps_probe()