Received: by 2002:a05:6a10:8395:0:0:0:0 with SMTP id n21csp620086pxh; Tue, 9 Nov 2021 16:18:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJwnPcc03r0ydbNpUTtcZN6U0afXxGEMMD+el4dmRP/gwYosRSOqxclkvqgde94S4OeKWqlX X-Received: by 2002:a05:6e02:1e0a:: with SMTP id g10mr9035001ila.50.1636503487868; Tue, 09 Nov 2021 16:18:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636503487; cv=none; d=google.com; s=arc-20160816; b=CMkmitg0u/XgUNfwq6LgrQgjsPr8ZPgQ87Vld31wbiJC5tFFGo+FT/biefiVyRa46e 81c0CVzOtAkUdyaAhKnGilGy9WNckl0sT0m9skytDmTs0i8xD5ns15DREPRpRAzpVVwO MF5cTwy11iR+DrdY1zmmzW1o2rrVwFjouUTJ3Oniqru1ZIChzrAUh/ZjEU6mCZF5I2v7 pGz+Dgk+n/OGUPPgTLmLLQg8cBFQNBh6pgrjPMVmirMnfPmgYRk3+mt1mEBxnWIq0n9c vVScVKNaSQ3/b2DMza6vQ2cxxtIJdYgJYRMbOFPyomzQWP78Rrpfe+TV9MqRshDgbKDS u9FA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=NZmg3j0EAUz6SRjH0lLT+qY9ZFf2Fx+/cHi7xXQ221k=; b=tm+S14sBfH3UtD7Is7C/w4Ak5orYJ3N6r7jdWTLkGpGxpKBl1qgeBzEAlSGMhm+q5i xjEPYAx4g4gdSGsF7DtjCCX+w1Xx1V43stDTRTtU1yNOnikluAG9D9PErHezsR1MLRxR 38VNiaK/AXkJW42kHxGtNjudpLPVRpJlUSzvkBz1NrjCh0LeQ4vHAxNT6B4PtujdyPIa 5GV3h3tDBZNkfrQy7tMm9lGNhJo1dFj82p8+zDsjmJ3NkW9Wp8YrcvVg9UZpWO17foLg moPpP9W2PpbFNZxZDIiwjeK26ppYDEXQbweksx8pmVsWhV0cSfrx9kNgC5G1nMQqw1Na M0tA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=minbOTZi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z4si7591521jat.116.2021.11.09.16.17.54; Tue, 09 Nov 2021 16:18:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=minbOTZi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244471AbhKIUhW (ORCPT + 97 others); Tue, 9 Nov 2021 15:37:22 -0500 Received: from vps0.lunn.ch ([185.16.172.187]:53314 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239648AbhKIUhV (ORCPT ); Tue, 9 Nov 2021 15:37:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=NZmg3j0EAUz6SRjH0lLT+qY9ZFf2Fx+/cHi7xXQ221k=; b=minbOTZiNi6GoEgekr24PBPWFW wJdqcet8470M6FxSH98y41OHosHueu8nRrp7A33FuPRnuK9jz/RbQNJFODaSQwxBcTWCfOnfBOjbl wMn1MwCJ+vFP7DxKXM9aCplqrnyoMrzxgqKb+MRLoKdCjkz8fjGaZnS58tPhqRSs+KZw=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1mkXp1-00D1Mt-Pd; Tue, 09 Nov 2021 21:34:23 +0100 Date: Tue, 9 Nov 2021 21:34:23 +0100 From: Andrew Lunn To: Ansuel Smith Cc: Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Jakub Kicinski , Rob Herring , Jonathan Corbet , Pavel Machek , John Crispin , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-leds@vger.kernel.org, Marek =?iso-8859-1?Q?Beh=FAn?= Subject: Re: [RFC PATCH v3 1/8] leds: add support for hardware driven LEDs Message-ID: References: <20211109022608.11109-1-ansuelsmth@gmail.com> <20211109022608.11109-2-ansuelsmth@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211109022608.11109-2-ansuelsmth@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 09, 2021 at 03:26:01AM +0100, Ansuel Smith wrote: > Some LEDs can be driven by hardware (for example a LED connected to > an ethernet PHY or an ethernet switch can be configured to blink on > activity on the network, which in software is done by the netdev trigger). > > To do such offloading, LED driver must support this and a supported > trigger must be used. > > LED driver should declare the correct blink_mode supported and should set > the blink_mode parameter to one of HARDWARE_CONTROLLED or > SOFTWARE_HARDWARE_CONTROLLED. > The trigger will check this option and fail to activate if the blink_mode > is not supported. By default if a LED driver doesn't declare blink_mode, > SOFTWARE_CONTROLLED is assumed. > > The LED must implement 3 main API: > - trigger_offload_status(): This asks the LED driver if offload mode is > enabled or not. > Triggers will check if the offload mode is supported and will be > activated accordingly. If the trigger can't run in software mode, > return -EOPNOTSUPP as the blinking can't be simulated by software. I don't understand this last part. The LED controller is not implementing software mode, other than providing a method to manually turn the LED on and off. And there is a well defined call for that. If that call is a NULL, it is clear it is not implemented. There is no need to ask the driver. Andrew