i2c_imx           265 drivers/i2c/busses/i2c-imx.c static inline int is_imx1_i2c(struct imx_i2c_struct *i2c_imx)
i2c_imx           267 drivers/i2c/busses/i2c-imx.c 	return i2c_imx->hwdata->devtype == IMX1_I2C;
i2c_imx           271 drivers/i2c/busses/i2c-imx.c 		struct imx_i2c_struct *i2c_imx, unsigned int reg)
i2c_imx           273 drivers/i2c/busses/i2c-imx.c 	writeb(val, i2c_imx->base + (reg << i2c_imx->hwdata->regshift));
i2c_imx           276 drivers/i2c/busses/i2c-imx.c static inline unsigned char imx_i2c_read_reg(struct imx_i2c_struct *i2c_imx,
i2c_imx           279 drivers/i2c/busses/i2c-imx.c 	return readb(i2c_imx->base + (reg << i2c_imx->hwdata->regshift));
i2c_imx           283 drivers/i2c/busses/i2c-imx.c static void i2c_imx_dma_request(struct imx_i2c_struct *i2c_imx,
i2c_imx           288 drivers/i2c/busses/i2c-imx.c 	struct device *dev = &i2c_imx->adapter.dev;
i2c_imx           304 drivers/i2c/busses/i2c-imx.c 				(IMX_I2C_I2DR << i2c_imx->hwdata->regshift);
i2c_imx           323 drivers/i2c/busses/i2c-imx.c 				(IMX_I2C_I2DR << i2c_imx->hwdata->regshift);
i2c_imx           333 drivers/i2c/busses/i2c-imx.c 	i2c_imx->dma = dma;
i2c_imx           350 drivers/i2c/busses/i2c-imx.c 	struct imx_i2c_struct *i2c_imx = (struct imx_i2c_struct *)arg;
i2c_imx           351 drivers/i2c/busses/i2c-imx.c 	struct imx_i2c_dma *dma = i2c_imx->dma;
i2c_imx           358 drivers/i2c/busses/i2c-imx.c static int i2c_imx_dma_xfer(struct imx_i2c_struct *i2c_imx,
i2c_imx           361 drivers/i2c/busses/i2c-imx.c 	struct imx_i2c_dma *dma = i2c_imx->dma;
i2c_imx           363 drivers/i2c/busses/i2c-imx.c 	struct device *dev = &i2c_imx->adapter.dev;
i2c_imx           383 drivers/i2c/busses/i2c-imx.c 	txdesc->callback_param = i2c_imx;
i2c_imx           401 drivers/i2c/busses/i2c-imx.c static void i2c_imx_dma_free(struct imx_i2c_struct *i2c_imx)
i2c_imx           403 drivers/i2c/busses/i2c-imx.c 	struct imx_i2c_dma *dma = i2c_imx->dma;
i2c_imx           417 drivers/i2c/busses/i2c-imx.c static int i2c_imx_bus_busy(struct imx_i2c_struct *i2c_imx, int for_busy)
i2c_imx           422 drivers/i2c/busses/i2c-imx.c 	dev_dbg(&i2c_imx->adapter.dev, "<%s>\n", __func__);
i2c_imx           425 drivers/i2c/busses/i2c-imx.c 		temp = imx_i2c_read_reg(i2c_imx, IMX_I2C_I2SR);
i2c_imx           430 drivers/i2c/busses/i2c-imx.c 			imx_i2c_write_reg(temp, i2c_imx, IMX_I2C_I2SR);
i2c_imx           435 drivers/i2c/busses/i2c-imx.c 			i2c_imx->stopped = 0;
i2c_imx           439 drivers/i2c/busses/i2c-imx.c 			i2c_imx->stopped = 1;
i2c_imx           443 drivers/i2c/busses/i2c-imx.c 			dev_dbg(&i2c_imx->adapter.dev,
i2c_imx           453 drivers/i2c/busses/i2c-imx.c static int i2c_imx_trx_complete(struct imx_i2c_struct *i2c_imx)
i2c_imx           455 drivers/i2c/busses/i2c-imx.c 	wait_event_timeout(i2c_imx->queue, i2c_imx->i2csr & I2SR_IIF, HZ / 10);
i2c_imx           457 drivers/i2c/busses/i2c-imx.c 	if (unlikely(!(i2c_imx->i2csr & I2SR_IIF))) {
i2c_imx           458 drivers/i2c/busses/i2c-imx.c 		dev_dbg(&i2c_imx->adapter.dev, "<%s> Timeout\n", __func__);
i2c_imx           461 drivers/i2c/busses/i2c-imx.c 	dev_dbg(&i2c_imx->adapter.dev, "<%s> TRX complete\n", __func__);
i2c_imx           462 drivers/i2c/busses/i2c-imx.c 	i2c_imx->i2csr = 0;
i2c_imx           466 drivers/i2c/busses/i2c-imx.c static int i2c_imx_acked(struct imx_i2c_struct *i2c_imx)
i2c_imx           468 drivers/i2c/busses/i2c-imx.c 	if (imx_i2c_read_reg(i2c_imx, IMX_I2C_I2SR) & I2SR_RXAK) {
i2c_imx           469 drivers/i2c/busses/i2c-imx.c 		dev_dbg(&i2c_imx->adapter.dev, "<%s> No ACK\n", __func__);
i2c_imx           473 drivers/i2c/busses/i2c-imx.c 	dev_dbg(&i2c_imx->adapter.dev, "<%s> ACK received\n", __func__);
i2c_imx           477 drivers/i2c/busses/i2c-imx.c static void i2c_imx_set_clk(struct imx_i2c_struct *i2c_imx,
i2c_imx           480 drivers/i2c/busses/i2c-imx.c 	struct imx_i2c_clk_pair *i2c_clk_div = i2c_imx->hwdata->clk_div;
i2c_imx           485 drivers/i2c/busses/i2c-imx.c 	if (i2c_imx->cur_clk == i2c_clk_rate)
i2c_imx           488 drivers/i2c/busses/i2c-imx.c 	i2c_imx->cur_clk = i2c_clk_rate;
i2c_imx           490 drivers/i2c/busses/i2c-imx.c 	div = (i2c_clk_rate + i2c_imx->bitrate - 1) / i2c_imx->bitrate;
i2c_imx           493 drivers/i2c/busses/i2c-imx.c 	else if (div > i2c_clk_div[i2c_imx->hwdata->ndivs - 1].div)
i2c_imx           494 drivers/i2c/busses/i2c-imx.c 		i = i2c_imx->hwdata->ndivs - 1;
i2c_imx           500 drivers/i2c/busses/i2c-imx.c 	i2c_imx->ifdr = i2c_clk_div[i].val;
i2c_imx           508 drivers/i2c/busses/i2c-imx.c 	i2c_imx->disable_delay = (500000U * i2c_clk_div[i].div
i2c_imx           512 drivers/i2c/busses/i2c-imx.c 	dev_dbg(&i2c_imx->adapter.dev, "I2C_CLK=%d, REQ DIV=%d\n",
i2c_imx           514 drivers/i2c/busses/i2c-imx.c 	dev_dbg(&i2c_imx->adapter.dev, "IFDR[IC]=0x%x, REAL DIV=%d\n",
i2c_imx           523 drivers/i2c/busses/i2c-imx.c 	struct imx_i2c_struct *i2c_imx = container_of(nb,
i2c_imx           528 drivers/i2c/busses/i2c-imx.c 		i2c_imx_set_clk(i2c_imx, ndata->new_rate);
i2c_imx           533 drivers/i2c/busses/i2c-imx.c static int i2c_imx_start(struct imx_i2c_struct *i2c_imx)
i2c_imx           538 drivers/i2c/busses/i2c-imx.c 	dev_dbg(&i2c_imx->adapter.dev, "<%s>\n", __func__);
i2c_imx           540 drivers/i2c/busses/i2c-imx.c 	imx_i2c_write_reg(i2c_imx->ifdr, i2c_imx, IMX_I2C_IFDR);
i2c_imx           542 drivers/i2c/busses/i2c-imx.c 	imx_i2c_write_reg(i2c_imx->hwdata->i2sr_clr_opcode, i2c_imx, IMX_I2C_I2SR);
i2c_imx           543 drivers/i2c/busses/i2c-imx.c 	imx_i2c_write_reg(i2c_imx->hwdata->i2cr_ien_opcode, i2c_imx, IMX_I2C_I2CR);
i2c_imx           549 drivers/i2c/busses/i2c-imx.c 	temp = imx_i2c_read_reg(i2c_imx, IMX_I2C_I2CR);
i2c_imx           551 drivers/i2c/busses/i2c-imx.c 	imx_i2c_write_reg(temp, i2c_imx, IMX_I2C_I2CR);
i2c_imx           552 drivers/i2c/busses/i2c-imx.c 	result = i2c_imx_bus_busy(i2c_imx, 1);
i2c_imx           558 drivers/i2c/busses/i2c-imx.c 	imx_i2c_write_reg(temp, i2c_imx, IMX_I2C_I2CR);
i2c_imx           562 drivers/i2c/busses/i2c-imx.c static void i2c_imx_stop(struct imx_i2c_struct *i2c_imx)
i2c_imx           566 drivers/i2c/busses/i2c-imx.c 	if (!i2c_imx->stopped) {
i2c_imx           568 drivers/i2c/busses/i2c-imx.c 		dev_dbg(&i2c_imx->adapter.dev, "<%s>\n", __func__);
i2c_imx           569 drivers/i2c/busses/i2c-imx.c 		temp = imx_i2c_read_reg(i2c_imx, IMX_I2C_I2CR);
i2c_imx           571 drivers/i2c/busses/i2c-imx.c 		if (i2c_imx->dma)
i2c_imx           573 drivers/i2c/busses/i2c-imx.c 		imx_i2c_write_reg(temp, i2c_imx, IMX_I2C_I2CR);
i2c_imx           575 drivers/i2c/busses/i2c-imx.c 	if (is_imx1_i2c(i2c_imx)) {
i2c_imx           580 drivers/i2c/busses/i2c-imx.c 		udelay(i2c_imx->disable_delay);
i2c_imx           583 drivers/i2c/busses/i2c-imx.c 	if (!i2c_imx->stopped)
i2c_imx           584 drivers/i2c/busses/i2c-imx.c 		i2c_imx_bus_busy(i2c_imx, 0);
i2c_imx           587 drivers/i2c/busses/i2c-imx.c 	temp = i2c_imx->hwdata->i2cr_ien_opcode ^ I2CR_IEN,
i2c_imx           588 drivers/i2c/busses/i2c-imx.c 	imx_i2c_write_reg(temp, i2c_imx, IMX_I2C_I2CR);
i2c_imx           593 drivers/i2c/busses/i2c-imx.c 	struct imx_i2c_struct *i2c_imx = dev_id;
i2c_imx           596 drivers/i2c/busses/i2c-imx.c 	temp = imx_i2c_read_reg(i2c_imx, IMX_I2C_I2SR);
i2c_imx           599 drivers/i2c/busses/i2c-imx.c 		i2c_imx->i2csr = temp;
i2c_imx           601 drivers/i2c/busses/i2c-imx.c 		temp |= (i2c_imx->hwdata->i2sr_clr_opcode & I2SR_IIF);
i2c_imx           602 drivers/i2c/busses/i2c-imx.c 		imx_i2c_write_reg(temp, i2c_imx, IMX_I2C_I2SR);
i2c_imx           603 drivers/i2c/busses/i2c-imx.c 		wake_up(&i2c_imx->queue);
i2c_imx           610 drivers/i2c/busses/i2c-imx.c static int i2c_imx_dma_write(struct imx_i2c_struct *i2c_imx,
i2c_imx           617 drivers/i2c/busses/i2c-imx.c 	struct imx_i2c_dma *dma = i2c_imx->dma;
i2c_imx           618 drivers/i2c/busses/i2c-imx.c 	struct device *dev = &i2c_imx->adapter.dev;
i2c_imx           624 drivers/i2c/busses/i2c-imx.c 	result = i2c_imx_dma_xfer(i2c_imx, msgs);
i2c_imx           628 drivers/i2c/busses/i2c-imx.c 	temp = imx_i2c_read_reg(i2c_imx, IMX_I2C_I2CR);
i2c_imx           630 drivers/i2c/busses/i2c-imx.c 	imx_i2c_write_reg(temp, i2c_imx, IMX_I2C_I2CR);
i2c_imx           636 drivers/i2c/busses/i2c-imx.c 	imx_i2c_write_reg(i2c_8bit_addr_from_msg(msgs), i2c_imx, IMX_I2C_I2DR);
i2c_imx           638 drivers/i2c/busses/i2c-imx.c 				&i2c_imx->dma->cmd_complete,
i2c_imx           647 drivers/i2c/busses/i2c-imx.c 		temp = imx_i2c_read_reg(i2c_imx, IMX_I2C_I2SR);
i2c_imx           658 drivers/i2c/busses/i2c-imx.c 	temp = imx_i2c_read_reg(i2c_imx, IMX_I2C_I2CR);
i2c_imx           660 drivers/i2c/busses/i2c-imx.c 	imx_i2c_write_reg(temp, i2c_imx, IMX_I2C_I2CR);
i2c_imx           664 drivers/i2c/busses/i2c-imx.c 				i2c_imx, IMX_I2C_I2DR);
i2c_imx           665 drivers/i2c/busses/i2c-imx.c 	result = i2c_imx_trx_complete(i2c_imx);
i2c_imx           669 drivers/i2c/busses/i2c-imx.c 	return i2c_imx_acked(i2c_imx);
i2c_imx           672 drivers/i2c/busses/i2c-imx.c static int i2c_imx_dma_read(struct imx_i2c_struct *i2c_imx,
i2c_imx           679 drivers/i2c/busses/i2c-imx.c 	struct imx_i2c_dma *dma = i2c_imx->dma;
i2c_imx           680 drivers/i2c/busses/i2c-imx.c 	struct device *dev = &i2c_imx->adapter.dev;
i2c_imx           688 drivers/i2c/busses/i2c-imx.c 	result = i2c_imx_dma_xfer(i2c_imx, msgs);
i2c_imx           693 drivers/i2c/busses/i2c-imx.c 				&i2c_imx->dma->cmd_complete,
i2c_imx           702 drivers/i2c/busses/i2c-imx.c 		temp = imx_i2c_read_reg(i2c_imx, IMX_I2C_I2SR);
i2c_imx           713 drivers/i2c/busses/i2c-imx.c 	temp = imx_i2c_read_reg(i2c_imx, IMX_I2C_I2CR);
i2c_imx           715 drivers/i2c/busses/i2c-imx.c 	imx_i2c_write_reg(temp, i2c_imx, IMX_I2C_I2CR);
i2c_imx           718 drivers/i2c/busses/i2c-imx.c 	temp = imx_i2c_read_reg(i2c_imx, IMX_I2C_I2CR);
i2c_imx           720 drivers/i2c/busses/i2c-imx.c 	imx_i2c_write_reg(temp, i2c_imx, IMX_I2C_I2CR);
i2c_imx           722 drivers/i2c/busses/i2c-imx.c 	msgs->buf[msgs->len-2] = imx_i2c_read_reg(i2c_imx, IMX_I2C_I2DR);
i2c_imx           724 drivers/i2c/busses/i2c-imx.c 	result = i2c_imx_trx_complete(i2c_imx);
i2c_imx           734 drivers/i2c/busses/i2c-imx.c 		temp = imx_i2c_read_reg(i2c_imx, IMX_I2C_I2CR);
i2c_imx           736 drivers/i2c/busses/i2c-imx.c 		imx_i2c_write_reg(temp, i2c_imx, IMX_I2C_I2CR);
i2c_imx           737 drivers/i2c/busses/i2c-imx.c 		i2c_imx_bus_busy(i2c_imx, 0);
i2c_imx           746 drivers/i2c/busses/i2c-imx.c 		temp = imx_i2c_read_reg(i2c_imx, IMX_I2C_I2CR);
i2c_imx           748 drivers/i2c/busses/i2c-imx.c 		imx_i2c_write_reg(temp, i2c_imx, IMX_I2C_I2CR);
i2c_imx           750 drivers/i2c/busses/i2c-imx.c 	msgs->buf[msgs->len-1] = imx_i2c_read_reg(i2c_imx, IMX_I2C_I2DR);
i2c_imx           755 drivers/i2c/busses/i2c-imx.c static int i2c_imx_write(struct imx_i2c_struct *i2c_imx, struct i2c_msg *msgs)
i2c_imx           759 drivers/i2c/busses/i2c-imx.c 	dev_dbg(&i2c_imx->adapter.dev, "<%s> write slave address: addr=0x%x\n",
i2c_imx           763 drivers/i2c/busses/i2c-imx.c 	imx_i2c_write_reg(i2c_8bit_addr_from_msg(msgs), i2c_imx, IMX_I2C_I2DR);
i2c_imx           764 drivers/i2c/busses/i2c-imx.c 	result = i2c_imx_trx_complete(i2c_imx);
i2c_imx           767 drivers/i2c/busses/i2c-imx.c 	result = i2c_imx_acked(i2c_imx);
i2c_imx           770 drivers/i2c/busses/i2c-imx.c 	dev_dbg(&i2c_imx->adapter.dev, "<%s> write data\n", __func__);
i2c_imx           774 drivers/i2c/busses/i2c-imx.c 		dev_dbg(&i2c_imx->adapter.dev,
i2c_imx           777 drivers/i2c/busses/i2c-imx.c 		imx_i2c_write_reg(msgs->buf[i], i2c_imx, IMX_I2C_I2DR);
i2c_imx           778 drivers/i2c/busses/i2c-imx.c 		result = i2c_imx_trx_complete(i2c_imx);
i2c_imx           781 drivers/i2c/busses/i2c-imx.c 		result = i2c_imx_acked(i2c_imx);
i2c_imx           788 drivers/i2c/busses/i2c-imx.c static int i2c_imx_read(struct imx_i2c_struct *i2c_imx, struct i2c_msg *msgs, bool is_lastmsg)
i2c_imx           793 drivers/i2c/busses/i2c-imx.c 	int use_dma = i2c_imx->dma && msgs->len >= DMA_THRESHOLD && !block_data;
i2c_imx           795 drivers/i2c/busses/i2c-imx.c 	dev_dbg(&i2c_imx->adapter.dev,
i2c_imx           800 drivers/i2c/busses/i2c-imx.c 	imx_i2c_write_reg(i2c_8bit_addr_from_msg(msgs), i2c_imx, IMX_I2C_I2DR);
i2c_imx           801 drivers/i2c/busses/i2c-imx.c 	result = i2c_imx_trx_complete(i2c_imx);
i2c_imx           804 drivers/i2c/busses/i2c-imx.c 	result = i2c_imx_acked(i2c_imx);
i2c_imx           808 drivers/i2c/busses/i2c-imx.c 	dev_dbg(&i2c_imx->adapter.dev, "<%s> setup bus\n", __func__);
i2c_imx           811 drivers/i2c/busses/i2c-imx.c 	temp = imx_i2c_read_reg(i2c_imx, IMX_I2C_I2CR);
i2c_imx           822 drivers/i2c/busses/i2c-imx.c 	imx_i2c_write_reg(temp, i2c_imx, IMX_I2C_I2CR);
i2c_imx           823 drivers/i2c/busses/i2c-imx.c 	imx_i2c_read_reg(i2c_imx, IMX_I2C_I2DR); /* dummy read */
i2c_imx           825 drivers/i2c/busses/i2c-imx.c 	dev_dbg(&i2c_imx->adapter.dev, "<%s> read data\n", __func__);
i2c_imx           828 drivers/i2c/busses/i2c-imx.c 		return i2c_imx_dma_read(i2c_imx, msgs, is_lastmsg);
i2c_imx           834 drivers/i2c/busses/i2c-imx.c 		result = i2c_imx_trx_complete(i2c_imx);
i2c_imx           843 drivers/i2c/busses/i2c-imx.c 			len = imx_i2c_read_reg(i2c_imx, IMX_I2C_I2DR);
i2c_imx           846 drivers/i2c/busses/i2c-imx.c 			dev_dbg(&i2c_imx->adapter.dev,
i2c_imx           857 drivers/i2c/busses/i2c-imx.c 				dev_dbg(&i2c_imx->adapter.dev,
i2c_imx           859 drivers/i2c/busses/i2c-imx.c 				temp = imx_i2c_read_reg(i2c_imx, IMX_I2C_I2CR);
i2c_imx           861 drivers/i2c/busses/i2c-imx.c 				imx_i2c_write_reg(temp, i2c_imx, IMX_I2C_I2CR);
i2c_imx           862 drivers/i2c/busses/i2c-imx.c 				i2c_imx_bus_busy(i2c_imx, 0);
i2c_imx           871 drivers/i2c/busses/i2c-imx.c 				temp = imx_i2c_read_reg(i2c_imx, IMX_I2C_I2CR);
i2c_imx           873 drivers/i2c/busses/i2c-imx.c 				imx_i2c_write_reg(temp, i2c_imx, IMX_I2C_I2CR);
i2c_imx           876 drivers/i2c/busses/i2c-imx.c 			dev_dbg(&i2c_imx->adapter.dev,
i2c_imx           878 drivers/i2c/busses/i2c-imx.c 			temp = imx_i2c_read_reg(i2c_imx, IMX_I2C_I2CR);
i2c_imx           880 drivers/i2c/busses/i2c-imx.c 			imx_i2c_write_reg(temp, i2c_imx, IMX_I2C_I2CR);
i2c_imx           885 drivers/i2c/busses/i2c-imx.c 			msgs->buf[i] = imx_i2c_read_reg(i2c_imx, IMX_I2C_I2DR);
i2c_imx           886 drivers/i2c/busses/i2c-imx.c 		dev_dbg(&i2c_imx->adapter.dev,
i2c_imx           899 drivers/i2c/busses/i2c-imx.c 	struct imx_i2c_struct *i2c_imx = i2c_get_adapdata(adapter);
i2c_imx           901 drivers/i2c/busses/i2c-imx.c 	dev_dbg(&i2c_imx->adapter.dev, "<%s>\n", __func__);
i2c_imx           903 drivers/i2c/busses/i2c-imx.c 	result = pm_runtime_get_sync(i2c_imx->adapter.dev.parent);
i2c_imx           908 drivers/i2c/busses/i2c-imx.c 	result = i2c_imx_start(i2c_imx);
i2c_imx           910 drivers/i2c/busses/i2c-imx.c 		if (i2c_imx->adapter.bus_recovery_info) {
i2c_imx           911 drivers/i2c/busses/i2c-imx.c 			i2c_recover_bus(&i2c_imx->adapter);
i2c_imx           912 drivers/i2c/busses/i2c-imx.c 			result = i2c_imx_start(i2c_imx);
i2c_imx           925 drivers/i2c/busses/i2c-imx.c 			dev_dbg(&i2c_imx->adapter.dev,
i2c_imx           927 drivers/i2c/busses/i2c-imx.c 			temp = imx_i2c_read_reg(i2c_imx, IMX_I2C_I2CR);
i2c_imx           929 drivers/i2c/busses/i2c-imx.c 			imx_i2c_write_reg(temp, i2c_imx, IMX_I2C_I2CR);
i2c_imx           930 drivers/i2c/busses/i2c-imx.c 			result = i2c_imx_bus_busy(i2c_imx, 1);
i2c_imx           934 drivers/i2c/busses/i2c-imx.c 		dev_dbg(&i2c_imx->adapter.dev,
i2c_imx           938 drivers/i2c/busses/i2c-imx.c 		temp = imx_i2c_read_reg(i2c_imx, IMX_I2C_I2CR);
i2c_imx           939 drivers/i2c/busses/i2c-imx.c 		dev_dbg(&i2c_imx->adapter.dev,
i2c_imx           945 drivers/i2c/busses/i2c-imx.c 		temp = imx_i2c_read_reg(i2c_imx, IMX_I2C_I2SR);
i2c_imx           946 drivers/i2c/busses/i2c-imx.c 		dev_dbg(&i2c_imx->adapter.dev,
i2c_imx           955 drivers/i2c/busses/i2c-imx.c 			result = i2c_imx_read(i2c_imx, &msgs[i], is_lastmsg);
i2c_imx           957 drivers/i2c/busses/i2c-imx.c 			if (i2c_imx->dma && msgs[i].len >= DMA_THRESHOLD)
i2c_imx           958 drivers/i2c/busses/i2c-imx.c 				result = i2c_imx_dma_write(i2c_imx, &msgs[i]);
i2c_imx           960 drivers/i2c/busses/i2c-imx.c 				result = i2c_imx_write(i2c_imx, &msgs[i]);
i2c_imx           968 drivers/i2c/busses/i2c-imx.c 	i2c_imx_stop(i2c_imx);
i2c_imx           970 drivers/i2c/busses/i2c-imx.c 	pm_runtime_mark_last_busy(i2c_imx->adapter.dev.parent);
i2c_imx           971 drivers/i2c/busses/i2c-imx.c 	pm_runtime_put_autosuspend(i2c_imx->adapter.dev.parent);
i2c_imx           974 drivers/i2c/busses/i2c-imx.c 	dev_dbg(&i2c_imx->adapter.dev, "<%s> exit with: %s: %d\n", __func__,
i2c_imx           982 drivers/i2c/busses/i2c-imx.c 	struct imx_i2c_struct *i2c_imx;
i2c_imx           984 drivers/i2c/busses/i2c-imx.c 	i2c_imx = container_of(adap, struct imx_i2c_struct, adapter);
i2c_imx           986 drivers/i2c/busses/i2c-imx.c 	pinctrl_select_state(i2c_imx->pinctrl, i2c_imx->pinctrl_pins_gpio);
i2c_imx           991 drivers/i2c/busses/i2c-imx.c 	struct imx_i2c_struct *i2c_imx;
i2c_imx           993 drivers/i2c/busses/i2c-imx.c 	i2c_imx = container_of(adap, struct imx_i2c_struct, adapter);
i2c_imx           995 drivers/i2c/busses/i2c-imx.c 	pinctrl_select_state(i2c_imx->pinctrl, i2c_imx->pinctrl_pins_default);
i2c_imx          1005 drivers/i2c/busses/i2c-imx.c static int i2c_imx_init_recovery_info(struct imx_i2c_struct *i2c_imx,
i2c_imx          1008 drivers/i2c/busses/i2c-imx.c 	struct i2c_bus_recovery_info *rinfo = &i2c_imx->rinfo;
i2c_imx          1010 drivers/i2c/busses/i2c-imx.c 	i2c_imx->pinctrl = devm_pinctrl_get(&pdev->dev);
i2c_imx          1011 drivers/i2c/busses/i2c-imx.c 	if (!i2c_imx->pinctrl || IS_ERR(i2c_imx->pinctrl)) {
i2c_imx          1013 drivers/i2c/busses/i2c-imx.c 		return PTR_ERR(i2c_imx->pinctrl);
i2c_imx          1016 drivers/i2c/busses/i2c-imx.c 	i2c_imx->pinctrl_pins_default = pinctrl_lookup_state(i2c_imx->pinctrl,
i2c_imx          1018 drivers/i2c/busses/i2c-imx.c 	i2c_imx->pinctrl_pins_gpio = pinctrl_lookup_state(i2c_imx->pinctrl,
i2c_imx          1028 drivers/i2c/busses/i2c-imx.c 		   IS_ERR(i2c_imx->pinctrl_pins_default) ||
i2c_imx          1029 drivers/i2c/busses/i2c-imx.c 		   IS_ERR(i2c_imx->pinctrl_pins_gpio)) {
i2c_imx          1040 drivers/i2c/busses/i2c-imx.c 	i2c_imx->adapter.bus_recovery_info = rinfo;
i2c_imx          1058 drivers/i2c/busses/i2c-imx.c 	struct imx_i2c_struct *i2c_imx;
i2c_imx          1080 drivers/i2c/busses/i2c-imx.c 	i2c_imx = devm_kzalloc(&pdev->dev, sizeof(*i2c_imx), GFP_KERNEL);
i2c_imx          1081 drivers/i2c/busses/i2c-imx.c 	if (!i2c_imx)
i2c_imx          1086 drivers/i2c/busses/i2c-imx.c 		i2c_imx->hwdata = match;
i2c_imx          1088 drivers/i2c/busses/i2c-imx.c 		i2c_imx->hwdata = (struct imx_i2c_hwdata *)
i2c_imx          1092 drivers/i2c/busses/i2c-imx.c 	strlcpy(i2c_imx->adapter.name, pdev->name, sizeof(i2c_imx->adapter.name));
i2c_imx          1093 drivers/i2c/busses/i2c-imx.c 	i2c_imx->adapter.owner		= THIS_MODULE;
i2c_imx          1094 drivers/i2c/busses/i2c-imx.c 	i2c_imx->adapter.algo		= &i2c_imx_algo;
i2c_imx          1095 drivers/i2c/busses/i2c-imx.c 	i2c_imx->adapter.dev.parent	= &pdev->dev;
i2c_imx          1096 drivers/i2c/busses/i2c-imx.c 	i2c_imx->adapter.nr		= pdev->id;
i2c_imx          1097 drivers/i2c/busses/i2c-imx.c 	i2c_imx->adapter.dev.of_node	= pdev->dev.of_node;
i2c_imx          1098 drivers/i2c/busses/i2c-imx.c 	i2c_imx->base			= base;
i2c_imx          1099 drivers/i2c/busses/i2c-imx.c 	ACPI_COMPANION_SET(&i2c_imx->adapter.dev, ACPI_COMPANION(&pdev->dev));
i2c_imx          1102 drivers/i2c/busses/i2c-imx.c 	i2c_imx->clk = devm_clk_get(&pdev->dev, NULL);
i2c_imx          1103 drivers/i2c/busses/i2c-imx.c 	if (IS_ERR(i2c_imx->clk)) {
i2c_imx          1104 drivers/i2c/busses/i2c-imx.c 		if (PTR_ERR(i2c_imx->clk) != -EPROBE_DEFER)
i2c_imx          1106 drivers/i2c/busses/i2c-imx.c 		return PTR_ERR(i2c_imx->clk);
i2c_imx          1109 drivers/i2c/busses/i2c-imx.c 	ret = clk_prepare_enable(i2c_imx->clk);
i2c_imx          1117 drivers/i2c/busses/i2c-imx.c 				pdev->name, i2c_imx);
i2c_imx          1124 drivers/i2c/busses/i2c-imx.c 	init_waitqueue_head(&i2c_imx->queue);
i2c_imx          1127 drivers/i2c/busses/i2c-imx.c 	i2c_set_adapdata(&i2c_imx->adapter, i2c_imx);
i2c_imx          1130 drivers/i2c/busses/i2c-imx.c 	platform_set_drvdata(pdev, i2c_imx);
i2c_imx          1142 drivers/i2c/busses/i2c-imx.c 	i2c_imx->bitrate = IMX_I2C_BIT_RATE;
i2c_imx          1144 drivers/i2c/busses/i2c-imx.c 				   "clock-frequency", &i2c_imx->bitrate);
i2c_imx          1146 drivers/i2c/busses/i2c-imx.c 		i2c_imx->bitrate = pdata->bitrate;
i2c_imx          1147 drivers/i2c/busses/i2c-imx.c 	i2c_imx->clk_change_nb.notifier_call = i2c_imx_clk_notifier_call;
i2c_imx          1148 drivers/i2c/busses/i2c-imx.c 	clk_notifier_register(i2c_imx->clk, &i2c_imx->clk_change_nb);
i2c_imx          1149 drivers/i2c/busses/i2c-imx.c 	i2c_imx_set_clk(i2c_imx, clk_get_rate(i2c_imx->clk));
i2c_imx          1152 drivers/i2c/busses/i2c-imx.c 	imx_i2c_write_reg(i2c_imx->hwdata->i2cr_ien_opcode ^ I2CR_IEN,
i2c_imx          1153 drivers/i2c/busses/i2c-imx.c 			i2c_imx, IMX_I2C_I2CR);
i2c_imx          1154 drivers/i2c/busses/i2c-imx.c 	imx_i2c_write_reg(i2c_imx->hwdata->i2sr_clr_opcode, i2c_imx, IMX_I2C_I2SR);
i2c_imx          1157 drivers/i2c/busses/i2c-imx.c 	ret = i2c_imx_init_recovery_info(i2c_imx, pdev);
i2c_imx          1163 drivers/i2c/busses/i2c-imx.c 	ret = i2c_add_numbered_adapter(&i2c_imx->adapter);
i2c_imx          1170 drivers/i2c/busses/i2c-imx.c 	dev_dbg(&i2c_imx->adapter.dev, "claimed irq %d\n", irq);
i2c_imx          1171 drivers/i2c/busses/i2c-imx.c 	dev_dbg(&i2c_imx->adapter.dev, "device resources: %pR\n", res);
i2c_imx          1172 drivers/i2c/busses/i2c-imx.c 	dev_dbg(&i2c_imx->adapter.dev, "adapter name: \"%s\"\n",
i2c_imx          1173 drivers/i2c/busses/i2c-imx.c 		i2c_imx->adapter.name);
i2c_imx          1174 drivers/i2c/busses/i2c-imx.c 	dev_info(&i2c_imx->adapter.dev, "IMX I2C adapter registered\n");
i2c_imx          1177 drivers/i2c/busses/i2c-imx.c 	i2c_imx_dma_request(i2c_imx, phy_addr);
i2c_imx          1182 drivers/i2c/busses/i2c-imx.c 	clk_notifier_unregister(i2c_imx->clk, &i2c_imx->clk_change_nb);
i2c_imx          1190 drivers/i2c/busses/i2c-imx.c 	clk_disable_unprepare(i2c_imx->clk);
i2c_imx          1196 drivers/i2c/busses/i2c-imx.c 	struct imx_i2c_struct *i2c_imx = platform_get_drvdata(pdev);
i2c_imx          1204 drivers/i2c/busses/i2c-imx.c 	dev_dbg(&i2c_imx->adapter.dev, "adapter removed\n");
i2c_imx          1205 drivers/i2c/busses/i2c-imx.c 	i2c_del_adapter(&i2c_imx->adapter);
i2c_imx          1207 drivers/i2c/busses/i2c-imx.c 	if (i2c_imx->dma)
i2c_imx          1208 drivers/i2c/busses/i2c-imx.c 		i2c_imx_dma_free(i2c_imx);
i2c_imx          1211 drivers/i2c/busses/i2c-imx.c 	imx_i2c_write_reg(0, i2c_imx, IMX_I2C_IADR);
i2c_imx          1212 drivers/i2c/busses/i2c-imx.c 	imx_i2c_write_reg(0, i2c_imx, IMX_I2C_IFDR);
i2c_imx          1213 drivers/i2c/busses/i2c-imx.c 	imx_i2c_write_reg(0, i2c_imx, IMX_I2C_I2CR);
i2c_imx          1214 drivers/i2c/busses/i2c-imx.c 	imx_i2c_write_reg(0, i2c_imx, IMX_I2C_I2SR);
i2c_imx          1216 drivers/i2c/busses/i2c-imx.c 	clk_notifier_unregister(i2c_imx->clk, &i2c_imx->clk_change_nb);
i2c_imx          1217 drivers/i2c/busses/i2c-imx.c 	clk_disable_unprepare(i2c_imx->clk);
i2c_imx          1227 drivers/i2c/busses/i2c-imx.c 	struct imx_i2c_struct *i2c_imx = dev_get_drvdata(dev);
i2c_imx          1229 drivers/i2c/busses/i2c-imx.c 	clk_disable(i2c_imx->clk);
i2c_imx          1236 drivers/i2c/busses/i2c-imx.c 	struct imx_i2c_struct *i2c_imx = dev_get_drvdata(dev);
i2c_imx          1239 drivers/i2c/busses/i2c-imx.c 	ret = clk_enable(i2c_imx->clk);