Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1136551pxa; Thu, 20 Aug 2020 03:37:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwyCPz+ouqzKiWXQFuNOY3wKBLjDESYD/yXwwZt3R79z6tVW5982BIts1mBx1q4PBmF+xuu X-Received: by 2002:a17:906:a3d6:: with SMTP id ca22mr2558317ejb.78.1597919858352; Thu, 20 Aug 2020 03:37:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597919858; cv=none; d=google.com; s=arc-20160816; b=H0mJ+4LlO1xf8BNr6o91G5/Gq77enjuhg10/HtyvlR5EANhNZcx/0C0dXCwx4oqvNc R7RO9H6FfXdTKn4d2gseOxlFJ1GKxLB1cTa4Rws//Qm6z0DCxf30I4gCjKfXTEa/Cbay 64zm9PYBEIbxnZuLQiUBnWQPjiCxa4W7klTk2mQbRNjGbLJoJdccy+K9QFEJZmTElJeQ ykQenkBe/X8sRV8V5rFUkWAEVTz24O58P/TzKiTS6b7darUqF811OrJ2DZok3UgYwnmN XqRvtzwTOr2OwJfGw1IjptHZ7XSwl/tQVhq7h4rpm0bcJRbnX20AZjpbPBrFoEEPcx3T htJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=kowVQ7CEk2DYVnlwZW8GLlBCPSkdx5g6eVhBOlcs0xw=; b=mX84Y4ci2i/VEqwwgoxn9yLle7YgoUxJltdWpvXx/mPW86+DF2JhB+3jBWcmWypHh5 PKttdvXRoHo5P0aAi7sRl5H8L17rL6xJ30Wo7rTKUMQL2nTQCctU1s9jsiifY9cIjnsj tVVWyYuHu9/OpAYvlhagKyWdP0BnhME7VSRKh55ewKWvaUrbTa4GxcGo37kzT5SZFWDl jMxty66nbxR+UEnwLly8gdXr8SgeKN453zxtMpVSS78v6HerRw/iICm3VUvJaQc0wzzO dEKxAgK2QJiJx5CylUtxOLuhP27lTiM1sbI7SQAEKC9ZAg4lSHD0lHqTqsKbVHY3SVt6 wPxA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s11si1084279edi.214.2020.08.20.03.37.13; Thu, 20 Aug 2020 03:37:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731440AbgHTKgO (ORCPT + 99 others); Thu, 20 Aug 2020 06:36:14 -0400 Received: from alexa-out.qualcomm.com ([129.46.98.28]:27234 "EHLO alexa-out.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731217AbgHTKgI (ORCPT ); Thu, 20 Aug 2020 06:36:08 -0400 Received: from ironmsg07-lv.qualcomm.com (HELO ironmsg07-lv.qulacomm.com) ([10.47.202.151]) by alexa-out.qualcomm.com with ESMTP; 20 Aug 2020 03:36:06 -0700 Received: from ironmsg01-blr.qualcomm.com ([10.86.208.130]) by ironmsg07-lv.qulacomm.com with ESMTP/TLS/AES256-SHA; 20 Aug 2020 03:36:04 -0700 Received: from c-rojay-linux.qualcomm.com ([10.206.21.80]) by ironmsg01-blr.qualcomm.com with ESMTP; 20 Aug 2020 16:05:28 +0530 Received: by c-rojay-linux.qualcomm.com (Postfix, from userid 88981) id 5D9CC1F62; Thu, 20 Aug 2020 16:05:27 +0530 (IST) From: Roja Rani Yarubandi To: wsa@kernel.org Cc: swboyd@chromium.org, dianders@chromium.org, saiprakash.ranjan@codeaurora.org, gregkh@linuxfoundation.org, mka@chromium.org, akashast@codeaurora.org, msavaliy@qti.qualcomm.com, skakit@codeaurora.org, rnayak@codeaurora.org, agross@kernel.org, bjorn.andersson@linaro.org, linux-arm-msm@vger.kernel.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, sumit.semwal@linaro.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, Roja Rani Yarubandi Subject: [PATCH V2 1/2] i2c: i2c-qcom-geni: Store DMA mapping data in geni_i2c_dev struct Date: Thu, 20 Aug 2020 16:05:21 +0530 Message-Id: <20200820103522.26242-2-rojay@codeaurora.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200820103522.26242-1-rojay@codeaurora.org> References: <20200820103522.26242-1-rojay@codeaurora.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Store DMA mapping data in geni_i2c_dev struct to enhance DMA mapping data scope. For example during shutdown callback to unmap DMA mapping, this stored DMA mapping data can be used to call geni_se_tx_dma_unprep and geni_se_rx_dma_unprep functions. Signed-off-by: Roja Rani Yarubandi --- Changes in V2: - As per Stephen's comments, changed commit text, fixed minor nitpicks. drivers/i2c/busses/i2c-qcom-geni.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c index 7f130829bf01..1fda5c7c2cfc 100644 --- a/drivers/i2c/busses/i2c-qcom-geni.c +++ b/drivers/i2c/busses/i2c-qcom-geni.c @@ -86,6 +86,9 @@ struct geni_i2c_dev { u32 clk_freq_out; const struct geni_i2c_clk_fld *clk_fld; int suspended; + dma_addr_t tx_dma; + dma_addr_t rx_dma; + size_t xfer_len; }; struct geni_i2c_err_log { @@ -358,6 +361,7 @@ static int geni_i2c_rx_one_msg(struct geni_i2c_dev *gi2c, struct i2c_msg *msg, struct geni_se *se = &gi2c->se; size_t len = msg->len; + gi2c->xfer_len = msg->len; if (!of_machine_is_compatible("lenovo,yoga-c630")) dma_buf = i2c_get_dma_safe_msg_buf(msg, 32); @@ -384,6 +388,7 @@ static int geni_i2c_rx_one_msg(struct geni_i2c_dev *gi2c, struct i2c_msg *msg, if (dma_buf) { if (gi2c->err) geni_i2c_rx_fsm_rst(gi2c); + gi2c->rx_dma = rx_dma; geni_se_rx_dma_unprep(se, rx_dma, len); i2c_put_dma_safe_msg_buf(dma_buf, msg, !gi2c->err); } @@ -400,6 +405,7 @@ static int geni_i2c_tx_one_msg(struct geni_i2c_dev *gi2c, struct i2c_msg *msg, struct geni_se *se = &gi2c->se; size_t len = msg->len; + gi2c->xfer_len = msg->len; if (!of_machine_is_compatible("lenovo,yoga-c630")) dma_buf = i2c_get_dma_safe_msg_buf(msg, 32); @@ -429,6 +435,7 @@ static int geni_i2c_tx_one_msg(struct geni_i2c_dev *gi2c, struct i2c_msg *msg, if (dma_buf) { if (gi2c->err) geni_i2c_tx_fsm_rst(gi2c); + gi2c->tx_dma = tx_dma; geni_se_tx_dma_unprep(se, tx_dma, len); i2c_put_dma_safe_msg_buf(dma_buf, msg, !gi2c->err); } -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation