Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7044684imu; Mon, 21 Jan 2019 22:37:05 -0800 (PST) X-Google-Smtp-Source: ALg8bN6bmewHRWCQbxrVXMMedzw2NTq42wFhrSuTojqT8+I6vwXFzIg6g2gMi+xwCad+yuI9NW3S X-Received: by 2002:a17:902:82c2:: with SMTP id u2mr32998539plz.110.1548139025342; Mon, 21 Jan 2019 22:37:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548139025; cv=none; d=google.com; s=arc-20160816; b=Av/X2hGuqI5DvuESTKu8BM5J5xV4GCrd9feDt62V4q6Y3IlDmOvmbwumVAbyAoh+yO csDZiaU5gn8HGaUG7MKyJHT2rmeewdpKxrkuRyWYbUh6gMVMsoER8sP8PW0kywuJzApX YdXxC/f4jGWbFTxS5iLkS2XBannEV3xzOzO2swafduuIwRtoLdtJFasDVWay5IhqI3bu tM5t0Z0xudPQsSWvqEgXOxmQj8fYrCjHeY1SS+DVc14FayIB1DjwpE/msbONdPFyxO+D t3LhM+IwNGzAohcMHmoiuyPOIyACHPEGzTyCmx57g8mVZxhlnDR1YfMtzPYNF+FJ2y+t eEEQ== 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=ealxuMcQAGivE+NALptL9iOHYn52H+FlREc6DrBnUjQ=; b=HEYKIAsrNf4KLOnkAUS1638CZ9pgD/y4K+c4KDY25NWKvwsCP+siCNJpaiNSWbSFLT HUOKgBhVuac8Li9wcPdJaHvRHGrchxfoYaPsnUutg90dHjHh0TLK9qic+QzU+Cy8uu4u bTsgusWM3Pc+8oCvQgaVzu/wRqvl/HPxG0QCGYW9tXkb5kZ3es+a20jxXqx4hRH6B35/ hUfTkAh+sBOrWPfnh0tk7dVmQv25ZM1V8eyF7Dx+PHu/PfYHG9rWH3LYgUIhmuiHbVId Qi2l2IDzfRHEBWnaFXlDNCpvSFP2AYyD4ju7fFF6tutLIgfhRoYrcTqPiUKsF2uoPb6T xm2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=JLl4MQTk; dkim=pass header.i=@codeaurora.org header.s=default header.b=Dkyc32QO; 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 k25si14771662pfe.10.2019.01.21.22.36.49; Mon, 21 Jan 2019 22:37:05 -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=JLl4MQTk; dkim=pass header.i=@codeaurora.org header.s=default header.b=Dkyc32QO; 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 S1727215AbfAVGer (ORCPT + 99 others); Tue, 22 Jan 2019 01:34:47 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:39872 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726174AbfAVGeq (ORCPT ); Tue, 22 Jan 2019 01:34:46 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 6802B6098A; Tue, 22 Jan 2019 06:34:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1548138884; bh=t+7VFsYr21LVGhDoaiu71aEFa4FmA54Z0rNp7gXcbag=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JLl4MQTk3A2hxFYrMUMoECnaUQPMbMKbVawcMUsknj94Uug2lD1Iw6hTRwHg0V+93 mwKNBqdJg8+3PHqxQzQFR5/Am69Z8nFfmpIeY2GJKyArti6rcVPt8REZv8qdMa/8SY F7YuGfa+ryUbtPHp8bJpkEUxcizBUJzv4Ucj+AUg= 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 BE6E76095F; Tue, 22 Jan 2019 06:34:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1548138877; bh=t+7VFsYr21LVGhDoaiu71aEFa4FmA54Z0rNp7gXcbag=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Dkyc32QO63cJ9YXD7K4kbfLq8G6r4jmH2qSsiMXhF/Wd83Z2UFc1MV1N5vcJ6mYnT n8quJGFPCLUTJjspFfnkkQqB3lpvoKyVXLDgBSubYE97uUeVcnbxb4jyfIqnB+n6NE AgX5drNrcMcxiKpLMwEwQq8QbjLaS5yaCkRDMtao= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org BE6E76095F 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, Greg Kroah-Hartman , Jiri Slaby Cc: andy.gross@linaro.org, david.brown@linaro.org, georgi.djakov@linaro.org, dianders@chromium.org, swboyd@chromium.org, bjorn.andersson@linaro.org, Alok Chauhan Subject: [PATCH 5/6] tty: serial: qcom_geni_serial: Add interconnect support Date: Tue, 22 Jan 2019 12:03:35 +0530 Message-Id: <1548138816-1149-6-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 Uart based Serial Engine device and vote accordingly based on maximum supported Uart frequency. Signed-off-by: Alok Chauhan --- drivers/tty/serial/qcom_geni_serial.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c index a72d6d9..e2ea499 100644 --- a/drivers/tty/serial/qcom_geni_serial.c +++ b/drivers/tty/serial/qcom_geni_serial.c @@ -19,6 +19,7 @@ #include #include #include +#include /* UART specific GENI registers */ #define SE_UART_LOOPBACK_CFG 0x22c @@ -1348,6 +1349,22 @@ static int qcom_geni_serial_probe(struct platform_device *pdev) return ret; } + /* Set the bus quota to a reasonable value */ + port->se.avg_bw = console ? Bps_to_icc(1000) : Bps_to_icc(2500); + port->se.peak_bw = Bps_to_icc(76800000); + ret = geni_interconnect_init(&port->se); + if (ret) { + dev_err(&pdev->dev, "interconnect_init failed %d\n", ret); + return ret; + } + + /* + * Vote for interconnect path early. This has to move as part of + * Runtime PM APIs when implemented for better control betwen + * console and non-console usecases + */ + geni_icc_update_bw(&port->se, true); + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!res) return -EINVAL; @@ -1385,8 +1402,15 @@ static int __maybe_unused qcom_geni_serial_sys_suspend(struct device *dev) { struct qcom_geni_serial_port *port = dev_get_drvdata(dev); struct uart_port *uport = &port->uport; + int ret; + + ret = uart_suspend_port(uport->private_data, uport); + if (ret) + return ret; + + geni_icc_update_bw(&port->se, false); - return uart_suspend_port(uport->private_data, uport); + return 0; } static int __maybe_unused qcom_geni_serial_sys_resume(struct device *dev) @@ -1394,6 +1418,7 @@ static int __maybe_unused qcom_geni_serial_sys_resume(struct device *dev) struct qcom_geni_serial_port *port = dev_get_drvdata(dev); struct uart_port *uport = &port->uport; + geni_icc_update_bw(&port->se, true); return uart_resume_port(uport->private_data, uport); } -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project