Lines Matching refs:chip

33 static int ds4510_mem_write(uint8_t chip, int offset, uint8_t *buf, int count)  in ds4510_mem_write()  argument
43 if (i2c_write(chip, offset, 1, &buf[i], wrlen)) in ds4510_mem_write()
62 static int ds4510_mem_read(uint8_t chip, int offset, uint8_t *buf, int count) in ds4510_mem_read() argument
64 return i2c_read(chip, offset, 1, buf, count); in ds4510_mem_read()
72 static int ds4510_see_write(uint8_t chip, uint8_t nv) in ds4510_see_write() argument
76 if (i2c_read(chip, DS4510_CFG, 1, &data, 1)) in ds4510_see_write()
84 return ds4510_mem_write(chip, DS4510_CFG, &data, 1); in ds4510_see_write()
90 static int ds4510_rstdelay_write(uint8_t chip, uint8_t delay) in ds4510_rstdelay_write() argument
94 if (i2c_read(chip, DS4510_RSTDELAY, 1, &data, 1)) in ds4510_rstdelay_write()
100 return ds4510_mem_write(chip, DS4510_RSTDELAY, &data, 1); in ds4510_rstdelay_write()
106 static int ds4510_pullup_write(uint8_t chip, uint8_t val) in ds4510_pullup_write() argument
110 return ds4510_mem_write(chip, DS4510_PULLUP, (uint8_t *)&val, 1); in ds4510_pullup_write()
116 static int ds4510_pullup_read(uint8_t chip) in ds4510_pullup_read() argument
120 if (i2c_read(chip, DS4510_PULLUP, 1, &val, 1)) in ds4510_pullup_read()
129 static int ds4510_gpio_write(uint8_t chip, uint8_t val) in ds4510_gpio_write() argument
135 if (i2c_read(chip, DS4510_IO0 - i, 1, &data, 1)) in ds4510_gpio_write()
143 if (ds4510_mem_write(chip, DS4510_IO0 - i, &data, 1)) in ds4510_gpio_write()
153 static int ds4510_gpio_read(uint8_t chip) in ds4510_gpio_read() argument
160 if (i2c_read(chip, DS4510_IO0 - i, 1, &data, 1)) in ds4510_gpio_read()
173 static int ds4510_gpio_read_val(uint8_t chip) in ds4510_gpio_read_val() argument
177 if (i2c_read(chip, DS4510_IO_STATUS, 1, &val, 1)) in ds4510_gpio_read_val()
186 static int ds4510_info(uint8_t chip) in ds4510_info() argument
192 printf("DS4510 @ 0x%x:\n\n", chip); in ds4510_info()
194 if (i2c_read(chip, DS4510_RSTDELAY, 1, &data, 1)) in ds4510_info()
198 if (i2c_read(chip, DS4510_CFG, 1, &data, 1)) in ds4510_info()
211 tmp = ds4510_pullup_read(chip); in ds4510_info()
219 tmp = ds4510_gpio_read(chip); in ds4510_info()
227 tmp = ds4510_gpio_read_val(chip); in ds4510_info()
252 static uint8_t chip = 0x51; in do_ds4510() local
283 chip = ul_arg2; in do_ds4510()
284 printf("Current device address: 0x%x\n", chip); in do_ds4510()
287 return ds4510_see_write(chip, ul_arg2); in do_ds4510()
289 tmp = ds4510_gpio_read(chip); in do_ds4510()
296 return ds4510_gpio_write(chip, tmp); in do_ds4510()
298 tmp = ds4510_gpio_read_val(chip); in do_ds4510()
303 tmp = ds4510_pullup_read(chip); in do_ds4510()
310 return ds4510_pullup_write(chip, tmp); in do_ds4510()
312 return ds4510_info(chip); in do_ds4510()
314 return ds4510_rstdelay_write(chip, ul_arg2); in do_ds4510()
349 return rw_func(chip, off, (uint8_t *)addr, cnt); in do_ds4510()