[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6c846999-9d64-4c3a-9d57-570dba0d48c7@perex.cz>
Date: Sun, 22 Dec 2024 14:30:26 +0100
From: Jaroslav Kysela <perex@...ex.cz>
To: Ilpo Järvinen <ilpo.jarvinen@...ux.intel.com>,
Jackie Dong <xy-jackie@....com>
Cc: ike.pan@...onical.com, Hans de Goede <hdegoede@...hat.com>,
tiwai@...e.com, bo.liu@...arytech.com, kovalev@...linux.org, me@...herl.one,
jaroslaw.janik@...il.com, cs@...edo.de, songxiebing@...inos.cn,
kailang@...ltek.com, sbinding@...nsource.cirrus.com,
simont@...nsource.cirrus.com, josh@...huagrisham.com,
rf@...nsource.cirrus.com, LKML <linux-kernel@...r.kernel.org>,
platform-driver-x86@...r.kernel.org, linux-sound@...r.kernel.org,
Mark Pearson <mpearson-lenovo@...ebb.ca>, waterflowdeg@...il.com,
Jackie Dong <dongeg1@...ovo.com>
Subject: Re: [PATCH 1/2] platform/x86: ideapad-laptop: Support for mic and
audio leds.
On 19. 12. 24 12:40, Ilpo Järvinen wrote:
> On Thu, 19 Dec 2024, Jackie Dong wrote:
...
>> +};
>> +
>> static int ideapad_input_init(struct ideapad_private *priv)
>> {
>> struct input_dev *inputdev;
>> @@ -2023,15 +2033,145 @@ static void ideapad_check_features(struct ideapad_private *priv)
>> /*
>> * WMI driver
>> */
>> +#define IDEAPAD_ACPI_LED_MAX (((SNDRV_CTL_ELEM_ACCESS_MIC_LED -\
>> + SNDRV_CTL_ELEM_ACCESS_SPK_LED) >> SNDRV_CTL_ELEM_ACCESS_LED_SHIFT) + 1)
>
> Hmm, so you fix the math bug (2-1 is not 2 but 1) with that +1 in the end?
>
> I think you would want something like this here (but I'm not entirely
> sure at this point of reading your change):
>
> FIELD_GET(SNDRV_CTL_ELEM_ACCESS_MIC_LED, SNDRV_CTL_ELEM_ACCESS_MIC_LED)
>
> (Remember to make sure you've include for FIELD_GET if that's the correct
> way to go here).
There's no reason to use SNDRV_CTL_ELEM_ACCESS definitions here (no direct
connection to the sound control API). I would use direct value 2 here, because
this extension controls only 2 LEDs.
Jaroslav
--
Jaroslav Kysela <perex@...ex.cz>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.
Powered by blists - more mailing lists