Linux-mediatek Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: Luiz Augusto von Dentz <luiz.dentz@gmail.com>,
	Chen-Yu Tsai <wenst@chromium.org>
Cc: Marcel Holtmann <marcel@holtmann.org>,
	Sean Wang <sean.wang@kernel.org>,
	linux-bluetooth@vger.kernel.org,
	linux-mediatek@lists.infradead.org
Subject: Re: [PATCH RESEND] Bluetooth: btmtksdio: Lookup device node only as fallback
Date: Tue, 15 Oct 2024 10:46:00 +0200	[thread overview]
Message-ID: <f0b77d1a-b2b6-46a3-a6a1-44dc601e8584@collabora.com> (raw)
In-Reply-To: <CABBYNZ+UGx8TtW+aXZer_j=L79NYEP28+FcSeRqT3BKN7L+CGw@mail.gmail.com>

Il 08/10/24 15:39, Luiz Augusto von Dentz ha scritto:
> Hi,
> 
> On Tue, Oct 8, 2024 at 4:27 AM Chen-Yu Tsai <wenst@chromium.org> wrote:
>>
>> If the device tree is properly written, the SDIO function device node
>> should be correctly defined, and the mmc core in Linux should correctly
>> tie it to the device being probed.
>>
>> Only fall back to searching for the device node by compatible if the
>> original device node tied to the device is incorrect, as seen in older
>> device trees.
>>
>> Signed-off-by: Chen-Yu Tsai <wenst@chromium.org>
> 
> I was hoping to see some Reviewed-by/Tested-by here, were the mediatek
> made aware of these changes?
> 

Sorry I didn't see this patch in my .. rather big .. stack of patches :-D

I can confirm

Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> # 
MT8186 Corsola

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

Cheers,
Angelo

>> ---
>> Resending after three and a half months.
>>
>> This follows up on the MT7921S bluetooth binding and DT fixup patches [1].
>> This should not be backported.
>>
>> [1] https://lore.kernel.org/linux-bluetooth/20240412073046.1192744-1-wenst@chromium.org/
>>
>>   drivers/bluetooth/btmtksdio.c | 17 +++++++++++++++--
>>   1 file changed, 15 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/bluetooth/btmtksdio.c b/drivers/bluetooth/btmtksdio.c
>> index cc097aedc1e1..a1dfcfe43d3a 100644
>> --- a/drivers/bluetooth/btmtksdio.c
>> +++ b/drivers/bluetooth/btmtksdio.c
>> @@ -1328,6 +1328,8 @@ static int btmtksdio_probe(struct sdio_func *func,
>>   {
>>          struct btmtksdio_dev *bdev;
>>          struct hci_dev *hdev;
>> +       struct device_node *old_node;
>> +       bool restore_node;
>>          int err;
>>
>>          bdev = devm_kzalloc(&func->dev, sizeof(*bdev), GFP_KERNEL);
>> @@ -1411,13 +1413,24 @@ static int btmtksdio_probe(struct sdio_func *func,
>>          if (err)
>>                  bt_dev_err(hdev, "failed to initialize device wakeup");
>>
>> -       bdev->dev->of_node = of_find_compatible_node(NULL, NULL,
>> -                                                    "mediatek,mt7921s-bluetooth");
>> +       restore_node = false;
>> +       if (!of_device_is_compatible(bdev->dev->of_node, "mediatek,mt7921s-bluetooth")) {
>> +               restore_node = true;
>> +               old_node = bdev->dev->of_node;
>> +               bdev->dev->of_node = of_find_compatible_node(NULL, NULL,
>> +                                                            "mediatek,mt7921s-bluetooth");
>> +       }
>> +
>>          bdev->reset = devm_gpiod_get_optional(bdev->dev, "reset",
>>                                                GPIOD_OUT_LOW);
>>          if (IS_ERR(bdev->reset))
>>                  err = PTR_ERR(bdev->reset);
>>
>> +       if (restore_node) {
>> +               of_node_put(bdev->dev->of_node);
>> +               bdev->dev->of_node = old_node;
>> +       }
>> +
>>          return err;
>>   }
>>
>> --
>> 2.47.0.rc0.187.ge670bccf7e-goog
>>
> 
> 



  reply	other threads:[~2024-10-15  8:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-08  8:27 [PATCH RESEND] Bluetooth: btmtksdio: Lookup device node only as fallback Chen-Yu Tsai
2024-10-08 13:39 ` Luiz Augusto von Dentz
2024-10-15  8:46   ` AngeloGioacchino Del Regno [this message]
2024-10-15 16:30 ` patchwork-bot+bluetooth

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=f0b77d1a-b2b6-46a3-a6a1-44dc601e8584@collabora.com \
    --to=angelogioacchino.delregno@collabora.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=luiz.dentz@gmail.com \
    --cc=marcel@holtmann.org \
    --cc=sean.wang@kernel.org \
    --cc=wenst@chromium.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