From patchwork Fri Jul 28 12:30:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Golle X-Patchwork-Id: 127641 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:918b:0:b0:3e4:2afc:c1 with SMTP id s11csp434174vqg; Fri, 28 Jul 2023 06:27:40 -0700 (PDT) X-Google-Smtp-Source: APBJJlEx2m8FfQn9rB8nfWPVFtY3BVBki6TuKT85Gv/SDYnQgjYHSU5WSRYW9XtDvDcMEJruRFUo X-Received: by 2002:a05:6e02:1ca5:b0:348:b910:313d with SMTP id x5-20020a056e021ca500b00348b910313dmr3492645ill.14.1690550859936; Fri, 28 Jul 2023 06:27:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690550859; cv=none; d=google.com; s=arc-20160816; b=SASxMtFcwA+iu0PQsc8QzdXNvYYOylGspR9f365pyJOEKC8xAHFTIaMUAsI4mON/pT /9LZFwDH7fu1PYjvGc2hWdQcJF3KaY0iWNr+/Ke6GbhPbirmCLVCpXpxtIz9UtQ0esOS ZkERR94cwD9iGoAQjRcwE/EJ4er6D7U4T/alp4wkJIsgORc22DdwiDQ9CVCUrTn9jHWE D6KEaJDmXMWPP6xnz0Z3VDQrb3UHE/p3KSUWFZQZultfUnnNzT74onvp4hKOJkfYeajt WJT70YkV2sCcVjqb2WMCLo87VqUDK07Q1VUB6OmJvQL3jBxbnV1HxgcVeGju0QqOxneL gFCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-disposition:mime-version:message-id :subject:to:from:date; bh=Q+IKxVOnN5iNmEaAVUcqXnDTnmBHpXXICSNDsx/H3DM=; fh=ZqLowDVvVpVxcrlw7MM/IM9y2WQ53COJXAUeTF8s64E=; b=s61yADlOx9s8SaLZ79BT+dBIVIJ4qkGu+xngcfdsXN7M36pU2ZO0BhNLq2PGLx8xR4 29qghwFY+fz7JkeSsY8Xd6E5qdpl2cH9EqGTy2axmmgsNPYgRay2Xqo1TmFvg2WChbUe HPUBtqpJFlgq/BFBGRZ6n4UxQxdrxHfaHamsw/Q2qTlT1DjEIA/aVaMNi0LTBt572mzP V8O58ZcHVdLvQc9ydufVXZluD4HEx/Kz6ukHvQJZhCdfLGp8zOI5YtJieHoVdcmgl1qz ElIr9+Mm0+reNFvgskhtkhKwPYSClsvMnhATrOMRGN3jXKrlJMWHVDCG3Bauh3EIMhKc FvEQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b2-20020a17090a9bc200b0024753ec4dccsi3228773pjw.124.2023.07.28.06.27.24; Fri, 28 Jul 2023 06:27:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235543AbjG1Mba (ORCPT + 99 others); Fri, 28 Jul 2023 08:31:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235314AbjG1Mb2 (ORCPT ); Fri, 28 Jul 2023 08:31:28 -0400 Received: from pidgin.makrotopia.org (pidgin.makrotopia.org [185.142.180.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C4FBB10FC; Fri, 28 Jul 2023 05:31:27 -0700 (PDT) Received: from local by pidgin.makrotopia.org with esmtpsa (TLS1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.96) (envelope-from ) id 1qPMck-0003Lx-2p; Fri, 28 Jul 2023 12:31:14 +0000 Date: Fri, 28 Jul 2023 13:30:58 +0100 From: Daniel Golle To: Pavel Machek , Lee Jones , Daniel Golle , Johannes Berg , Andrew Morton , Richard Purdie , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] led: trig: timer: stop offloading on deactivation Message-ID: <728da6e11d34a39f717be07e246dcc4964b0fd51.1690542871.git.daniel@makrotopia.org> MIME-Version: 1.0 Content-Disposition: inline X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772671058756265355 X-GMAIL-MSGID: 1772671058756265355 Stop hardware blinking when switching from 'timer' to another trigger. Fixes: 5ada28bf7675 ("led-class: always implement blinking") Signed-off-by: Daniel Golle --- drivers/leds/trigger/ledtrig-timer.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/leds/trigger/ledtrig-timer.c b/drivers/leds/trigger/ledtrig-timer.c index b4688d1d9d2b2..fb6b207b052b8 100644 --- a/drivers/leds/trigger/ledtrig-timer.c +++ b/drivers/leds/trigger/ledtrig-timer.c @@ -125,6 +125,8 @@ static void timer_trig_deactivate(struct led_classdev *led_cdev) { /* Stop blinking */ led_set_brightness(led_cdev, LED_OFF); + if (led_cdev->blink_set) + led_cdev->blink_set(led_cdev, 0, 0); } static struct led_trigger timer_led_trigger = {