Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ccc4bf40 authored by Vipin Deep Kaur's avatar Vipin Deep Kaur
Browse files

i2c: i2c-qcom-geni: Set IEOB for Go tre in a Read transfer



For an I2C GSI read transfer in a non-shared se case, tx descriptor
contains Go tre only. Set the IEOB flag for Go tre so that tx
descriptor is freed when go tre has been serviced.

Change-Id: I42b04ad058907b71ad4a2f2163c87fb734a69fac
Signed-off-by: default avatarVipin Deep Kaur <vkaur@codeaurora.org>
parent dd22fab7
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
// SPDX-License-Identifier: GPL-2.0-only
/*
/*
 * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
 */
 */


#include <linux/atomic.h>
#include <linux/atomic.h>
@@ -2363,7 +2363,7 @@ struct dma_async_tx_descriptor *gpi_prep_slave_sg(struct dma_chan *chan,
		tre = sg_virt(sg);
		tre = sg_virt(sg);


		/* Check if last tre has ieob set */
		/* Check if last tre has ieob set */
		if (i == sg_len - 1) {
		if (sg_len != 1 && i == sg_len - 1) {
			if ((((struct msm_gpi_tre *)tre)->dword[3] &
			if ((((struct msm_gpi_tre *)tre)->dword[3] &
					GPI_IEOB_BMSK) >> GPI_IEOB_BMSK_SHIFT)
					GPI_IEOB_BMSK) >> GPI_IEOB_BMSK_SHIFT)
				gpii->ieob_set = true;
				gpii->ieob_set = true;
+8 −4
Original line number Original line Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
// SPDX-License-Identifier: GPL-2.0-only
/*
/*
 * Copyright (c) 2017-2019, The Linux Foundation. All rights reserved.
 * Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
 */
 */


#include <linux/clk.h>
#include <linux/clk.h>
@@ -405,7 +405,7 @@ static void gi2c_gsi_tx_cb(void *ptr)
	struct msm_gpi_dma_async_tx_cb_param *tx_cb = ptr;
	struct msm_gpi_dma_async_tx_cb_param *tx_cb = ptr;
	struct geni_i2c_dev *gi2c = tx_cb->userdata;
	struct geni_i2c_dev *gi2c = tx_cb->userdata;


	if (tx_cb->completion_code == MSM_GPI_TCE_EOB) {
	if (tx_cb->completion_code == MSM_GPI_TCE_EOB && gi2c->is_shared) {
		complete(&gi2c->xfer);
		complete(&gi2c->xfer);
	} else if (!(gi2c->cur->flags & I2C_M_RD)) {
	} else if (!(gi2c->cur->flags & I2C_M_RD)) {
		gi2c_gsi_cb_err(tx_cb, "TX");
		gi2c_gsi_cb_err(tx_cb, "TX");
@@ -553,8 +553,12 @@ static int geni_i2c_gsi_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[],


		if (msgs[i].flags & I2C_M_RD) {
		if (msgs[i].flags & I2C_M_RD) {
			go_t->dword[2] = MSM_GPI_I2C_GO_TRE_DWORD2(msgs[i].len);
			go_t->dword[2] = MSM_GPI_I2C_GO_TRE_DWORD2(msgs[i].len);
			go_t->dword[3] = MSM_GPI_I2C_GO_TRE_DWORD3(1, 0, 0, 0,
			if (gi2c->is_shared)
									0);
				go_t->dword[3] = MSM_GPI_I2C_GO_TRE_DWORD3(1,
							0, 0, 0, 0);
			else
				go_t->dword[3] = MSM_GPI_I2C_GO_TRE_DWORD3(1,
							0, 0, 1, 0);
		} else {
		} else {
			go_t->dword[2] = MSM_GPI_I2C_GO_TRE_DWORD2(0);
			go_t->dword[2] = MSM_GPI_I2C_GO_TRE_DWORD2(0);
			go_t->dword[3] = MSM_GPI_I2C_GO_TRE_DWORD3(0, 0, 0, 0,
			go_t->dword[3] = MSM_GPI_I2C_GO_TRE_DWORD3(0, 0, 0, 0,