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: 10302669 X-Patchwork-Delegate: kvalo@adurom.com 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 0D1C2600F6 for ; Fri, 23 Mar 2018 05:04:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F156728BC0 for ; Fri, 23 Mar 2018 05:04:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E62D328BC3; Fri, 23 Mar 2018 05:04:05 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8FEC128BC0 for ; Fri, 23 Mar 2018 05:04:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751832AbeCWFEC (ORCPT ); Fri, 23 Mar 2018 01:04:02 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:46820 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751821AbeCWFEB (ORCPT ); Fri, 23 Mar 2018 01:04:01 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 4D36C60F6C; 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 Cc: linux-wireless@vger.kernel.org, Govind Singh 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> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.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 = {