driver: i2c: mec15xx: i2c clk and data same group
I2C clock and I2C gpio could be on same gpio group. Remove assertion that required them to be on different group. Signed-off-by: Jay Vasanth <jay.vasanth@microchip.com>
This commit is contained in:
parent
e60a4afcdf
commit
3e25b36979
1 changed files with 10 additions and 9 deletions
|
@ -8,7 +8,6 @@
|
||||||
|
|
||||||
#include <drivers/clock_control.h>
|
#include <drivers/clock_control.h>
|
||||||
#include <kernel.h>
|
#include <kernel.h>
|
||||||
#include <assert.h>
|
|
||||||
#include <soc.h>
|
#include <soc.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <drivers/gpio.h>
|
#include <drivers/gpio.h>
|
||||||
|
@ -303,14 +302,19 @@ static bool check_lines_high(const struct device *dev)
|
||||||
gpio_port_value_t sda = 0, scl = 0;
|
gpio_port_value_t sda = 0, scl = 0;
|
||||||
|
|
||||||
if (gpio_port_get_raw(data->sda_gpio, &sda)) {
|
if (gpio_port_get_raw(data->sda_gpio, &sda)) {
|
||||||
LOG_DBG("gpio_port_get_raw for %s SDA failed", dev->name);
|
LOG_ERR("gpio_port_get_raw for %s SDA failed", dev->name);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gpio_port_get_raw(data->scl_gpio, &scl)) {
|
/* both pins could be on same GPIO group */
|
||||||
LOG_DBG("gpio_port_get_raw for %s SCL failed",
|
if (data->sda_gpio == data->scl_gpio) {
|
||||||
dev->name);
|
scl = sda;
|
||||||
return false;
|
} else {
|
||||||
|
if (gpio_port_get_raw(data->scl_gpio, &scl)) {
|
||||||
|
LOG_ERR("gpio_port_get_raw for %s SCL failed",
|
||||||
|
dev->name);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (sda & BIT(config->sda_pos)) && (scl & BIT(config->scl_pos));
|
return (sda & BIT(config->sda_pos)) && (scl & BIT(config->scl_pos));
|
||||||
|
@ -899,9 +903,6 @@ static int i2c_xec_init(const struct device *dev)
|
||||||
return -ENXIO;
|
return -ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
__ASSERT(data->sda_gpio != data->scl_gpio,
|
|
||||||
"Both i2c pins on same GPIO");
|
|
||||||
|
|
||||||
/* Default configuration */
|
/* Default configuration */
|
||||||
ret = i2c_xec_configure(dev,
|
ret = i2c_xec_configure(dev,
|
||||||
I2C_MODE_MASTER |
|
I2C_MODE_MASTER |
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue