Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7044003imu; Mon, 21 Jan 2019 22:36:07 -0800 (PST) X-Google-Smtp-Source: ALg8bN7iySwB40820KuATs374XA+jBuANAyIRN4OK5xrbtqFlMO7VeYtkF/rbVVO0oc0w4x1F4VF X-Received: by 2002:a62:1112:: with SMTP id z18mr32110393pfi.173.1548138967841; Mon, 21 Jan 2019 22:36:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548138967; cv=none; d=google.com; s=arc-20160816; b=1IF3EIQz1SbQq4I2dNF2KOMkzUhGUccWhUN69VPIa9jpuSXuCcVn2e+qjMvk2UgWQP ghyjnc7U0D9J8+5W4PbX+dn1Gf099kh8AL5j8KXHQAPeBXFz4Ri/TeyuDrrKFf0vLgBW ojMDhmMaDSQ5xX3KvzFMKm8RBMzU8d7Sau7bmzCEGuzkJZSyrYHn/HpPYB9tOdnMlign KRb82UBraCTGsOTbRJgDZroG4hDCXzhdd+Kgo+Z2PZ8usMUsSKkJeT0USs+ZKTOsKEyG UOtvlGO2kOA/Uewwx7/4keRfu7JzcGDiYzbZBK8QECr5SRvq83P7b44QOi/GZPECHt3y aAPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dmarc-filter:dkim-signature:dkim-signature; bh=OOMsSTCj4/sYcaDkg/ptN326cyCnVMNSRsHbDWWN7oQ=; b=mF+LRKNVXgi6QmXIH0QJ/ePJYUL1T1sw5q4/iivVfIeGrZ5+NBMiFNl2qoXYYykAif RHnCjDpNMEImpsxcFZpnS1fhFtJ3R5UMnnVcXtenTyI17hfa9JGxMgNq8ZTTEb4grOL9 PMQSiT7qHw5bKxTk5461oEv6CElOvbgYgcW/JX8V3qM8BaGWbRSdUHssGZw89PGUVH16 O/lhSaMQdHkSm9zk1Vr5Uu0zzpxP7sq7mIP6h3Vcjjd3VWPdwhTgzFL4al8jXxOgIkYS wsXOszp16N/lRj8RXaOHzmkYEJ3dRW556G2O17g49aSpVCbddOt5iGgEz+f10MhzSITy Ka6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=HJMz1ymH; dkim=pass header.i=@codeaurora.org header.s=default header.b=nKDDsBqi; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h69si3675082pge.121.2019.01.21.22.35.52; Mon, 21 Jan 2019 22:36:07 -0800 (PST) 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=@codeaurora.org header.s=default header.b=HJMz1ymH; dkim=pass header.i=@codeaurora.org header.s=default header.b=nKDDsBqi; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727142AbfAVGed (ORCPT + 99 others); Tue, 22 Jan 2019 01:34:33 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:39538 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726174AbfAVGec (ORCPT ); Tue, 22 Jan 2019 01:34:32 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id DA9E2608EA; Tue, 22 Jan 2019 06:34:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1548138871; bh=0Hi91cQ/hjCVhDdogwQ5vT80/tQYis8QOW0Gl5mbSwM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HJMz1ymHd+VlzyrIarYKO3eoO3pyh3hh4bSqkuUDNJ/NC6GT2U8ZFy26aKqWbx1IW TUwyvSFoWsIaRCqs558aBQqd8xEjwg2+6FYxBXx7Ey9Et8sMYbfWiiy44VzBehHzHB lUPXE6rfzui4QqEkQSbJ/pgIJj50THewyNLxn3Yk= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED autolearn=no autolearn_force=no version=3.4.0 Received: from alokc-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: alokc@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 4987260712; Tue, 22 Jan 2019 06:34:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1548138866; bh=0Hi91cQ/hjCVhDdogwQ5vT80/tQYis8QOW0Gl5mbSwM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nKDDsBqiwCiFtyCdFvoZn3oj8ffPEv3E8zDzTYgPDNA9Uz9ie95C/eYKvxsNYU4N2 s62YU2DrebdjKnDs1Tnn2sCrP/+GFb3weu9cmPV8jq/8fjOaUS7fV+gETKFDTeycb0 1p34CgzArTG47DTN3UDdQN/shmTpQ/9lnDwOiXXs= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 4987260712 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=alokc@codeaurora.org From: Alok Chauhan To: linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, linux-spi@vger.kernel.org, linux-serial@vger.kernel.org, Alok Chauhan , Karthikeyan Ramasubramanian Cc: andy.gross@linaro.org, david.brown@linaro.org, georgi.djakov@linaro.org, dianders@chromium.org, swboyd@chromium.org, bjorn.andersson@linaro.org Subject: [PATCH 3/6] i2c: i2c-qcom-geni: Add interconnect support Date: Tue, 22 Jan 2019 12:03:33 +0530 Message-Id: <1548138816-1149-4-git-send-email-alokc@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1548138816-1149-1-git-send-email-alokc@codeaurora.org> References: <1548138816-1149-1-git-send-email-alokc@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Get the interconnect paths for I2C based Serial Engine device and vote accordingly based on maximum supported I2C frequency. Signed-off-by: Alok Chauhan --- drivers/i2c/busses/i2c-qcom-geni.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c index db075bc..e8fe63a 100644 --- a/drivers/i2c/busses/i2c-qcom-geni.c +++ b/drivers/i2c/busses/i2c-qcom-geni.c @@ -14,6 +14,7 @@ #include #include #include +#include #define SE_I2C_TX_TRANS_LEN 0x26c #define SE_I2C_RX_TRANS_LEN 0x270 @@ -508,6 +509,15 @@ static int geni_i2c_probe(struct platform_device *pdev) return ret; } + /* Set the bus quota to a reasonable value */ + gi2c->se.avg_bw = Bps_to_icc(1000); + gi2c->se.peak_bw = Bps_to_icc(76800000); + ret = geni_interconnect_init(&gi2c->se); + if (ret) { + dev_err(&pdev->dev, "interconnect_init failed %d\n", ret); + return ret; + } + ret = device_property_read_u32(&pdev->dev, "clock-frequency", &gi2c->clk_freq_out); if (ret) { @@ -611,6 +621,8 @@ static int __maybe_unused geni_i2c_runtime_suspend(struct device *dev) gi2c->suspended = 1; } + geni_icc_update_bw(&gi2c->se, false); + return 0; } @@ -619,6 +631,7 @@ static int __maybe_unused geni_i2c_runtime_resume(struct device *dev) int ret; struct geni_i2c_dev *gi2c = dev_get_drvdata(dev); + geni_icc_update_bw(&gi2c->se, true); ret = geni_se_resources_on(&gi2c->se); if (ret) return ret; -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project