From: Yang Li <yang.li@amlogic.com>
To: Krzysztof Kozlowski <krzk@kernel.org>,
Marcel Holtmann <marcel@holtmann.org>,
Luiz Augusto von Dentz <luiz.dentz@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Catalin Marinas <catalin.marinas@arm.com>,
Will Deacon <will@kernel.org>
Cc: linux-bluetooth@vger.kernel.org, netdev@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org, Ye He <ye.he@amlogic.com>
Subject: Re: [PATCH v2 2/3] Bluetooth: hci_uart: Add support for Amlogic HCI UART
Date: Fri, 19 Jul 2024 16:26:11 +0800 [thread overview]
Message-ID: <3ebf010d-8dd3-4144-93b4-033cf2293d87@amlogic.com> (raw)
In-Reply-To: <0bfeee6a-a425-4892-a062-5ef91db305a3@kernel.org>
Dear Krzysztof
Thanks for the review.
On 2024/7/18 19:43, Krzysztof Kozlowski wrote:
> On 18/07/2024 09:42, Yang Li via B4 Relay wrote:
>> From: Yang Li <yang.li@amlogic.com>
>>
>> This patch introduces support for Amlogic Bluetooth controller over
>> UART. In order to send the final firmware at full speed. It is a pretty
>> straight forward H4 driver with exception of actually having it's own
>> setup address configuration.
>>
> ...
>
>> +static int aml_parse_dt(struct aml_serdev *amldev)
>> +{
>> + struct device *pdev = amldev->dev;
>> +
>> + amldev->bt_en_gpio = devm_gpiod_get(pdev, "bt-enable",
>> + GPIOD_OUT_LOW);
>> + if (IS_ERR(amldev->bt_en_gpio)) {
>> + dev_err(pdev, "Failed to acquire bt-enable gpios");
>> + return PTR_ERR(amldev->bt_en_gpio);
>> + }
>> +
>> + if (device_property_read_string(pdev, "firmware-name",
>> + &amldev->firmware_name)) {
>> + dev_err(pdev, "Failed to acquire firmware path");
>> + return -ENODEV;
>> + }
>> +
>> + amldev->bt_supply = devm_regulator_get(pdev, "bt");
>> + if (IS_ERR(amldev->bt_supply)) {
>> + dev_err(pdev, "Failed to acquire regulator");
>> + return PTR_ERR(amldev->bt_supply);
>> + }
>> +
>> + amldev->lpo_clk = devm_clk_get(pdev, NULL);
>> + if (IS_ERR(amldev->lpo_clk)) {
>> + dev_err(pdev, "Failed to acquire clock source");
>> + return PTR_ERR(amldev->lpo_clk);
>> + }
>> +
>> + /* get rf config parameter */
>> + if (device_property_read_u32(pdev, "antenna-number",
>> + &amldev->ant_number)) {
>> + dev_info(pdev, "No antenna-number, using default value");
>> + amldev->ant_number = 1;
>> + }
>> +
>> + return 0;
>> +}
>> +
>> +static int aml_power_on(struct aml_serdev *amldev)
>> +{
>> + int err;
>> +
>> + if (!IS_ERR(amldev->bt_supply)) {
> How is IS_ERR possible?
Well, I got it.
>
>> + err = regulator_enable(amldev->bt_supply);
>> + if (err) {
>> + dev_err(amldev->dev, "Failed to enable regulator: (%d)", err);
>> + return err;
>> + }
>> + }
>> +
>> + if (!IS_ERR(amldev->lpo_clk)) {
> How is IS_ERR possible?
I got it.
>
>> + err = clk_prepare_enable(amldev->lpo_clk);
>> + if (err) {
>> + dev_err(amldev->dev, "Failed to enable lpo clock: (%d)", err);
>> + return err;
>> + }
>> + }
>> +
>> + if (!IS_ERR(amldev->bt_en_gpio))
> How is IS_ERR possible?
I got it.
>
>> + gpiod_set_value_cansleep(amldev->bt_en_gpio, 1);
>> +
>> + /* wait 100ms for bluetooth controller power on */
>> + msleep(100);
>> + return 0;
>> +}
>
> Best regards,
> Krzysztof
>
next prev parent reply other threads:[~2024-07-19 8:26 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-18 7:42 [PATCH v2 0/3] Add support for Amlogic HCI UART Yang Li via B4 Relay
2024-07-18 7:42 ` [PATCH v2 1/3] dt-bindings: net: bluetooth: Add support for Amlogic Bluetooth Yang Li via B4 Relay
2024-07-18 8:38 ` Add support for Amlogic HCI UART bluez.test.bot
2024-07-18 11:40 ` [PATCH v2 1/3] dt-bindings: net: bluetooth: Add support for Amlogic Bluetooth Krzysztof Kozlowski
2024-07-19 8:20 ` Yang Li
2024-07-20 18:25 ` Krzysztof Kozlowski
2024-07-22 7:41 ` Yang Li
2024-07-22 7:58 ` Krzysztof Kozlowski
2024-07-24 6:48 ` Yang Li
2024-07-30 5:52 ` Yang Li
2024-07-18 7:42 ` [PATCH v2 2/3] Bluetooth: hci_uart: Add support for Amlogic HCI UART Yang Li via B4 Relay
2024-07-18 11:43 ` Krzysztof Kozlowski
2024-07-19 8:26 ` Yang Li [this message]
2024-07-18 18:43 ` Sai Krishna Gajula
2024-07-18 19:01 ` Luiz Augusto von Dentz
2024-07-19 9:05 ` Yang Li
2024-07-18 7:42 ` [PATCH v2 3/3] MAINTAINERS: Add an entry for Amlogic HCI UART (M: Yang Li) Yang Li via B4 Relay
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=3ebf010d-8dd3-4144-93b4-033cf2293d87@amlogic.com \
--to=yang.li@amlogic.com \
--cc=catalin.marinas@arm.com \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=krzk+dt@kernel.org \
--cc=krzk@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luiz.dentz@gmail.com \
--cc=marcel@holtmann.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=robh@kernel.org \
--cc=will@kernel.org \
--cc=ye.he@amlogic.com \
/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