Smart gpio fixes 2 (#765)

* gpio chips: relax error checking on _add

Do not halt whole system if wrong or nulled config is passed.
In current smart-gpio implementation this can happen and it is not
as error. Let smart-gpio handle this, kust reurn negative.

* tle8888: return back includes needed for debug

* smar-gpio: -Werror=missing-field-initializers fix
This commit is contained in:
dron0gus 2019-04-19 08:42:24 +03:00 committed by rusefi
parent f09bc89508
commit 71cc657f10
4 changed files with 10 additions and 3 deletions

View File

@ -343,7 +343,8 @@ int mc33972_add(unsigned int index, const struct mc33972_config *cfg)
struct mc33972_priv *chip;
/* no config or no such chip */
osalDbgCheck((cfg != NULL) && (cfg->spi_bus != NULL) && (index < BOARD_MC33972_COUNT));
if ((!cfg) || (!cfg->spi_bus) || (index >= BOARD_MC33972_COUNT))
return -1;
/* check for valid cs.
* DOTO: remove this check? CS can be driven by SPI */

View File

@ -474,7 +474,8 @@ int tle6240_add(unsigned int index, const struct tle6240_config *cfg)
struct tle6240_priv *chip;
/* no config or no such chip */
osalDbgCheck((cfg != NULL) && (cfg->spi_bus != NULL) && (index < BOARD_TLE6240_COUNT));
if ((!cfg) || (!cfg->spi_bus) || (index >= BOARD_TLE6240_COUNT))
return -1;
/* check for valid cs.
* DOTO: remove this check? CS can be driven by SPI */

View File

@ -23,7 +23,10 @@
#include "pin_repository.h"
#include "rfiutil.h"
/* to be rmeoved */
#if EFI_TUNER_STUDIO
#include "engine_configuration.h"
EXTERN_CONFIG;
#include "tunerstudio.h"
extern TunerStudioOutputChannels tsOutputChannels;
#endif /* EFI_TUNER_STUDIO */
@ -480,7 +483,8 @@ int tle8888_add(unsigned int index, const struct tle8888_config *cfg)
efiAssert(OBD_PCM_Processor_Fault, cfg != NULL, "8888CFG", 0)
/* no config or no such chip */
osalDbgCheck((cfg != NULL) && (cfg->spi_bus != NULL) && (index < BOARD_TLE8888_COUNT));
if ((!cfg) || (!cfg->spi_bus) || (index >= BOARD_TLE8888_COUNT))
return -1;
/* check for valid cs.
* TODO: remove this check? CS can be driven by SPI */

View File

@ -120,6 +120,7 @@ static struct tle8888_config tle8888_cfg = {
0,
.cr2 = SPI_CR2_16BIT_MODE
},
.reset = {.port = NULL, .pad = 0},
.direct_io = {
[0] = {.port = NULL, .pad = 0, .output = 9},
[1] = {.port = NULL, .pad = 0, .output = 10},