From patchwork Fri Mar 10 06:55:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ChiaEn Wu X-Patchwork-Id: 67243 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp728555wrd; Thu, 9 Mar 2023 23:18:58 -0800 (PST) X-Google-Smtp-Source: AK7set9mxtfbmKe/QH01oHnzjf9UtiBzM2q1q0MM/fupgIIJxtnhJAhcg8Xs6j0uXwbu3VbrOn/L X-Received: by 2002:a05:6a20:914c:b0:bf:58d1:ce92 with SMTP id x12-20020a056a20914c00b000bf58d1ce92mr1123179pzc.17.1678432737998; Thu, 09 Mar 2023 23:18:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1678432737; cv=none; d=google.com; s=arc-20160816; b=LsmoxK0gLSP4fl2raAU2zVDZ1iYltw/bCHmZ8KGKZv3WBL2Aa+VV00BBamnclqT1CM 3Nm4EAaEf3aL/xk1xGm3J6e/IsPpXPrzJbojqquhqItXhhdLUoG071EAiwgQV5XCS8LB 3muYG1nRrSDupfDT5SPYkUCo14lgF6gQASyAGT3L4bH+7U8GCvOOWxFDNXX7i1ncc/JN uqSYPM2wvQKRhX72D9KHsOQ2taDbFJPuGgFzIoKVLgnTlr2mGDt9SGF0jX+jdbhM5zx9 aE9K8LnnVUhcXNvk1MK0j9txq5xFCJ6ZKvmH4a86GUVwSML2R/F6K2eXBGKe8dEyax6t OdJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=X2f7PcdZsfyhr/wPvOYFQehbqeQQKC8HQ7+DblIGL2Q=; b=P8wxq/BejYT2a0Txut/pQ+YLXruinV9zaGt4UGPYn893JMrL5Wdxqyrx40FRTSN6Fl AhuOAxpSVSHa2LPFJhbgZH2KAHc19c0lC4pnUPx5sjdztsZmLIJxAXJcvr2zW6058pCU uV3IirAwtcaaSCvNANiNoTHVUcsq6x6b0FyZwMJl/YB9RPl7/QgitgINqV5hFFu1QEpb MVr6PcvawZ/O5cp3t3VO41refQevHJVGl0LRbuSswjJm0siAdbb4uD0/9+dJyqF7y4hC ySdowyeH5JPIkmtKXDVfDZ5DQHA6KeLOhjOcpHcJvfEOKpUAtsfaGdlzh6KOHvY9latr 9y4w== 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 207-20020a6302d8000000b005077dda0493si1266475pgc.551.2023.03.09.23.18.44; Thu, 09 Mar 2023 23:18:57 -0800 (PST) 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 S229983AbjCJG4m (ORCPT + 99 others); Fri, 10 Mar 2023 01:56:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229602AbjCJG4j (ORCPT ); Fri, 10 Mar 2023 01:56:39 -0500 Received: from mg.richtek.com (mg.richtek.com [220.130.44.152]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0A482F7ECC; Thu, 9 Mar 2023 22:56:35 -0800 (PST) X-MailGates: (flag:4,DYNAMIC,BADHELO,RELAY,NOHOST:PASS)(compute_score:DE LIVER,40,3) Received: from 192.168.10.46 by mg.richtek.com with MailGates ESMTP Server V5.0(20043:0:AUTH_RELAY) (envelope-from ); Fri, 10 Mar 2023 14:56:02 +0800 (CST) Received: from ex3.rt.l (192.168.10.46) by ex3.rt.l (192.168.10.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.25; Fri, 10 Mar 2023 14:56:02 +0800 Received: from linuxcarl2.richtek.com (192.168.10.154) by ex3.rt.l (192.168.10.45) with Microsoft SMTP Server id 15.2.1118.25 via Frontend Transport; Fri, 10 Mar 2023 14:56:02 +0800 From: ChiaEn Wu To: , , , , , , CC: , , , , , , , , ChiaEn Wu Subject: [PATCH v18 3/3] docs: leds: Add MT6370 RGB LED pattern document Date: Fri, 10 Mar 2023 14:55:57 +0800 Message-ID: <38f1e863b0f099158a63fb6f95056a1cb30d80a0.1678430444.git.chiaen_wu@richtek.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS 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: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1759964286898563184?= X-GMAIL-MSGID: =?utf-8?q?1759964286898563184?= From: ChiYuan Huang Document the MT6370 RGB LED pattern trigger. This simply describe how the pattern works, each timing period, and the pattern diagram for MT6370 RGB LED. Signed-off-by: ChiYuan Huang Signed-off-by: ChiaEn Wu --- v18: - Revise the text in document title and description. --- Documentation/leds/leds-mt6370-rgb.rst | 64 ++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 Documentation/leds/leds-mt6370-rgb.rst diff --git a/Documentation/leds/leds-mt6370-rgb.rst b/Documentation/leds/leds-mt6370-rgb.rst new file mode 100644 index 00000000..abf739e --- /dev/null +++ b/Documentation/leds/leds-mt6370-rgb.rst @@ -0,0 +1,64 @@ +.. SPDX-License-Identifier: GPL-2.0 + +========================================= +The device for Mediatek MT6370 RGB LED +========================================= + +Description +----------- + +The MT6370 integrates a four-channel RGB LED driver, designed to provide a +variety of lighting effect for mobile device applications. The RGB LED devices +includes a smart LED string controller and it can drive 3 channels of LEDs with +a sink current up to 24mA and a CHG_VIN power good indicator LED with sink +current up to 6mA. It provides three operation modes for RGB LEDs: +PWM Dimming mode, breath pattern mode, and constant current mode. The device +can increase or decrease the brightness of the RGB LED via an I2C interface. + +The breath pattern for a channel can be programmed using the "pattern" trigger, +using the hw_pattern attribute. + +/sys/class/leds//hw_pattern +-------------------------------- + +Specify a hardware breath pattern for a MT6370 RGB LED. + +The breath pattern is a series of timing pairs, with the hold-time expressed in +milliseconds. And the brightness is controlled by +'/sys/class/leds//brightness'. The pattern doesn't include the brightness +setting. Hardware pattern only controls the timing for each pattern stage +depending on the current brightness setting. + +Pattern diagram:: + + "0 Tr1 0 Tr2 0 Tf1 0 Tf2 0 Ton 0 Toff" --> '0' for dummy brightness code + + ^ + | ============ + | / \ / +Icurr | / \ / + | / \ / + | / \ / .....repeat + | / \ / + | --- --- --- + |--- --- --- + +----------------------------------============------------> Time + < Tr1>< Ton >< Toff >< Tr1> + +Timing description:: + +Tr1: First rising time for duty 0 to 30%. +Tr2: Second rising time for duty 31% to 100%. +Ton: On time for duty 100%. +Tf1: First falling time for duty 100% to 31%. +Tf2: Second falling time for duty 30% to 0%. +Toff: Off time for duty 0%. + +Tr1/Tr2/Tf1/Tf2/Ton: 125ms to 3125ms, 200ms per step. +Toff: 250ms to 6250ms, 400ms per step. + +Pattern example:: + + "0 125 0 125 0 125 0 125 0 625 0 1050" + +This Will configure Tr1/Tr2/Tf1/Tf2 to 125m, Ton to 625ms, and Toff to 1050ms.