From patchwork Sat Apr 16 00:19:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve deRosier X-Patchwork-Id: 8859831 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C96749F1D3 for ; Sat, 16 Apr 2016 00:23:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9EE4B2024D for ; Sat, 16 Apr 2016 00:23:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A63AE20259 for ; Sat, 16 Apr 2016 00:23:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752257AbcDPAXo (ORCPT ); Fri, 15 Apr 2016 20:23:44 -0400 Received: from mail-qg0-f50.google.com ([209.85.192.50]:34533 "EHLO mail-qg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752070AbcDPAXn (ORCPT ); Fri, 15 Apr 2016 20:23:43 -0400 Received: by mail-qg0-f50.google.com with SMTP id c6so90513539qga.1 for ; Fri, 15 Apr 2016 17:23:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=+dbdObGDTzagWbee2RubT4A+VKlVZ9AwpRxpNvoAvWo=; b=x32fiO3f3bHebCs1wHKIwIzT4ClZXg2n2rBSGkOQ9gnjO27jd5xDjzqrT26vvURpHf ebdJOeKK8995Yc0+c8cr760N6rNfJ92j5HSzjU/kjj57dm2VKTsa9BXLyLxb0cEPfFv0 0hK2fZ1nh6ut3b5O2XmhqYTvEzA/Jpqp9yZW8GN6GTyx9kscYJVhH7qNBaIuQCmgbJk6 /POX2lP2QO4UwXWbkwEQX9AV1/a6VgndaK196RF0TtNGpzLpHMvozIHptPzuSZkbiwwq P3fYX9hDPVA99QOxsN+WU1Gte0iHYq6DMdF+wmQw46sIYbdwQoUTzrfIGM9D/9znndpQ y55g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=+dbdObGDTzagWbee2RubT4A+VKlVZ9AwpRxpNvoAvWo=; b=bHfQGi9Wqlc4XZ/pRQYPTI9/N2076iQV0WTWEoNvo+w9G6YR62z1Urw18MTf6QVHb7 pWwRoc4z+vw73dsgNJdiz8qDnXNZtijuA/ANdAW56mJixab0yyIa2pvFIxgXgLG2/KMw wH1TSBknqOO7HqZzt3MH0ba87hDA8fSIP717wmhgzv+ATEYPAH1/4rNuvhSezBPDl+C1 jOs/+j50istakoXQpp562ggP1Gt0c1hmm5prneyMCliZNpgYg2MSaLkGlbOJBimIMAEM rCZTF6+QJRw0OfN+W7qo276G159FJG13oAnVZGGHrx1ActmmEXfZDnQIanLKgDfSO7XR Y9fA== X-Gm-Message-State: AOPr4FUyROHQAF6LLFDejcC6MxNsCjFBPOaw4x3GA1cTr7ZiPppk0cjkBJMkWXDdcsijzg== X-Received: by 10.140.96.85 with SMTP id j79mr28322957qge.92.1460766222260; Fri, 15 Apr 2016 17:23:42 -0700 (PDT) Received: from elmer.corp.lairdtech.com (c-50-184-185-234.hsd1.ca.comcast.net. [50.184.185.234]) by smtp.gmail.com with ESMTPSA id u185sm10760324qhe.13.2016.04.15.17.23.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 15 Apr 2016 17:23:41 -0700 (PDT) From: Steve deRosier X-Google-Original-From: Steve deRosier To: Kalle Valo Cc: ath6kl@lists.infradead.org, linux-wireless@vger.kernel.org, Steve deRosier Subject: [PATCH] ath6kl: Add ability to set debug uart baud rate Date: Fri, 15 Apr 2016 17:19:46 -0700 Message-Id: <1460765986-12698-1-git-send-email-steve.derosier@lairdtech.com> X-Mailer: git-send-email 1.9.1 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It's useful to permit the customization of the debug uart baud rate. Enable this and send down the value to the chip if we're enabling debug. Signed-off-by: Steve deRosier --- drivers/net/wireless/ath/ath6kl/core.c | 3 +++ drivers/net/wireless/ath/ath6kl/core.h | 1 + drivers/net/wireless/ath/ath6kl/init.c | 8 ++++++++ 3 files changed, 12 insertions(+) diff --git a/drivers/net/wireless/ath/ath6kl/core.c b/drivers/net/wireless/ath/ath6kl/core.c index 4ec02ce..ebb9f16 100644 --- a/drivers/net/wireless/ath/ath6kl/core.c +++ b/drivers/net/wireless/ath/ath6kl/core.c @@ -31,6 +31,7 @@ unsigned int debug_mask; static unsigned int suspend_mode; static unsigned int wow_mode; static unsigned int uart_debug; +static unsigned int uart_rate = 115200; static unsigned int ath6kl_p2p; static unsigned int testmode; static unsigned int recovery_enable; @@ -40,6 +41,7 @@ module_param(debug_mask, uint, 0644); module_param(suspend_mode, uint, 0644); module_param(wow_mode, uint, 0644); module_param(uart_debug, uint, 0644); +module_param(uart_rate, uint, 0644); module_param(ath6kl_p2p, uint, 0644); module_param(testmode, uint, 0644); module_param(recovery_enable, uint, 0644); @@ -180,6 +182,7 @@ int ath6kl_core_init(struct ath6kl *ar, enum ath6kl_htc_type htc_type) if (uart_debug) ar->conf_flags |= ATH6KL_CONF_UART_DEBUG; + ar->hw.uarttx_rate = uart_rate; set_bit(FIRST_BOOT, &ar->flag); diff --git a/drivers/net/wireless/ath/ath6kl/core.h b/drivers/net/wireless/ath/ath6kl/core.h index 5f3acfe..80ce54d 100644 --- a/drivers/net/wireless/ath/ath6kl/core.h +++ b/drivers/net/wireless/ath/ath6kl/core.h @@ -781,6 +781,7 @@ struct ath6kl { u32 board_addr; u32 refclk_hz; u32 uarttx_pin; + u32 uarttx_rate; u32 testscript_addr; u8 tx_ant; u8 rx_ant; diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c index 3daeb27..58fb227 100644 --- a/drivers/net/wireless/ath/ath6kl/init.c +++ b/drivers/net/wireless/ath/ath6kl/init.c @@ -651,6 +651,14 @@ int ath6kl_configure_target(struct ath6kl *ar) if (status) return status; + /* Only set the baud rate if we're actually doing debug */ + if (ar->conf_flags & ATH6KL_CONF_UART_DEBUG) { + status = ath6kl_bmi_write_hi32(ar, hi_desired_baud_rate, + ar->hw.uarttx_rate); + if (status) + return status; + } + /* Configure target refclk_hz */ if (ar->hw.refclk_hz != 0) { status = ath6kl_bmi_write_hi32(ar, hi_refclk_hz,