From patchwork Tue Feb 13 07:31:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 13554583 Received: from mail-ej1-f46.google.com (mail-ej1-f46.google.com [209.85.218.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6F4AC20B27; Tue, 13 Feb 2024 07:31:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707809501; cv=none; b=blwlSUnP2//DP2XIF7A7BqB5Zzc1d1BcgItx7wRn/+A372LgWzr5l+zFlMH+FcC0t4iPrTU14Aed6V8J/eVpl9ZUHCmIPvb/bNp0wxelseB9cApHvoZN+iaroIRyyU6ZCLMMU2rtIiwAFonbz493OLInDmEGIrslsG8RNZiNPeI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707809501; c=relaxed/simple; bh=IEP5Pp/MGyp4bSvWtxsqiSvIpWE8fFGf72aSgQ1kxZQ=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=NF3UOOrnv+YT7ynK5e74BKr45N77RRRRkMukl4Lt/QqGYAqwXqds02/xoptLNGPmSAqi/mGWEqTghN1fbeMnhlEfU7R0k4yD6zmMaozH878epSV+gA6wp3U8cOTBx7d0wS2yMpjxQUpG0A9PuAODg5QzDCCMhpXQhgbSaz4Da2Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=O2gvB3Cz; arc=none smtp.client-ip=209.85.218.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="O2gvB3Cz" Received: by mail-ej1-f46.google.com with SMTP id a640c23a62f3a-a3cc8f0c97fso160231966b.0; Mon, 12 Feb 2024 23:31:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707809497; x=1708414297; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:references:cc:to :from:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=g601Zqjiouh4eSRY41DYHDQ8iYJQProKGT5aNIaSf7E=; b=O2gvB3CztE3resBL+g0YLokAVv56ZuqLTVZjUHRAghlFo3e3ZdG9YKmHgJEvK0s+ZZ b6dCfygS/Qjjoi7vKdzl5FBTcUa31pTNYxb3no0HqdMQe88RQ3O8uL/Dr0p6Z6NldxRW 5B+6u3AxwJb5rsJo0i4EqndEdO8qotShOWsO/g5r2fADHhm/Kvr5yWpjrRPXgqUxLc7f TXGu/wLk0IPdo++1AvYuUzoFgqDzA9SPbV//drHSdScKvR12UqeHhkDYQG1OmFvbWTfm W18jH+1pmYrvAZlO2zFEsyFUxo43FL4scp4JjFLGrbnBTonTI8lG8xsESkNmWj1zHFcn 2t4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707809497; x=1708414297; h=content-transfer-encoding:in-reply-to:autocrypt:references:cc:to :from:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=g601Zqjiouh4eSRY41DYHDQ8iYJQProKGT5aNIaSf7E=; b=O2EXYj4GvzOWH+4EIwcr5G3+Dy3wkDlJCS02dLcOVL2a8URHOBvvecksemxgg+ZDQn OwTqm7XQa/yUeMUHcLlplURxazGjtEoCXu+qQr5/0BJRjgyBk9JUV+6a5xegoRQCSfeS Z2GvXTKopcs7rqPwdC/OtfkVZ+6p356IeDL6ffLsowSKB3KhQcNXjn0P7N1Y4iKgyKTR R2Iq7F1atDBmYB64lZGwz8Rl2HJqY9qF9jSyRmRZa9nzUJ8Ic1oq/xR6pFZlHpmt2RyD QNWkw1kI5dWuRiBYoaUkRc+vPJCL2DMSyMHxzzqgFUoMot9pUJQny15+MM/TNzWMdbsL jhSw== X-Forwarded-Encrypted: i=1; AJvYcCWvduAZ2NbpByD58bjSrhiuFACPzuVTv8/MD8aBICWlf68e3aw9qshxXQRwFmnygOXX93yrpM9kUGnjuwQA55JO05+lLRDi/ugyfznZR5fJdqYtwKgGmO4dhPv9WOHsbcOQ+L/ODnJn7nW4cw53LI3stG0H2Opyo21HZSRoi9Xrld5JxgY= X-Gm-Message-State: AOJu0YxEPK5+OGh25iJkKrUVNBms4ZyFGq+qrLK56U+xPfz5TTmfcFd0 e2sokdfnQZXXEFoU09WLYMBTLcCiRmXLknlzp2JjU/iDyBIpCPfM X-Google-Smtp-Source: AGHT+IF14vaqlG+OMUECtGu7dVBCPCGJGCGmNm2FBhOnQDSUpoqKW013cesdu609Zp9DxWikvZncWg== X-Received: by 2002:a17:906:3597:b0:a3c:f544:2ca9 with SMTP id o23-20020a170906359700b00a3cf5442ca9mr927715ejb.4.1707809496759; Mon, 12 Feb 2024 23:31:36 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCV2aIstHq/V+jsPSTtE3dNM+hD0JEODLZ84A0bpv0yAohlvXiS6cACLRTSeq0QwO+JmS8d4UP10Y66xZwG3eZQQq0gUcKvKTWOoMV98QET4rUGLzBXWf5XcRoQASn4Nnamn1uIp7I/Qy4gv+i+32qPEUJrs69fUIEOOswEF2n+Mw3iMt3vGg/v4xFb7rKuKit9jTjHRpWvUjnIV0aUgIC3WlB4d6lfTcbd99R2qsw99NmDS+AfXvito6Wc2dNjD/B4Pd/hqo583tZPlLrhQFxu4AWPOYkflrNYk4iR1qvYoc4WwrDQ9imz51Ig= Received: from ?IPV6:2a01:c23:bdaf:b200:457b:b235:98c6:f76b? (dynamic-2a01-0c23-bdaf-b200-457b-b235-98c6-f76b.c23.pool.telefonica.de. [2a01:c23:bdaf:b200:457b:b235:98c6:f76b]) by smtp.googlemail.com with ESMTPSA id vh2-20020a170907d38200b00a3d08f3283fsm251555ejc.104.2024.02.12.23.31.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 12 Feb 2024 23:31:36 -0800 (PST) Message-ID: <5dff96ac-8ccd-401d-a6a9-19800b7143f0@gmail.com> Date: Tue, 13 Feb 2024 08:31:38 +0100 Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 1/4] leds: trigger: Store brightness set by led_trigger_event() Content-Language: en-US From: Heiner Kallweit To: Pavel Machek , Lee Jones , Jaroslav Kysela , Takashi Iwai , Dmitry Torokhov , Thomas Bogendoerfer Cc: "linux-leds@vger.kernel.org" , linux-sound@vger.kernel.org, "open list:HID CORE LAYER" , linux-mips@vger.kernel.org References: <30d49088-283c-40f3-b97b-fd5f5174a467@gmail.com> Autocrypt: addr=hkallweit1@gmail.com; keydata= xsFNBF/0ZFUBEAC0eZyktSE7ZNO1SFXL6cQ4i4g6Ah3mOUIXSB4pCY5kQ6OLKHh0FlOD5/5/ sY7IoIouzOjyFdFPnz4Bl3927ClT567hUJJ+SNaFEiJ9vadI6vZm2gcY4ExdIevYHWe1msJF MVE4yNwdS+UsPeCF/6CQQTzHc+n7DomE7fjJD5J1hOJjqz2XWe71fTvYXzxCFLwXXbBiqDC9 dNqOe5odPsa4TsWZ09T33g5n2nzTJs4Zw8fCy8rLqix/raVsqr8fw5qM66MVtdmEljFaJ9N8 /W56qGCp+H8Igk/F7CjlbWXiOlKHA25mPTmbVp7VlFsvsmMokr/imQr+0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UhLgeam8yglyO+A6RXCh+s6ak Wje7Vo1wGK4eYxp6pwMPJXLMsI0ii/2k3YPEJPv+yJf90MbYyQSbkTwZhrsokjQEaIfjrIk3 rQRjTve/J62WIO28IbY/mENuGgWehRlTAbhC4BLTZ5uYS0YMQCR7v9UGMWdNWXFyrOB6PjSu Trn9MsPoUc8qI72mVpxEXQDLlrd2ijEWm7Nrf52YMD7hL6rXXuis7R6zY8WnnBhW0uCfhajx q+KuARXC0sDLztcjaS3ayXonpoCPZep2Bd5xqE4Ln8/COCslP7E92W1uf1EcdXXIrx1acg21 H/0Z53okMykVs3a8tECPHIxnre2UxKdTbCEkjkR4V6JyplTS47oWMw3zyI7zkaadfzVFBxk2 lo/Tny+FX1Azea3Ce7oOnRUEZtWSsUidtIjmL8YUQFZYm+JUIgfRmSpMFq8JP4VH43GXpB/S OCrl+/xujzvoUBFV/cHKjEQYBxo+MaiQa1U54ykM2W4DnHb1UiEf5xDkFd4= In-Reply-To: <30d49088-283c-40f3-b97b-fd5f5174a467@gmail.com> If a simple trigger is assigned to a LED, then the LED may be off until the next led_trigger_event() call. This may be an issue for simple triggers with rare led_trigger_event() calls, e.g. power supply charging indicators (drivers/power/supply/power_supply_leds.c). Therefore persist the brightness value of the last led_trigger_event() call and use this value if the trigger is assigned to a LED. In addition add a getter for the trigger brightness value. Signed-off-by: Heiner Kallweit --- drivers/leds/led-triggers.c | 6 ++++-- include/linux/leds.h | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/drivers/leds/led-triggers.c b/drivers/leds/led-triggers.c index 0f5ac3005..b1b323b19 100644 --- a/drivers/leds/led-triggers.c +++ b/drivers/leds/led-triggers.c @@ -194,11 +194,11 @@ int led_trigger_set(struct led_classdev *led_cdev, struct led_trigger *trig) spin_unlock(&trig->leddev_list_lock); led_cdev->trigger = trig; + ret = 0; if (trig->activate) ret = trig->activate(led_cdev); else - ret = 0; - + led_set_brightness(led_cdev, trig->brightness); if (ret) goto err_activate; @@ -387,6 +387,8 @@ void led_trigger_event(struct led_trigger *trig, if (!trig) return; + trig->brightness = brightness; + rcu_read_lock(); list_for_each_entry_rcu(led_cdev, &trig->led_cdevs, trig_list) led_set_brightness(led_cdev, brightness); diff --git a/include/linux/leds.h b/include/linux/leds.h index 7598d4729..48fff5980 100644 --- a/include/linux/leds.h +++ b/include/linux/leds.h @@ -455,6 +455,9 @@ struct led_trigger { int (*activate)(struct led_classdev *led_cdev); void (*deactivate)(struct led_classdev *led_cdev); + /* Brightness set by led_trigger_event */ + enum led_brightness brightness; + /* LED-private triggers have this set */ struct led_hw_trigger_type *trigger_type; @@ -508,6 +511,12 @@ static inline void *led_get_trigger_data(struct led_classdev *led_cdev) return led_cdev->trigger_data; } +static inline enum led_brightness +led_trigger_get_brightness(const struct led_trigger *trigger) +{ + return trigger ? trigger->brightness : LED_OFF; +} + #define module_led_trigger(__led_trigger) \ module_driver(__led_trigger, led_trigger_register, \ led_trigger_unregister) @@ -544,6 +553,12 @@ static inline void *led_get_trigger_data(struct led_classdev *led_cdev) return NULL; } +static inline enum led_brightness +led_trigger_get_brightness(const struct led_trigger *trigger) +{ + return LED_OFF; +} + #endif /* CONFIG_LEDS_TRIGGERS */ /* Trigger specific enum */ From patchwork Tue Feb 13 07:32:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 13554584 Received: from mail-ej1-f42.google.com (mail-ej1-f42.google.com [209.85.218.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 67AB614291; Tue, 13 Feb 2024 07:32:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707809553; cv=none; b=QrJXFy/Fza9CaKwURwfq9pOCgmT99+0PUr4lTl4PgFe9xg17Nujbptc9sLbELmvLPfyjoKjJsXcgR9fGPLDOyzGsC30t/UrAsPTuzuW0FApRKSAlX86lzB/lie3MZu4HGK5OxmItIFeGFsCMbQYmZFFt0mh36boHNw6QkFmwQ6A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707809553; c=relaxed/simple; bh=NajG3i6+q3PjrLOiV0Moz2Vg8qd5eN29XdfIyf14FXc=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=dJAFI+gvDKyhZ+hco/2HOzh0uX3SsCADmJkzy3jTsYG8QYihCCj6ouzLOEoF4x1VsGX1NOJEEeXqrSHEorR/MODR5xWSOivJRcq27wm4KyVJqb7ZzoIEUaold2C6NES6bziDRKgQWS8XX8FG7TO2bVXPXl50kt2O2fNfeNcd+z4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=AbL8Xi7l; arc=none smtp.client-ip=209.85.218.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="AbL8Xi7l" Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-a38271c0bd5so497136866b.0; Mon, 12 Feb 2024 23:32:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707809549; x=1708414349; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:references:cc:to :from:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=Obr7s4SU8ucDOWXyyEnl/wXENLxRIoz08KK3pAwpxf4=; b=AbL8Xi7lRigy97JGBXK5nn4z1gohdrFhyQduqNYvQzzMKXFxwN9cY6eGlB+Bf0597W gPY2zPiDc20TT7I7fD0YlfEj7gtGVak7yJ+GHc0NjBTdamALEODPgknED82QWKAhDhSW lI4hOADlBeMHLIpGWGhLU/I55vr4XnImwVvrksP0nOltR/DKKvCo0tHoMEthdm/FsN/3 /Vjwmh/eWnSEurhqTLkTYrHIA/M2xCAPTnlD5F23D+vVKVinfd80ctdWgl4h6tbnIrOv +SKJ/M49vP65SVAUd6xmt3Hhrw23PWy0M3qEqprtcWq1XwT19tKR1wpN6at6cRhz4FJu xp1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707809549; x=1708414349; h=content-transfer-encoding:in-reply-to:autocrypt:references:cc:to :from:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Obr7s4SU8ucDOWXyyEnl/wXENLxRIoz08KK3pAwpxf4=; b=GheSvIzTiMoRrAUkPYKbnSmpWI6P2gdBtXByohUVG+C/93pyI7/Wlhq251tU5FVfTO hXolQcHf2/1NUfK3yfPYqxkctmherWFp7FW+x0cdBtprAzK9IMbh4yYfqotsDOkISqqb 3zmot+vRhsaGOaOexirK6yQjbmt/KpxwKOpFYkRUex7vUOQ5RRTC8osnYu5AJ9XXOfZo pDI0p/GKz2TsoCkd+rEu3o5OUjac/LO4iyKgXpNJdgI439RpCEanVLoxgDHFZRLENh2/ i2MSH8lyvKzC7dINgwt1qZiC2Plf/rdz0CDc5gWKGF2wf0nrTrXJB/UGtx0s+W288MhU xXlA== X-Forwarded-Encrypted: i=1; AJvYcCVPdFEdrthA42ijmandW6bbPDeBoUniub1CaMg8wa/ASemUk1swvKomZ2UvfkC5aCayq91juSrcMJYIJzAC5YL64mE5rJNhXv8QHqhpf6gFY0QOKGqqo6vwWCTfZpVYh3K/DP2hbehzXphUN4Fzy06jTQxNAj8IBvpgNJL9pwtg6Un3gA0= X-Gm-Message-State: AOJu0YzCdpiSGNLSE6pDyi2dJ6V0A7YEGyIvgvZjrzfWwJL7VI4vlZTB dgjIKckigHre1cBuENTnMcPfXDgr22ZlLHquwHJZeNfgOUSdMs9b X-Google-Smtp-Source: AGHT+IEltaiHsMtSZennMcjIkW+E5kBbU1CFi+QWneGyD05yJ8UhbSGoo36/aRJTrplqSyXAa57izA== X-Received: by 2002:a17:906:c57:b0:a3d:57f:5b91 with SMTP id t23-20020a1709060c5700b00a3d057f5b91mr464217ejf.74.1707809549230; Mon, 12 Feb 2024 23:32:29 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCXpjA9HaAeQ94rYYPvufxgYEHK0joPd0rqN0ndcsS6VeQ0fAP1JDErxQJ1/vNy/Oy6qNi3MT8v2NcHZh7EHakXgtAZ65kw5U2hcVbzIxIB8f/hmfpuchQii9akmiNznruUpbT2CnquU/1vbCVWBZaJ99S1OKX1j1jB4XlvZMb4t4C86HXRPsx1Ii/yx9Po9p7ni7K/UN4ocAl1yw+v0FIa4MWUYPXDy0AsW8TvXR6AfuKSgrjqoseIXqBAplJBp8rKsUKIP1ZleQEzAXPazqiAg0WvGEbhbhLYdWbqD30XUhjvWQuPCS2Dhj4k= Received: from ?IPV6:2a01:c23:bdaf:b200:457b:b235:98c6:f76b? (dynamic-2a01-0c23-bdaf-b200-457b-b235-98c6-f76b.c23.pool.telefonica.de. [2a01:c23:bdaf:b200:457b:b235:98c6:f76b]) by smtp.googlemail.com with ESMTPSA id vh2-20020a170907d38200b00a3d08f3283fsm251555ejc.104.2024.02.12.23.32.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 12 Feb 2024 23:32:28 -0800 (PST) Message-ID: <1e1dfb3a-f808-43a4-8df9-6f861f56eec9@gmail.com> Date: Tue, 13 Feb 2024 08:32:30 +0100 Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 2/4] ALSA: control-led: Integrate mute led trigger Content-Language: en-US From: Heiner Kallweit To: Pavel Machek , Lee Jones , Jaroslav Kysela , Takashi Iwai , Dmitry Torokhov , Thomas Bogendoerfer Cc: "linux-leds@vger.kernel.org" , linux-sound@vger.kernel.org, "open list:HID CORE LAYER" , linux-mips@vger.kernel.org References: <30d49088-283c-40f3-b97b-fd5f5174a467@gmail.com> Autocrypt: addr=hkallweit1@gmail.com; keydata= xsFNBF/0ZFUBEAC0eZyktSE7ZNO1SFXL6cQ4i4g6Ah3mOUIXSB4pCY5kQ6OLKHh0FlOD5/5/ sY7IoIouzOjyFdFPnz4Bl3927ClT567hUJJ+SNaFEiJ9vadI6vZm2gcY4ExdIevYHWe1msJF MVE4yNwdS+UsPeCF/6CQQTzHc+n7DomE7fjJD5J1hOJjqz2XWe71fTvYXzxCFLwXXbBiqDC9 dNqOe5odPsa4TsWZ09T33g5n2nzTJs4Zw8fCy8rLqix/raVsqr8fw5qM66MVtdmEljFaJ9N8 /W56qGCp+H8Igk/F7CjlbWXiOlKHA25mPTmbVp7VlFsvsmMokr/imQr+0nXtmvYVaKEUwY2g 86IU6RAOuA8E0J5bD/BeyZdMyVEtX1kT404UJZekFytJZrDZetwxM/cAH+1fMx4z751WJmxQ J7mIXSPuDfeJhRDt9sGM6aRVfXbZt+wBogxyXepmnlv9K4A13z9DVLdKLrYUiu9/5QEl6fgI kPaXlAZmJsQfoKbmPqCHVRYj1lpQtDM/2/BO6gHASflWUHzwmBVZbS/XRs64uJO8CB3+V3fa cIivllReueGCMsHh6/8wgPAyopXOWOxbLsZ291fmZqIR0L5Y6b2HvdFN1Xhc+YrQ8TKK+Z4R mJRDh0wNQ8Gm89g92/YkHji4jIWlp2fwzCcx5+lZCQ1XdqAiHQARAQABzSZIZWluZXIgS2Fs bHdlaXQgPGhrYWxsd2VpdDFAZ21haWwuY29tPsLBjgQTAQgAOBYhBGx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gfRmSpMFq8JP4VH43GXpB/S OCrl+/xujzvoUBFV/cHKjEQYBxo+MaiQa1U54ykM2W4DnHb1UiEf5xDkFd4= In-Reply-To: <30d49088-283c-40f3-b97b-fd5f5174a467@gmail.com> This driver is the only one calling ledtrig_audio_set(), therefore the LED audio trigger isn't usable standalone. So it makes sense to fully integrate LED audio triger handling here. The module aliases ensure that the driver is auto-loaded (if built as module) if a LED device has one of the two audio triggers as default trigger. Signed-off-by: Heiner Kallweit --- sound/core/control_led.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/sound/core/control_led.c b/sound/core/control_led.c index a78eb4892..b9d650380 100644 --- a/sound/core/control_led.c +++ b/sound/core/control_led.c @@ -53,6 +53,7 @@ struct snd_ctl_led_ctl { static DEFINE_MUTEX(snd_ctl_led_mutex); static bool snd_ctl_led_card_valid[SNDRV_CARDS]; +static struct led_trigger *snd_ctl_ledtrig_audio[NUM_AUDIO_LEDS]; static struct snd_ctl_led snd_ctl_leds[MAX_LED] = { { .name = "speaker", @@ -176,8 +177,11 @@ static void snd_ctl_led_set_state(struct snd_card *card, unsigned int access, case MODE_FOLLOW_ROUTE: if (route >= 0) route ^= 1; break; case MODE_FOLLOW_MUTE: /* noop */ break; } - if (route >= 0) - ledtrig_audio_set(led->trigger_type, route ? LED_OFF : LED_ON); + if (route >= 0) { + struct led_trigger *trig = snd_ctl_ledtrig_audio[led->trigger_type]; + + led_trigger_event(trig, route ? LED_OFF : LED_ON); + } } static struct snd_ctl_led_ctl *snd_ctl_led_find(struct snd_kcontrol *kctl, unsigned int ioff) @@ -442,8 +446,9 @@ static ssize_t brightness_show(struct device *dev, struct device_attribute *attr, char *buf) { struct snd_ctl_led *led = container_of(dev, struct snd_ctl_led, dev); + struct led_trigger *trig = snd_ctl_ledtrig_audio[led->trigger_type]; - return sysfs_emit(buf, "%u\n", ledtrig_audio_get(led->trigger_type)); + return sysfs_emit(buf, "%u\n", led_trigger_get_brightness(trig)); } static DEVICE_ATTR_RW(mode); @@ -736,6 +741,9 @@ static int __init snd_ctl_led_init(void) struct snd_ctl_led *led; unsigned int group; + led_trigger_register_simple("audio-mute", &snd_ctl_ledtrig_audio[LED_AUDIO_MUTE]); + led_trigger_register_simple("audio-micmute", &snd_ctl_ledtrig_audio[LED_AUDIO_MICMUTE]); + device_initialize(&snd_ctl_led_dev); snd_ctl_led_dev.class = &sound_class; snd_ctl_led_dev.release = snd_ctl_led_dev_release; @@ -788,7 +796,13 @@ static void __exit snd_ctl_led_exit(void) } device_unregister(&snd_ctl_led_dev); snd_ctl_led_clean(NULL); + + led_trigger_unregister_simple(snd_ctl_ledtrig_audio[LED_AUDIO_MUTE]); + led_trigger_unregister_simple(snd_ctl_ledtrig_audio[LED_AUDIO_MICMUTE]); } module_init(snd_ctl_led_init) module_exit(snd_ctl_led_exit) + +MODULE_ALIAS("ledtrig:audio-mute"); +MODULE_ALIAS("ledtrig:audio-micmute"); From patchwork Tue Feb 13 07:33:24 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 13554618 Received: from mail-ej1-f47.google.com (mail-ej1-f47.google.com [209.85.218.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6D6441757B; Tue, 13 Feb 2024 07:33:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707809607; cv=none; b=pZ5LguAQddWmHEF+xoHW/+xpPO0uNKHdXX65MZpFk6Y51l51QBz9s1xExaT+FFOWM4PPv85RcNBClycB/Y1EOQLiirhcMFbZa8W9bfqhb3Wdp46nboLJKqFvEYgAreLBeFewkT6ZhqddLGQ09fO1Z7zIyXyCVww/Kio0zmSKtrk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707809607; c=relaxed/simple; bh=SEML+0TPkSCmWBIBFvxbSaih2xERndEmc1I8Koj7DxI=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=SnNGCf/waKIgYMKaf+3a4w99AwxGZquXr1tfMvx4oKKMHDUCHyPG9SJGhEIn3aANZriplVY88UUxCoC1Fm/zus7Cu360GNzZ6ul0/Tc2MIRVJK+ZDEpjjQzf+F1jVSEBA8j/HoK7EZJPfnNokGSf57QYq4Q0u6jXmHm0/HM7ZNM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=BRPvLJvH; arc=none smtp.client-ip=209.85.218.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="BRPvLJvH" Received: by mail-ej1-f47.google.com with SMTP id a640c23a62f3a-a30f7c9574eso69071466b.0; Mon, 12 Feb 2024 23:33:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707809603; x=1708414403; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:references:cc:to :from:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=eA4K5JikTKOOhX+zkD3OEmddfXb7zVrNQEOiJut+G2o=; b=BRPvLJvH0L7RbO1pZSKNAdGnhR3u+ZKAR1VOx03qj6iG8sx3Z9doylM9hzQ97n8Ugo hj5uwq/CfyHqKlhHlvvAW88vDdjQwNS7w22Lsiss8/sFQoE7vwV4pfCwpNlzHhUfrt31 8p//mOXWRucTL70nG2LR6q0oYab54npsYR+NcuVLBSW8V4sDiu8vRl3YsqlmZOmevebe 7Gja9bLjtyufYo3nksixvcMGfoavCArre7aYmZkfIGqU3PhwMlV6G7NoaZ87KklkwD1e PDiTyoWXUN3qK3Mzbil4kY/B+uyr7BQa7+EWGhtM+0qGpAAuj9HTnxGtf0yv7y9UvQFN G1Kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707809603; x=1708414403; h=content-transfer-encoding:in-reply-to:autocrypt:references:cc:to :from:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=eA4K5JikTKOOhX+zkD3OEmddfXb7zVrNQEOiJut+G2o=; b=uAVFPTON1rJxXg9hl6f/YcGWi2YEmrzgHWXbk7Q1gVtFv2jIhQXh36iBE6q9DyW2RV UnjA4nkJDRda/McgpB35B9MvHs9TI8ggDjvCzscS0msMAe//HPEV4+KfQCNa8Ja3CvWQ H4PwvnF32myChcAABhteItnc+zehw3Y7HLSUq3ZLju/dRdJ/W8rdZlmPylwChi90HK/4 AT2pbQtJH3W9Hhd2cgMMuadEh0Z8+QeMUXQrSt/VLwLF6odZgikwCrc+yFR9DVh4GBtK TWQGgaf3VeCKNKDhachE3i5muWRndDGEZ8ZLJPmUOA1g7WWiLuWWaqk+MPYrnOIK+Api XJLA== X-Forwarded-Encrypted: i=1; AJvYcCXgnR0M4AND/84kezmdvPJ5v52JcOPp/lW73FbKP22UhUbDY+a/k+R7eBKtXOxLudlt6phWoYgxL0IGPcsxc1sypYQvWJ2gjCq58W7BwED5tm3A1/gmGT4L1f3SCBNWd8zludMbaMTemeq7wA1myaU4UDEM5ZeI2RN9vOy207pWsfZG+sU= X-Gm-Message-State: AOJu0Yy4YBkT7gS+VbA5DsZ2W0qWHr7x2l2dN9VBBG+i65NlB0Wgyumj K6CnTDFeCLTWnJDiA2zcWVr9KvD1ni7idznIBfY+/mKOYOpOImuc X-Google-Smtp-Source: AGHT+IG9qhurMCbNaYom5yQcrUj8srNmhS+wiT0qd7jNFQwq9Uwz572+Mnee3XUurgTA+4fZ9r2LJw== X-Received: by 2002:a17:906:e0d1:b0:a3c:ceff:e83 with SMTP id gl17-20020a170906e0d100b00a3cceff0e83mr2295219ejb.74.1707809603330; Mon, 12 Feb 2024 23:33:23 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCXFcdTjOhzgIlC8PyQ4I4+WnW7eFksdn5gTDmKJ8FjB6MUs6nHWMQdhPfHZDV75p+tw9hpE5UMCRMG+VUq/CsteKvRreh2kti8/mImn1vRIxFBc2LFPSIy8Yhh8L1aR2dzGTK/Gl9oRYXJe2o5hzi2a24+2dnbVaniItoTyVqWmRKDD4oRt+u6Ab6V1NqwgRhAY8cJnA+ui6GZh/qe7U8TrNDYMbNNGl0q3kCvUOEHwir67gl+p4XC1LPSY8TcFuOmqPxfBoA1C+BjSnwMeSCxkcqDZRB5YTRyvGG70iNrCBQUMA2C8dtkjLFg= Received: from ?IPV6:2a01:c23:bdaf:b200:457b:b235:98c6:f76b? (dynamic-2a01-0c23-bdaf-b200-457b-b235-98c6-f76b.c23.pool.telefonica.de. [2a01:c23:bdaf:b200:457b:b235:98c6:f76b]) by smtp.googlemail.com with ESMTPSA id vh2-20020a170907d38200b00a3d08f3283fsm251555ejc.104.2024.02.12.23.33.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 12 Feb 2024 23:33:23 -0800 (PST) Message-ID: Date: Tue, 13 Feb 2024 08:33:24 +0100 Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 3/4] Input: leds: Prepare for removal of config option LEDS_AUDIO_TRIGGER Content-Language: en-US From: Heiner Kallweit To: Pavel Machek , Lee Jones , Jaroslav Kysela , Takashi Iwai , Dmitry Torokhov , Thomas Bogendoerfer Cc: "linux-leds@vger.kernel.org" , linux-sound@vger.kernel.org, "open list:HID CORE LAYER" , linux-mips@vger.kernel.org References: <30d49088-283c-40f3-b97b-fd5f5174a467@gmail.com> Autocrypt: addr=hkallweit1@gmail.com; keydata= xsFNBF/0ZFUBEAC0eZyktSE7ZNO1SFXL6cQ4i4g6Ah3mOUIXSB4pCY5kQ6OLKHh0FlOD5/5/ sY7IoIouzOjyFdFPnz4Bl3927ClT567hUJJ+SNaFEiJ9vadI6vZm2gcY4ExdIevYHWe1msJF MVE4yNwdS+UsPeCF/6CQQTzHc+n7DomE7fjJD5J1hOJjqz2XWe71fTvYXzxCFLwXXbBiqDC9 dNqOe5odPsa4TsWZ09T33g5n2nzTJs4Zw8fCy8rLqix/raVsqr8fw5qM66MVtdmEljFaJ9N8 /W56qGCp+H8Igk/F7CjlbWXiOlKHA25mPTmbVp7VlFsvsmMokr/imQr+0nXtmvYVaKEUwY2g 86IU6RAOuA8E0J5bD/BeyZdMyVEtX1kT404UJZekFytJZrDZetwxM/cAH+1fMx4z751WJmxQ J7mIXSPuDfeJhRDt9sGM6aRVfXbZt+wBogxyXepmnlv9K4A13z9DVLdKLrYUiu9/5QEl6fgI kPaXlAZmJsQfoKbmPqCHVRYj1lpQtDM/2/BO6gHASflWUHzwmBVZbS/XRs64uJO8CB3+V3fa cIivllReueGCMsHh6/8wgPAyopXOWOxbLsZ291fmZqIR0L5Y6b2HvdFN1Xhc+YrQ8TKK+Z4R mJRDh0wNQ8Gm89g92/YkHji4jIWlp2fwzCcx5+lZCQ1XdqAiHQARAQABzSZIZWluZXIgS2Fs bHdlaXQgPGhrYWxsd2VpdDFAZ21haWwuY29tPsLBjgQTAQgAOBYhBGxfqY/yOyXjyjJehXLe ig9U8DoMBQJf9GRVAhsDBQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAAAoJEHLeig9U8DoMSycQ AJbfg8HZEK0ljV4M8nvdaiNixWAufrcZ+SD8zhbxl8GispK4F3Yo+20Y3Uo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HTBGvuSXSZo ythk/0EAuz5IkwkhYBT1MGIAvNSn9ivE5aRnBazugy0rTRkVggHvt3/7flFHlGVGpBHxFUwb /a4UjJBPtIwa4tWR8B1Ma36S8Jk456k2n1id7M0LQ+eqstmp6Y+UB+pt9NX6t0Slw1NCdYTW gJezWTVKF7pmTdXszXGxlc9kTrVUz04PqPjnYbv5UWuDd2eyzGjrrFOsJEi8OK2d2j4FfF++ AzOMdW09JVqejQARAQABwsF2BBgBCAAgFiEEbF+pj/I7JePKMl6Fct6KD1TwOgwFAl/0ZFUC GwwACgkQct6KD1TwOgxUfg//eAoYc0Vm4NrxymfcY30UjHVD0LgSvU8kUmXxil3qhFPS7KA+ y7tgcKLHOkZkXMX5MLFcS9+SmrAjSBBV8omKoHNo+kfFx/dUAtz0lot8wNGmWb+NcHeKM1eb nwUMOEa1uDdfZeKef/U/2uHBceY7Gc6zPZPWgXghEyQMTH2UhLgeam8yglyO+A6RXCh+s6ak Wje7Vo1wGK4eYxp6pwMPJXLMsI0ii/2k3YPEJPv+yJf90MbYyQSbkTwZhrsokjQEaIfjrIk3 rQRjTve/J62WIO28IbY/mENuGgWehRlTAbhC4BLTZ5uYS0YMQCR7v9UGMWdNWXFyrOB6PjSu Trn9MsPoUc8qI72mVpxEXQDLlrd2ijEWm7Nrf52YMD7hL6rXXuis7R6zY8WnnBhW0uCfhajx q+KuARXC0sDLztcjaS3ayXonpoCPZep2Bd5xqE4Ln8/COCslP7E92W1uf1EcdXXIrx1acg21 H/0Z53okMykVs3a8tECPHIxnre2UxKdTbCEkjkR4V6JyplTS47oWMw3zyI7zkaadfzVFBxk2 lo/Tny+FX1Azea3Ce7oOnRUEZtWSsUidtIjmL8YUQFZYm+JUIgfRmSpMFq8JP4VH43GXpB/S OCrl+/xujzvoUBFV/cHKjEQYBxo+MaiQa1U54ykM2W4DnHb1UiEf5xDkFd4= In-Reply-To: <30d49088-283c-40f3-b97b-fd5f5174a467@gmail.com> In a follow-up patch handling of the LED audio trigger will be changed, including removal of config symbol LEDS_AUDIO_TRIGGER. Therefore set the default trigger unconditionally to "audio-mute". It does no harm if a default trigger doesn't exist. Signed-off-by: Heiner Kallweit --- drivers/input/input-leds.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/input/input-leds.c b/drivers/input/input-leds.c index b16fc8194..176f1da7f 100644 --- a/drivers/input/input-leds.c +++ b/drivers/input/input-leds.c @@ -18,12 +18,6 @@ #define VT_TRIGGER(_name) .trigger = NULL #endif -#if IS_ENABLED(CONFIG_LEDS_TRIGGER_AUDIO) -#define AUDIO_TRIGGER(_name) .trigger = _name -#else -#define AUDIO_TRIGGER(_name) .trigger = NULL -#endif - static const struct { const char *name; const char *trigger; @@ -35,7 +29,7 @@ static const struct { [LED_KANA] = { "kana", VT_TRIGGER("kbd-kanalock") }, [LED_SLEEP] = { "sleep" } , [LED_SUSPEND] = { "suspend" }, - [LED_MUTE] = { "mute", AUDIO_TRIGGER("audio-mute") }, + [LED_MUTE] = { "mute", "audio-mute" }, [LED_MISC] = { "misc" }, [LED_MAIL] = { "mail" }, [LED_CHARGING] = { "charging" }, From patchwork Tue Feb 13 07:34:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiner Kallweit X-Patchwork-Id: 13554619 Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B2C0717583; Tue, 13 Feb 2024 07:34:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.45 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707809650; cv=none; b=k9FEujMPt0KOywyFO+bA39jWlkDorLZo+RklnC7hVmI8l5tM4HXneRD8KD/PPr8SLTivYHO8G3PQAB1UrnQdPpOwHqOC97VfBDcHJ3Vgvb5KniiG2biCpGRZcy7KBbg83XOycvwudZCeDwpLdCVDj/zDK8tdZUU6puCdsy8YLbg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707809650; c=relaxed/simple; bh=mImGS2FUaLNTH+3c5ZI5QZBUT1jkyJXPNm6dfIT8lmM=; h=Message-ID:Date:MIME-Version:Subject:From:To:Cc:References: In-Reply-To:Content-Type; b=u/xLDuQ0pcr5OdYUvZcpqpSv3zQ6CvatKB3e95wpc1xi5cOJ/0i952Q/6f3hokHO+fCdI5mb5Tcc2SSfifzOVf4Xr7IjyauLKVIcYcgpyocstXhgymo16hVgigAjftTsMAGl+QAEsPPrxwAultDe9/p9N1ZDOf7JiLv30mTXuR8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=mpLhMsE2; arc=none smtp.client-ip=209.85.218.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mpLhMsE2" Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-a3cf9c970d8so46255366b.3; Mon, 12 Feb 2024 23:34:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707809647; x=1708414447; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:references:cc:to :from:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=isNeZP/rP42rhcuGqltQyT3Dku65VLTVYk/NO91/p/g=; b=mpLhMsE2YIA2rfqk6+fc+R+LioEDvbM4wk/TqBbujY77ZHrxEY5z5665TE7CSj1g01 xXbRXZTAyVTFpd5LOmAd7s4FH5fO9RvWohkrPs9nvwXdPuHPD3MX+f6ONpfJeYX9CsjT lSU4qcsLWFISOWXiBeaVzGBqp5Nzgu5jw/eq9vG/noids9kvVjNEyBOt81TgWLPUYcfx eMr+eYf4v/vHf39KOQanGXahWG50UKP62jdlgVcNeTzpEtnJJRG3LCV332dZI3U/7AoM maX/yY2/TNB+OcW6Xko5wU6mTeKaqfI4E6doh+FpBFzyfhEm6cfAugI07GZ9s/YjUvlH Rp0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707809647; x=1708414447; h=content-transfer-encoding:in-reply-to:autocrypt:references:cc:to :from:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=isNeZP/rP42rhcuGqltQyT3Dku65VLTVYk/NO91/p/g=; b=KJU85B9zKg/SHNn9l9CeNCHKpJ7Pc5tjHVY+yR1tKuKwFy/w9lJ6zOGYJQY7sZh2hD jhggMfPDXxFPJlPIiazueMevaPq/d5zPODRCv/sMkCwKW+lyK0BzJ8nOlW8OsBlztwQq MLaCVRX84PW6aPtKfsobIB6BxasN2JqvGiMBt8UIb2xShp2koLfqptrokkPG3hsjDK0s iC8ieiLL5THIbdG9MBzY/JDUILnu8Qx+7+RfQ2RpvdvDTGsRchHay+FWIuRGJpIDU8m3 c1VcJqAJzvAH8XIzSgQhyLSpjYeUuBVryZ2yGRaY+xtjPk/Dw9xigydZ1ow0D9ZJ9WL/ Qhbg== X-Forwarded-Encrypted: i=1; AJvYcCWuSjkEbDysIwto4SDHJsfQn75hXK4pw7R2HYwAMqGaw43KkSyk4zWk1W3RqAoklHo5wjz6QJqo0GkqDicFLWbg59jKkrZ43N3tMwu8T/+3nn4hHgpN1BODgI1ssdDitp5UKbM70tOkVNWozM3qKIjDC8+XBeOChabRKIy12Z32MUhHBik= X-Gm-Message-State: AOJu0YwYLXX4Im4J4vGXr8AY+1XXY4RnsmdoT0W9FHJORUOCG0Z6Y6Yq DdcJPNduVveEnAbksfFTA3FtAQp02zukBa8pMqbDs7YEs9pbCJzr X-Google-Smtp-Source: AGHT+IG+m/bM34SwNSHAlHCc/Opdtk5V4XAQWG6Mq13jstCpRasAiCmIQ3mF780XI99jP0Y8k4uEog== X-Received: by 2002:a17:906:b28a:b0:a3c:c0a8:3b20 with SMTP id q10-20020a170906b28a00b00a3cc0a83b20mr2405461ejz.22.1707809646735; Mon, 12 Feb 2024 23:34:06 -0800 (PST) X-Forwarded-Encrypted: i=1; AJvYcCWb1+TiQjv9lnhwxmvvMTqZODkujRUzecr6h4k8IJoepMQnSyDkSV3M/O78YfBBikC1hkt+2s0f3rw/4YzA+ZAPg852u8oR/F+r5WwZjEv7sEoCT0iKIHreb5dn6SuBrI+L6Y3AFj8PAD/CzjUoyeaomlKADo4KHx55juTwdShA6UZlZzcMFhfH4ku5MaJsoQS0IXDK3drjOujZ4YaTKnJHNH+whR3Ls/mXh6s8FPmyajNdHdAdhVQx0a8tNZd8k8GH/+EH3qlEwBDIHb5RVMWOkh347P+gljxwayniMjqHkhd1qqcrrFwgVBQ= Received: from ?IPV6:2a01:c23:bdaf:b200:457b:b235:98c6:f76b? (dynamic-2a01-0c23-bdaf-b200-457b-b235-98c6-f76b.c23.pool.telefonica.de. [2a01:c23:bdaf:b200:457b:b235:98c6:f76b]) by smtp.googlemail.com with ESMTPSA id vh2-20020a170907d38200b00a3d08f3283fsm251555ejc.104.2024.02.12.23.34.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 12 Feb 2024 23:34:06 -0800 (PST) Message-ID: <81c2a494-3e25-45df-854e-9fe4d6acbfb8@gmail.com> Date: Tue, 13 Feb 2024 08:34:07 +0100 Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: [PATCH 4/4] leds: trigger: audio: Remove this trigger Content-Language: en-US From: Heiner Kallweit To: Pavel Machek , Lee Jones , Jaroslav Kysela , Takashi Iwai , Dmitry Torokhov , Thomas Bogendoerfer Cc: "linux-leds@vger.kernel.org" , linux-sound@vger.kernel.org, "open list:HID CORE LAYER" , linux-mips@vger.kernel.org References: <30d49088-283c-40f3-b97b-fd5f5174a467@gmail.com> Autocrypt: addr=hkallweit1@gmail.com; keydata= xsFNBF/0ZFUBEAC0eZyktSE7ZNO1SFXL6cQ4i4g6Ah3mOUIXSB4pCY5kQ6OLKHh0FlOD5/5/ sY7IoIouzOjyFdFPnz4Bl3927ClT567hUJJ+SNaFEiJ9vadI6vZm2gcY4ExdIevYHWe1msJF MVE4yNwdS+UsPeCF/6CQQTzHc+n7DomE7fjJD5J1hOJjqz2XWe71fTvYXzxCFLwXXbBiqDC9 dNqOe5odPsa4TsWZ09T33g5n2nzTJs4Zw8fCy8rLqix/raVsqr8fw5qM66MVtdmEljFaJ9N8 /W56qGCp+H8Igk/F7CjlbWXiOlKHA25mPTmbVp7VlFsvsmMokr/imQr+0nXtmvYVaKEUwY2g 86IU6RAOuA8E0J5bD/BeyZdMyVEtX1kT404UJZekFytJZrDZetwxM/cAH+1fMx4z751WJmxQ J7mIXSPuDfeJhRDt9sGM6aRVfXbZt+wBogxyXepmnlv9K4A13z9DVLdKLrYUiu9/5QEl6fgI kPaXlAZmJsQfoKbmPqCHVRYj1lpQtDM/2/BO6gHASflWUHzwmBVZbS/XRs64uJO8CB3+V3fa cIivllReueGCMsHh6/8wgPAyopXOWOxbLsZ291fmZqIR0L5Y6b2HvdFN1Xhc+YrQ8TKK+Z4R mJRDh0wNQ8Gm89g92/YkHji4jIWlp2fwzCcx5+lZCQ1XdqAiHQARAQABzSZIZWluZXIgS2Fs bHdlaXQgPGhrYWxsd2VpdDFAZ21haWwuY29tPsLBjgQTAQgAOBYhBGxfqY/yOyXjyjJehXLe ig9U8DoMBQJf9GRVAhsDBQsJCAcCBh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xo+MaiQa1U54ykM2W4DnHb1UiEf5xDkFd4= In-Reply-To: <30d49088-283c-40f3-b97b-fd5f5174a467@gmail.com> Now that the audio trigger is fully integrated in sound/core/control_led.c, we can remove it here. Signed-off-by: Heiner Kallweit --- arch/mips/configs/ci20_defconfig | 1 - drivers/leds/trigger/Kconfig | 7 --- drivers/leds/trigger/Makefile | 1 - drivers/leds/trigger/ledtrig-audio.c | 67 ---------------------------- include/linux/leds.h | 14 ------ sound/core/Kconfig | 1 - 6 files changed, 91 deletions(-) delete mode 100644 drivers/leds/trigger/ledtrig-audio.c diff --git a/arch/mips/configs/ci20_defconfig b/arch/mips/configs/ci20_defconfig index cdf2a782d..7827b2b39 100644 --- a/arch/mips/configs/ci20_defconfig +++ b/arch/mips/configs/ci20_defconfig @@ -152,7 +152,6 @@ CONFIG_LEDS_TRIGGER_CAMERA=m CONFIG_LEDS_TRIGGER_PANIC=y CONFIG_LEDS_TRIGGER_NETDEV=y CONFIG_LEDS_TRIGGER_PATTERN=y -CONFIG_LEDS_TRIGGER_AUDIO=y CONFIG_RTC_CLASS=y CONFIG_RTC_DRV_JZ4740=y CONFIG_DMADEVICES=y diff --git a/drivers/leds/trigger/Kconfig b/drivers/leds/trigger/Kconfig index d11d80176..31576952e 100644 --- a/drivers/leds/trigger/Kconfig +++ b/drivers/leds/trigger/Kconfig @@ -136,13 +136,6 @@ config LEDS_TRIGGER_PATTERN which is a series of tuples, of brightness and duration (ms). If unsure, say N -config LEDS_TRIGGER_AUDIO - tristate "Audio Mute LED Trigger" - help - This allows LEDs to be controlled by audio drivers for following - the audio mute and mic-mute changes. - If unsure, say N - config LEDS_TRIGGER_TTY tristate "LED Trigger for TTY devices" depends on TTY diff --git a/drivers/leds/trigger/Makefile b/drivers/leds/trigger/Makefile index 25c4db97c..242f6c4e3 100644 --- a/drivers/leds/trigger/Makefile +++ b/drivers/leds/trigger/Makefile @@ -14,5 +14,4 @@ obj-$(CONFIG_LEDS_TRIGGER_CAMERA) += ledtrig-camera.o obj-$(CONFIG_LEDS_TRIGGER_PANIC) += ledtrig-panic.o obj-$(CONFIG_LEDS_TRIGGER_NETDEV) += ledtrig-netdev.o obj-$(CONFIG_LEDS_TRIGGER_PATTERN) += ledtrig-pattern.o -obj-$(CONFIG_LEDS_TRIGGER_AUDIO) += ledtrig-audio.o obj-$(CONFIG_LEDS_TRIGGER_TTY) += ledtrig-tty.o diff --git a/drivers/leds/trigger/ledtrig-audio.c b/drivers/leds/trigger/ledtrig-audio.c deleted file mode 100644 index 2ecd4b760..000000000 --- a/drivers/leds/trigger/ledtrig-audio.c +++ /dev/null @@ -1,67 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -// -// Audio Mute LED trigger -// - -#include -#include -#include -#include "../leds.h" - -static enum led_brightness audio_state[NUM_AUDIO_LEDS]; - -static int ledtrig_audio_mute_activate(struct led_classdev *led_cdev) -{ - led_set_brightness_nosleep(led_cdev, audio_state[LED_AUDIO_MUTE]); - return 0; -} - -static int ledtrig_audio_micmute_activate(struct led_classdev *led_cdev) -{ - led_set_brightness_nosleep(led_cdev, audio_state[LED_AUDIO_MICMUTE]); - return 0; -} - -static struct led_trigger ledtrig_audio[NUM_AUDIO_LEDS] = { - [LED_AUDIO_MUTE] = { - .name = "audio-mute", - .activate = ledtrig_audio_mute_activate, - }, - [LED_AUDIO_MICMUTE] = { - .name = "audio-micmute", - .activate = ledtrig_audio_micmute_activate, - }, -}; - -enum led_brightness ledtrig_audio_get(enum led_audio type) -{ - return audio_state[type]; -} -EXPORT_SYMBOL_GPL(ledtrig_audio_get); - -void ledtrig_audio_set(enum led_audio type, enum led_brightness state) -{ - audio_state[type] = state; - led_trigger_event(&ledtrig_audio[type], state); -} -EXPORT_SYMBOL_GPL(ledtrig_audio_set); - -static int __init ledtrig_audio_init(void) -{ - led_trigger_register(&ledtrig_audio[LED_AUDIO_MUTE]); - led_trigger_register(&ledtrig_audio[LED_AUDIO_MICMUTE]); - return 0; -} -module_init(ledtrig_audio_init); - -static void __exit ledtrig_audio_exit(void) -{ - led_trigger_unregister(&ledtrig_audio[LED_AUDIO_MUTE]); - led_trigger_unregister(&ledtrig_audio[LED_AUDIO_MICMUTE]); -} -module_exit(ledtrig_audio_exit); - -MODULE_DESCRIPTION("LED trigger for audio mute control"); -MODULE_LICENSE("GPL v2"); -MODULE_ALIAS("ledtrig:audio-mute"); -MODULE_ALIAS("ledtrig:audio-micmute"); diff --git a/include/linux/leds.h b/include/linux/leds.h index 48fff5980..d2668b427 100644 --- a/include/linux/leds.h +++ b/include/linux/leds.h @@ -705,18 +705,4 @@ enum led_audio { NUM_AUDIO_LEDS }; -#if IS_ENABLED(CONFIG_LEDS_TRIGGER_AUDIO) -enum led_brightness ledtrig_audio_get(enum led_audio type); -void ledtrig_audio_set(enum led_audio type, enum led_brightness state); -#else -static inline enum led_brightness ledtrig_audio_get(enum led_audio type) -{ - return LED_OFF; -} -static inline void ledtrig_audio_set(enum led_audio type, - enum led_brightness state) -{ -} -#endif - #endif /* __LINUX_LEDS_H_INCLUDED */ diff --git a/sound/core/Kconfig b/sound/core/Kconfig index 8077f481d..b970a1734 100644 --- a/sound/core/Kconfig +++ b/sound/core/Kconfig @@ -262,6 +262,5 @@ config SND_CTL_LED tristate select NEW_LEDS if SND_CTL_LED select LEDS_TRIGGERS if SND_CTL_LED - select LEDS_TRIGGER_AUDIO if SND_CTL_LED source "sound/core/seq/Kconfig"