Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp2780310pxb; Fri, 8 Oct 2021 15:22:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx4B27n5QKMZrLnSApZ/rZcV+cEaLGOzvk88Wqn+2b6iyJ4ZG62H6vi8+5ranLe18p4TGG1 X-Received: by 2002:a63:9d0d:: with SMTP id i13mr6706505pgd.117.1633731742542; Fri, 08 Oct 2021 15:22:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633731742; cv=none; d=google.com; s=arc-20160816; b=HdSX+4GzkaJXPSHfNPDSnwNOeA2rSrKu+AbvQX6zWTCarDwdSoFiDpBaaI0RuSUA5g ndzZjE1t651pZXkmnPA8nXADO0hK24Wi9Bo5bwn+Krv7gDrl+gZi6VNvNJhJM1SG9omc 3PFUEwqVTvdBfxl2lhONt4eEDEzdPDH/7GDdrUA05TLbxrt77jGXT3azFlobLgUsYJAn mKfbDTLjjNvHdb+hhnVGChxdHFh8R63vBeW86XC8nUnGNukilgXOq4QPLOzZxb1iLUoR 7l8C+hUvIdqlv8w56NGi6J97sNuwp/zRU/WfF32UoQglFuEh0Nk+Z6a2G7p38kD9lry5 65Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=n4i3s9T45XLolvmKakSmI3Bp6yKFDgWgZZukxSb+iRs=; b=VoZFdirIqwyGiH8wlx/C5SsgQdMCxMMx9YQyCqI+Egs5XNXS0v+VSiZ9JA1OeF8vtm 2MCQeCU6C/nLPE3r71JC7HXQNvULv64kl4PT3x2GAT38dAOkbmsC3++swHSpvlOCeLGT KHmSdukA7HL+UGgzhdzSQFFmAtfF/fz7sVhNyeebfkKt/xPBGkAWhXY49Q2/4KkNYlu7 FZo/jRCjm88qb7hbxGexUtjpHlYBVrzPMGHg4ayrTjyJPSV0TkUCwNhEGOdFlNZydBMt 4HS04lV5DRZHVF3gC6fK2Pdaurlg2YbU2IvpzRT/r7MWw3ceFYCiu5zEzCARomqBwfyg NL8A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b4si672804plm.94.2021.10.08.15.22.10; Fri, 08 Oct 2021 15:22:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243664AbhJHWXU (ORCPT + 99 others); Fri, 8 Oct 2021 18:23:20 -0400 Received: from mailgw01.mediatek.com ([216.200.240.184]:36675 "EHLO mailgw01.mediatek.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243642AbhJHWXI (ORCPT ); Fri, 8 Oct 2021 18:23:08 -0400 X-UUID: 431fb91993654d2b814cf9bbe0a2a408-20211008 X-UUID: 431fb91993654d2b814cf9bbe0a2a408-20211008 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1638295555; Fri, 08 Oct 2021 15:20:06 -0700 Received: from mtkcas10.mediatek.inc (172.21.101.39) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 8 Oct 2021 15:10:37 -0700 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Sat, 9 Oct 2021 06:10:36 +0800 From: To: , CC: , , , , , , , , , , , , , , , , , , , , , , , , , , , Mark-yw Chen Subject: [PATCH v1 04/10] Bluetooth: btmtksdio: explicitly set WHISR as write-1-clear Date: Sat, 9 Oct 2021 06:10:11 +0800 Message-ID: X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sean Wang That is a preliminary patch to introduce mt7921s support. Explicitly set WHISR as write-1-clear method to all devices that is the expected behavior the driver rely on. Co-developed-by: Mark-yw Chen Signed-off-by: Mark-yw Chen Signed-off-by: Sean Wang --- drivers/bluetooth/btmtksdio.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/drivers/bluetooth/btmtksdio.c b/drivers/bluetooth/btmtksdio.c index 77d1c4ac582d..57126a95e292 100644 --- a/drivers/bluetooth/btmtksdio.c +++ b/drivers/bluetooth/btmtksdio.c @@ -487,8 +487,8 @@ static void btmtksdio_interrupt(struct sdio_func *func) static int btmtksdio_open(struct hci_dev *hdev) { struct btmtksdio_dev *bdev = hci_get_drvdata(hdev); + u32 status, val; int err; - u32 status; sdio_claim_host(bdev->func); @@ -533,8 +533,13 @@ static int btmtksdio_open(struct hci_dev *hdev) if (err < 0) goto err_release_irq; - /* Setup write-1-clear for CHISR register */ - sdio_writel(bdev->func, C_INT_CLR_CTRL, MTK_REG_CHCR, &err); + /* Explitly set write-1-clear method */ + val = sdio_readl(bdev->func, MTK_REG_CHCR, &err); + if (err < 0) + goto err_release_irq; + + val |= C_INT_CLR_CTRL; + sdio_writel(bdev->func, val, MTK_REG_CHCR, &err); if (err < 0) goto err_release_irq; -- 2.25.1