From: Sean Wang <sean.wang@mediatek.com>
To: Marcel Holtmann <marcel@holtmann.org>
Cc: Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Johan Hedberg <johan.hedberg@gmail.com>,
devicetree <devicetree@vger.kernel.org>,
BlueZ development <linux-bluetooth@vger.kernel.org>,
linux-arm-kernel <linux-arm-kernel@lists.infradead.org>,
linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 6/7] Bluetooth: hci_mediatek: Add protocol support for MediaTek serial devices
Date: Fri, 27 Apr 2018 17:14:28 +0800 [thread overview]
Message-ID: <1524820468.12322.205.camel@mtkswgap22> (raw)
In-Reply-To: <BBFEF77F-BE5D-4092-BB2B-8844C10CC34E@holtmann.org>
On Fri, 2018-04-27 at 07:25 +0200, Marcel Holtmann wrote:
> Hi Sean,
>
> >>>>> This adds a driver for the MediaTek serial protocol based on H4 protocol,
> >>>>> which can enable the built-in Bluetooth device inside MT7622 SoC.
> >>>>>
> >>>>> Signed-off-by: Sean Wang <sean.wang@mediatek.com>
> >>>>> ---
> >
[... snip ...]
> >
> > where could I find the newest btuart.c (which seems cannot be found in
> > 4.17 rc2)? It seems a time to rewrite the driver based on btuart.c
>
> It is not merged yet. I posted RFC patches to the mailing list.
>
got it.
> >
> > the Bluetooth device can't survive in a power/down cycle and
> >
> > * power on should be including
> > - enable clk and power domain
> > - download firmware through specific ACL command
> > - send specific commands to configure bluetooth (Required to note that
> > the steps should be after downloading firmware because the behavior for
> > the command might be changed by the firmware)
>
> Then this sounds like you need a quirk that runs setup() after every open() and not just after the first open(). You would be the first hardware that looses their firmware, but that is fine, I almost expect that at some point someone comes along and requires this. So just create a new HCI_QUIRK_NON_PERSISTENT_SETUP.
>
Yes, it should be good to have an option HCI_QUIRK_NON_PERSISTENT_SETUP
to allow us to run setup() for every open().
When users are feeling unexpected thing happening on its device, they
always have a habit trying to restart device from UI.
If close() -> open() can completely power reset a bluetooth device and
then it can recover from any fatal error to the initial state as at
boot. It's good for these problems specially hard to be reproduced and
required to reboot the whole machine to save.
However, it would take a little longer time on open() since it takes
extra time to make firmware download and reconfiguration.
> > * power off should be including
> > - send specific commands, such as to disable bluetooth
>
> So try to put these in shutdown()
>
got it.
> > - disable power domain and clk
>
> And do this in close().
>
got it.
> >
> >>>
> >>>>> +
> >>>>> + return err;
[ ... snip ....]
> .open = mtk_open,
> >>
>
> Go with a brand new btmtkuart.c driver. I really sounds you don’t want the hci_ldisc.c framework in your way. You want direct control over the core callbacks.
>
1)
In fact. the device is working via a internal serial bus, rather than
via uart for mt7622. so could i call it btmtkserial.c ?
Becasue mediatek indeed also have bluetooth over uart, if i called it
btmtkserialc, the same code logic I think can be fit to all other
devices using either uart or internal serial bus.
2)
Yes, i don't want hci_ldisc. so far i thought serdev version is enough,
and i preferred that bluetotoh device don't depend on any utility on
user space to launch.
3)
last question
if i have bluetooth over usb, the usb version bluetooth can reuse
btmtkserial.c code?
> Regards
>
> Marcel
>
next prev parent reply other threads:[~2018-04-27 9:14 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-03 7:15 [PATCH v1 0/7] add support for Bluetooth on MT7622 SoC sean.wang
2018-04-03 7:15 ` [PATCH v1 1/7] dt-bindings: net: bluetooth: Add mediatek-bluetooth sean.wang
2018-04-09 21:16 ` Rob Herring
2018-04-03 7:15 ` [PATCH v1 2/7] serdev: add dev_pm_domain_attach|detach() sean.wang
2018-04-03 10:29 ` Marcel Holtmann
2018-04-26 5:29 ` Sean Wang
2018-04-03 7:15 ` [PATCH v1 3/7] soc: mediatek: reuse read[l,x]_poll_timeout helpers sean.wang
2018-04-18 15:06 ` Matthias Brugger
2018-04-03 7:15 ` [PATCH v1 4/7] soc: mediatek: reuse regmap_read_poll_timeout helpers sean.wang
2018-04-19 10:23 ` Matthias Brugger
2018-04-20 3:42 ` Sean Wang
2018-04-03 7:15 ` [PATCH v1 5/7] soc: mediatek: add a fixed wait for SRAM stable sean.wang
2018-04-05 16:42 ` Sasha Levin
2018-04-19 10:33 ` Matthias Brugger
2018-04-20 3:49 ` Sean Wang
2018-04-23 8:58 ` Sean Wang
2018-04-03 7:15 ` [PATCH v1 6/7] Bluetooth: hci_mediatek: Add protocol support for MediaTek serial devices sean.wang
2018-04-03 10:27 ` Marcel Holtmann
2018-04-26 7:34 ` Sean Wang
2018-04-26 9:47 ` Marcel Holtmann
2018-04-27 4:13 ` Sean Wang
2018-04-27 5:25 ` Marcel Holtmann
2018-04-27 9:14 ` Sean Wang [this message]
2018-04-27 16:34 ` Marcel Holtmann
2018-05-08 6:48 ` Sean Wang
2018-05-08 7:27 ` Marcel Holtmann
2018-05-08 8:22 ` Sean Wang
2018-05-08 11:18 ` Marcel Holtmann
2018-05-10 6:45 ` Sean Wang
2018-04-03 12:13 ` [RFC PATCH] Bluetooth: hci_mediatek: mtk_recv_frame() can be static kbuild test robot
2018-04-03 12:13 ` [PATCH v1 6/7] Bluetooth: hci_mediatek: Add protocol support for MediaTek serial devices kbuild test robot
2018-04-03 7:15 ` [PATCH v1 7/7] MAINTAINERS: add an entry for MediaTek Bluetooth driver sean.wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1524820468.12322.205.camel@mtkswgap22 \
--to=sean.wang@mediatek.com \
--cc=devicetree@vger.kernel.org \
--cc=johan.hedberg@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=marcel@holtmann.org \
--cc=mark.rutland@arm.com \
--cc=robh+dt@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).