From: Orlando Chamberlain <orlandoch.dev@gmail.com>
To: Aditya Garg <gargaditya08@live.com>
Cc: Jiri Kosina <jikos@kernel.org>,
bentiss@kernel.org, linux-input@vger.kernel.org,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] HID: apple: Add support for magic keyboard backlight on T2 Macs
Date: Tue, 2 Jul 2024 08:57:23 +1000 [thread overview]
Message-ID: <B28CFBDD-16ED-41AE-AE4A-92066D0DD4D8@gmail.com> (raw)
In-Reply-To: <8DC4D384-1349-4C8A-848D-589BA25B15D2@gmail.com>
> On 2 Jul 2024, at 8:48 AM, Orlando Chamberlain <orlandoch.dev@gmail.com> wrote:
>
>> On 2 Jul 2024, at 4:19 AM, Aditya Garg <gargaditya08@live.com> wrote:
>> Apparently this patch is breaking touchbar functionality is some cases.
>
> I think this is because apple_magic_backlight_init will return an error when it finds the touchbar interface, but this return value is not checked, so hid-apple still binds to the touchbar backlight.
We may also need to make sure hid_hw_stop is called in this case. Perhaps we can move this logic from apple_magic_backlight_init to apple_probe?
>
> This should be fixable so I don't think we need to still have the separate driver.
>
>>>
>>> static int apple_probe(struct hid_device *hdev,
>>> const struct hid_device_id *id)
>>> {
>>> @@ -860,6 +940,9 @@ static int apple_probe(struct hid_device *hdev,
>>> if (quirks & APPLE_BACKLIGHT_CTL)
>>> apple_backlight_init(hdev);
>>>
>>> + if (quirks & APPLE_MAGIC_BACKLIGHT)
>>> + apple_magic_backlight_init(hdev);
>
> return value isn't checked here ^, we return 0 unconditionally below.
>
>>> +
>>> return 0;
>>> }
next prev parent reply other threads:[~2024-07-01 22:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-01 10:45 [PATCH] HID: apple: Add support for magic keyboard backlight on T2 Macs Aditya Garg
2024-07-01 18:19 ` Aditya Garg
2024-07-01 22:48 ` Orlando Chamberlain
2024-07-01 22:57 ` Orlando Chamberlain [this message]
2024-07-02 9:50 ` Aditya Garg
2024-07-03 11:13 ` Aditya Garg
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=B28CFBDD-16ED-41AE-AE4A-92066D0DD4D8@gmail.com \
--to=orlandoch.dev@gmail.com \
--cc=bentiss@kernel.org \
--cc=gargaditya08@live.com \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.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