Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp821634lqs; Tue, 5 Mar 2024 19:07:38 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVl9LCTGhh5qTNjEurIuXmkyArCniNOUrmO1eBgW66yrBKCMWCe+UcR9h0ko/BHcgF6TfzKLYYvrAEGPuz7PAw46aNNp4uhj5CfJ3IbDg== X-Google-Smtp-Source: AGHT+IFfil7alpCCn+vCrCehbUNoZwQU1UvzIDI+JG4pNwK55rQHZuNYqTnrddQF1PGJwK6WOu8B X-Received: by 2002:a05:6a20:18a0:b0:1a1:4957:ec19 with SMTP id bm32-20020a056a2018a000b001a14957ec19mr2764152pzb.62.1709694457864; Tue, 05 Mar 2024 19:07:37 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709694457; cv=pass; d=google.com; s=arc-20160816; b=cdCUwpPjLG36SqDfb3h8m+pDBFyG79sBX35hOuI8tjkpvDWCMfuJ8QiW4h2o0PvYNW OYycMhb5P3T//mqfcYX95/JBxDkNpOhJIeZJNuXa6One3vWndJe6JwpxPv2oYqhLyeLJ Es+QiVEy0sk5zlGpIInc5m0WcS8rYICM1iTDSge6Ql/FSaPmP3xXrZAp/l8B2VaHPS4+ Gngfquk9H35oIW4bisdifziiHWkNjlogiuPyHe6de66zr9JfEvMl++P/N8FTzml+8FwN ntO1YAu1nWEXf5FQ3GCVOM1eJ6B9geIhQYTgtOc0JBEZRNG71Vyib5bW8COE0C8HW0wQ Lh8g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=NpaEtz8DypAu/ov2Q0LUUMD0B3ELzhFV6wWxCNb2Rjc=; fh=AnTpDt5VJ7EmhRl0QbOIJk4nFqSkEEVCWyMHCQRXSM4=; b=c7NqGML4AX3YE3XIUrHrvXtduTt5gdOWwmPU9v7x7VUwGG2bLPSBB+yIbwAOQXKZzn v1pBd9nYUrr6oQgIKDF8Ov58H5+47+Xz9xb7VGMq86tXkZxxvsknN3pydqbSBboRmOB6 JM1bfeagz1icwHiyRqz+WprcBlfMs6iqxa9E4pL1J8jNft+js8RzKK+GAhCgBiK6+nZu me9soX7oujP5q+TuwJUtgHKNB/vYbUl0GVUHmTAJeOMclwlCsZElZzsP9PYT3f9JM7a0 tQQboiylTh/j3u7df34yknl3ymaIs3nugBKp6TCP7XgFf8s/z0bCedRBgsT8UZ/501tn z9SQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Ylj4pOSC; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-93255-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93255-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id t7-20020a17090b018700b002997a4298ebsi13140270pjs.132.2024.03.05.19.07.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 19:07:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-93255-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Ylj4pOSC; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-93255-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-93255-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 2D25CB279C4 for ; Wed, 6 Mar 2024 02:58:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D839ADDAB; Wed, 6 Mar 2024 02:58:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Ylj4pOSC" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4B21633E1 for ; Wed, 6 Mar 2024 02:58:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709693905; cv=none; b=E9gKQ1R9sNGUTc3M6zjuHmCM+xG+x9OX/FNDf901VNbEyEZU7hMcn1aeNWmK/Im5/p6wqHAZYqvU1/qqy31QDHTaPUS7p6bYOBDwSKAIgl/nag/bZtMPK3EORT3rchmgqowuKSbNGCMFLNi6IM/8EHkn3hlszNxs4aL4jNYSt3Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709693905; c=relaxed/simple; bh=a0OOWv2WSGmSbvPtvl2vO3P9ZD7k/by876B14jjFqP4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=qt3TaEZiNNf8+ct1oLgUpxSCljoRlUoR9rktvtLl5v9NH6vZXRt04PeNyZJMiV412SCARJpDldD+zDMLJkveCShLqmg5iPMAX+wiAsHIsimuXYmFugOKH5iOSH49R++ZoyPPzYXSVXC/X4zMTfMFhkNUfrIEqTcKp/+dOO7/rwQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Ylj4pOSC; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1709693902; 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=NpaEtz8DypAu/ov2Q0LUUMD0B3ELzhFV6wWxCNb2Rjc=; b=Ylj4pOSCFcS/Fz00gBOCJLdk9EBqq2TYDAwiG5GIXEBIQHL9AtRedJ8aSp1c+0rWxc5Q3U VsmH3PEyX5NSZAs8tVuebuOWhSFQ9J+jqw0ffbUH4KZ6q/uuv9IHXoH+5s5+GdrAUZpIdR xVAhHzfUy/op1uZoLcpt9cFJmjrnj8M= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-222-5dusHTwePVCJ3TuZP1Wrpw-1; Tue, 05 Mar 2024 21:58:21 -0500 X-MC-Unique: 5dusHTwePVCJ3TuZP1Wrpw-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 945338007A7; Wed, 6 Mar 2024 02:58:20 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.39.192.36]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0BA0D111DCFF; Wed, 6 Mar 2024 02:58:15 +0000 (UTC) From: Kate Hsuan To: Pavel Machek , Lee Jones , linux-leds@vger.kernel.org, platform-driver-x86@vger.kernel.org, Hans de Goede , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , =?UTF-8?q?Andr=C3=A9=20Apitzsch?= , linux-kernel@vger.kernel.org Cc: Kate Hsuan Subject: [PATCH v4 0/2] KTD2026 indicator LED for X86 Xiaomi Pad2 Date: Wed, 6 Mar 2024 10:57:59 +0800 Message-ID: <20240306025801.8814-1-hpa@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 This patch added the support for Xiaomi Pad2 indicator LED. This work included two parts. 1. Added the KTD2026 swnode description to describe the LED controller. 2. Migrated the original driver to fwnode to support x86 platform. Moreover, the LED trigger is set to bq27520-0-charging for Xiaomi Pad2 so the LED will be turned on when charging. -- Changes in v4: 1. Fix double casting. 2. Since force casting a pointer value to int will trigger a compiler warning, the type of num_leds was changed to unsigned long. Changes in v3: 1. Drop the patch "leds-ktd202x: Skip regulator settings for Xiaomi pad2" Changes in v2: 1. Typo and style fixes. 2. The patch 0003 skips all the regulator setup for Xiaomi pad2 since KTD2026 on Xiaomi pad2 is already powered by BP25890RTWR. So, the sleep can be removed when removing the module. Kate Hsuan (2): platform: x86-android-tablets: other: Add swnode for Xiaomi pad2 indicator LED leds: rgb: leds-ktd202x: Get device properties through fwnode to support ACPI drivers/leds/rgb/Kconfig | 1 - drivers/leds/rgb/leds-ktd202x.c | 60 ++++++++----- .../platform/x86/x86-android-tablets/other.c | 85 +++++++++++++++++++ .../x86/x86-android-tablets/shared-psy-info.h | 2 + 4 files changed, 127 insertions(+), 21 deletions(-) -- 2.43.2