From: Pavel Machek <pavel@ucw.cz>
To: Takashi Iwai <tiwai@suse.de>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>,
Ayman Bagabas <ayman.bagabas@gmail.com>,
ALSA Development Mailing List <alsa-devel@alsa-project.org>,
Hui Wang <hui.wang@canonical.com>,
Andy Shevchenko <andy@infradead.org>,
Darren Hart <dvhart@infradead.org>,
Jaroslav Kysela <perex@perex.cz>,
Kailang Yang <kailang@realtek.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Platform Driver <platform-driver-x86@vger.kernel.org>
Subject: Re: [PATCH v3 3/3] ALSA: hda: add support for Huawei WMI micmute LED
Date: Sat, 24 Nov 2018 11:41:57 +0100 [thread overview]
Message-ID: <20181124104157.GA17954@amd> (raw)
In-Reply-To: <s5hftvq99qe.wl-tiwai@suse.de>
[-- Attachment #1: Type: text/plain, Size: 4249 bytes --]
Hi!
> > > > > > > > > You have general-purpose LED, yet you are treating it as "something
> > > > > > > > > special". That means ugly code (quoted above) and lack of flexibility.
> > > > > > > > >
> >
> > > > I'd prefer this to be normal LED and "mic muted" to become normal
> > > > trigger.
> > >
> > > But how would you solve the existing problem?
> > >
> > > As already mentioned, you'll need to hook the LED trigger and the
> > > actual mixer value change. This is the biggest missing piece, and
> > > it's the very reason we have the exported symbol from the platform
> > > driver side.
> > >
> > > So, if you prefer in that way, please implement that for the existing
> > > driver (thinkpad_acpi and dell-laptop) at first. I'll be really happy
> > > to get rid of the present ugly solution! But it's been there just
> > > because it's not so trivial at all. FWIW, this must be all done
> > > inside the kernel; otherwise you'll hit a regression.
> >
> > Ok, what about something like this?
> >
> > Tested, and it did not work. I guess I hooked it up at the wrong place
> > in LED subsystem... or maybe thinkpad x60 is wrong machine to test on.
I meant to say "wrong place in ALSA subsystem".
> > Anyway, it looks less ugly than current code in alsa. We should not
> > really be using mixer settings to turn LED on and off.
> >
> > Plus, it works in similar way triggers and LEDs "usually" do, and has
> > all the flexibility.
>
> Yes, thanks, that's something similar as what I had in mind, too.
> I guess it's just a matter of thinkpad_acpi side implementation that
> differs from your expectation.
>
> However, one remaining problem is that the state will be inconsistent
> depending on the driver module order, if we get rid of the dynamic
> symbol binding. Then both modules become completely individual and
> thinkpad_acpi can be loaded at anytime later than HD-audio codec.
> If a mixer state is already changed before loading thinkpad_acpi, this
> event is lost and the state may be different in both sides.
> So, we'd need to record the state in the mute-trigger side, and add a
> function to return the current state. Then thinkpad_acpi will query
> the state at the initialization time.
We want to record state at mute-trigger side, yes. Should not be
really different from other triggers.
> Also, we'll need also the normal mute LED in addition to the mic mute
> LED, so there need to be two triggers.
Yes.
> In anyway, moving to this direction requires the leds class
> implementation for dell-laptop.c as well as the new huawei stuff. So,
> I'd really like to have the "already good working" code before
> actually hacking this, so that we can see and track the functional
> regression more obviously.
As well as thinkpad; note I did not do that part, because I don't have
that LED on my test machine.
Anyway, normally we get the architecture right and only then we merge
the drivers.
All Huawei hackers need to do is to convert their driver into normal
LED driver, and test it with some other trigger (like heartbeat). Then
we can be fairly sure it will work when we get the micmute done.
> I can start hacking this in the next week. At least I have a Dell
> laptop and I can check the part of the changes locally.
>
> Since the changes will be fairly cross-tree, it's better to have an
> immutable branch to start with. I'd branch off at 4.20-rc3 (or rc4),
> apply the current patches, so that it can be merged to all relevant
> trees cleanly.
As you will not change any core LED code, I don't think any heavy
synchronization with LED tree should be neccessary. We have LED
triggers living outside drivers/leds/triggers, too, such as
drivers/usb/common/led.c .
(Actually, that's the beauty of the LED subsystem. You have standard
trigger. You have standard LED -- which says it prefers that trigger if
available. They are really independend, so you can test and merge them
separately).
Let me know if you need any more help.
Best regards,
Pavel
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
next prev parent reply other threads:[~2018-11-24 10:42 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-08 17:16 [PATCH v3 0/3] Huawei laptops Ayman Bagabas
2018-11-08 17:16 ` [PATCH v3 1/3] x86: add support for Huawei WMI hotkeys Ayman Bagabas
2018-11-08 19:58 ` Andy Shevchenko
2018-11-09 3:52 ` ayman.bagabas
2018-11-09 10:40 ` Andy Shevchenko
2018-11-08 17:16 ` [PATCH v3 2/3] ALSA: hda: fix front speakers on Huawei MBXP Ayman Bagabas
2018-11-09 8:55 ` Takashi Iwai
2018-11-08 17:16 ` [PATCH v3 3/3] ALSA: hda: add support for Huawei WMI micmute LED Ayman Bagabas
2018-11-09 9:01 ` Takashi Iwai
[not found] ` <CAB3uXr7-YW+yND1EC_wt8ptgnhUZLaYsoxJbs-vcWvOeEy6+Zw@mail.gmail.com>
2018-11-09 13:28 ` Takashi Iwai
2018-11-19 23:57 ` Pavel Machek
2018-11-20 7:07 ` Takashi Iwai
2018-11-20 9:10 ` Pavel Machek
2018-11-20 9:23 ` Takashi Iwai
2018-11-20 9:36 ` Pavel Machek
2018-11-20 9:49 ` Takashi Iwai
2018-11-20 11:51 ` Pavel Machek
2018-11-20 12:19 ` Takashi Iwai
2018-11-22 11:36 ` Andy Shevchenko
2018-11-22 13:18 ` Pavel Machek
2018-11-22 13:43 ` Takashi Iwai
2018-11-23 22:05 ` Pavel Machek
2018-11-23 23:33 ` Pavel Machek
2018-11-24 8:10 ` Takashi Iwai
2018-11-24 10:41 ` Pavel Machek [this message]
2018-11-22 13:12 ` Pavel Machek
2018-11-22 13:14 ` Takashi Iwai
2018-11-08 19:59 ` [PATCH v3 0/3] Huawei laptops Andy Shevchenko
2018-11-09 3:38 ` ayman.bagabas
2018-11-09 7:41 ` Takashi Iwai
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=20181124104157.GA17954@amd \
--to=pavel@ucw.cz \
--cc=alsa-devel@alsa-project.org \
--cc=andy.shevchenko@gmail.com \
--cc=andy@infradead.org \
--cc=ayman.bagabas@gmail.com \
--cc=dvhart@infradead.org \
--cc=hui.wang@canonical.com \
--cc=kailang@realtek.com \
--cc=linux-kernel@vger.kernel.org \
--cc=perex@perex.cz \
--cc=platform-driver-x86@vger.kernel.org \
--cc=tiwai@suse.de \
/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