From patchwork Fri Mar 23 05:03:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Govind Singh X-Patchwork-Id: 10302695 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B374B60384 for ; Fri, 23 Mar 2018 05:04:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A20EC28B9A for ; Fri, 23 Mar 2018 05:04:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 960F428BC3; Fri, 23 Mar 2018 05:04:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 477F328B9A for ; Fri, 23 Mar 2018 05:04:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=vxtr5dd3CuU+q44CY+HlVmYJkBl9cL1jJWmpC7oAyqo=; b=QuVoz8bL+axAQpzxvojNBFWoPC VPjHa1NJzzsZoYYTt6i8JTSMZoE6mMvqbAqNs2/ho9KSJiGmuiCcgu1YI8IwU9ItvYDmPi1/acI1Z mEOCbcVEAnTmo4gacS8HHTAkkWXAM9BId1Y7dTICOcwwcZPtglBPOhZeEwLR5ZZA02plYIwLltAcE UBuEjNmY9/Xpty9svVbFsy2vIFU9lr4WY6HDj9KcUb3ggRJNHgDsDzsYm/QybjNPsfYbd7U1FNXW0 hI3L/tTJd0J8idyHlXmukPoxE+7NQeTZgTJKO53wz2Wqy/Jr11B9BP2s/MAPhMTH0Q+fhVSa8SyNO A2olkF/g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1ezEsc-0002ti-Mh; Fri, 23 Mar 2018 05:04:42 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1ezEsA-0002U1-V2 for ath10k@lists.infradead.org; Fri, 23 Mar 2018 05:04:20 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 8EB0160F72; Fri, 23 Mar 2018 05:04:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1521781441; bh=cAGOTZ4nV0wYxeRtuTd/5ys/0JTzyg0p1bskmVoeVIM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FjPU7o90F0s/8gDpI9Y5CW1IbUFQv4wLvFamExv/J9PJuESVQpdcgZleoWMdXR1N2 MSZJyvu3nZ1fYCxImfLDH76ViW4NUu4DOHHmM9wIjU7Xohvy1ZSquPBCAJBp3LQZJB APyjfbjFmgKppJoZu8mbYquNkRhdFDCyB+Qn+K5g= Received: from govinds-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.1 with cipher ECDHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: govinds@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id AD1ED60C65; Fri, 23 Mar 2018 05:03:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1521781441; bh=cAGOTZ4nV0wYxeRtuTd/5ys/0JTzyg0p1bskmVoeVIM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FjPU7o90F0s/8gDpI9Y5CW1IbUFQv4wLvFamExv/J9PJuESVQpdcgZleoWMdXR1N2 MSZJyvu3nZ1fYCxImfLDH76ViW4NUu4DOHHmM9wIjU7Xohvy1ZSquPBCAJBp3LQZJB APyjfbjFmgKppJoZu8mbYquNkRhdFDCyB+Qn+K5g= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org AD1ED60C65 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=govinds@codeaurora.org From: Govind Singh To: ath10k@lists.infradead.org Subject: [PATCH v2 06/13] ath10k: Add hif power-up/power-down methods Date: Fri, 23 Mar 2018 10:33:37 +0530 Message-Id: <1521781424-24972-7-git-send-email-govinds@codeaurora.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1521781424-24972-1-git-send-email-govinds@codeaurora.org> References: <1521781424-24972-1-git-send-email-govinds@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180322_220415_976181_D169A184 X-CRM114-Status: GOOD ( 10.83 ) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Govind Singh , linux-wireless@vger.kernel.org MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Add hif power-up/power-down methods for wcn3990 target. Signed-off-by: Govind Singh --- drivers/net/wireless/ath/ath10k/snoc.c | 61 ++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/snoc.c b/drivers/net/wireless/ath/ath10k/snoc.c index a39eee7..9d402e4 100644 --- a/drivers/net/wireless/ath/ath10k/snoc.c +++ b/drivers/net/wireless/ath/ath10k/snoc.c @@ -519,6 +519,65 @@ static int ath10k_snoc_hif_start(struct ath10k *ar) return 0; } +static int ath10k_snoc_init_pipes(struct ath10k *ar) +{ + int i, ret; + + for (i = 0; i < CE_COUNT; i++) { + ret = ath10k_ce_init_pipe(ar, i, &host_ce_config_wlan[i]); + if (ret) { + ath10k_err(ar, "failed to initialize copy engine pipe %d: %d\n", + i, ret); + return ret; + } + } + + return 0; +} + +static int ath10k_snoc_wlan_enable(struct ath10k *ar) +{ + return 0; +} + +static void ath10k_snoc_wlan_disable(struct ath10k *ar) +{ +} + +static void ath10k_snoc_hif_power_down(struct ath10k *ar) +{ + ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot hif power down\n"); + + ath10k_snoc_wlan_disable(ar); +} + +static int ath10k_snoc_hif_power_up(struct ath10k *ar) +{ + int ret; + + ath10k_dbg(ar, ATH10K_DBG_SNOC, "%s:WCN3990 driver state = %d\n", + __func__, ar->state); + + ret = ath10k_snoc_wlan_enable(ar); + if (ret) { + ath10k_err(ar, "failed to enable wcn3990: %d\n", ret); + return ret; + } + + ret = ath10k_snoc_init_pipes(ar); + if (ret) { + ath10k_err(ar, "failed to initialize CE: %d\n", ret); + goto err_wlan_enable; + } + + return 0; + +err_wlan_enable: + ath10k_snoc_wlan_disable(ar); + + return ret; +} + static const struct ath10k_hif_ops ath10k_snoc_hif_ops = { .read32 = ath10k_snoc_read32, .write32 = ath10k_snoc_write32, @@ -526,6 +585,8 @@ static int ath10k_snoc_hif_start(struct ath10k *ar) .stop = ath10k_snoc_hif_stop, .map_service_to_pipe = ath10k_snoc_hif_map_service_to_pipe, .get_default_pipe = ath10k_snoc_hif_get_default_pipe, + .power_up = ath10k_snoc_hif_power_up, + .power_down = ath10k_snoc_hif_power_down, }; static const struct ath10k_bus_ops ath10k_snoc_bus_ops = {