Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp1255883imc; Mon, 11 Mar 2019 09:40:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqyrAM47qKRILmNWLcTMDKTIqAelsfpV0qP1vxlr84Eb7SglOCW1wsBMDVEvg5By79Xkhd1M X-Received: by 2002:a17:902:8690:: with SMTP id g16mr34512208plo.284.1552322405632; Mon, 11 Mar 2019 09:40:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552322405; cv=none; d=google.com; s=arc-20160816; b=lIGK+CWZG3b0we8Vow+2BT3qF8Fz00NN0uzczKaWvzD9dCSxjFlPU135Q4I38sIo2K wy7zZEcp1L2Qtwe6XFsRCFEEc8NGi9jHxJ75SzzKTHwgSedeXN640bnooSRMHdqM6EdT 4nMJ1SqoeaULJeBABIuHbAk2baqsYs2lY0SeBmt9H8cfvg8+EMWNJ+n8usFcqJIM3Gx4 RmNZPL2t4v0YDcDcm1ShQ3SncP8NoohZN9JSLX5i4T7NLc+fd/qbVHWXYEpR9E4M76hX HK9fxV92vrbuK3xxowhib3FKAiLFh2bo0SaMmk0jbk/Y2ZrKsJ7Mor9ab5iKt3AMyWOa gM+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version; bh=NZlXcymTqL0CKY79RYKt09FLiSPrhrASu5HGqIauWGA=; b=qnGEYgUks6klJQyJonkRl4orYuU41hTFKZ7OD2bRv50ucqeYNqchvApKmSHCTYoRwB fuCmx8xGUh84Fd3ilKsEIBKSVCIrUAWhFZiwHMrfNXaiFFNVOKMbw+EBcSJ/2x1Pc/2f 08pWm2BzwyHLKrtNDgYhiEjyUyLGup3yHbBE2GkyEafaxN8o3xVpNdvOx/vldJsFLUaN oyY7Ujw70IkQUJGCFmxCd2LNtHkEBQ9vnS7On2nSDCduiH5E1dMFQpyaBL5SirsB+EkR duGjPxtUtGtihaNdeDhSLJkgzNUhbxVxG/ZgK1Bt6pggT30XLkp7KylREgWCJVYSE+90 n8sw== 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 d5si5769849pla.312.2019.03.11.09.39.50; Mon, 11 Mar 2019 09:40:05 -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 S1727882AbfCKQiz convert rfc822-to-8bit (ORCPT + 99 others); Mon, 11 Mar 2019 12:38:55 -0400 Received: from coyote.holtmann.net ([212.227.132.17]:46926 "EHLO mail.holtmann.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726675AbfCKQiy (ORCPT ); Mon, 11 Mar 2019 12:38:54 -0400 Received: from marcel-macpro.fritz.box (p4FEFC449.dip0.t-ipconnect.de [79.239.196.73]) by mail.holtmann.org (Postfix) with ESMTPSA id ADE59CF2C9; Mon, 11 Mar 2019 17:46:50 +0100 (CET) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: [PATCH v1 2/2] Bluetooth: mediatek: add support for MediaTek MT7663S and MT7668S SDIO devices From: Marcel Holtmann In-Reply-To: <89776e11d742196e50e2d5f3ccc4336dc5aee134.1552007059.git.sean.wang@mediatek.com> Date: Mon, 11 Mar 2019 17:38:51 +0100 Cc: Johan Hedberg , Ulf Hansson , "open list:BLUETOOTH DRIVERS" , linux-mediatek@lists.infradead.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8BIT Message-Id: <71123002-4772-4BDC-BFEF-4C520F4459FE@holtmann.org> References: <89776e11d742196e50e2d5f3ccc4336dc5aee134.1552007059.git.sean.wang@mediatek.com> To: Sean Wang X-Mailer: Apple Mail (2.3445.102.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Sean, > This adds the support of enabling MT7663S and MT7668S SDIO-based > Bluetooth function. > > There are quite many differences between MT766[3,8]S and standard > Bluetooth SDIO devices such as Type-A and Type-B devices. For example, > MT766[3,8]S have its own SDIO registers layout, definition, SDIO packet > format, and the specific flow should be programmed on them to complete > the device initialization and low power control and so on. > > Currently, there are many independent programming sequences from the > transport which are exactly the same as the ones in btusb.c about MediaTek > support [1] and btmtkuart.c. We can try to split the transport independent > Bluetooth setups on the advance, place them into the common files and allow > varous transport drivers to reuse them in the future. > > [1] http://lists.infradead.org/pipermail/linux-mediatek/2019-January/017074.html > > Signed-off-by: Sean Wang > --- > drivers/bluetooth/Kconfig | 11 + > drivers/bluetooth/Makefile | 1 + > drivers/bluetooth/btmtksdio.c | 979 ++++++++++++++++++++++++++++++++++ > 3 files changed, 991 insertions(+) > create mode 100644 drivers/bluetooth/btmtksdio.c patch has been applied to bluetooth-next tree. You also need to send an extra patch providing a fix for this: CC drivers/bluetooth/btmtksdio.o drivers/bluetooth/btmtksdio.c: In function ‘btmtksdio_interrupt’: drivers/bluetooth/btmtksdio.c:470:2: warning: ‘old_len’ may be used uninitialized in this function [-Wmaybe-uninitialized] print_hex_dump(KERN_ERR, "err sdio rx: ", DUMP_PREFIX_NONE, 4, 1, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ old_data, old_len, true); ~~~~~~~~~~~~~~~~~~~~~~~~ drivers/bluetooth/btmtksdio.c:376:15: note: ‘old_len’ was declared here unsigned int old_len; ^~~~~~~ drivers/bluetooth/btmtksdio.c:470:2: warning: ‘old_data’ may be used uninitialized in this function [-Wmaybe-uninitialized] print_hex_dump(KERN_ERR, "err sdio rx: ", DUMP_PREFIX_NONE, 4, 1, ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ old_data, old_len, true); ~~~~~~~~~~~~~~~~~~~~~~~~ drivers/bluetooth/btmtksdio.c:375:17: note: ‘old_data’ was declared here unsigned char *old_data; ^~~~~~~~ And can we actually introduce module_sdio_driver similar to module_usb_driver. Regards Marcel