From patchwork Thu Feb 15 08:49:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Govind Singh X-Patchwork-Id: 10220683 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 ABCCE601E7 for ; Thu, 15 Feb 2018 08:50:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 98F4F290B4 for ; Thu, 15 Feb 2018 08:50:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8AC00290BC; Thu, 15 Feb 2018 08:50:09 +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 10E01290B4 for ; Thu, 15 Feb 2018 08:50:09 +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: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:In-Reply-To: References:List-Owner; bh=vxtr5dd3CuU+q44CY+HlVmYJkBl9cL1jJWmpC7oAyqo=; b=WDI 42H1mkVMFZnhkUJDb1fZRkkpk5w70/bSPwgGX6FS24aziEV/V7dQ4Rn1K1hDZd4EJgEw5HdOua+It l/pzqXwFdcsJzrtRRIR9LNfK7ek3CsuFLbo7JggO/qa1uIuRBQQrd1q/P4a3PQ3pUrI2lm88dfT4X WcwSmiCTzIgBWMro+KtOozp8eXfHFGp2ddAfZrFne94gqUydRW/WaQy1I3AWc3VqUJjVX8+T9kXGc Os6UXSnBnOjNJGi0a1t082NGn4t3jt5GTLtKmvV6fdjx8oaWVcVqmr+veCsiIecRpRaMWEPmzUFe6 78+/cUWP6eNLOeWE8OSDmvhTHzm41hA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1emFEr-0007Kk-MF; Thu, 15 Feb 2018 08:49:57 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1emFEE-0006lj-CB for ath10k@lists.infradead.org; Thu, 15 Feb 2018 08:49:26 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 67E0060F76; Thu, 15 Feb 2018 08:49:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1518684547; bh=cAGOTZ4nV0wYxeRtuTd/5ys/0JTzyg0p1bskmVoeVIM=; h=From:To:Cc:Subject:Date:From; b=PagB9yPp+WnBwgUervcQN+kPXBYYm/r18rJb4G+7D7RRfIU5qoDbS8vmABFf/YYCJ OQ+Ko7nJgAPncPIuDCRQAyWMTklFxMGhLBDYWQdvjpr+d8irwyinANGrChaLxpVz5x nFWir2S/0tKQuzZ5UZGN7yQ3SUF4FEqPkupDKtTM= 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 DA24C6043F; Thu, 15 Feb 2018 08:49:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1518684547; bh=cAGOTZ4nV0wYxeRtuTd/5ys/0JTzyg0p1bskmVoeVIM=; h=From:To:Cc:Subject:Date:From; b=PagB9yPp+WnBwgUervcQN+kPXBYYm/r18rJb4G+7D7RRfIU5qoDbS8vmABFf/YYCJ OQ+Ko7nJgAPncPIuDCRQAyWMTklFxMGhLBDYWQdvjpr+d8irwyinANGrChaLxpVz5x nFWir2S/0tKQuzZ5UZGN7yQ3SUF4FEqPkupDKtTM= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org DA24C6043F 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 06/13] ath10k: Add hif power-up/power-down methods Date: Thu, 15 Feb 2018 14:19:02 +0530 Message-Id: <1518684542-5604-1-git-send-email-govinds@codeaurora.org> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180215_004918_643758_F4C5BAC8 X-CRM114-Status: GOOD ( 10.93 ) 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 = {