From: Matthias Kaehlcke <mka@chromium.org>
To: Balakrishna Godavarthi <bgodavar@codeaurora.org>
Cc: marcel@holtmann.org, johan.hedberg@gmail.com,
linux-bluetooth@vger.kernel.org, rtatiya@codeaurora.org,
hemantg@codeaurora.org, linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH v4 2/3] Bluetooth: hci_qca: Add support for Qualcomm Bluetooth chip wcn3990.
Date: Wed, 9 May 2018 10:24:25 -0700 [thread overview]
Message-ID: <20180509172425.GH19594@google.com> (raw)
In-Reply-To: <595e02f711f40a104ed86b7eb06b28d7@codeaurora.org>
Hi Balakrishna,
On Wed, May 09, 2018 at 03:37:34PM +0530, Balakrishna Godavarthi wrote:
> Hi,
> Please find my comments inline.
>
> On 2018-05-05 06:47, Matthias Kaehlcke wrote:
> > Hi,
> >
> > On Fri, May 04, 2018 at 09:05:05PM +0530, Balakrishna Godavarthi wrote:
> > > Add support to set voltage/current of various regulators
> > > to power up/down Bluetooth chip wcn3990.
> > > Add support to read baudrate from dts.
> > >
> > > Signed-off-by: Balakrishna Godavarthi <bgodavar@codeaurora.org>
> > > ---
> > > drivers/bluetooth/hci_qca.c | 555
> > > ++++++++++++++++++++++++++++++++++++++------
> > > 1 file changed, 483 insertions(+), 72 deletions(-)
> > >
> > > diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c
> > > index f05382b..075fab7 100644
> > > --- a/drivers/bluetooth/hci_qca.c
> > > +++ b/drivers/bluetooth/hci_qca.c
> > > ...
> > > - bt_dev_info(hdev, "ROME setup");
> > > + /* disable flow control, as chip is still not turned on */
> > > + hci_uart_set_flow_control(hu, true);
> >
> > The interface of this function is confusing. enable = true disables
> > flow control ... Not the fault of this driver though :)
> [Bala]: yes it is bit confusing. i taught to update.. but not sure of
> impact.
> so instead of updating, using the same function and written a
> comment above.
Sure, not much you can do about it. Just mentioned it since I was
about to comment that things are done inversely, but tean checked
hci_uart_set_flow_control() and saw that it has this odd
interface. Folks more familiar with the Bluetooth subsystem are
probably already used to it ;-)
> > > - if (speed)
> > > - host_set_baudrate(hu, speed);
> > > + /* Enable flow control */
> > > + hci_uart_set_flow_control(hu, false);
> > > + /* wait until flow control settled */
> > > + mdelay(100);
> >
> > A busy wait of 100ms doesn't seem a good idea. Use msleep()
> > instead. Is it really necessary to wait that long?
> [Bala]: yes this delay is required for BT Soc to bootup and settle down.
:(
> > What follows looks similar to the Cherokee path. I didn't look at all
> > the details, but it's probably possible to share some more code.
> [Bala]: yes these are two different chip.
> we also have difference in setup. the follwing are major differences
> Cherokee uses flow control. where ROME flow control is disabled.
> ON sequence also varies.
Ok, I'll give it another pass in the next revision to see if I have
suggestions to make it at least a bit less redundant.
> > > +static const struct btqca_vreg_data cherokee_data = {
> > > + .soc_type = BTQCA_CHEROKEE,
> > > + .vregs = (struct btqca_vreg []) {
> > > + { "vddio", 1352000, 1352000, 0 },
> > > + { "vddxtal", 1904000, 2040000, 0 },
> > > + { "vddcore", 1800000, 1800000, 1 },
> > > + { "vddpa", 130400, 1304000, 1 },
> >
> > 0 missing for min_v?
>
> [Bala]: min_v is the minimum voltage required for BT chip.
I referred to the value '130400', which happens to be exactly 1/10 of
the max_v '1304000', so I suspect the voltages are the same and a zero
is missing.
> > > + regulator_set_voltage(qca->vreg_bulk[i].consumer,
> > > + vregs[i].min_v,
> > > + vregs[i].max_v);
> >
> > Check return value.
> [Bala]: i am checking the status for regulator enable
> do we really require to check the status. as this same regulators
> are used by different sub systems.
> we will get an error during regulator enable when voltages are not
> settled down.
regulator_set_voltage() could fail due to requesting a voltage range
not supported by the regulator. In this case regulator_enable() could
still succeed, but not supply the requested voltage.
Thanks
Matthias
next prev parent reply other threads:[~2018-05-09 17:24 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-04 15:35 [PATCH v4 0/3] Enable Bluetooth functionality for WCN3990 Balakrishna Godavarthi
2018-05-04 15:35 ` [PATCH v4 1/3] dt-bindings: net: bluetooth: Add device tree bindings for QTI chip wcn3990 Balakrishna Godavarthi
2018-05-04 15:35 ` [PATCH v4 2/3] Bluetooth: hci_qca: Add support for Qualcomm Bluetooth " Balakrishna Godavarthi
2018-05-05 1:17 ` Matthias Kaehlcke
2018-05-09 8:56 ` Balakrishna Godavarthi
2018-05-09 9:27 ` Balakrishna Godavarthi
2018-05-09 10:07 ` Balakrishna Godavarthi
2018-05-09 17:24 ` Matthias Kaehlcke [this message]
2018-05-10 16:01 ` Balakrishna Godavarthi
2018-05-05 19:21 ` kbuild test robot
2018-05-05 19:45 ` kbuild test robot
2018-05-05 20:11 ` [RFC PATCH] Bluetooth: hci_qca: btqca_disable_regulators() can be static kbuild test robot
2018-05-04 15:35 ` [PATCH v4 3/3] Bluetooth: btqca: Add wcn3990 firmware download support Balakrishna Godavarthi
2018-05-05 19:11 ` kbuild test robot
2018-05-05 19:14 ` kbuild test robot
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=20180509172425.GH19594@google.com \
--to=mka@chromium.org \
--cc=bgodavar@codeaurora.org \
--cc=hemantg@codeaurora.org \
--cc=johan.hedberg@gmail.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=marcel@holtmann.org \
--cc=rtatiya@codeaurora.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.