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: 611fd6cfe1 ("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>
This commit is contained in:
Dmitry Torokhov 2026-08-30 04:15:08 -07:00 committed by Ilpo Järvinen
parent aab060ec96
commit 7872c625cd
No known key found for this signature in database
GPG Key ID: 59AC4F6153E5CE31
3 changed files with 21 additions and 4 deletions

View File

@ -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);

View File

@ -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,

View File

@ -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