From patchwork Wed Sep 4 11:36:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 1157611 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-i2c-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="h6B+fLtp"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 46Nhbn68HYz9sDB for ; Wed, 4 Sep 2019 21:36:21 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725911AbfIDLgT (ORCPT ); Wed, 4 Sep 2019 07:36:19 -0400 Received: from mail-wm1-f54.google.com ([209.85.128.54]:38053 "EHLO mail-wm1-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725840AbfIDLgT (ORCPT ); Wed, 4 Sep 2019 07:36:19 -0400 Received: by mail-wm1-f54.google.com with SMTP id o184so3282999wme.3 for ; Wed, 04 Sep 2019 04:36:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=6n1x8bAGsyaVUn7RCRrZd6pcUeSbUTUlFO1sD7W+jdE=; b=h6B+fLtpSONhSBxg/IJPOu8ZrT+zjGIRlQ9PafT3Q+SZuugLTW6Ms+HeiIs199by73 /y+NK2ynYGk5Q1wiraznmv2S5N8Lz0qJIog53PZqHuAG5OFvBaAac4XnhbVk0k+0NGWi IUHCcEYDqbyRKZZp2QJ8hxBdm7rxewdpV32Cn9jFMFQB3McBI0q5ZjtIQTG3kzNunl+J wd5cfQNbtsC+bA9G4OAwDPM+UzwfqTBSFiXdOXS2MFlj5hQCg4AYNsTJ3GCer+YjaTp7 TYsyWv5RGnBfWrv689OK75VW6sakK4tDIkVN+13SPqxEk7zGNRbD7F3Sp3yWfKoTo0bU rcdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=6n1x8bAGsyaVUn7RCRrZd6pcUeSbUTUlFO1sD7W+jdE=; b=MFen+MiUb6Z6+7tk1RW9gFGHYF6rR82mN/4lFyBCOAWvesTJldMmhAVsxtb1cKr8wk p5xDOgoGVzHa8sHWIk7utpEk6BnvdZW7YYqlbcSwHU0EODmaoL7pBp0I13gJALQl7LMo GPr3q1n6KZ+RpUlNO/+g0rSvGsXkednfPPrY7T1tGWTyyV6rebP6RiIB74lYrI9FW5iP PUJHH6l1Q60jXI+uJCztkrmwOY2dxd2iidV5ZxlPtO8roDaxBKVCPySkz7MXttbIvqCW GtxpTzWlPelVKwYv/m+4Sbybu26cV64AtmQcM/iYCc9hOT/YUu2N7UTh4XRtrlLkJ2Ds 8Lmw== X-Gm-Message-State: APjAAAXNaQJMvUKWmLMQsz96Mo779Dhwv9es7Jslwj3GInvNE6naVWxw WMpRfkShRPawPDmY6MTlIdxO5Q== X-Google-Smtp-Source: APXvYqzrtOfOuNj6frgLWfYGsNvZUObicbYASkZ26jqaCnscUAcwcq1/Gwrc40q+OpB0xe98gVVB7A== X-Received: by 2002:a1c:20cf:: with SMTP id g198mr4199256wmg.66.1567596977066; Wed, 04 Sep 2019 04:36:17 -0700 (PDT) Received: from localhost.localdomain ([95.147.198.36]) by smtp.gmail.com with ESMTPSA id d9sm10823933wrc.39.2019.09.04.04.36.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2019 04:36:16 -0700 (PDT) From: Lee Jones To: alokc@codeaurora.org, agross@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, bjorn.andersson@linaro.org, linux-i2c@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Lee Jones Subject: [PATCH 1/2] i2c: qcom-geni: Provide an option to select FIFO processing Date: Wed, 4 Sep 2019 12:36:12 +0100 Message-Id: <20190904113613.14997-1-lee.jones@linaro.org> X-Mailer: git-send-email 2.17.1 Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org Signed-off-by: Lee Jones Reviewed-by: Vinod Koul --- drivers/i2c/busses/i2c-qcom-geni.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c index a89bfce5388e..dfdbce067827 100644 --- a/drivers/i2c/busses/i2c-qcom-geni.c +++ b/drivers/i2c/busses/i2c-qcom-geni.c @@ -353,13 +353,16 @@ static void geni_i2c_tx_fsm_rst(struct geni_i2c_dev *gi2c) static int geni_i2c_rx_one_msg(struct geni_i2c_dev *gi2c, struct i2c_msg *msg, u32 m_param) { + struct device_node *np = gi2c->se.dev->of_node; dma_addr_t rx_dma; unsigned long time_left; - void *dma_buf; + void *dma_buf = NULL; struct geni_se *se = &gi2c->se; size_t len = msg->len; - dma_buf = i2c_get_dma_safe_msg_buf(msg, 32); + if (!of_property_read_bool(np, "qcom,geni-se-fifo")) + dma_buf = i2c_get_dma_safe_msg_buf(msg, 32); + if (dma_buf) geni_se_select_mode(se, GENI_SE_DMA); else @@ -392,13 +395,16 @@ static int geni_i2c_rx_one_msg(struct geni_i2c_dev *gi2c, struct i2c_msg *msg, static int geni_i2c_tx_one_msg(struct geni_i2c_dev *gi2c, struct i2c_msg *msg, u32 m_param) { + struct device_node *np = gi2c->se.dev->of_node; dma_addr_t tx_dma; unsigned long time_left; - void *dma_buf; + void *dma_buf = NULL; struct geni_se *se = &gi2c->se; size_t len = msg->len; - dma_buf = i2c_get_dma_safe_msg_buf(msg, 32); + if (!of_property_read_bool(np, "qcom,geni-se-fifo")) + dma_buf = i2c_get_dma_safe_msg_buf(msg, 32); + if (dma_buf) geni_se_select_mode(se, GENI_SE_DMA); else From patchwork Wed Sep 4 11:36:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 1157613 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-i2c-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="qp0yJe04"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 46Nhbq62Qgz9s7T for ; Wed, 4 Sep 2019 21:36:23 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728961AbfIDLgW (ORCPT ); Wed, 4 Sep 2019 07:36:22 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:37697 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727083AbfIDLgT (ORCPT ); Wed, 4 Sep 2019 07:36:19 -0400 Received: by mail-wm1-f67.google.com with SMTP id r195so3294355wme.2 for ; Wed, 04 Sep 2019 04:36:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Uuq1eCLagqB7It6aGbezur+IR8biDO9SazdI7cqdaFI=; b=qp0yJe04jx2ivZeuIXUwlhAyXXeFSfk5tgqH6oCkHR05lDEik9mPR5v9927SPGcRcF Bqpd9uYWbP1lsr+hb7QvkpYLluhnrev870vk1hyz6CstDwPiqkr8mp4/e4g5uP5dShX8 xdt0ym7tbVmwYwx2pgRVRGsEZ8C1evHUk9FGitl/8RMxdTyfqj6zxtwcIzKPbnKHu2ay q7f/9kZ1lQ7dZpPPtuumZ9QoFlwEHWVriNgD+6IQtn2ystKcFOD1L8ahTB72/zQlOPjj vijaYPmPpyVFjezLg3cx8drAtt4pP5Fz+cYk5fH1mE2O8yX+nvUAM681Qx1ltYOUjSXv zQLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Uuq1eCLagqB7It6aGbezur+IR8biDO9SazdI7cqdaFI=; b=nUMPLO5y2aCPmUxljHyzo3PTv1S56l+GMAJXKCarxzZPCu0QDOqcdcmpCzLQJnpSKE Keb3hdbiGG9whuF9fhTcpIRbi7/O3xA0qhlor5tLneYlHRcwHMlFq9ebOTSxDr1dtySM vDGRT4/h/+x1pRrgQaScS2+ZMLJ4ZviCLpdt9LmKnVNJBCO99e8QxuKFv0GdPcPxXt2J j2DZVhm3EYVFmgmhzXcLHgty17M+Np+MMcS8MZSb+Vbp2YcsF5XL9s+g3iXNgIkFflpK GmizCBOLW5GcmaAKukPdmtK8HU91xspP4+XueRa+eW2mN0AUuxCTMqLfl2v94z06eMOw wllw== X-Gm-Message-State: APjAAAUpfRgySlYYaNnJKSaSSgNjOI5fdWgNhgbzRL+i9PhOm2bt8Dh+ gO6Frr+pEUAJMMBIOV7XJLeW+g== X-Google-Smtp-Source: APXvYqxrVXn7NXLmsW+n0aD02675Wv9vt7hSV40SwdLs0RB8oNmnK6HhJ+4q7rd/GnqwtFaz3fRPdA== X-Received: by 2002:a7b:c8ca:: with SMTP id f10mr3812956wml.36.1567596978030; Wed, 04 Sep 2019 04:36:18 -0700 (PDT) Received: from localhost.localdomain ([95.147.198.36]) by smtp.gmail.com with ESMTPSA id d9sm10823933wrc.39.2019.09.04.04.36.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Sep 2019 04:36:17 -0700 (PDT) From: Lee Jones To: alokc@codeaurora.org, agross@kernel.org, robh+dt@kernel.org, mark.rutland@arm.com, bjorn.andersson@linaro.org, linux-i2c@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Lee Jones Subject: [PATCH 2/2] dt-bindings: soc: qcom: Provide option to select FIFO mode Date: Wed, 4 Sep 2019 12:36:13 +0100 Message-Id: <20190904113613.14997-2-lee.jones@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190904113613.14997-1-lee.jones@linaro.org> References: <20190904113613.14997-1-lee.jones@linaro.org> Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org Used when DMA is not available or the best option. Signed-off-by: Lee Jones Reviewed-by: Vinod Koul --- Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.txt b/Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.txt index dab7ca9f250c..b0e71c07e604 100644 --- a/Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.txt +++ b/Documentation/devicetree/bindings/soc/qcom/qcom,geni-se.txt @@ -40,6 +40,7 @@ Required properties: Optional property: - clock-frequency: Desired I2C bus clock frequency in Hz. When missing default to 100000Hz. +- qcom,geni-se-fifo: Selects FIFO processing - as opposed to DMA. Child nodes should conform to I2C bus binding as described in i2c.txt.