From patchwork Thu Apr 13 15:18:03 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 673726 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 79BE5C77B71 for ; Thu, 13 Apr 2023 15:19:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231536AbjDMPTA (ORCPT ); Thu, 13 Apr 2023 11:19:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229999AbjDMPS6 (ORCPT ); Thu, 13 Apr 2023 11:18:58 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13EED9013 for ; Thu, 13 Apr 2023 08:18:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1681399096; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=HkFrf371n3q3T/PZtZx2WJtsRnWzXQw+29ZKklq7bDU=; b=dsvSHP+2a20dGBDO99EbNCseBXStx/GobdDW7xyJsYNm4ckT8z5XllXHRdV8nUPVP3FQw/ dkMun7cIMbhA61fabjEg7vLLyL3aBVoGCpSjSxXMsejwBN40wgeEBFn/WDafTon0d8y7xc nvZahlnjyUUHT/fEKyrZKvLVkdl2uEw= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-571-zhEyzppKOA6HEmGMZTFN8Q-1; Thu, 13 Apr 2023 11:18:11 -0400 X-MC-Unique: zhEyzppKOA6HEmGMZTFN8Q-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1F0DD29DD997; Thu, 13 Apr 2023 15:18:11 +0000 (UTC) Received: from x1.nl (unknown [10.39.192.251]) by smtp.corp.redhat.com (Postfix) with ESMTP id BC031141511D; Thu, 13 Apr 2023 15:18:09 +0000 (UTC) From: Hans de Goede To: Pavel Machek , Lee Jones , Yauhen Kharuzhy Cc: Hans de Goede , linux-leds@vger.kernel.org Subject: [PATCH 0/5] leds: Add Intel Cherry Trail Whiskey Cove PMIC LED driver Date: Thu, 13 Apr 2023 17:18:03 +0200 Message-Id: <20230413151808.20900-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org Hi All, Here is a patch series to add support for the LED controller on Intel Cherry Trail Whiskey Cove PMICs. This is based on the original patch for this from Yauhen Kharuzhy, with additional work on top by me. This addresses the review remarks on the v2 posting from Yauhen: - Since the PMIC is connected to the battery any changes we make to the LED settings are permanent, even surviving reboot / poweroff. Save LED1 register settings on probe() and if auto-/hw-control was enabled on probe() restore the settings on remove() and shutdown(). - Add support for the pattern trigger to select breathing mode This makes the charging LED on devices with these PMICs properly reflect the charging status (this relies on sw control on most devices) and this also allows control of the LED behind the pen (digitizer on) symbol on the keyboard half of the Lenovo Yoga Book 1 models. Regards, Hans Hans de Goede (4): leds: cht-wcove: Add suspend/resume handling leds: cht-wcove: Add support for breathing mode use hw_pattern sysfs API leds: cht-wcove: Set default trigger for charging LED leds: cht-wcove: Use breathing when LED_INIT_DEFAULT_TRIGGER is set Yauhen Kharuzhy (1): leds: Add Intel Cherry Trail Whiskey Cove PMIC LED driver Documentation/leds/index.rst | 1 + Documentation/leds/leds-cht-wcove.rst | 29 ++ drivers/leds/Kconfig | 11 + drivers/leds/Makefile | 1 + drivers/leds/leds-cht-wcove.c | 466 ++++++++++++++++++++++++++ 5 files changed, 508 insertions(+) create mode 100644 Documentation/leds/leds-cht-wcove.rst create mode 100644 drivers/leds/leds-cht-wcove.c