summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2026-08-30 04:15:08 -0700
committerIlpo Järvinen <ilpo.jarvinen@linux.intel.com>2026-09-02 14:43:23 +0300
commit7872c625cd83a0247821cedd6c6f63938d4bddbc (patch)
tree0419635e591813bfc85417fef84ef56227dded43
parentaab060ec969c3859b81f80f3444fd5a2edfc3cf5 (diff)
downloadlinux-7872c625cd83a0247821cedd6c6f63938d4bddbc.tar.gz
linux-7872c625cd83a0247821cedd6c6f63938d4bddbc.zip
platform/x86: x86-android-tablets: add Crystal Cove GPIO swnode support
The crystalcove_gpiochip_node was created when gpiolib supported matching a software node name against the GPIO chip label. Later, gpiolib replaced name matching with firmware node identity mapping, and support for dynamically attaching software nodes to ACPI GPIO chips as secondary firmware nodes was added for Baytrail and Cherryview, but Crystal Cove ("INT33FD:00") was omitted. Consequently, lookups on the unattached Crystal Cove software node fail. Add support for attaching crystalcove_gpiochip_node to the INT33FD:00 ACPI device as a secondary firmware node, and enable it on Lenovo Yoga Tab 2 models. Fixes: 611fd6cfe139 ("gpio: swnode: remove deprecated lookup mechanism") Assisted-by: LLM Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Tested-by: Hans de Goede <johannes.goede@oss.qualcomm.com> # Yoga tab 2 1380, yt3 Reviewed-by: Hans de Goede <johannes.goede@oss.qualcomm.com> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com> Reviewed-by: Linus Walleij <linusw@kernel.org> Link: https://patch.msgid.link/20260830-x86-android-lenovo-swnode-v1-4-066a91acb4ba@gmail.com Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
-rw-r--r--drivers/platform/x86/x86-android-tablets/core.c17
-rw-r--r--drivers/platform/x86/x86-android-tablets/lenovo.c6
-rw-r--r--drivers/platform/x86/x86-android-tablets/x86-android-tablets.h2
3 files changed, 21 insertions, 4 deletions
diff --git a/drivers/platform/x86/x86-android-tablets/core.c b/drivers/platform/x86/x86-android-tablets/core.c
index 45673bfc0b7b..b028af1c9942 100644
--- a/drivers/platform/x86/x86-android-tablets/core.c
+++ b/drivers/platform/x86/x86-android-tablets/core.c
@@ -361,6 +361,15 @@ static const struct software_node *cherryview_gpiochip_node_group[] = {
NULL
};
+const struct software_node crystalcove_gpiochip_node = {
+ .name = "INT33FD:00",
+};
+
+static const struct software_node *crystalcove_gpiochip_node_group[] = {
+ &crystalcove_gpiochip_node,
+ NULL
+};
+
static void gpio_secondary_unset(void *data)
{
struct device *dev = data;
@@ -491,6 +500,14 @@ static __init int x86_android_tablet_probe(struct platform_device *pdev)
return ret;
}
+ if (dev_info->has_crystalcove) {
+ ret = gpio_secondary_fwnode_init(&pdev->dev, crystalcove_gpiochip_node_group);
+ if (ret) {
+ x86_android_tablet_remove(pdev);
+ return ret;
+ }
+ }
+
ret = software_node_register_node_group(dev_info->swnode_group);
if (ret) {
x86_android_tablet_remove(pdev);
diff --git a/drivers/platform/x86/x86-android-tablets/lenovo.c b/drivers/platform/x86/x86-android-tablets/lenovo.c
index c34f62bdf8f9..54068a0f4633 100644
--- a/drivers/platform/x86/x86-android-tablets/lenovo.c
+++ b/drivers/platform/x86/x86-android-tablets/lenovo.c
@@ -61,9 +61,6 @@ static struct lp855x_platform_data lenovo_lp8557_reg_only_pdata = {
.initial_brightness = 128,
};
-static const struct software_node crystalcove_gpiochip_node = {
- .name = "gpio_crystalcove",
-};
/* Lenovo Yoga Book X90F / X90L's Android factory image has everything hardcoded */
@@ -431,7 +428,6 @@ static const struct software_node lenovo_yoga_tab2_830_1050_wm5102 = {
};
static const struct software_node *lenovo_yoga_tab2_830_1050_swnodes[] = {
- &crystalcove_gpiochip_node,
&lenovo_yoga_tab2_830_1050_wm5102,
&generic_lipo_hv_4v35_battery_node,
NULL
@@ -454,6 +450,7 @@ const struct x86_dev_info lenovo_yoga_tab2_830_1050_info __initconst = {
.gpio_button_swnodes = lenovo_yoga_tab2_830_1050_lid_swnodes,
.swnode_group = lenovo_yoga_tab2_830_1050_swnodes,
.modules = lenovo_yoga_tab2_modules,
+ .has_crystalcove = true,
.gpiochip_type = X86_GPIOCHIP_BAYTRAIL,
.init = lenovo_yoga_tab2_830_1050_init,
.exit = lenovo_yoga_tab2_830_1050_exit,
@@ -799,6 +796,7 @@ const struct x86_dev_info lenovo_yoga_tab2_1380_info __initconst = {
.gpio_button_swnodes = lenovo_yoga_tab2_830_1050_lid_swnodes,
.swnode_group = lenovo_yoga_tab2_830_1050_swnodes,
.modules = lenovo_yoga_tab2_modules,
+ .has_crystalcove = true,
.gpiochip_type = X86_GPIOCHIP_BAYTRAIL,
.init = lenovo_yoga_tab2_1380_init,
.exit = lenovo_yoga_tab2_830_1050_exit,
diff --git a/drivers/platform/x86/x86-android-tablets/x86-android-tablets.h b/drivers/platform/x86/x86-android-tablets/x86-android-tablets.h
index c756961ae5fd..6e6534f8fa6c 100644
--- a/drivers/platform/x86/x86-android-tablets/x86-android-tablets.h
+++ b/drivers/platform/x86/x86-android-tablets/x86-android-tablets.h
@@ -96,6 +96,7 @@ struct x86_dev_info {
int (*init)(struct device *dev);
void (*exit)(void);
bool use_pci;
+ bool has_crystalcove;
enum x86_gpiochip_type gpiochip_type;
};
@@ -107,6 +108,7 @@ int x86_acpi_irq_helper_get(const struct x86_acpi_irq_data *data);
/* Software nodes representing GPIO chips used by various tablets */
extern const struct software_node baytrail_gpiochip_nodes[];
extern const struct software_node cherryview_gpiochip_nodes[];
+extern const struct software_node crystalcove_gpiochip_node;
/*
* Extern declarations of x86_dev_info structs so there can be a single