Received: by 2002:a05:6a10:8395:0:0:0:0 with SMTP id n21csp621179pxh; Tue, 9 Nov 2021 16:19:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJx1UWLuR4Xav/SbdGuiynHy3sDKO7H6SD7DTxrFzCR+D8hcDhE3PQMyVvzC9v/QdpJmeas9 X-Received: by 2002:a5d:8c8e:: with SMTP id g14mr7577358ion.16.1636503551988; Tue, 09 Nov 2021 16:19:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636503551; cv=none; d=google.com; s=arc-20160816; b=Ip32uMqSiJB9RNa2sT5UrpVc9VcIkfISYOI2PR8ohnL1eUEFWd55MlIFVURO541lvZ kM3nNF5OFglqm7XehHMeDUTP4LM2/VpytNKYaIt3EsjtmylcHKRbdreTX9MI40AvtPYu 31F7itRkBthAC6vJnUU39oQ1Eiy0eb7Rj4UsbwiKvuYSfvFHo8USt+N1oS33NHS53/0O 6kJYoWhMFNMy9DHyoj9lAeYgaIqFSt4cZ5lZaC9qqEUTBlbdl+S1CC6L86a4HfRRjJ8C obnNf3sQMonwzw5RSX4fM4rxyiDQrkJFWcmocoMvdZFZB5holM/4XEoDh/JkRa0hEQ1U AmVg== 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=mg2e7z58lDe73VgrFciCdoCrTckxjsQdMH47LIpMlD8=; b=KA2Oh8EJT4Bptt5ogC86Zu8UvMCsBy2sU3v2+Em+h2t/aWwjynEEklDfdBY1CwhSf5 X7/VdvF19a6bgSb0z5mgGcRvg+gXgaoxZV3pilHnDP3ERbbAMbm/WLSBYWrvLH5YQerW 4v79Z/ZpG8/C6oCEc+m+rPgWolgm7s6dcZAz+ue3kIKqn5WyWSkr/hV1gP3U5+kyz0wu nua4dS35dPVsFesr8qJPKMglTm2+nL8nI3smmVE9WA9JAsyD94uXTcYB7stWjhX0+O1i Cct4fL6+NldNZCzM5NCkYMIS3i0SxuXrBohsH3mryByTu4ZRpYibAZe4aH/VcHTcUShS HFSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Lvp6NHOP; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x19si35506015ioa.9.2021.11.09.16.19.00; Tue, 09 Nov 2021 16:19:11 -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=@gmail.com header.s=20210112 header.b=Lvp6NHOP; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244561AbhKIUno (ORCPT + 97 others); Tue, 9 Nov 2021 15:43:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242487AbhKIUnn (ORCPT ); Tue, 9 Nov 2021 15:43:43 -0500 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F471C061764; Tue, 9 Nov 2021 12:40:57 -0800 (PST) Received: by mail-wr1-x42b.google.com with SMTP id d5so163675wrc.1; Tue, 09 Nov 2021 12:40:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=mg2e7z58lDe73VgrFciCdoCrTckxjsQdMH47LIpMlD8=; b=Lvp6NHOPZwHxPj+fWGq2BvF2OdAqief2GwNbnsMaefDadOSWDKKRqm4nLRL+frEpyn 3KxZbtgCyg5WaAc7md7R3p0k2BKSjcdVrhP1UX8HyvvL8nEyjPsN5gIKQkVZMXEjuZht B9boo/vxS4NoUxhzQF06GsGAvqR63F77yGlkWa3Av52PpHn0WQBXQPFK6NqjB0mukGUl e1ecdTvzm6ZXzm5okWFnbpUUl8Xv52ZoFIygwJ/p/YnYDPpxmmamQBMbyVQf4Au0VQdK 8VbYtJ5KUNe1E3SBSIpZfqkYRK2o+H9ydDPeJFetb8HMFLUTDwG/1l64AiNY9Yyja5oh ztLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=mg2e7z58lDe73VgrFciCdoCrTckxjsQdMH47LIpMlD8=; b=BMEf8quqlRyJnHb6GvhkduziGhNFEvDoqRpXO/Bc4I4n0pbvjsj/0+THCwEZfNHZ13 3VbetPCh7Xnnz8sWbBKVKrO9sg2IGP+uFk1qN2vRVOBthpPTqNnZJT5TTO9xET/Zx20E Zlcq5xCirXYFVRbdmx0iOiqlhyCK96tXk+cN5tQ9sRZSszQqjtR7M8pa3IdQtTxX4blx BZ+q2WFusV8mmGiLYe+BnaBS2uK7qNtrSF5Yb50ofLzCEmS54RlS8wTnztY+ucDikTiZ 9JRRwhEreoJh8SHabCERmtzNVwakcq3xsXlPAtV2LqOSsjOE09kjQxLNIbfz1PMczO15 v2/Q== X-Gm-Message-State: AOAM531920aB0Ti7Xtu0tl5iptidCk4AAcsdVmslkpF2KmXfavq3/KWE RTKWddZv0gRpbZI54oLj1VKFaBhd6WU= X-Received: by 2002:a05:6000:23a:: with SMTP id l26mr12861034wrz.215.1636490455780; Tue, 09 Nov 2021 12:40:55 -0800 (PST) Received: from Ansuel-xps.localdomain ([5.171.121.77]) by smtp.gmail.com with ESMTPSA id i17sm3675547wmq.48.2021.11.09.12.40.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Nov 2021 12:40:55 -0800 (PST) Date: Tue, 9 Nov 2021 21:40:53 +0100 From: Ansuel Smith To: Andrew Lunn 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: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 09, 2021 at 09:34:23PM +0100, Andrew Lunn wrote: > 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 You are right I have to remove the last part as it doesn't make sense. We already use blink_mode. Will remove in v4. -- Ansuel