Platform-driver-x86 archive mirror
 help / color / mirror / Atom feed
From: Kate Hsuan <hpa@redhat.com>
To: "Pavel Machek" <pavel@ucw.cz>, "Lee Jones" <lee@kernel.org>,
	linux-leds@vger.kernel.org, platform-driver-x86@vger.kernel.org,
	"Hans de Goede" <hdegoede@redhat.com>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>,
	"André Apitzsch" <git@apitzsch.eu>,
	linux-kernel@vger.kernel.org,
	"Andy Shevchenko" <andy.shevchenko@gmail.com>,
	"Sebastian Reichel" <sre@kernel.org>,
	linux-pm@vger.kernel.org
Cc: Kate Hsuan <hpa@redhat.com>
Subject: [PATCH v6 0/5] KTD2026 indicator LED for X86 Xiaomi Pad2
Date: Tue, 16 Apr 2024 13:39:04 +0800	[thread overview]
Message-ID: <20240416053909.256319-1-hpa@redhat.com> (raw)

This patch added the support for Xiaomi Pad2 indicator LED. This work
included:
1. Added the KTD2026 swnode description to describe the LED controller.
2. Migrated the original driver to fwnode to support x86 platform.
3. Support for multi-color LED trigger event.
4. The LED shows orange  when charging and the LED shows green when the
   battery is full.

Moreover, the LED trigger is set to the new trigger, called
"bq27520-0-charging-orange-full-green" for Xiaomi Pad2 so the LED shows
orange when charging and the LED shows green when the battery is full.

The new LED API led_mc_trigger_event() can be found in the following
URL.
https://lore.kernel.org/linux-leds/f40a0b1a-ceac-e269-c2dd-0158c5b4a1ad@gmail.com/

--
Changes in v6:
1. The I2C ID table was moved to a separate patch.
2. The LED shows orange when charging.
3. The trigger name was renamed to charging-orange-full-green.
4. The default trigger of Xiaomi Pad2 is
   "bq27520-0-charging-orange-full-green".

Changes in v5:
1. Fix swnode LED color settings.
2. Improve the driver based on the comments.
3. Introduce a LED new API- led_mc_trigger_event() to make the LED
   color can be changed according to the trigger.
4. Introduced a new trigger "charging-red-full-green". The LED will be
   red when charging and the the LED will be green when the battery is
   full.
5. Set the default trigger to "bq27520-0-charging-red-full-green" for
   Xiaomi Pad2.

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 (5):
  platform: x86-android-tablets: other: Add swnode for Xiaomi pad2
    indicator LED
  leds: rgb: leds-ktd202x: Get device properties through fwnode to
    support ACPI
  leds: rgb: leds-ktd202x: I2C ID tables for KTD2026 and 2027
  power: supply: power-supply-leds: Add charging_orange_full_green
    trigger for RGB LED
  platform: x86-android-tablets: others: Set the LED trigger to
    charging_orange_full_green for Xiaomi pad2

 drivers/leds/rgb/Kconfig                      |  1 -
 drivers/leds/rgb/leds-ktd202x.c               | 73 ++++++++++-------
 .../platform/x86/x86-android-tablets/other.c  | 82 +++++++++++++++++++
 .../x86/x86-android-tablets/shared-psy-info.h |  2 +
 drivers/power/supply/power_supply_leds.c      | 26 ++++++
 include/linux/power_supply.h                  |  2 +
 6 files changed, 156 insertions(+), 30 deletions(-)

-- 
2.44.0


             reply	other threads:[~2024-04-16  5:39 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-16  5:39 Kate Hsuan [this message]
2024-04-16  5:39 ` [PATCH v6 1/5] platform: x86-android-tablets: other: Add swnode for Xiaomi pad2 indicator LED Kate Hsuan
2024-04-16 13:45   ` Andy Shevchenko
2024-04-18  7:46     ` Kate Hsuan
2024-04-18  8:55   ` Hans de Goede
2024-04-16  5:39 ` [PATCH v6 2/5] leds: rgb: leds-ktd202x: Get device properties through fwnode to support ACPI Kate Hsuan
2024-04-16 17:29   ` Andy Shevchenko
2024-04-18  7:22     ` Kate Hsuan
2024-04-16  5:39 ` [PATCH v6 3/5] leds: rgb: leds-ktd202x: I2C ID tables for KTD2026 and 2027 Kate Hsuan
2024-04-16 17:31   ` Andy Shevchenko
2024-04-18  7:01     ` Kate Hsuan
2024-04-16  5:39 ` [PATCH v6 4/5] power: supply: power-supply-leds: Add charging_orange_full_green trigger for RGB LED Kate Hsuan
2024-04-16 17:03   ` kernel test robot
2024-04-16 17:33     ` Andy Shevchenko
2024-04-18  6:40       ` Kate Hsuan
2024-04-16 23:27   ` kernel test robot
2024-04-18 12:34   ` Sebastian Reichel
2024-04-19  7:37     ` Hans de Goede
2024-04-19 11:14       ` Sebastian Reichel
2024-04-16  5:39 ` [PATCH v6 5/5] platform: x86-android-tablets: others: Set the LED trigger to charging_orange_full_green for Xiaomi pad2 Kate Hsuan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240416053909.256319-1-hpa@redhat.com \
    --to=hpa@redhat.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=git@apitzsch.eu \
    --cc=hdegoede@redhat.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=lee@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=sre@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).