Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp2429096imc; Tue, 12 Mar 2019 13:44:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqwpgr8Z0+/YpSXXftj6fb/37dylckp9SYK5X/A1qRE1ysgFGGhn1OEEayPm7ORpaJ2XkfMq X-Received: by 2002:a62:1d90:: with SMTP id d138mr34400586pfd.232.1552423449109; Tue, 12 Mar 2019 13:44:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552423449; cv=none; d=google.com; s=arc-20160816; b=twFC1TFIYRFVW+diqd/iNc0ZDyMdACNxScDsNojVXnt/PXhGfwgpC/btKd+tBQffsG 7eEIv6c/XXjHAKxo+eoQGTxfHPH0VC/P3qixklxXH2b2mqapRwMwOxfmskNZbuFdFa9z uowiSvkmrOdvVdCqagXbgTiVmGkJPChF7Znvy8hvGs+oek9NXhQL/wB4+znoAHOoyLUx EZYjQk3TUCgW6aZcG4thm2l7OQ55c/KzksOl/pXEkWIht9390OKTH4yKKbV/v5XgD42E 2PEWdKHDu5o9G8oUGGRIZBkGVnzbpgFyxn01L3+PpaBN7n0d1Uu2ZeOOzHwt309zkWtb sKDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date :mime-version:references:in-reply-to:from:dkim-signature; bh=L3SDyRARfNU7pJbRWNe9TuH+x3npRa8h38TywjUR+48=; b=C3ALMqx3C/Uk95j8mmOJO0zw6TkBxYuPTiFr/zrptysm0Z3N2dveVyOLoTJr1QSNS8 yxtQ1IV940VvfKECVi3z5ql2w1PAVvcVJzl4XJ8EVl2hehsjuZMdkfPVRgoF1m/UWdKt LcCS8uNK+kqeHIl1ASiY1+0rZqd/hapS8g7lW5ph747Vd/dmopb7zY7qtkmtxgGWNMIa OU3B7mjEAtqKK4Y9815lOvOq5+yLNTy30EBwgk+lTSyDn3UmNQdON36LsQ8AwvkPGLIh OqndArLKnjLJbuwKym+pnad2aK0j+XlO2uM/wNYutIegEcvwkZEpBYzo8u8trdedBPJB cbxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ERuvxAx2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d21si8974650pll.437.2019.03.12.13.43.52; Tue, 12 Mar 2019 13:44:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ERuvxAx2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727144AbfCLUmX (ORCPT + 99 others); Tue, 12 Mar 2019 16:42:23 -0400 Received: from mail-yw1-f65.google.com ([209.85.161.65]:33831 "EHLO mail-yw1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726565AbfCLUmX (ORCPT ); Tue, 12 Mar 2019 16:42:23 -0400 Received: by mail-yw1-f65.google.com with SMTP id x129so3306929ywc.1 for ; Tue, 12 Mar 2019 13:42:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:in-reply-to:references:mime-version:date:message-id:subject:to :cc; bh=L3SDyRARfNU7pJbRWNe9TuH+x3npRa8h38TywjUR+48=; b=ERuvxAx2z+FJ3kqE7IdxuLqO6MB/mcmMpH8jDgR6g0mBYl1jD7odLHRmxRncAV89cP 7JVyfDta7to8AeXFGBRkhWjuaJHqmOCbNUq0v7+Pk9ifsBpTsXqINQwsWU9JqNssEQ19 ld8pqQo3ni97qcPAQjn35tzk43o+T7ezPlgf8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:in-reply-to:references:mime-version:date :message-id:subject:to:cc; bh=L3SDyRARfNU7pJbRWNe9TuH+x3npRa8h38TywjUR+48=; b=RZ4HRKOrIOSCzK2e/5QjobtOcnvBYLZ+khj7jhepOZfROlHcVJts0y5xz/Mv3Ap6WF ICg3t+3LQ7qRgCp2FmrnoVLStKOsyfEz0dvc7RRG3/QcjHZug2SbV40YNyxDwYV1h1px 1O7/FTeuZqXjdNq1VP2lWBJLhclgy/0Z5ATsMsoSS4uJOEIjhTXxs8iMQrmGCDD7Ph3M Y8+e6QkoJvVsrNcW+iAlVZGRLKxC01xKUoHfCTDiUkQjC1Qh4TWXiKgZ69dAq98urczp t1l8D8vONRvynO+8XbQKaYf+sHbtn4YzYdgh/BQ3Zctx73sMaCF8qmYZW4g1Dqz/5CPP ymsw== X-Gm-Message-State: APjAAAU324HQUiC8U/YXuAW3cahNArk+HJKhBYAniJOFC29dFwcljsbj /SFT5CrbuPITwp5ho8owEx6/E2NGD+Idh/lhAagE8g== X-Received: by 2002:a25:4444:: with SMTP id r65mr32704412yba.223.1552423342309; Tue, 12 Mar 2019 13:42:22 -0700 (PDT) Received: from 764776645087 named unknown by gmailapi.google.com with HTTPREST; Tue, 12 Mar 2019 13:42:21 -0700 From: Matthias Kaehlcke X-Mailer: git-send-email 2.21.0.360.g471c308f928-goog In-Reply-To: <20190312204217.73296-1-mka@chromium.org> References: <20190312204217.73296-1-mka@chromium.org> MIME-Version: 1.0 Date: Tue, 12 Mar 2019 13:42:21 -0700 Message-ID: Subject: [PATCH v2 1/2] Bluetooth: hci_qca: Rename STATE_ to QCA_ To: Marcel Holtmann , Johan Hedberg Cc: linux-bluetooth@vger.kernel.org, linux-kernel@vger.kernel.org, Balakrishna Godavarthi , Hemantg , Rocky Liao , Harish Bandi , Matthias Kaehlcke Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Rename STATE_IN_BAND_SLEEP_ENABLED to QCA_IN_BAND_SLEEP_ENABLED. The constant represents a flag (multiple flags can be set at once), not a unique state of the controller or driver. Also make the flag an enum value instead of a pre-processor constant (more flags will be added to the enum group by another patch). Signed-off-by: Matthias Kaehlcke --- Changes in v2: - don't use BIT() - change to enum type - updated commit message --- drivers/bluetooth/hci_qca.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c index 237aea34b69f..1b7ba9e9e08a 100644 --- a/drivers/bluetooth/hci_qca.c +++ b/drivers/bluetooth/hci_qca.c @@ -54,9 +54,6 @@ #define HCI_IBS_WAKE_ACK 0xFC #define HCI_MAX_IBS_SIZE 10 -/* Controller states */ -#define STATE_IN_BAND_SLEEP_ENABLED 1 - #define IBS_WAKE_RETRANS_TIMEOUT_MS 100 #define IBS_TX_IDLE_TIMEOUT_MS 2000 #define CMD_TRANS_TIMEOUT_MS 100 @@ -67,6 +64,10 @@ /* Controller debug log header */ #define QCA_DEBUG_HANDLE 0x2EDC +enum qca_flags { + QCA_IN_BAND_SLEEP_ENABLED, +}; + /* HCI_IBS transmit side sleep protocol states */ enum tx_ibs_states { HCI_IBS_TX_ASLEEP, @@ -775,7 +776,7 @@ static int qca_enqueue(struct hci_uart *hu, struct sk_buff *skb) /* Don't go to sleep in middle of patch download or * Out-Of-Band(GPIOs control) sleep is selected. */ - if (!test_bit(STATE_IN_BAND_SLEEP_ENABLED, &qca->flags)) { + if (!test_bit(QCA_IN_BAND_SLEEP_ENABLED, &qca->flags)) { skb_queue_tail(&qca->txq, skb); spin_unlock_irqrestore(&qca->hci_ibs_lock, flags); return 0; @@ -1192,7 +1193,7 @@ static int qca_setup(struct hci_uart *hu) return ret; /* Patch downloading has to be done without IBS mode */ - clear_bit(STATE_IN_BAND_SLEEP_ENABLED, &qca->flags); + clear_bit(QCA_IN_BAND_SLEEP_ENABLED, &qca->flags); if (qcadev->btsoc_type == QCA_WCN3990) { bt_dev_info(hdev, "setting up wcn3990"); @@ -1236,7 +1237,7 @@ static int qca_setup(struct hci_uart *hu) /* Setup patch / NVM configurations */ ret = qca_uart_setup(hdev, qca_baudrate, qcadev->btsoc_type, soc_ver); if (!ret) { - set_bit(STATE_IN_BAND_SLEEP_ENABLED, &qca->flags); + set_bit(QCA_IN_BAND_SLEEP_ENABLED, &qca->flags); qca_debugfs_init(hdev); } else if (ret == -ENOENT) { /* No patch/nvm-config found, run with original fw/config */ @@ -1294,7 +1295,7 @@ static void qca_power_shutdown(struct hci_uart *hu) * data in skb's. */ spin_lock_irqsave(&qca->hci_ibs_lock, flags); - clear_bit(STATE_IN_BAND_SLEEP_ENABLED, &qca->flags); + clear_bit(QCA_IN_BAND_SLEEP_ENABLED, &qca->flags); qca_flush(hu); spin_unlock_irqrestore(&qca->hci_ibs_lock, flags); -- 2.21.0.360.g471c308f928-goog