From patchwork Tue Apr 16 05:39:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kate Hsuan X-Patchwork-Id: 789575 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 D833C3A29C for ; Tue, 16 Apr 2024 05:39:47 +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=1713245990; cv=none; b=MOepw76Bc89cde+1QuNE8Hsq8Mz2eAaugJtc3U2KYC0hm95iSUCeRb27bPK0WExVRslAJ3SE1Hj3TwAOxR/MTudZEVAmBMbDl4wMm7sGwcTK0JtX5JIv0o6CaBdxXN1eVAaSMwBDHWgEPvmviMOq6ITAphMP4vQn7iCvEbbiOIo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713245990; c=relaxed/simple; bh=Nku8TS1wMiFLplVVxpdO3JkSes4YA0gaL2IquRgtu/M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=G8bHUzq5tW0biYEaJtjPks/5iduKRe8ozK15JD7e0KuiuKTHsfQGJN2PMCPHivHnoUecv4+5Od6HakQmJQYR89W5gQS/YWUVlJ7o2K8C2Mz40IVDtm52lfcXjpqSj2yGnJ7pHoAYE6o1SrcptliIBVeKCmxhai4uL+wImMT1lsQ= 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=fo+NwYfX; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="fo+NwYfX" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713245986; 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: in-reply-to:in-reply-to:references:references; bh=0PPjH5ogqqD10NyBQ3gLfVf4axP6G/LJix2SPW5Xsxo=; b=fo+NwYfXSx06B+S/3YF08pT/tHKvue3t8krz/NxnQkrrTF4VZg77QzxRADRMB8bIGynCRp BsDf3N3BxohGbRrpPvFt/On9Wmd0AvhkJO5SqccMPqFdDS0pXZiVIIK3uuvhjRgRcDKTs0 2Wk/Z6j0ETNE10YHqDu9700lkHAIJ6E= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-466-1X0Gv_-hOau6Wqr_aXJ1Fw-1; Tue, 16 Apr 2024 01:39:43 -0400 X-MC-Unique: 1X0Gv_-hOau6Wqr_aXJ1Fw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (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 02F683803916; Tue, 16 Apr 2024 05:39:43 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.39.192.2]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4970C51EF; Tue, 16 Apr 2024 05:39:36 +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_J=C3=A4rvinen?= , =?utf-8?q?A?= =?utf-8?q?ndr=C3=A9_Apitzsch?= , linux-kernel@vger.kernel.org, Andy Shevchenko , Sebastian Reichel , linux-pm@vger.kernel.org Cc: Kate Hsuan Subject: [PATCH v6 1/5] platform: x86-android-tablets: other: Add swnode for Xiaomi pad2 indicator LED Date: Tue, 16 Apr 2024 13:39:05 +0800 Message-ID: <20240416053909.256319-2-hpa@redhat.com> In-Reply-To: <20240416053909.256319-1-hpa@redhat.com> References: <20240416053909.256319-1-hpa@redhat.com> Precedence: bulk X-Mailing-List: linux-leds@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 KTD2026 LED controller manages the indicator LED for Xiaomi pad2. The ACPI for it is not properly made so the kernel can't get a correct description. This work adds a description for this RGB LED controller and also sets a trigger to indicate the changing event (bq27520-0-charging). When it is charging, the indicator LED will be turned on. Signed-off-by: Kate Hsuan --- .../platform/x86/x86-android-tablets/other.c | 82 +++++++++++++++++++ .../x86/x86-android-tablets/shared-psy-info.h | 2 + 2 files changed, 84 insertions(+) diff --git a/drivers/platform/x86/x86-android-tablets/other.c b/drivers/platform/x86/x86-android-tablets/other.c index bc6bbf7ec6ea..c77d56454f2d 100644 --- a/drivers/platform/x86/x86-android-tablets/other.c +++ b/drivers/platform/x86/x86-android-tablets/other.c @@ -13,6 +13,8 @@ #include #include +#include + #include "shared-psy-info.h" #include "x86-android-tablets.h" @@ -593,6 +595,83 @@ const struct x86_dev_info whitelabel_tm800a550l_info __initconst = { .gpiod_lookup_tables = whitelabel_tm800a550l_gpios, }; +/* + * The fwnode for ktd2026 on Xaomi pad2. It composed of a RGB LED node + * with three subnodes for each color. The RGB LED node is named + * "multi-led" to align with the name in the device tree. + */ + +/* main fwnode for ktd2026 */ +static const struct software_node ktd2026_node = { + .name = "ktd2026" +}; + +static const struct property_entry ktd2026_rgb_led_props[] = { + PROPERTY_ENTRY_U32("reg", 0), + PROPERTY_ENTRY_U32("color", LED_COLOR_ID_RGB), + PROPERTY_ENTRY_STRING("function", "indicator"), + PROPERTY_ENTRY_STRING("linux,default-trigger", "bq27520-0-charging"), + { } +}; + +static const struct software_node ktd2026_rgb_led_node = { + .name = "multi-led", + .properties = ktd2026_rgb_led_props, + .parent = &ktd2026_node, +}; + +static const struct property_entry ktd2026_blue_led_props[] = { + PROPERTY_ENTRY_U32("reg", 0), + PROPERTY_ENTRY_U32("color", LED_COLOR_ID_BLUE), + { } +}; + +static const struct software_node ktd2026_blue_led_node = { + .properties = ktd2026_blue_led_props, + .parent = &ktd2026_rgb_led_node, +}; + +static const struct property_entry ktd2026_green_led_props[] = { + PROPERTY_ENTRY_U32("reg", 1), + PROPERTY_ENTRY_U32("color", LED_COLOR_ID_GREEN), + { } +}; + +static const struct software_node ktd2026_green_led_node = { + .properties = ktd2026_green_led_props, + .parent = &ktd2026_rgb_led_node, +}; + +static const struct property_entry ktd2026_red_led_props[] = { + PROPERTY_ENTRY_U32("reg", 2), + PROPERTY_ENTRY_U32("color", LED_COLOR_ID_RED), + { } +}; + +static const struct software_node ktd2026_red_led_node = { + .properties = ktd2026_red_led_props, + .parent = &ktd2026_rgb_led_node, +}; + +static const struct software_node *ktd2026_node_group[] = { + &ktd2026_node, + &ktd2026_rgb_led_node, + &ktd2026_green_led_node, + &ktd2026_blue_led_node, + &ktd2026_red_led_node, + NULL +}; + +static int __init xiaomi_mipad2_init(void) +{ + return software_node_register_node_group(ktd2026_node_group); +} + +static void xiaomi_mipad2_exit(void) +{ + software_node_unregister_node_group(ktd2026_node_group); +} + /* * If the EFI bootloader is not Xiaomi's own signed Android loader, then the * Xiaomi Mi Pad 2 X86 tablet sets OSID in the DSDT to 1 (Windows), causing @@ -616,6 +695,7 @@ static const struct x86_i2c_client_info xiaomi_mipad2_i2c_clients[] __initconst .type = "ktd2026", .addr = 0x30, .dev_name = "ktd2026", + .swnode = &ktd2026_node, }, .adapter_path = "\\_SB_.PCI0.I2C3", }, @@ -624,4 +704,6 @@ static const struct x86_i2c_client_info xiaomi_mipad2_i2c_clients[] __initconst const struct x86_dev_info xiaomi_mipad2_info __initconst = { .i2c_client_info = xiaomi_mipad2_i2c_clients, .i2c_client_count = ARRAY_SIZE(xiaomi_mipad2_i2c_clients), + .init = xiaomi_mipad2_init, + .exit = xiaomi_mipad2_exit, }; diff --git a/drivers/platform/x86/x86-android-tablets/shared-psy-info.h b/drivers/platform/x86/x86-android-tablets/shared-psy-info.h index c2d2968cddc2..8c33ec47ee12 100644 --- a/drivers/platform/x86/x86-android-tablets/shared-psy-info.h +++ b/drivers/platform/x86/x86-android-tablets/shared-psy-info.h @@ -29,4 +29,6 @@ extern const char * const bq24190_modules[]; extern const struct platform_device_info int3496_pdevs[]; extern struct gpiod_lookup_table int3496_reference_gpios; +extern const struct software_node ktd2026_leds_node; + #endif From patchwork Tue Apr 16 05:39:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kate Hsuan X-Patchwork-Id: 790909 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 4259A3BBE2 for ; Tue, 16 Apr 2024 05:39:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713245998; cv=none; b=uJrxCNmV1CuJh+RlhuCqjOquMv9cWfEOS18VhHVTJB6F+9J1ja13GbOb67RSPtkRu0Wec2i0A03/FdqKgGrEiIFjLPCnHRQG/5dmoh1lFUwgp+i2gMoa5V7DdgOVtt0QyCe7Z62GhymZP/PncHipZkxnPzhD/EwuDDwINnh265s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713245998; c=relaxed/simple; bh=3o8fsDoKxogUP+giW3mIfjii4mwpSVRjSxzxi91sHP0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=R4+/J9jLPq6SFwfOOA/HIOAt4/kfP6mGOZBi37tL5DP0RWfhUe1x0A83Ae4aZZMeobzGC5LCof/2lcyQws5DSg2+aSJzzpfhAd8gDF7TXiZRkUk3LEYpocNHON8HCCHykandGtOKk/lZ5Id55lOy28NU2BFbHym5k/P67FGKzyw= 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=Am5P77VP; arc=none smtp.client-ip=170.10.129.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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Am5P77VP" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713245996; 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: in-reply-to:in-reply-to:references:references; bh=I+zNkS3A/joay3pty9yb1Z8mlEWvfV88sj5f9kywark=; b=Am5P77VPAPAolkOrLxmVb/C9Am8e4tc7GI0csU88yzuW5xwTRV9eVr39tg1TwpfYenWyY5 j8q8Mcw7WYzBv9D4qKokcuZW1ePfQLZ4DpAe1fE0k7munvvRs+Ugpn7QbyHwYoxSDYK7fu GfQbU9OZ377Jptq/zh6hVn1z5uKQdug= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-133-4kDOlOtyO7aBV0MVXLd1yQ-1; Tue, 16 Apr 2024 01:39:53 -0400 X-MC-Unique: 4kDOlOtyO7aBV0MVXLd1yQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (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 5E6F9380390E; Tue, 16 Apr 2024 05:39:52 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.39.192.2]) by smtp.corp.redhat.com (Postfix) with ESMTP id AF21251EF; Tue, 16 Apr 2024 05:39:46 +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_J=C3=A4rvinen?= , =?utf-8?q?A?= =?utf-8?q?ndr=C3=A9_Apitzsch?= , linux-kernel@vger.kernel.org, Andy Shevchenko , Sebastian Reichel , linux-pm@vger.kernel.org Cc: Kate Hsuan Subject: [PATCH v6 2/5] leds: rgb: leds-ktd202x: Get device properties through fwnode to support ACPI Date: Tue, 16 Apr 2024 13:39:06 +0800 Message-ID: <20240416053909.256319-3-hpa@redhat.com> In-Reply-To: <20240416053909.256319-1-hpa@redhat.com> References: <20240416053909.256319-1-hpa@redhat.com> Precedence: bulk X-Mailing-List: linux-leds@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 This LED controller is installed on a Xiaomi pad2 and it is an x86 platform. The original driver is based on the device tree and can't be used for this ACPI based system. This patch migrated the driver to use fwnode to access the properties. Moreover, the fwnode API supports the device tree so this work won't affect the original implementations. Signed-off-by: Kate Hsuan --- drivers/leds/rgb/Kconfig | 1 - drivers/leds/rgb/leds-ktd202x.c | 67 ++++++++++++++++++--------------- 2 files changed, 37 insertions(+), 31 deletions(-) diff --git a/drivers/leds/rgb/Kconfig b/drivers/leds/rgb/Kconfig index e66bd21b9852..14d6b294a786 100644 --- a/drivers/leds/rgb/Kconfig +++ b/drivers/leds/rgb/Kconfig @@ -17,7 +17,6 @@ config LEDS_GROUP_MULTICOLOR config LEDS_KTD202X tristate "LED support for KTD202x Chips" depends on I2C - depends on OF select REGMAP_I2C help This option enables support for the Kinetic KTD2026/KTD2027 diff --git a/drivers/leds/rgb/leds-ktd202x.c b/drivers/leds/rgb/leds-ktd202x.c index 514965795a10..8d0ed1a95a9f 100644 --- a/drivers/leds/rgb/leds-ktd202x.c +++ b/drivers/leds/rgb/leds-ktd202x.c @@ -99,7 +99,7 @@ struct ktd202x { struct device *dev; struct regmap *regmap; bool enabled; - int num_leds; + unsigned long num_leds; struct ktd202x_led leds[] __counted_by(num_leds); }; @@ -381,16 +381,18 @@ static int ktd202x_blink_mc_set(struct led_classdev *cdev, mc->num_colors); } -static int ktd202x_setup_led_rgb(struct ktd202x *chip, struct device_node *np, +static int ktd202x_setup_led_rgb(struct ktd202x *chip, struct fwnode_handle *fwnode, struct ktd202x_led *led, struct led_init_data *init_data) { + struct fwnode_handle *child; struct led_classdev *cdev; - struct device_node *child; struct mc_subled *info; - int num_channels; + int num_channels = 0; int i = 0; - num_channels = of_get_available_child_count(np); + fwnode_for_each_available_child_node(fwnode, child) + num_channels++; + if (!num_channels || num_channels > chip->num_leds) return -EINVAL; @@ -398,22 +400,22 @@ static int ktd202x_setup_led_rgb(struct ktd202x *chip, struct device_node *np, if (!info) return -ENOMEM; - for_each_available_child_of_node(np, child) { + fwnode_for_each_available_child_node(fwnode, child) { u32 mono_color; u32 reg; int ret; - ret = of_property_read_u32(child, "reg", ®); + ret = fwnode_property_read_u32(child, "reg", ®); if (ret != 0 || reg >= chip->num_leds) { - dev_err(chip->dev, "invalid 'reg' of %pOFn\n", child); - of_node_put(child); - return -EINVAL; + dev_err(chip->dev, "invalid 'reg' of %pfw\n", child); + fwnode_handle_put(child); + return ret; } - ret = of_property_read_u32(child, "color", &mono_color); + ret = fwnode_property_read_u32(child, "color", &mono_color); if (ret < 0 && ret != -EINVAL) { - dev_err(chip->dev, "failed to parse 'color' of %pOF\n", child); - of_node_put(child); + dev_err(chip->dev, "failed to parse 'color' of %pfw\n", child); + fwnode_handle_put(child); return ret; } @@ -433,16 +435,16 @@ static int ktd202x_setup_led_rgb(struct ktd202x *chip, struct device_node *np, return devm_led_classdev_multicolor_register_ext(chip->dev, &led->mcdev, init_data); } -static int ktd202x_setup_led_single(struct ktd202x *chip, struct device_node *np, +static int ktd202x_setup_led_single(struct ktd202x *chip, struct fwnode_handle *fwnode, struct ktd202x_led *led, struct led_init_data *init_data) { struct led_classdev *cdev; u32 reg; int ret; - ret = of_property_read_u32(np, "reg", ®); + ret = fwnode_property_read_u32(fwnode, "reg", ®); if (ret != 0 || reg >= chip->num_leds) { - dev_err(chip->dev, "invalid 'reg' of %pOFn\n", np); + dev_err(chip->dev, "invalid 'reg' of %pfw\n", fwnode); return -EINVAL; } led->index = reg; @@ -454,7 +456,9 @@ static int ktd202x_setup_led_single(struct ktd202x *chip, struct device_node *np return devm_led_classdev_register_ext(chip->dev, &led->cdev, init_data); } -static int ktd202x_add_led(struct ktd202x *chip, struct device_node *np, unsigned int index) +static int ktd202x_add_led(struct ktd202x *chip, + struct fwnode_handle *fwnode, + unsigned int index) { struct ktd202x_led *led = &chip->leds[index]; struct led_init_data init_data = {}; @@ -463,21 +467,21 @@ static int ktd202x_add_led(struct ktd202x *chip, struct device_node *np, unsigne int ret; /* Color property is optional in single color case */ - ret = of_property_read_u32(np, "color", &color); + ret = fwnode_property_read_u32(fwnode, "color", &color); if (ret < 0 && ret != -EINVAL) { - dev_err(chip->dev, "failed to parse 'color' of %pOF\n", np); + dev_err(chip->dev, "failed to parse 'color' of %pfw\n", fwnode); return ret; } led->chip = chip; - init_data.fwnode = of_fwnode_handle(np); + init_data.fwnode = fwnode; if (color == LED_COLOR_ID_RGB) { cdev = &led->mcdev.led_cdev; - ret = ktd202x_setup_led_rgb(chip, np, led, &init_data); + ret = ktd202x_setup_led_rgb(chip, fwnode, led, &init_data); } else { cdev = &led->cdev; - ret = ktd202x_setup_led_single(chip, np, led, &init_data); + ret = ktd202x_setup_led_single(chip, fwnode, led, &init_data); } if (ret) { @@ -492,26 +496,27 @@ static int ktd202x_add_led(struct ktd202x *chip, struct device_node *np, unsigne static int ktd202x_probe_dt(struct ktd202x *chip) { - struct device_node *np = dev_of_node(chip->dev), *child; + struct fwnode_handle *child, *fwnode; + struct device *dev = chip->dev; int count; int i = 0; - chip->num_leds = (int)(unsigned long)of_device_get_match_data(chip->dev); - - count = of_get_available_child_count(np); + count = device_get_child_node_count(dev); if (!count || count > chip->num_leds) return -EINVAL; + fwnode = dev_fwnode(dev); + regmap_write(chip->regmap, KTD202X_REG_RESET_CONTROL, KTD202X_RSTR_RESET); /* Allow the device to execute the complete reset */ usleep_range(200, 300); - for_each_available_child_of_node(np, child) { + fwnode_for_each_available_child_node(fwnode, child) { int ret = ktd202x_add_led(chip, child, i); if (ret) { - of_node_put(child); + fwnode_handle_put(child); return ret; } i++; @@ -554,6 +559,8 @@ static int ktd202x_probe(struct i2c_client *client) return ret; } + chip->num_leds = (unsigned long)i2c_get_match_data(client); + chip->regulators[0].supply = "vin"; chip->regulators[1].supply = "vio"; ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(chip->regulators), chip->regulators); @@ -605,7 +612,7 @@ static void ktd202x_shutdown(struct i2c_client *client) static const struct of_device_id ktd202x_match_table[] = { { .compatible = "kinetic,ktd2026", .data = (void *)KTD2026_NUM_LEDS }, { .compatible = "kinetic,ktd2027", .data = (void *)KTD2027_NUM_LEDS }, - {}, + {} }; MODULE_DEVICE_TABLE(of, ktd202x_match_table); @@ -616,7 +623,7 @@ static struct i2c_driver ktd202x_driver = { }, .probe = ktd202x_probe, .remove = ktd202x_remove, - .shutdown = ktd202x_shutdown, + .shutdown = ktd202x_shutdown }; module_i2c_driver(ktd202x_driver); From patchwork Tue Apr 16 05:39:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kate Hsuan X-Patchwork-Id: 789574 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 9E5993BB24 for ; Tue, 16 Apr 2024 05:40:05 +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=1713246007; cv=none; b=UtvG5p2GzpPY/yk2CDr5Qe2e3YvwvENh+vaaoDGpZ0EmzAdE75Vu4vj1h6DkzWQWR0cL5zr2YD2FW/mTzw+9Jm+ptYJd3MZKLUIBKvy5rKyeQWsS7n4Lf0GwP0W/EtVibdD6yE+50Z7unZbXgCNh8C4EZzbe30LcZsakiD650Ic= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713246007; c=relaxed/simple; bh=+55S4oRIAMDdcjdwd2tMpXVDwAx0gM6uvk5BEebFs4U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YOoGWULvAAe8PIHa24PeFxk64V74o9l15cHdhMT9MrqXIdJ5KdC/ajNmtWfGAXl42+yfPKvcaXS2rNLPb6DBi6KgTkgFLo/YnsGUvXqVJp2QKREyxP9S02n1YsKwkM0gSkb9b8WfMMpK58Ih7XZbkg9L+ArFa+haf4TiK0keHNo= 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=b7xkJkSQ; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="b7xkJkSQ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713246004; 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: in-reply-to:in-reply-to:references:references; bh=PiGC8XIvz4znawb/VkO4X/ecJuSv6PcgzmcML1mcfEw=; b=b7xkJkSQQbRd1D5l8BRZC3RQ1NTHsLsd3VgP/xYZM0MVpizJrG9mBYWo7dfsL+kwNdDDGM S3J1hJwjL7GJ1D+C+CXMDGXuzFTUmBOSZL+Vo9oSB6IGAp2plhYotDxOvQYEWo8XCzJMgv pgQavyFGeLb3Dtv+c3YksTLsuWUR01I= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-516-JBKYJeYDNgq3y42L4_wN0w-1; Tue, 16 Apr 2024 01:40:01 -0400 X-MC-Unique: JBKYJeYDNgq3y42L4_wN0w-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (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 E32163C000B2; Tue, 16 Apr 2024 05:40:00 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.39.192.2]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2B15551EF; Tue, 16 Apr 2024 05:39:54 +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_J=C3=A4rvinen?= , =?utf-8?q?A?= =?utf-8?q?ndr=C3=A9_Apitzsch?= , linux-kernel@vger.kernel.org, Andy Shevchenko , Sebastian Reichel , linux-pm@vger.kernel.org Cc: Kate Hsuan Subject: [PATCH v6 3/5] leds: rgb: leds-ktd202x: I2C ID tables for KTD2026 and 2027 Date: Tue, 16 Apr 2024 13:39:07 +0800 Message-ID: <20240416053909.256319-4-hpa@redhat.com> In-Reply-To: <20240416053909.256319-1-hpa@redhat.com> References: <20240416053909.256319-1-hpa@redhat.com> Precedence: bulk X-Mailing-List: linux-leds@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 This table shows the maximum support LED channel for KTD2026 and KTD-2027. The 3-channel LED controller KTD2026 controls R/G/B three LEDs. The 4-channel LED controller KTD2027 controls R/G/B and a flashing LEDs. Link: https://www.kinet-ic.com/uploads/KTD2026-7-04h.pdf Signed-off-by: Kate Hsuan --- drivers/leds/rgb/leds-ktd202x.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/leds/rgb/leds-ktd202x.c b/drivers/leds/rgb/leds-ktd202x.c index 8d0ed1a95a9f..2c47b0405961 100644 --- a/drivers/leds/rgb/leds-ktd202x.c +++ b/drivers/leds/rgb/leds-ktd202x.c @@ -609,6 +609,13 @@ static void ktd202x_shutdown(struct i2c_client *client) regmap_write(chip->regmap, KTD202X_REG_RESET_CONTROL, KTD202X_RSTR_RESET); } +static const struct i2c_device_id ktd202x_id[] = { + {"ktd2026", KTD2026_NUM_LEDS}, + {"ktd2027", KTD2027_NUM_LEDS}, + {} +}; +MODULE_DEVICE_TABLE(i2c, ktd202x_id); + static const struct of_device_id ktd202x_match_table[] = { { .compatible = "kinetic,ktd2026", .data = (void *)KTD2026_NUM_LEDS }, { .compatible = "kinetic,ktd2027", .data = (void *)KTD2027_NUM_LEDS }, @@ -623,7 +630,8 @@ static struct i2c_driver ktd202x_driver = { }, .probe = ktd202x_probe, .remove = ktd202x_remove, - .shutdown = ktd202x_shutdown + .shutdown = ktd202x_shutdown, + .id_table = ktd202x_id }; module_i2c_driver(ktd202x_driver); From patchwork Tue Apr 16 05:39:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kate Hsuan X-Patchwork-Id: 790908 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 3AE113BBC9 for ; Tue, 16 Apr 2024 05:40:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713246017; cv=none; b=OitIvEeKB5VRq/uy/qLdTCXZnMKRlCi10Po0RsAMN+WuC4KG7dEFRICV3b7TC643orxbUtckiEGyxif6vmgC+UX7E5B0k8qP3myFEt0q8/RmeTTuxXOqZ3uTBrVAEd/3uM88NuXnFvgJO6bq7fQqf3fQmrx30dmFNdUxPbu07Rc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713246017; c=relaxed/simple; bh=BPy9w6pvQJsx2dsHgKCy7OcSZSb24S8ZkQbbQcYva3o=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=nzeVrkgCpfCPfTmSD5S+MhFelYVrVHJMtjyCy6HjF2aOtO0jJC2bocALSKLjTTSa54iy3DG/TNgPj0VlPJu3oyII2Id3hEz5WVOiGx93PO2FX8C4vgtrcqffvmfAqfDks55xi8SaWpkdA+YteDv+dZMXM5K7LLh0iH9LVWzwneE= 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=FxarOxV1; arc=none smtp.client-ip=170.10.129.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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="FxarOxV1" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713246013; 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: in-reply-to:in-reply-to:references:references; bh=jQZxld0dHvX8vI/R3vTz99PXylCe6DhIyDcpOixp/JU=; b=FxarOxV11EhqFM0Xe9oPDx6xa/XVwbpErsLk3y4xHpM2sZg8WoNnshne45wQX0/19K/D3S z3Dbjnagwfgw4aVCtdq7jBrpvGV7SXs+EUFE1rOKCPxyoW61CY7PCUYRU4pV6POFvi6y8I 5GrLhOvCYL35Rjw6JyNOzGr62yrz10A= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-581-c3js6w0sPkGPKK8O7wKslw-1; Tue, 16 Apr 2024 01:40:10 -0400 X-MC-Unique: c3js6w0sPkGPKK8O7wKslw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (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 96F07380390E; Tue, 16 Apr 2024 05:40:09 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.39.192.2]) by smtp.corp.redhat.com (Postfix) with ESMTP id D754851EF; Tue, 16 Apr 2024 05:40:03 +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_J=C3=A4rvinen?= , =?utf-8?q?A?= =?utf-8?q?ndr=C3=A9_Apitzsch?= , linux-kernel@vger.kernel.org, Andy Shevchenko , Sebastian Reichel , linux-pm@vger.kernel.org Cc: Kate Hsuan Subject: [PATCH v6 4/5] power: supply: power-supply-leds: Add charging_orange_full_green trigger for RGB LED Date: Tue, 16 Apr 2024 13:39:08 +0800 Message-ID: <20240416053909.256319-5-hpa@redhat.com> In-Reply-To: <20240416053909.256319-1-hpa@redhat.com> References: <20240416053909.256319-1-hpa@redhat.com> Precedence: bulk X-Mailing-List: linux-leds@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 Add a charging_orange_full_green LED trigger and the trigger is based on led_mc_trigger_event() which can set an RGB LED when the trigger is triggered. The LED will show orange when the battery status is charging. The LED will show green when the battery status is full. Link: https://lore.kernel.org/linux-leds/f40a0b1a-ceac-e269-c2dd-0158c5b4a1ad@gmail.com/ Signed-off-by: Kate Hsuan Acked-by: Sebastian Reichel --- drivers/power/supply/power_supply_leds.c | 26 ++++++++++++++++++++++++ include/linux/power_supply.h | 2 ++ 2 files changed, 28 insertions(+) diff --git a/drivers/power/supply/power_supply_leds.c b/drivers/power/supply/power_supply_leds.c index c7db29d5fcb8..8dd99199c65b 100644 --- a/drivers/power/supply/power_supply_leds.c +++ b/drivers/power/supply/power_supply_leds.c @@ -22,6 +22,9 @@ static void power_supply_update_bat_leds(struct power_supply *psy) { union power_supply_propval status; + unsigned int intensity_green[3] = {255, 0, 0}; + unsigned int intensity_orange[3] = {128, 0, 255}; + unsigned int intensity_red[3] = {0, 0, 255}; if (power_supply_get_property(psy, POWER_SUPPLY_PROP_STATUS, &status)) return; @@ -36,12 +39,20 @@ static void power_supply_update_bat_leds(struct power_supply *psy) /* Going from blink to LED on requires a LED_OFF event to stop blink */ led_trigger_event(psy->charging_blink_full_solid_trig, LED_OFF); led_trigger_event(psy->charging_blink_full_solid_trig, LED_FULL); + led_mc_trigger_event(psy->charging_orange_full_green_trig, + intensity_green, + ARRAY_SIZE(intensity_green), + LED_FULL); break; case POWER_SUPPLY_STATUS_CHARGING: led_trigger_event(psy->charging_full_trig, LED_FULL); led_trigger_event(psy->charging_trig, LED_FULL); led_trigger_event(psy->full_trig, LED_OFF); led_trigger_blink(psy->charging_blink_full_solid_trig, 0, 0); + led_mc_trigger_event(psy->charging_orange_full_green_trig, + intensity_orange, + ARRAY_SIZE(intensity_orange), + LED_FULL); break; default: led_trigger_event(psy->charging_full_trig, LED_OFF); @@ -49,6 +60,10 @@ static void power_supply_update_bat_leds(struct power_supply *psy) led_trigger_event(psy->full_trig, LED_OFF); led_trigger_event(psy->charging_blink_full_solid_trig, LED_OFF); + led_mc_trigger_event(psy->charging_orange_full_green_trig, + intensity_red, + ARRAY_SIZE(intensity_red), + LED_OFF); break; } } @@ -74,6 +89,11 @@ static int power_supply_create_bat_triggers(struct power_supply *psy) if (!psy->charging_blink_full_solid_trig_name) goto charging_blink_full_solid_failed; + psy->charging_orange_full_green_trig_name = kasprintf(GFP_KERNEL, + "%s-charging-orange-full-green", psy->desc->name); + if (!psy->charging_orange_full_green_trig_name) + goto charging_red_full_green_failed; + led_trigger_register_simple(psy->charging_full_trig_name, &psy->charging_full_trig); led_trigger_register_simple(psy->charging_trig_name, @@ -82,9 +102,13 @@ static int power_supply_create_bat_triggers(struct power_supply *psy) &psy->full_trig); led_trigger_register_simple(psy->charging_blink_full_solid_trig_name, &psy->charging_blink_full_solid_trig); + led_trigger_register_simple(psy->charging_orange_full_green_trig_name, + &psy->charging_orange_full_green_trig); return 0; +charging_red_full_green_failed: + kfree(psy->charging_blink_full_solid_trig_name); charging_blink_full_solid_failed: kfree(psy->full_trig_name); full_failed: @@ -101,10 +125,12 @@ static void power_supply_remove_bat_triggers(struct power_supply *psy) led_trigger_unregister_simple(psy->charging_trig); led_trigger_unregister_simple(psy->full_trig); led_trigger_unregister_simple(psy->charging_blink_full_solid_trig); + led_trigger_unregister_simple(psy->charging_orange_full_green_trig); kfree(psy->charging_blink_full_solid_trig_name); kfree(psy->full_trig_name); kfree(psy->charging_trig_name); kfree(psy->charging_full_trig_name); + kfree(psy->charging_orange_full_green_trig_name); } /* Generated power specific LEDs triggers. */ diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index c0992a77feea..9b6898085224 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h @@ -318,6 +318,8 @@ struct power_supply { char *online_trig_name; struct led_trigger *charging_blink_full_solid_trig; char *charging_blink_full_solid_trig_name; + struct led_trigger *charging_orange_full_green_trig; + char *charging_orange_full_green_trig_name; #endif }; From patchwork Tue Apr 16 05:39:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kate Hsuan X-Patchwork-Id: 789573 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 E4C894502E for ; Tue, 16 Apr 2024 05:40: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=1713246026; cv=none; b=dGqxFnIeJ3y67qf6udVAZDC9N1ICVP1/9zkq2Db1FrpdO0VAcPYsIZNc1aFwG6apIaLo8xBfnS39fgsHX/F1+zi8HLnU8NcUgRqKFEtZj5j78LOz9DwB2PGSt1HGssllSXex7OTvDVcWJAgzmykdiA3SyjLKz3vcjlUjNmMdkqc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713246026; c=relaxed/simple; bh=p7Qf/Wv2gRIQXdGwm+8FyGDK8jF8gAk1WduxuCaLuAU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=V6T1cAVXcM3jhGBizsoGhtUHnVD8yEPb4i1BUvykzLoqtuScv/Xr5BYJ3cy5lbBXVRsR381SkIm9mhIPzVZIS9nzlnyhn7QB1L4g60mYQCOM9kPS5Gv/U+hO1t/x5q+vVEQ6nXhAJqoYtxLOPvjaQbvsp2qQNwbmF8UFawN/btU= 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=GZBOy22q; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="GZBOy22q" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1713246023; 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: in-reply-to:in-reply-to:references:references; bh=oCFCbOFCL4zzLvTeJtHwSPF85SA+R3VeJ49a5BsSC8o=; b=GZBOy22q3QXUtN5OKocwSieHYsY9CEQd4kmi9NWOV1cBz78CGt63SoiNFYMUyONKdNCK7I DoSqQUEME9Yn6+vEeVmvr6nAOGcZalDHqoxsD+qqyY4pWg6h5FD7ikp1c2ZiP7xBpR1JYD WPTG2GOhT5jrQ/GPW/h3IbhFYPGzfSo= 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-692-GYCt1oTgPSinxF7vLj3KzQ-1; Tue, 16 Apr 2024 01:40:18 -0400 X-MC-Unique: GYCt1oTgPSinxF7vLj3KzQ-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (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 D7F418007BA; Tue, 16 Apr 2024 05:40:17 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.39.192.2]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2AA0E51EF; Tue, 16 Apr 2024 05:40:11 +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_J=C3=A4rvinen?= , =?utf-8?q?A?= =?utf-8?q?ndr=C3=A9_Apitzsch?= , linux-kernel@vger.kernel.org, Andy Shevchenko , Sebastian Reichel , linux-pm@vger.kernel.org Cc: Kate Hsuan Subject: [PATCH v6 5/5] platform: x86-android-tablets: others: Set the LED trigger to charging_orange_full_green for Xiaomi pad2 Date: Tue, 16 Apr 2024 13:39:09 +0800 Message-ID: <20240416053909.256319-6-hpa@redhat.com> In-Reply-To: <20240416053909.256319-1-hpa@redhat.com> References: <20240416053909.256319-1-hpa@redhat.com> Precedence: bulk X-Mailing-List: linux-leds@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.5 Set the default trigger to bq27520-0-charging-orange-full-green. The LED will show orange when the battery is charging. The LED will show green when the battery status is full. Signed-off-by: Kate Hsuan --- drivers/platform/x86/x86-android-tablets/other.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/x86/x86-android-tablets/other.c b/drivers/platform/x86/x86-android-tablets/other.c index c77d56454f2d..52032a874b7f 100644 --- a/drivers/platform/x86/x86-android-tablets/other.c +++ b/drivers/platform/x86/x86-android-tablets/other.c @@ -610,7 +610,7 @@ static const struct property_entry ktd2026_rgb_led_props[] = { PROPERTY_ENTRY_U32("reg", 0), PROPERTY_ENTRY_U32("color", LED_COLOR_ID_RGB), PROPERTY_ENTRY_STRING("function", "indicator"), - PROPERTY_ENTRY_STRING("linux,default-trigger", "bq27520-0-charging"), + PROPERTY_ENTRY_STRING("linux,default-trigger", "bq27520-0-charging-orange-full-green"), { } };