Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp575761ybe; Wed, 4 Sep 2019 04:37:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqxWQbBPbEVnuwSEqzsKz4fmXEwBmOCATlwpjZcb2ZRcd7h9ojtU3yvh0rxD01pghKsRGtFw X-Received: by 2002:a62:31c3:: with SMTP id x186mr44459541pfx.97.1567597049090; Wed, 04 Sep 2019 04:37:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567597049; cv=none; d=google.com; s=arc-20160816; b=uGqvBr+yG5y3zbImny8Skl1BFQFNAnSnfxthXy/9b9mdrBH262+qTq87RhvuAS336w zTFgbautyi4OIfhRW28r62j9xQyeCu5/JhiBJgzJQscn7aXc4HJTrAobY3HvxYbyOElp qaU/bft403jtcaV7Q1lvqFHKUrfzTY0c/S8xPmjhKLN9LD3JAqp/vc4Vt3Oay0teuqBa XKDvV5sUCH9qBDKeJI6fvXTHCLmMQlbtHJ8pxdItBAXgx0QGZxfGJcEptdns8cJ/H6jL qzFBy0fhApky29WnGXD6u2/JEYZkaLeb/TtUAwsOQcZvYIQbjEp5AKvXYyXaWicqaPfk TcnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=6n1x8bAGsyaVUn7RCRrZd6pcUeSbUTUlFO1sD7W+jdE=; b=0YkqezFBIc9dh5wlfqc7BLJQm3TGt68bCFSX3CFgjQIDg8j5tvGoke7BXF4Kb0mRNG jTkUUh9udOOrmDj0Ms591TSYCHmZ/MlIAzPAtHdgkuAVjQLee9NEiNmZCCxiCGDHoCZq ZAbVTOa9Hv7Y1qoM7OY0mfTbxJ9Gb/CIj2KOKLrVzst7dw2L7mZNKsC0YvqvYu/fUVVI j2r1l4iUqUbLTqqDu7ZYGYnP6vIokB94SN0PgjjzrDsSgEVwU7LBEptxHq0guKDVGIhQ YuagTe+nnPr5BV6ubSXnjycl4wHcIwbsDEdmffbK3eBBBfv5VPbk7mD9TEoNXx+dMTW6 IFcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=h6B+fLtp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y3si16975329pgy.230.2019.09.04.04.37.13; Wed, 04 Sep 2019 04:37:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=h6B+fLtp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728238AbfIDLgT (ORCPT + 99 others); Wed, 4 Sep 2019 07:36:19 -0400 Received: from mail-wm1-f52.google.com ([209.85.128.52]:39020 "EHLO mail-wm1-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726495AbfIDLgT (ORCPT ); Wed, 4 Sep 2019 07:36:19 -0400 Received: by mail-wm1-f52.google.com with SMTP id q12so1487150wmj.4 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=KCeDae7ckHyLNXNNC8tD0nYOsnfihXwwRlv3DZkrKd3dAE81ZJplPmPZj3I5F0GMb2 3WokzhkkXhpGzU3QdstS0MkWgWre0WktjDY+UPQ7Let7l3BF4X/2dVubV3gtbJpNZZCH nrq3CiCKSUDrWvNAlqmhGla/LEVpAfaKfvGMWSRBaR03gXzjZzphmisyNhUXgh15ePE9 hQ24/ZsreEISFIjD45ZqL+OZx7SY1zTWgbFAt9ONx/HhtbKAcgF/dE0qbk+wye7IuaHb I+qhmyV8AGUI+s29nIpckvY0kHoQqOgnvob5IkKrZdZE6boKZN9LyccziIqvraDllJaW nsBw== X-Gm-Message-State: APjAAAWy/9qu7+uB0RP6jz9LbM+RB6l+y1T3vor95nvrw+iaaIWtCTKj JxPoJivjgN0jPSRaNweOfTWPmkvAHmw= 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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Signed-off-by: Lee Jones --- 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 -- 2.17.1