• Home
  • Raw
  • Download

Lines Matching refs:sda

37 static int i2c_gpio_sda_get(struct gpio_desc *sda)  in i2c_gpio_sda_get()  argument
39 return dm_gpio_get_value(sda); in i2c_gpio_sda_get()
42 static void i2c_gpio_sda_set(struct gpio_desc *sda, int bit) in i2c_gpio_sda_set() argument
45 dm_gpio_set_dir_flags(sda, GPIOD_IS_IN); in i2c_gpio_sda_set()
47 dm_gpio_set_dir_flags(sda, GPIOD_IS_OUT); in i2c_gpio_sda_set()
59 static void i2c_gpio_write_bit(struct gpio_desc *scl, struct gpio_desc *sda, in i2c_gpio_write_bit() argument
64 i2c_gpio_sda_set(sda, bit); in i2c_gpio_write_bit()
70 static int i2c_gpio_read_bit(struct gpio_desc *scl, struct gpio_desc *sda, in i2c_gpio_read_bit() argument
77 value = i2c_gpio_sda_get(sda); in i2c_gpio_read_bit()
86 static void i2c_gpio_send_start(struct gpio_desc *scl, struct gpio_desc *sda, in i2c_gpio_send_start() argument
90 i2c_gpio_sda_set(sda, 1); in i2c_gpio_send_start()
94 i2c_gpio_sda_set(sda, 0); in i2c_gpio_send_start()
99 static void i2c_gpio_send_stop(struct gpio_desc *scl, struct gpio_desc *sda, in i2c_gpio_send_stop() argument
104 i2c_gpio_sda_set(sda, 0); in i2c_gpio_send_stop()
108 i2c_gpio_sda_set(sda, 1); in i2c_gpio_send_stop()
113 static void i2c_gpio_send_ack(struct gpio_desc *scl, struct gpio_desc *sda, in i2c_gpio_send_ack() argument
116 i2c_gpio_write_bit(scl, sda, delay, ack); in i2c_gpio_send_ack()
126 static void i2c_gpio_send_reset(struct gpio_desc *scl, struct gpio_desc *sda, in i2c_gpio_send_reset() argument
132 i2c_gpio_write_bit(scl, sda, delay, 1); in i2c_gpio_send_reset()
134 i2c_gpio_send_stop(scl, sda, delay); in i2c_gpio_send_reset()
138 static void i2c_gpio_sda_high(struct gpio_desc *scl, struct gpio_desc *sda, in i2c_gpio_sda_high() argument
143 i2c_gpio_sda_set(sda, 1); in i2c_gpio_sda_high()
148 static int i2c_gpio_write_byte(struct gpio_desc *scl, struct gpio_desc *sda, in i2c_gpio_write_byte() argument
155 i2c_gpio_write_bit(scl, sda, delay, data & 0x80); in i2c_gpio_write_byte()
162 i2c_gpio_sda_high(scl, sda, delay); in i2c_gpio_write_byte()
163 nack = i2c_gpio_read_bit(scl, sda, delay); in i2c_gpio_write_byte()
172 static uchar i2c_gpio_read_byte(struct gpio_desc *scl, struct gpio_desc *sda, in i2c_gpio_read_byte() argument
178 i2c_gpio_sda_high(scl, sda, delay); in i2c_gpio_read_byte()
182 data |= i2c_gpio_read_bit(scl, sda, delay); in i2c_gpio_read_byte()
184 i2c_gpio_send_ack(scl, sda, delay, ack); in i2c_gpio_read_byte()
190 int i2c_send_slave_addr(struct gpio_desc *scl, struct gpio_desc *sda, int delay, in i2c_send_slave_addr() argument
193 i2c_gpio_send_start(scl, sda, delay); in i2c_send_slave_addr()
195 if (i2c_gpio_write_byte(scl, sda, delay, chip)) { in i2c_send_slave_addr()
196 i2c_gpio_send_stop(scl, sda, delay); in i2c_send_slave_addr()
208 struct gpio_desc *sda = &bus->gpios[PIN_SDA]; in i2c_gpio_write_data() local
214 if (i2c_send_slave_addr(scl, sda, delay, chip << 1)) { in i2c_gpio_write_data()
220 if (i2c_gpio_write_byte(scl, sda, delay, *buffer++)) in i2c_gpio_write_data()
225 i2c_gpio_send_stop(scl, sda, delay); in i2c_gpio_write_data()
229 if (i2c_send_slave_addr(scl, sda, delay, (chip << 1) | 0x1)) { in i2c_gpio_write_data()
241 struct gpio_desc *sda = &bus->gpios[PIN_SDA]; in i2c_gpio_read_data() local
247 *buffer++ = i2c_gpio_read_byte(scl, sda, delay, len == 0); in i2c_gpio_read_data()
249 i2c_gpio_send_stop(scl, sda, delay); in i2c_gpio_read_data()
281 struct gpio_desc *sda = &bus->gpios[PIN_SDA]; in i2c_gpio_probe() local
285 i2c_gpio_send_start(scl, sda, delay); in i2c_gpio_probe()
286 ret = i2c_gpio_write_byte(scl, sda, delay, (chip << 1) | 0); in i2c_gpio_probe()
287 i2c_gpio_send_stop(scl, sda, delay); in i2c_gpio_probe()
299 struct gpio_desc *sda = &bus->gpios[PIN_SDA]; in i2c_gpio_set_bus_speed() local
303 i2c_gpio_send_reset(scl, sda, bus->udelay); in i2c_gpio_set_bus_speed()