Lines Matching +full:data +full:- +full:bus +full:- +full:gpios
8 * SPDX-License-Identifier: Apache-2.0
26 const struct device *bus; member
36 const struct gpio_i2c_switch_config *config = dev->config; in gpio_i2c_switch_configure()
38 return i2c_configure(config->bus, dev_config); in gpio_i2c_switch_configure()
45 struct gpio_i2c_switch_data *data = dev->data; in gpio_i2c_switch_transfer() local
46 const struct gpio_i2c_switch_config *config = dev->config; in gpio_i2c_switch_transfer()
48 res = k_mutex_lock(&data->lock, K_USEC(GPIO_I2C_LOCK_TIMEOUT_US)); in gpio_i2c_switch_transfer()
54 gpio_pin_set_dt(&config->gpio, 1); in gpio_i2c_switch_transfer()
57 res = i2c_transfer(config->bus, msgs, num_msgs, addr); in gpio_i2c_switch_transfer()
60 gpio_pin_set_dt(&config->gpio, 0); in gpio_i2c_switch_transfer()
62 k_mutex_unlock(&data->lock); in gpio_i2c_switch_transfer()
77 const struct gpio_i2c_switch_config *config = dev->config; in gpio_i2c_switch_init()
78 struct gpio_i2c_switch_data *data = dev->data; in gpio_i2c_switch_init() local
80 k_mutex_init(&data->lock); in gpio_i2c_switch_init()
82 return gpio_pin_configure_dt(&config->gpio, GPIO_OUTPUT_INACTIVE); in gpio_i2c_switch_init()
90 .bus = DEVICE_DT_GET(DT_PHANDLE(DT_DRV_INST(inst), controller)), \
91 .gpio = GPIO_DT_SPEC_GET(DT_DRV_INST(inst), gpios), \