Lines Matching refs:data

293 	const struct npcm_i2c_data *data;
367 static inline void npcm_i2c_wr_byte(struct npcm_i2c *bus, u8 data)
369 iowrite8(data, bus->reg + NPCM_I2CSDA);
460 if ((tx_fifo_sts & bus->data->txf_sts_tx_bytes) == 0)
473 if ((rx_fifo_sts & bus->data->rxf_sts_rx_bytes) == 0)
757 return (bus->data->txf_sts_tx_bytes &
760 return (bus->data->rxf_sts_rx_bytes &
773 size_free_fifo = bus->data->fifo_size - npcm_i2c_fifo_usage(bus);
779 size_free_fifo = bus->data->fifo_size - npcm_i2c_fifo_usage(bus);
800 rxf_ctl = min_t(int, nread, bus->data->fifo_size);
803 if (nread <= bus->data->fifo_size)
804 rxf_ctl |= bus->data->rxf_ctl_last_pec;
822 if (nwrite > bus->data->fifo_size)
823 /* data to send is more then FIFO size. */
824 iowrite8(bus->data->fifo_size, bus->reg + NPCM_I2CTXF_CTL);
834 u8 data;
837 data = npcm_i2c_rd_byte(bus);
839 bus->rd_buf[bus->rd_ind++] = data;
891 while (max_bytes-- && bus->data->fifo_size != npcm_i2c_fifo_usage(bus)) {
894 bus->slv_wr_ind = bus->slv_wr_ind & (bus->data->fifo_size - 1);
897 bus->slv_wr_ind = bus->slv_wr_ind & (bus->data->fifo_size - 1);
904 u8 data;
910 data = npcm_i2c_rd_byte(bus);
912 bus->slv_rd_ind = bus->slv_rd_ind & (bus->data->fifo_size - 1);
913 bus->slv_rd_buf[bus->slv_rd_ind] = data;
918 bus->slv_rd_size = data + bus->PEC_use + 1;
930 for (i = 0; i < bus->data->fifo_size; i++) {
931 if (bus->slv_wr_size >= bus->data->fifo_size)
939 ind = (bus->slv_wr_ind + bus->slv_wr_size) & (bus->data->fifo_size - 1);
943 return bus->data->fifo_size - ret;
955 * got data from master (new offset in device), ignore wr fifo:
978 iowrite8(bus->data->fifo_size, bus->reg + NPCM_I2CRXF_CTL);
1011 left_in_fifo = bus->data->txf_sts_tx_bytes &
1015 if (left_in_fifo >= bus->data->fifo_size ||
1016 bus->slv_wr_size >= bus->data->fifo_size)
1024 bus->slv_wr_ind += bus->data->fifo_size;
1032 * transmit data. Write till the master will NACK
1040 * receive data.
1085 * Check whether bus arbitration or Start or Stop during data
1170 iowrite8(bus->data->fifo_size, bus->reg + NPCM_I2CRXF_CTL);
1216 * 2. Start, SA, read, data, restart, SA, read, ...
1218 * 3. Start, SA, write, data, restart, SA, read, ..
1327 * we read the data in the following way. If the number of bytes to
1329 * and in the next int we read rest of the data.
1331 if (rcount < (2 * bus->data->fifo_size) && rcount > bus->data->fifo_size)
1332 fifo_bytes = rcount - bus->data->fifo_size;
1413 u8 data;
1425 data = npcm_i2c_rd_byte(bus);
1426 data = clamp_val(data, 1, I2C_SMBUS_BLOCK_MAX);
1427 bus->rd_size = data + block_extra_bytes_size;
1428 bus->rd_buf[bus->rd_ind++] = data;
1432 data = ioread8(bus->reg + NPCM_I2CFIF_CTS);
1433 data = data | NPCM_I2CFIF_CTS_RXF_TXE;
1434 iowrite8(data, bus->reg + NPCM_I2CFIF_CTS);
1989 /* Initialize the internal data structures */
2211 (bus->data->rxf_ctl_last_pec & ioread8(bus->reg + NPCM_I2CRXF_CTL)))
2293 bus->data = of_device_get_match_data(dev);
2294 if (!bus->data) {
2295 dev_err(dev, "OF data missing\n");
2312 regmap_write(gcr_regmap, NPCM_I2CSEGCTL, bus->data->segctl_init_val);
2373 { .compatible = "nuvoton,npcm750-i2c", .data = &npxm7xx_i2c_data },
2374 { .compatible = "nuvoton,npcm845-i2c", .data = &npxm8xx_i2c_data },