summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Challis <git@zvecr.com>2022-10-29 22:33:47 +0100
committerGitHub <noreply@github.com>2022-10-29 22:33:47 +0100
commitc63e2e378d4f3e96379bbc816f93a94aa05928ed (patch)
treed29a5ee5c6b1f8808bfdc501472eb9df3afe5d79
parentc78dc85a1aea4935dfe35f21d951fedb07b5ec1e (diff)
Revert "mcp23018: add return status to init (#18178)" (#18709)
This reverts commit 3fffa51554556edc9ca53bc04ef45abe87d3d3c9.
-rw-r--r--drivers/gpio/mcp23018.c14
-rw-r--r--drivers/gpio/mcp23018.h2
2 files changed, 5 insertions, 11 deletions
diff --git a/drivers/gpio/mcp23018.c b/drivers/gpio/mcp23018.c
index b4fbf296f8..41cbfe087e 100644
--- a/drivers/gpio/mcp23018.c
+++ b/drivers/gpio/mcp23018.c
@@ -18,20 +18,14 @@ enum {
CMD_GPIOB = 0x13,
};
-bool mcp23018_init(uint8_t slave_addr) {
+void mcp23018_init(uint8_t addr) {
static uint8_t s_init = 0;
- uint8_t addr = SLAVE_TO_ADDR(slave_addr);
- if (0 == s_init) {
+ if (!s_init) {
i2c_init();
- wait_ms(100);
+ wait_ms(1000);
- // probe that the expander is actually connected by reading from it
- uint8_t data = 0;
- if (I2C_STATUS_SUCCESS == i2c_readReg(addr, 0, &data, sizeof(data), 150)) {
- s_init = 1;
- }
+ s_init = 1;
}
- return (s_init > 0);
}
bool mcp23018_set_config(uint8_t slave_addr, mcp23018_port_t port, uint8_t conf) {
diff --git a/drivers/gpio/mcp23018.h b/drivers/gpio/mcp23018.h
index 081fdb24e3..e7c2730dd1 100644
--- a/drivers/gpio/mcp23018.h
+++ b/drivers/gpio/mcp23018.h
@@ -33,7 +33,7 @@ enum {
/**
* Init expander and any other dependent drivers
*/
-bool mcp23018_init(uint8_t slave_addr);
+void mcp23018_init(uint8_t slave_addr);
/**
* Configure input/output to a given port