Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp5910687pxb; Sun, 7 Nov 2021 23:29:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJxHxxGiJ3hDMz/gxy04cw4jsu1Qn8HpGV0bCVTZCRdds5m6W0DYIdaB2MrKvsGKTY3QQRTH X-Received: by 2002:a05:6402:4403:: with SMTP id y3mr60782847eda.163.1636356590025; Sun, 07 Nov 2021 23:29:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636356590; cv=none; d=google.com; s=arc-20160816; b=BJ/z476GqtSMIbBjk6MIQrZ5lJZ79J6EQOJmw4mmNqqbRSBUM9ex19+IQAWoka88KY nk9WfpxxuQNbtly8FXPBifXMJcSF1ttOn5UpAxUYP0QPXgOvg1lw0r/Ri1D85Jls+exa /dpzXbJzZWhKfmlBPscAhbcW7hJTs9HsWH1jCUdE3a7ErcaViFNY/1tDoQI71sExxtaP BYY6011BPkSbWfDKtvuuB6Dn6f/9DoJ+9FEufGmHr5BjPQUpHC3R44MKz60LweoM1KRj d9/+7DANyzR15oiw6tdV9yhYoWqL8bxGHLSrrCsCbn7q5z6rAZTJ01wEAyggdjt7Ki++ YhFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject:dkim-signature; bh=Kmu1o3d56x2PHpP0lDg/mYidF1A/EmIUpA6P+e8dkwE=; b=HsNFy2I/Pjo/vvFL9hLeBWv5vxIrmeApSaZsdF8sQT/ugjWnLpfaI8DyzEATerKegd aa8DdDJ4R2uxa1fo64JyYgzhg72lyqgMbtwv39w1XBM1elVTz2m9DcT1oYt7Wt4+nsPK Gaf1i+nUXiigc6O8XT0+aq+u5vk25Ar/S3nTgZuO5ZIGDNmMekDHquDi+ce+q+FKV+5z 3T6h6GjAT8+rXc4xmrrwT/avpTxIEIjVOfeI1O6LILtj5EmSOj24w+rQDHVpmwOF2l47 GNulwZuto08FjHRlT+xMkww0Nu96gxvTbbxBr+eALZU+bqOQtX7atsQPd78rFW4vnndc zQ0Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=merlin.20170209 header.b=wAknlF+y; 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 h13si23659916ejs.401.2021.11.07.23.29.27; Sun, 07 Nov 2021 23:29:50 -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=@infradead.org header.s=merlin.20170209 header.b=wAknlF+y; 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 S236531AbhKHCZP (ORCPT + 99 others); Sun, 7 Nov 2021 21:25:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47380 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229757AbhKHCZO (ORCPT ); Sun, 7 Nov 2021 21:25:14 -0500 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1234::107]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C188AC061570; Sun, 7 Nov 2021 18:22:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:To:Subject:Sender: Reply-To:Cc:Content-ID:Content-Description; bh=Kmu1o3d56x2PHpP0lDg/mYidF1A/EmIUpA6P+e8dkwE=; b=wAknlF+ydZevj70eq0j8ZFkyVz 0lClZbALmoyuNN2Xuk4+RZNhe06866teuO8O90/BcUMJ0rH1dDJhKd3C5UxiIokL9HsYwH4Jv6AVI HESTbJrNgKjgOZCRr/zenRz590Mm+BFpWf2aZI1k7itxTJM8E8Bv+xxDYX5Rw5RO72uclGmsUm8WX GL1GwaBoaZbM3p70SCqosj2OhgDMNp39jwPbcHWqA7z3kpcy3Y+ZbCiv+k4g9lRYdcnLmbPJH0Te7 RJ0tJvJKQ4gM7yhJau+SRBXElgZxU7HXiO53d0AH/KHkht3JbF+fmG6MWQzc4/ZP0lIogmZ40+Y4Y LYjU5GkQ==; Received: from [2601:1c0:6280:3f0::aa0b] by merlin.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mjuIj-008fPf-EB; Mon, 08 Nov 2021 02:22:26 +0000 Subject: Re: [RFC PATCH v2 2/5] leds: add function to configure offload leds To: Ansuel Smith , Andrew Lunn , 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 References: <20211108002500.19115-1-ansuelsmth@gmail.com> <20211108002500.19115-3-ansuelsmth@gmail.com> From: Randy Dunlap Message-ID: Date: Sun, 7 Nov 2021 18:22:19 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <20211108002500.19115-3-ansuelsmth@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/7/21 4:24 PM, Ansuel Smith wrote: > diff --git a/Documentation/leds/leds-class.rst b/Documentation/leds/leds-class.rst > index 5bf6e5d471ce..0a3bbe71dac7 100644 > --- a/Documentation/leds/leds-class.rst > +++ b/Documentation/leds/leds-class.rst > @@ -190,6 +190,30 @@ If the second argument (enable) to the trigger_offload() method is false, any > active HW offloading must be deactivated. In this case errors are not permitted > in the trigger_offload() method and the driver will be set to the new trigger. > > +The offload trigger will use the function configure_offload() provided by the driver > +that will configure the offloaded mode for the LED. > +This function passes as the first argument (offload_flags) a u32 flag. > +The second argument (cmd) of the configure_offload() method can be used to do various > +operations for the specific trigger. We currently support ENABLE, DISABLE, READ and > +SUPPORTED to enable, disable, read the state of the offload trigger and ask the LED > +driver supports the specific offload trigger. > + > +In ENABLE/DISABLE configure_offload() should configure the LED to enable/disable the > +requested trigger (flags). > +In READ configure_offload() should return 0 or 1 based on the status of the requested > +trigger (flags). > +In SUPPORTED configure_offload() should return 0 or 1 if the LED driver supports the > +requested trigger (flags) or not. > + > +The u32 flag is specific to the trigger and change across them. It's in the LED changes > +driver interest know how to elaborate this flag and to declare support for a driver's > +particular offload trigger. For this exact reason explicit support for the specific > +trigger is mandatory or the driver returns -EOPNOTSUPP if asked to enter offload mode > +with a not supported trigger. > +If the driver returns -EOPNOTSUPP on configure_offload(), the trigger activation will > +fail as the driver doesn't support that specific offload trigger or doesn't know > +how to handle the provided flags. -- ~Randy