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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4DB4C64ED6 for ; Mon, 13 Feb 2023 12:46:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229729AbjBMMqt (ORCPT ); Mon, 13 Feb 2023 07:46:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231263AbjBMMqi (ORCPT ); Mon, 13 Feb 2023 07:46:38 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43B051A481 for ; Mon, 13 Feb 2023 04:45:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676292340; 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=AnJoYBSrnxau6xe0s/FoZpvzZMcp5n1ICaH81YVRh4k=; b=CtEgv/sl6TwFRF1izw42CJ3+h4UWS/smk+ujqiymnCogq2lEmiPAjzEAEqBEykNPpz/N6K CEDIoBGdFcOz7put309tO0SfCWaced9hvnYboZ90/iVNm3vhuP1go4TlyyPxjz5H4LBmi5 0+j7HWIACdVCPr/xxcpysjoe6O/pJNM= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-572-GzXStqZ3Obml1-Y6mG4TSQ-1; Mon, 13 Feb 2023 07:45:36 -0500 X-MC-Unique: GzXStqZ3Obml1-Y6mG4TSQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id C5645181B7C9; Mon, 13 Feb 2023 12:45:35 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.67.24.132]) by smtp.corp.redhat.com (Postfix) with ESMTP id AFFE8403D0C1; Mon, 13 Feb 2023 12:45:30 +0000 (UTC) From: Kate Hsuan To: Pavel Machek , Lee Jones , linux-leds@vger.kernel.org, platform-driver-x86@vger.kernel.org, Hans de Goede , Daniel Scally , Mark Gross Cc: Kate Hsuan Subject: [RESEND PATCH 0/3] leds: tps68470: LED driver for TPS68470 Date: Mon, 13 Feb 2023 20:45:17 +0800 Message-Id: <20230213124520.1635257-1-hpa@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org This work allows user to control the indicator and flash LEDs though sysfs in user space. TPS68470 is a part of INT3470 and provides GPIO, LED, and power controls. To allow the user to control these two LEDs, two masks for the ILEDCTL, called TPS68470_ILEDCTL_ENA and TPS68470_ILEDCTL_ENA and a two bits mask, called TPS68470_ILEDCTL_CTRLB are defined and are used to enable/disable the LEDs and set the power status, respectively. The LED driver called leds-tps68470 provides the sysfs interface and the register configuration implementation. For the indicator LED, only TPS68470_ILEDCTL_ENA needs to be set to turn on/off the LED. For the flash LED, TPS68470 provides 4 levels of power settings. After enabling the TPS68470_ILEDCTL_ENB, the power level should also be set. The strategy is Brightness | Power ======================= LED_OFF | - LED_ON | 4mA LED_HALF | 8mA LED_FULL | 16mA Moreover, the user and application can set the brightness through sysfs, /sys/class/leds/tps68470-ileda and /sys/class/leds/tps68470-iledb Kate Hsuan (3): platform: x86: int3472: Add MFD cell for tps68470 LED include: mfd: tps68470: Add masks for LEDA and LEDB leds: tps68470: Add LED control for tps68470 drivers/leds/Kconfig | 12 ++ drivers/leds/Makefile | 1 + drivers/leds/leds-tps68470.c | 170 ++++++++++++++++++ drivers/platform/x86/intel/int3472/tps68470.c | 3 +- include/linux/mfd/tps68470.h | 5 + 5 files changed, 190 insertions(+), 1 deletion(-) create mode 100644 drivers/leds/leds-tps68470.c -- 2.39.0