Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp6109274imu; Mon, 21 Jan 2019 03:24:08 -0800 (PST) X-Google-Smtp-Source: ALg8bN7rxVi+dhcFa4Z1Y745kuNwU206wPlZGdeenmpMfQgEn06Dh6m8laqUzTAWvLVP1MuZfWd9 X-Received: by 2002:a63:1a4b:: with SMTP id a11mr27995494pgm.254.1548069848518; Mon, 21 Jan 2019 03:24:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548069848; cv=none; d=google.com; s=arc-20160816; b=QjAM6/aVHz/ES4egCNVqmygvBXv+wFCBqLqvHBbVh5GLzg59Ru7lpxMRGfhiJ35N3x UnI5D91ULa9YFlfS3FViEPbz75ER1Q5qt0Z8h3l74rUntI0gw7/cWLYMUaxEJgTqDgRE m6k5CdCaxm97tdl59yPJ3hF3vbgYmOjm33sy/N2+uct45/rg7EjO1V7KcQqI3yrENRKt unhpFzsRDhBHPWf7//+u+G93e3cNsBVBuxNVbiGuglD9EvFp7GO0ogC43E4DtjW9cBP9 UpNiveK0ofrIWYMbFnI+60WJY7p3uhutxEDk6lG0LDoN7CHiL/Nz9OWGTg3lZlMMILFa bfYw== 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=uAIAohr0r3XAGGo5Fyt24P3VZWUz0jIMlI+4OhRC5H8CFWfUWP+Abcfsu97rpcOai2 DI0BzF/HOhgPJe31Ol5av0v4oRMt0kIzd1bKEla/p+iTsxQH8UsWYHxYJbRT0KoYreu9 mK+6QlVbpqhbz8Dye4A+fSkjo6npKAhjpBopcnES9Azb7IAMchGZA7HTykxKdqPkARGX Mwe51RzxTofwHfcGSpS03g68VVxXS9bEz32HSjnXgnnMEOPcSu0R+01OuQThB4QjrgEg FlO8Zl83uuPMPeKDWP1DQx2LNP0a04565fy0H1AOqA9wbUBgWTspK9dtLr8KPSL6cVT/ DL7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b="n1/DfoTh"; dkim=pass header.i=@codeaurora.org header.s=default header.b=lVBm0ASt; 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 n5si13110004pgh.422.2019.01.21.03.23.53; Mon, 21 Jan 2019 03:24:08 -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="n1/DfoTh"; dkim=pass header.i=@codeaurora.org header.s=default header.b=lVBm0ASt; 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 S1728413AbfAULWY (ORCPT + 99 others); Mon, 21 Jan 2019 06:22:24 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:33286 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728345AbfAULWX (ORCPT ); Mon, 21 Jan 2019 06:22:23 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 9D75D6087D; Mon, 21 Jan 2019 11:22:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1548069741; bh=t+7VFsYr21LVGhDoaiu71aEFa4FmA54Z0rNp7gXcbag=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=n1/DfoThHT8yXQE3gjA6/LwedhEl2CtYGZkGqor8uca8Ykxp51nvhmu8Ta1JfRrlE 0BiYLloneIEVS8DL9p3HuBfYiAgQ+dnF1CA4VlHsqD8CdbryBJJnvH2x6AkxHIgRD9 IzZ5QBeAkAliYuCwzGqf4fxBpv8RwyFmIiXiOaHU= 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 03AB260878; Mon, 21 Jan 2019 11:22:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1548069739; bh=t+7VFsYr21LVGhDoaiu71aEFa4FmA54Z0rNp7gXcbag=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lVBm0AStbNvVQOmcgpcrIm3raYTuYQpSw44pM4TCdLla5VE+/9LvuJxnQOzG+bJDQ RF4+NedVieVrOvVj/h41KHFhwZkbC1Lg17wkmpV0M4peNDApoa0L7MpskTC5kng3o/ IBt2tUzEfb5bSsTU23WaxjTVanteYPuz1gVxaZdc= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 03AB260878 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, Greg Kroah-Hartman , Jiri Slaby , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org 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: Mon, 21 Jan 2019 16:51:42 +0530 Message-Id: <1548069703-26595-6-git-send-email-alokc@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1548069703-26595-1-git-send-email-alokc@codeaurora.org> References: <1548069703-26595-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