mre 050 compromise
This commit is contained in:
parent
d79e404bec
commit
137a41282b
|
@ -905,21 +905,36 @@ static int tle8888_chip_init(void * data) {
|
||||||
/* mark pins used */
|
/* mark pins used */
|
||||||
// we do not initialize CS pin so we should not be marking it used - i'm sad
|
// we do not initialize CS pin so we should not be marking it used - i'm sad
|
||||||
//ret = gpio_pin_markUsed(cfg->spi_config.ssport, cfg->spi_config.sspad, DRIVER_NAME " CS");
|
//ret = gpio_pin_markUsed(cfg->spi_config.ssport, cfg->spi_config.sspad, DRIVER_NAME " CS");
|
||||||
if (cfg->reset.port != NULL)
|
if (cfg->reset.port != NULL) {
|
||||||
ret |= gpio_pin_markUsed(cfg->reset.port, cfg->reset.pad, DRIVER_NAME " RST");
|
ret |= gpio_pin_markUsed(cfg->reset.port, cfg->reset.pad, DRIVER_NAME " RST");
|
||||||
if (cfg->ign_en.port != NULL)
|
palSetPadMode(cfg->reset.port, cfg->reset.pad, PAL_MODE_OUTPUT_PUSHPULL);
|
||||||
|
palSetPort(cfg->reset.port, PAL_PORT_BIT(cfg->reset.pad));
|
||||||
|
}
|
||||||
|
if (cfg->ign_en.port != NULL) {
|
||||||
ret |= gpio_pin_markUsed(cfg->ign_en.port, cfg->ign_en.pad, DRIVER_NAME " IGN EN");
|
ret |= gpio_pin_markUsed(cfg->ign_en.port, cfg->ign_en.pad, DRIVER_NAME " IGN EN");
|
||||||
if (cfg->inj_en.port != NULL)
|
palSetPadMode(cfg->ign_en.port, cfg->ign_en.pad, PAL_MODE_OUTPUT_PUSHPULL);
|
||||||
|
palClearPort(cfg->ign_en.port, PAL_PORT_BIT(cfg->ign_en.pad));
|
||||||
|
}
|
||||||
|
if (cfg->inj_en.port != NULL) {
|
||||||
ret |= gpio_pin_markUsed(cfg->inj_en.port, cfg->inj_en.pad, DRIVER_NAME " INJ EN");
|
ret |= gpio_pin_markUsed(cfg->inj_en.port, cfg->inj_en.pad, DRIVER_NAME " INJ EN");
|
||||||
for (int i = 0; i < TLE8888_DIRECT_MISC; i++)
|
palSetPadMode(cfg->inj_en.port, cfg->inj_en.pad, PAL_MODE_OUTPUT_PUSHPULL);
|
||||||
if (cfg->direct_io[i].port)
|
palClearPort(cfg->inj_en.port, PAL_PORT_BIT(cfg->inj_en.pad));
|
||||||
|
}
|
||||||
|
for (int i = 0; i < TLE8888_DIRECT_MISC; i++) {
|
||||||
|
if (cfg->direct_io[i].port) {
|
||||||
ret |= gpio_pin_markUsed(cfg->direct_io[i].port, cfg->direct_io[i].pad, DRIVER_NAME " DIRECT IO");
|
ret |= gpio_pin_markUsed(cfg->direct_io[i].port, cfg->direct_io[i].pad, DRIVER_NAME " DIRECT IO");
|
||||||
|
// TODO: we need this but that's incompatible configuration change
|
||||||
|
// palSetPadMode(cfg->direct_io[i].port, cfg->direct_io[i].pad, PAL_MODE_OUTPUT_PUSHPULL);
|
||||||
|
// palClearPort(cfg->direct_io[i].port, PAL_PORT_BIT(cfg->direct_io[i].pad));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
ret = -1;
|
ret = -1;
|
||||||
goto err_gpios;
|
goto err_gpios;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
|
||||||
err_gpios:
|
err_gpios:
|
||||||
/* unmark pins */
|
/* unmark pins */
|
||||||
|
|
Loading…
Reference in New Issue