From patchwork Mon Mar 13 21:05:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alban Bedel X-Patchwork-Id: 9622137 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 57EC9604CC for ; Mon, 13 Mar 2017 21:07:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 47F912843D for ; Mon, 13 Mar 2017 21:07:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3C576284F6; Mon, 13 Mar 2017 21:07: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=-6.9 required=2.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI autolearn=unavailable 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 070292843D for ; Mon, 13 Mar 2017 21:07:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932305AbdCMVHb (ORCPT ); Mon, 13 Mar 2017 17:07:31 -0400 Received: from smtp5-g21.free.fr ([212.27.42.5]:7509 "EHLO smtp5-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932291AbdCMVHY (ORCPT ); Mon, 13 Mar 2017 17:07:24 -0400 Received: from localhost.localdomain (unknown [78.54.115.31]) (Authenticated sender: albeu) by smtp5-g21.free.fr (Postfix) with ESMTPA id 9B6D15FF95; Mon, 13 Mar 2017 22:07:07 +0100 (CET) From: Alban To: QCA ath9k Development Cc: John Crispin , Alban , Kalle Valo , linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 7/7] ath9k: hw: Reset the device with the external reset before init Date: Mon, 13 Mar 2017 22:05:15 +0100 Message-Id: <1489439116-4233-7-git-send-email-albeu@free.fr> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1489439116-4233-1-git-send-email-albeu@free.fr> References: <1489439116-4233-1-git-send-email-albeu@free.fr> 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 On the SoC platform the board code often manually reset the device before registering it. To allow the same to happen on DT platforms let the driver call the reset before init. Signed-off-by: Alban --- drivers/net/wireless/ath/ath9k/hw.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c index efc0435..dfb13bc 100644 --- a/drivers/net/wireless/ath/ath9k/hw.c +++ b/drivers/net/wireless/ath/ath9k/hw.c @@ -576,6 +576,13 @@ static int __ath9k_hw_init(struct ath_hw *ah) struct ath_common *common = ath9k_hw_common(ah); int r = 0; + /* Reset the device before using it */ + r = ath9k_hw_external_reset(ah); + if (r) { + ath_err(common, "Failed to reset chip\n"); + return r; + } + ath9k_hw_read_revisions(ah); switch (ah->hw_version.macVersion) {