• Home
  • Raw
  • Download

Lines Matching refs:ptr

86 static void debug_packet(struct device *dev, const char *name, u8 *ptr,  in debug_packet()  argument
94 pr_cont(" %02x", ptr[i]); in debug_packet()
173 u8 *ptr, *end; in cros_ec_spi_receive_packet() local
191 ptr = ec_dev->din; in cros_ec_spi_receive_packet()
192 for (end = ptr + EC_MSG_PREAMBLE_COUNT; ptr != end; ptr++) { in cros_ec_spi_receive_packet()
193 if (*ptr == EC_SPI_FRAME_START) { in cros_ec_spi_receive_packet()
195 ptr - ec_dev->din); in cros_ec_spi_receive_packet()
199 if (ptr != end) in cros_ec_spi_receive_packet()
217 todo = end - ++ptr; in cros_ec_spi_receive_packet()
220 memmove(ec_dev->din, ptr, todo); in cros_ec_spi_receive_packet()
221 ptr = ec_dev->din + todo; in cros_ec_spi_receive_packet()
228 ret = receive_n_bytes(ec_dev, ptr, sizeof(*response) - todo); in cros_ec_spi_receive_packet()
231 ptr += (sizeof(*response) - todo); in cros_ec_spi_receive_packet()
251 todo, need_len, ptr - ec_dev->din); in cros_ec_spi_receive_packet()
253 ret = receive_n_bytes(ec_dev, ptr, todo); in cros_ec_spi_receive_packet()
257 ptr += todo; in cros_ec_spi_receive_packet()
261 dev_dbg(ec_dev->dev, "loop done, ptr=%zd\n", ptr - ec_dev->din); in cros_ec_spi_receive_packet()
281 u8 *ptr, *end; in cros_ec_spi_receive_response() local
299 ptr = ec_dev->din; in cros_ec_spi_receive_response()
300 for (end = ptr + EC_MSG_PREAMBLE_COUNT; ptr != end; ptr++) { in cros_ec_spi_receive_response()
301 if (*ptr == EC_SPI_FRAME_START) { in cros_ec_spi_receive_response()
303 ptr - ec_dev->din); in cros_ec_spi_receive_response()
307 if (ptr != end) in cros_ec_spi_receive_response()
325 todo = end - ++ptr; in cros_ec_spi_receive_response()
328 memmove(ec_dev->din, ptr, todo); in cros_ec_spi_receive_response()
329 ptr = ec_dev->din + todo; in cros_ec_spi_receive_response()
344 todo, need_len, ptr - ec_dev->din); in cros_ec_spi_receive_response()
346 ret = receive_n_bytes(ec_dev, ptr, todo); in cros_ec_spi_receive_response()
350 debug_packet(ec_dev->dev, "interim", ptr, todo); in cros_ec_spi_receive_response()
351 ptr += todo; in cros_ec_spi_receive_response()
355 dev_dbg(ec_dev->dev, "loop done, ptr=%zd\n", ptr - ec_dev->din); in cros_ec_spi_receive_response()
374 u8 *ptr; in cros_ec_pkt_xfer_spi() local
449 ptr = ec_dev->din; in cros_ec_pkt_xfer_spi()
452 response = (struct ec_host_response *)ptr; in cros_ec_pkt_xfer_spi()
469 sum += ptr[i]; in cros_ec_pkt_xfer_spi()
472 memcpy(ec_msg->data, ptr + sizeof(*response), len); in cros_ec_pkt_xfer_spi()
506 u8 *ptr; in cros_ec_cmd_xfer_spi() local
572 ptr = ec_dev->din; in cros_ec_cmd_xfer_spi()
575 ec_msg->result = ptr[0]; in cros_ec_cmd_xfer_spi()
580 len = ptr[1]; in cros_ec_cmd_xfer_spi()
581 sum = ptr[0] + ptr[1]; in cros_ec_cmd_xfer_spi()
591 sum += ptr[i + 2]; in cros_ec_cmd_xfer_spi()
593 ec_msg->data[i] = ptr[i + 2]; in cros_ec_cmd_xfer_spi()
597 debug_packet(ec_dev->dev, "in", ptr, len + 3); in cros_ec_cmd_xfer_spi()
599 if (sum != ptr[len + 2]) { in cros_ec_cmd_xfer_spi()
602 sum, ptr[len + 2]); in cros_ec_cmd_xfer_spi()