Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp344004yba; Thu, 18 Apr 2019 02:10:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqyh4XHS9wWKxTWTeHbyQzI2cx6EAhhPcLQrzuoWB00J8S3ccx+k4WGz5FIQ7k+uq4OgC6SP X-Received: by 2002:a63:4644:: with SMTP id v4mr4532719pgk.422.1555578612724; Thu, 18 Apr 2019 02:10:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555578612; cv=none; d=google.com; s=arc-20160816; b=0CthOX0tT9rfP5tQIo7kGGVzEnqXRqXu/EifPdGR6vTrDe9jhcV/SO1ynXMxbXwiey woBGM86n1aTclJWkUuIDznIxUsNl7NGjtnIL8SfGyjVo6FFX2xoKdZJDIf0OliZEUdKc Cv3WB1Xchf/uxjmpQ/9KJxB2dv+6F6dZ1L6lj+/PY6/M+k6snHQFcez/yKvwwWXGJh8i oSrqQJ5wiu1OeedxHv9qjyqefB6apJLsrylwowzXkau8FInpvsQX4CMD0P6dsgu5i2tW YQFQAq+prspIF9EpLa9PqWuRGGTTdmWpoz1fXqVproM6wEccCx5+yRCVnK0l2SdGq70e pR3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=0vMXBxdj3wtSUcZk40eJ8wg5Rf0HhG9DQl3ART53gMY=; b=0PJfaZh7kBP6OrKzTuLQcygHNtn9uAHKytcdTCZIsBYfbSZfkoaH2K1t7wmebOujmt lL4+hKkYJTlVmezvsTxOkwALdSt6XgOdT9Mf3iFcPvAETazUz8RHC+B+VI+ijTtlCZl7 /4d1z2hWDx2Yn9BE0WbNyg/5wzW2H5KtpWkQNsrJG4mg28MOnnDHJgyl2LvDT3F+8471 NBNm1STocwKbD+spzEfndoTvC0QKGTxGUjN6E5ShQyMxth0F43gi8enMYyLBxue8CW7r TzWmpxVQUEY9bKw/hXr5WkxLGY3MINSEef72UDmXA4BsO3IjCoI9VQPaa7OyQLJWBton 1Chg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z189si1817907pfz.126.2019.04.18.02.09.58; Thu, 18 Apr 2019 02:10:12 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388557AbfDRJIn (ORCPT + 99 others); Thu, 18 Apr 2019 05:08:43 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:36159 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2388394AbfDRJIQ (ORCPT ); Thu, 18 Apr 2019 05:08:16 -0400 X-UUID: 595c95a974654552a558d74eab67a375-20190418 X-UUID: 595c95a974654552a558d74eab67a375-20190418 Received: from mtkcas09.mediatek.inc [(172.21.101.178)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1589109885; Thu, 18 Apr 2019 17:08:05 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs01n1.mediatek.inc (172.21.101.68) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 18 Apr 2019 17:08:04 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Thu, 18 Apr 2019 17:08:04 +0800 From: To: , CC: , , , , , Sean Wang Subject: [PATCH v1 2/4] Bluetooth: btmtksdio: Add a bit definition for CHLPCR Date: Thu, 18 Apr 2019 17:08:00 +0800 Message-ID: <59a2a29ece89c13ffc2c7cd32432c1731906f447.1555577565.git.sean.wang@mediatek.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sean Wang Add a register bit definition about CHLPCR bit 8 because the bit is quite different in the meaning between reading and writing that bit. The patch adds a definition particularly for the bit read to avoid the confusion about using write definition to read the bit. Signed-off-by: Sean Wang --- drivers/bluetooth/btmtksdio.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/bluetooth/btmtksdio.c b/drivers/bluetooth/btmtksdio.c index 681e3e34977e..9c123a9de673 100644 --- a/drivers/bluetooth/btmtksdio.c +++ b/drivers/bluetooth/btmtksdio.c @@ -56,7 +56,8 @@ static const struct sdio_device_id btmtksdio_table[] = { #define MTK_REG_CHLPCR 0x4 /* W1S */ #define C_INT_EN_SET BIT(0) #define C_INT_EN_CLR BIT(1) -#define C_FW_OWN_REQ_SET BIT(8) +#define C_FW_OWN_REQ_SET BIT(8) /* For write */ +#define C_COM_DRV_OWN BIT(8) /* For read */ #define C_FW_OWN_REQ_CLR BIT(9) #define MTK_REG_CSDIOCSR 0x8 @@ -526,7 +527,7 @@ static int btmtksdio_open(struct hci_dev *hdev) goto err_disable_func; err = readx_poll_timeout(btmtksdio_drv_own_query, bdev, status, - status & C_FW_OWN_REQ_SET, 2000, 1000000); + status & C_COM_DRV_OWN, 2000, 1000000); if (err < 0) { bt_dev_err(bdev->hdev, "Cannot get ownership from device"); goto err_disable_func; @@ -606,7 +607,7 @@ static int btmtksdio_close(struct hci_dev *hdev) sdio_writel(bdev->func, C_FW_OWN_REQ_SET, MTK_REG_CHLPCR, NULL); err = readx_poll_timeout(btmtksdio_drv_own_query, bdev, status, - !(status & C_FW_OWN_REQ_SET), 2000, 1000000); + !(status & C_COM_DRV_OWN), 2000, 1000000); if (err < 0) bt_dev_err(bdev->hdev, "Cannot return ownership to device"); -- 2.18.0