From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11ADCC4743E for ; Fri, 4 Jun 2021 20:28:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E9190613FE for ; Fri, 4 Jun 2021 20:28:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231260AbhFDUal (ORCPT ); Fri, 4 Jun 2021 16:30:41 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:27000 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230022AbhFDUak (ORCPT ); Fri, 4 Jun 2021 16:30:40 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1622838532; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SsGVYeypydc8u4iFNETa0oN1HSK19Tp01M5QFxHPCz0=; b=WqEB+W70jbxBI80V7IbiwsiAJy7KM+mg6m6MEH7NduECxBc3OntGhnRCNn3IxFVpupSgW/ zoofNcIS0BBzxn6Ekim3fAnGNWJZXG8tiyI6u8fsEEvhLRma6p5D7Z15f8X/TmpyBkDYAb CG94RznpI8exk1CSS3FGza6joOyL97A= Received: from mail-ej1-f72.google.com (mail-ej1-f72.google.com [209.85.218.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-403-lJ5AIcZ-OzCwRs81gKvAFw-1; Fri, 04 Jun 2021 16:28:51 -0400 X-MC-Unique: lJ5AIcZ-OzCwRs81gKvAFw-1 Received: by mail-ej1-f72.google.com with SMTP id eb10-20020a170907280ab02903d65bd14481so3929737ejc.21 for ; Fri, 04 Jun 2021 13:28:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=SsGVYeypydc8u4iFNETa0oN1HSK19Tp01M5QFxHPCz0=; b=lvksNmGqO6gJ+3SFfBqvMURVGK+R/1winLkD2SGKNJh3OEOxkDggPS3nKb1R62oPJ+ +LknZhEa1jMvHbfGa2ocOLLDbtW3g/ySBRazxl8pNbVM2CcHcH6IPCJkmUsZqh7CsklF vj9TdOywbaiGsFnFkX2/XP9fXXl5o9q7jZp0qhP5wNH0GNFvSTH+1+0x07diPac9JPKD TDcGdzvEpwOJSXf8uqNUFY53dRaYzV2h6g4nNCUdgtVbe/jJPRbnfq7FRuX8vCnv3t3s 53sjEJVAruC669lc4yiq7oIsKxrvU92hl2gEiXdb6owl6Bh2hwPawCof14CYD+m/P6pb WOpA== X-Gm-Message-State: AOAM533GNnedVPuJMhYvxmCeyvb6/Dcm6ocxqBkRPUfUI9CyE4E1z8ed Bp2Kh24yuQp2BxqslMlyiFESdEIlmBtBqEeNVDa2hZ5zmP2bxvMgOfJJ+ln37WskqCwPQog6Nyb jFkpUr9vm9Pz/4pdQpZhdi/xb X-Received: by 2002:a17:906:5488:: with SMTP id r8mr6023687ejo.374.1622838530043; Fri, 04 Jun 2021 13:28:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZr8tMoGUk+6iPIIG2J7wot9p8hXipDIx7G9ak5GRpv0eUFYlrSWsOLmLZliliWaPh8ZtNYQ== X-Received: by 2002:a17:906:5488:: with SMTP id r8mr6023671ejo.374.1622838529811; Fri, 04 Jun 2021 13:28:49 -0700 (PDT) Received: from x1.localdomain (2001-1c00-0c1e-bf00-1054-9d19-e0f0-8214.cable.dynamic.v6.ziggo.nl. [2001:1c00:c1e:bf00:1054:9d19:e0f0:8214]) by smtp.gmail.com with ESMTPSA id m9sm3310162ejj.53.2021.06.04.13.28.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 04 Jun 2021 13:28:49 -0700 (PDT) Subject: Re: LEDs with hardware-accelerated patterns, suspend indication To: Pavel Machek , kernel list , andy.shevchenko@gmail.com, mchehab+huawei@kernel.org, mauro.chehab@huawei.com, linux-leds@vger.kernel.org, Jafar Akhondali References: <20210526153040.GA4537@amd> From: Hans de Goede Message-ID: <5fbbab4f-3e22-5a4a-eea8-2531ee165cc4@redhat.com> Date: Fri, 4 Jun 2021 22:28:48 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20210526153040.GA4537@amd> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Pavel, On 5/26/21 5:30 PM, Pavel Machek wrote: > Hi! > > We have hardware trigger for arbitrary patterns... but then we have > common hardware that can do few simple patterns but not arbitrary > ones. > > Proposal: > > Have a new hardware trigger "lpattern" that will allow selection of > patterns hardware can commonly provide. I guess that is "off", "on", > "blinking", "breathing". Maybe with variations like "slow" and "fast". Adding Jafar, who has been working on adding support for the hardware patterns on the Acer Helios 300 RGB keyboard. Quoting from his patch for this: Backlight modes: 1: Breath 2: Neon 3: Wave 4: Shifting 5: Zoom So it looks like we need some more patterns for this to also be usable for his case, although patterns like wave, shifting and zoom sound like they are multi-LED patterns. Jafar can you explain how this works in a bit more detail. I get the feeling that from a hardware-API pov there are no individual addressable LEDs, yet some effects do program individual LEDs differently then their neighbors ? Or am I just misunderstanding what some of the effects do ? > It should provide software fallbacks, so we have reference how the > patterns should look like and behave. I think that we should probably define a couple of standard patterns with sw-fallbacks but also allow drivers to add driver specific pattern names, which won't have a sw fallback, this could then be combined with a lpatterns_available sysfs file or some such which lists the standard patterns + the driver specific patterns. This could then e.g. be used by the Acer Helios 300 RGB keyboard case. > It is quite common to provide LED with charging activity. > > Proposal: > > Have a trigger called "charging" which would provide three > subdirectories "charged", "charging" and "discharging" with interface > similar to the new "lpattern" trigger. When you say similar, you mean that each dir will have a lpattern file which can have one of the (standard) lpattern values ? This sounds good to me (this should work well for the whiskey-cove PMIC case which we discussed a while ago. > It is very common to have combined LED for power and suspend. > > Proposal: > > Have a trigger called "sysstate" with three subdirectories "off", "on" > and "suspended", with interfaces similar to the "lpattern" trigger. Regards, Hans