public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Balakrishna Godavarthi <bgodavar@codeaurora.org>
To: Matthias Kaehlcke <mka@chromium.org>
Cc: marcel@holtmann.org, johan.hedberg@gmail.com,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
	linux-bluetooth@vger.kernel.org, thierry.escande@linaro.org,
	rtatiya@codeaurora.org, hemantg@codeaurora.org,
	linux-arm-msm@vger.kernel.org
Subject: Re: [PATCH v11 7/7] Bluetooth: hci_qca: Add support for Qualcomm Bluetooth chip wcn3990
Date: Tue, 31 Jul 2018 20:13:52 +0530	[thread overview]
Message-ID: <8a8c786f2c668681032a59888ffc020d@codeaurora.org> (raw)
In-Reply-To: <20180730205502.GC68975@google.com>

Hi Matthias,

On 2018-07-31 02:25, Matthias Kaehlcke wrote:
> On Fri, Jul 27, 2018 at 07:43:20PM +0530, Balakrishna Godavarthi wrote:
>> From: Balakrishna Godavarthi <bgodavar@codeaurora.org>
>> 
>> Add support to set voltage/current of various regulators
>> to power up/down Bluetooth chip wcn3990.
>> 
>> Signed-off-by: Balakrishna Godavarthi <bgodavar@codeaurora.org>
>> ---
>> Changes in v11:
>>     * removed support to read regulator currents from dts.
>>     * updated review comments.
> 
> Updated regulator voltage ranges?
> 
>> +static int qca_wcn3990_init(struct hci_uart *hu, u32 *soc_ver)
>> +{
>> +	struct hci_dev *hdev = hu->hdev;
>> +	int i, ret;
>> +
>> +	/* wcn3990 is a discrete Bluetooth chip connected to SoC.
>> +	 * sometimes we will face communication synchronization issues,
>> +	 * like reading version command timeouts. In which HCI_SETUP fails,
>> +	 * to overcome these issues, we try to communicate by performing an
>> +	 * cold power off and on.
>> +	 */
>> +	for (i = 0; i <= 3; i++) {
>> +		ret = qca_power_setup(hu, true);
>> +		if (ret)
>> +			goto regs_off;
>> +
>> +		/* Forcefully enable wcn3990 to enter in to boot mode. */
>> +		host_set_baudrate(hu, 2400);
>> +		ret = qca_send_power_pulse(hdev, QCA_WCN3990_POWEROFF_PULSE);
>> +		if (ret)
>> +			goto regs_off;
>> +
>> +		qca_set_speed(hu, QCA_INIT_SPEED);
>> +		ret = qca_send_power_pulse(hdev, QCA_WCN3990_POWERON_PULSE);
>> +		if (ret)
>> +			goto regs_off;
>> +
>> +		/* Wait for 100 ms for SoC to boot */
>> +		msleep(100);
>> +
>> +		/* Now the device is in ready state to communicate with host.
>> +		 * To sync host with device we need to reopen port.
>> +		 * Without this, we will have RTS and CTS synchronization
>> +		 * issues.
>> +		 */
>> +		serdev_device_close(hu->serdev);
>> +		ret = serdev_device_open(hu->serdev);
>> +		if (ret) {
>> +			bt_dev_err(hu->hdev, "failed to open port");
>> +			break;
>> +		}
>> +
>> +		hci_uart_set_flow_control(hu, false);
>> +		ret = qca_read_soc_version(hdev, soc_ver);
>> +
>> +		if (!ret)
>> +			break;
>> +
>> +regs_off:
>> +		bt_dev_err(hdev, "retrying to establish communication: %d",
>> +			   i + 1);
>> +		qca_power_shutdown(hdev);
>> +	}
>> +
>> +	return ret;
>> +}
> 
> I'm still not convinced that the retry loop is needed/desirable, I
> commented on the discussion on v10.
> 
[Bala] : replied on v10 patch.

>> +static const struct qca_vreg_data qca_soc_data = {
>> +	.soc_type = QCA_WCN3990,
>> +	.vregs = (struct qca_vreg []) {
>> +		{ "vddio",   1800000, 1900000,  15000  },
>> +		{ "vddxo",   1800000, 1900000,  80000  },
>> +		{ "vddrf",   1300000, 1350000,  300000 },
>> +		{ "vddch0",  3300000, 3400000,  450000 },
>> +	},
> 
> In v10 this was:
> 
> 		{ "vddio",   1800000, 1800000,  15000  },
> 		{ "vddxo",   1800000, 1800000,  80000  },
> 		{ "vddrf",   1304000, 1304000,  300000 },
> 		{ "vddch0",  3000000, 3312000,  450000 },
> 
> I don't have concerns about the new voltage ranges, but you should
> mention such changes in the changelog, ideally with a brief
> description why the change was made.

[Bala]: I missed to add, I just updated with latest values from 
datasheet.

-- 
Regards
Balakrishna.

      reply	other threads:[~2018-07-31 14:43 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-27 14:13 [PATCH v11 0/7] Enable Bluetooth functionality for WCN3990 Balakrishna Godavarthi
2018-07-27 14:13 ` [PATCH v11 1/7] dt-bindings: net: bluetooth: Add device tree bindings for QTI chip wcn3990 Balakrishna Godavarthi
2018-07-27 14:13 ` [PATCH v11 2/7] Bluetooth: btqca: Rename ROME specific functions to generic functions Balakrishna Godavarthi
2018-07-27 14:13 ` [PATCH v11 3/7] Bluetooth: btqca: Redefine qca_uart_setup() to generic function Balakrishna Godavarthi
2018-07-30 18:37   ` Matthias Kaehlcke
2018-07-31 10:20     ` Balakrishna Godavarthi
2018-07-27 14:13 ` [PATCH v11 4/7] Bluetooth: hci_qca: Add wrapper functions for setting UART speed Balakrishna Godavarthi
2018-07-27 14:13 ` [PATCH v11 5/7] Bluetooth: hci_qca: Enable 3.2 Mbps operating speed Balakrishna Godavarthi
2018-07-27 14:13 ` [PATCH v11 6/7] Bluetooth: btqca: Add wcn3990 firmware download support Balakrishna Godavarthi
2018-07-27 14:13 ` [PATCH v11 7/7] Bluetooth: hci_qca: Add support for Qualcomm Bluetooth chip wcn3990 Balakrishna Godavarthi
2018-07-30 20:55   ` Matthias Kaehlcke
2018-07-31 14:43     ` Balakrishna Godavarthi [this message]

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=8a8c786f2c668681032a59888ffc020d@codeaurora.org \
    --to=bgodavar@codeaurora.org \
    --cc=devicetree@vger.kernel.org \
    --cc=hemantg@codeaurora.org \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcel@holtmann.org \
    --cc=mka@chromium.org \
    --cc=rtatiya@codeaurora.org \
    --cc=thierry.escande@linaro.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