From nobody Fri Apr 3 06:29:39 2026 Received: from mail-ej1-f48.google.com (mail-ej1-f48.google.com [209.85.218.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2054E311973 for ; Sun, 1 Mar 2026 22:03:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772402608; cv=none; b=pPwM0EKgrGN+aaBS0dpcO/TTKAgV8tQRi8XaIMYm1BPfm6/s5m8m5dSD+AFDiicu5xPqw/J9vYglMGXlPgWGSZRkOY7/rVY+R2kR3pVjYELhcTQ7Rbm/cuSqM9BDNsJuY+43JLNHVhm6mVm59Jsn0TPZgV52bY0wh2JHPJVqL2k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772402608; c=relaxed/simple; bh=8CaRRVYQAWdhwxPlCQv5QyS+FWeQjLNGSv3kwyBqokA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=kB1ZtlBGUeIjtTIn4fEsLYt1EGh5W7XOna5ihWz20pu5/gNztkjTMjyA1CFjUZjfu5PocyeBCrv3z+wQbRo52z9hJGjertV/gpeMP0d7ClpnramjkW1pq37oW0cTVllkuxoWrakyGWCHF3bLU3p3n357UChcTBZn8LARCFIrflU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=kZEPjcdM; arc=none smtp.client-ip=209.85.218.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kZEPjcdM" Received: by mail-ej1-f48.google.com with SMTP id a640c23a62f3a-b936b85cc71so415257766b.2 for ; Sun, 01 Mar 2026 14:03:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1772402605; x=1773007405; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=2vu71svIllNIZ+Xzig1JgC/nicq10GD51e1cjSo9CeI=; b=kZEPjcdM6YVqtuL5dQa+aVu/BdE3YFe1Gv4kBqoGGkpRhm8m9vCw/0DO84vyqSekAB pPwYqpTHyRoBsy63TesGXNfkrPjrr2epsSZ4WFZ6BmCKln9vN2ZCcfHF4JiUhUdng6zm 1Ws0ZqHRVnHxpiLb/wvrjYYvGyioMrQAmogHbCUyc5JXX4ne4jOFjyPsSnA4wLCqF5pQ Gc+TxzM12uqrTGzj+mRKD1ns4+UdunsJGKm4xtEY4QozrTW+xMNxdE7QZcd0Tsjj883m vGrGUcCCywJSorVIGlK2z+Q557t857UZXyyFoT7zslrj6yfs5bOkrzzBkBytuxJknPmi N15g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772402605; x=1773007405; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=2vu71svIllNIZ+Xzig1JgC/nicq10GD51e1cjSo9CeI=; b=VIpeg/L349OlLMbDqFDxwbQWVWRSg2lAiJADp4I1vgmNRa/lY6WvJDlQiqU9Ft4Tiv tQzwihlPFrPaMTSvrSEZ2iWzG/arnKgioCt5GzDmH74LgUc3SgMHd69I9SgSbSA6TLWY 0niDXa861hr2Vv19LunLLeh1dn2iovqIWysgCmGGqR9TqHGpWJ/5RHxpkTl/QqemOZCa N8FuEWNk3WU3C50HOtUUsdtqhPEcQWo29eH3vp+2tGCdBGGaw3AMEwHkB+7Zd9JWlcnE f0a9ys+efMO46takOOsWgNPbq1879F4BcawACfB2SaKA6y8AvrSpMk+7qgJbXA2JRDqF D2DA== X-Forwarded-Encrypted: i=1; AJvYcCWdWW6tOlr0bSa4wH4CRrgjgS2wkKkyn4lXQRvWVMdmGZWZCVQanbxwCWAAXgOi7O185bdohX+xZnfNVOE=@vger.kernel.org X-Gm-Message-State: AOJu0YzpsUWC+hLzUH3FT4TAaGJ3e+WykwBL5RJ3pMhneEiheOWHY48y ZIt/u0432v+0JDCmKMZITAdE3oXALua+ddIibb+gp0OxaLEIlpIfs25E X-Gm-Gg: ATEYQzz2H5g8o3uzelcz+RmqtwFS7v1gXzlGPCdByKMiKRL26VFddp0WUr6gWsfnTYa mwJWN5fsszsHrgVpR+SX0kZ3bHjZRHEir0XQItq29rzFmVblsDKQgUhrijCXyQ2OSHoR0qfhoRN 0lKDUDp8BJddo2S2LHkFgV8zFwLo/iz6KXVpNb9KpYaITlMi7FoylOPMEnbv707SLjD6nK3Gox3 LCJ03QNP7rnBIMuCeR+9QtPrgf7DQYYHjrMr3SXn/5xGhPsYAiG1qnbHuwavw+7jP5LwnIKYsdD /7G39g9pfHX/zyoRQxgUuyJC1emeeNt5U0tfUwIXalZAoEaIVFoi+zAaJKv++MwMOPJzJgAvRou 1jY2hX8tygtqfjxxSmftjGvDczo6RCPMJpMT3T+SS5Dcm8kQP4RYsuz1H7vcWmxMSUSDJQk4Ci/ HdOWtG86YKTjYJhMZDZA== X-Received: by 2002:a17:907:3f87:b0:b8d:9bcc:9016 with SMTP id a640c23a62f3a-b93764b8182mr570180966b.37.1772402605194; Sun, 01 Mar 2026 14:03:25 -0800 (PST) Received: from [127.0.1.1] ([46.251.53.180]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-b935ab13593sm400915866b.3.2026.03.01.14.03.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Mar 2026 14:03:24 -0800 (PST) From: Yauhen Kharuzhy Date: Mon, 02 Mar 2026 00:03:15 +0200 Subject: [PATCH v2 2/2] platform: x86-android-tablets: lenovo: Add Yoga Book YB1 sound card info Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260302-x86-tablets-yogabook-v2-2-061768d5c9e7@gmail.com> References: <20260302-x86-tablets-yogabook-v2-0-061768d5c9e7@gmail.com> In-Reply-To: <20260302-x86-tablets-yogabook-v2-0-061768d5c9e7@gmail.com> To: Hans de Goede , =?utf-8?q?Ilpo_J=C3=A4rvinen?= Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Yauhen Kharuzhy X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1772402602; l=6856; i=jekhor@gmail.com; s=20260301; h=from:subject:message-id; bh=8CaRRVYQAWdhwxPlCQv5QyS+FWeQjLNGSv3kwyBqokA=; b=VA6nOfTFcDrQP7NIXIHwSUiGQ6AQ2M36xJPZeLvQKvkJVZ9ZOpTyDJ0HzEs8xhNAO4eXsXM5+ RIZ+eIi9yzPBm3FCFva6FWzfEmxqS1f3VOjO5n0jdV50Qp9LDfAt74O X-Developer-Key: i=jekhor@gmail.com; a=ed25519; pk=C/csaZJs7UBNDgeJcUAmPu4ntqNeaZ3BKfBQiH8tuGc= Define I2C devices, their properties, and GPIO lookup tables for the Yoga Book YB1-X90 sound codec and jack detection IC. The YB1-X90 doesn't have a valid codec entry in the DSDT, while the YB1-X91 does. The YB1-X91 includes additional information in the ACPI _CRS method regarding the jack detection IC connection, but it is also defined in this driver to simplify the unification of the sound driver for both tablet versions. Signed-off-by: Yauhen Kharuzhy --- drivers/platform/x86/x86-android-tablets/lenovo.c | 124 ++++++++++++++++++= ++++ 1 file changed, 124 insertions(+) diff --git a/drivers/platform/x86/x86-android-tablets/lenovo.c b/drivers/pl= atform/x86/x86-android-tablets/lenovo.c index bc10f00da8c6..e28e1442115b 100644 --- a/drivers/platform/x86/x86-android-tablets/lenovo.c +++ b/drivers/platform/x86/x86-android-tablets/lenovo.c @@ -142,6 +142,44 @@ static const struct software_node lenovo_yb1_x9x_drv26= 04l_1_node =3D { .properties =3D lenovo_yb1_x9x_drv2604l_1_props, }; =20 +static const struct software_node lenovo_yb1_rt5677_gpiochip_node =3D { + .name =3D "rt5677", +}; + +/* + * Certain properties are used by the cht_yogabook sound platform driver. = The sound + * configuration is defined as the RT5677 ACPI entry on YB1-X91; hence, th= e same + * approach is utilized for YB1-X90 as well. + */ +static const struct property_entry lenovo_yb1_x9x_rt5677_props[] =3D { + PROPERTY_ENTRY_BOOL("realtek,lout1-differential"), + PROPERTY_ENTRY_BOOL("realtek,lout2-differential"), + PROPERTY_ENTRY_BOOL("realtek,lout3-differential"), + PROPERTY_ENTRY_BOOL("realtek,in1-differential"), + PROPERTY_ENTRY_BOOL("realtek,in2-differential"), + PROPERTY_ENTRY_GPIO("realtek,reset-gpios", &cherryview_gpiochip_nodes[3],= 25, GPIO_ACTIVE_LOW), + PROPERTY_ENTRY_GPIO("realtek,pow-ldo2-gpios", &cherryview_gpiochip_nodes[= 3], 18, GPIO_ACTIVE_HIGH), + PROPERTY_ENTRY_GPIO("speaker-enable-gpios", &cherryview_gpiochip_nodes[3]= , 48, GPIO_ACTIVE_HIGH), + PROPERTY_ENTRY_GPIO("speaker-enable2-gpios", &lenovo_yb1_rt5677_gpiochip_= node, 2, GPIO_ACTIVE_HIGH), + PROPERTY_ENTRY_GPIO("headphone-enable-gpios", &lenovo_yb1_rt5677_gpiochip= _node, 4, GPIO_ACTIVE_HIGH), + {} +}; + +static const struct software_node lenovo_yb1_x90_rt5677_node =3D { + .properties =3D lenovo_yb1_x9x_rt5677_props, +}; + +static const struct property_entry lenovo_yb1_ts3a227e_props[] =3D { + /* MICBIAS is 2.5V */ + PROPERTY_ENTRY_U32("ti,micbias", 4), + PROPERTY_ENTRY_U32("ti,debounce-insertion-ms", 2000), + {} +}; + +static const struct software_node lenovo_yb1_ts3a227e_node =3D { + .properties =3D lenovo_yb1_ts3a227e_props, +}; + static const struct x86_i2c_client_info lenovo_yb1_x90_i2c_clients[] __ini= tconst =3D { { /* BQ27542 fuel-gauge */ @@ -231,6 +269,40 @@ static const struct x86_i2c_client_info lenovo_yb1_x90= _i2c_clients[] __initconst .polarity =3D ACPI_ACTIVE_LOW, .con_id =3D "hideep_ts_irq", }, + }, { + /* Audio codec */ + .board_info =3D { + .type =3D "rt5677", + .addr =3D 0x2c, + .dev_name =3D "rt5677", + .swnode =3D &lenovo_yb1_x90_rt5677_node, + }, + .adapter_path =3D "\\_SB_.PCI0.I2C1", + .irq_data =3D { + .type =3D X86_ACPI_IRQ_TYPE_GPIOINT, + .chip =3D "INT33FF:00", + .index =3D 91, + .trigger =3D ACPI_EDGE_SENSITIVE, + .polarity =3D ACPI_ACTIVE_LOW, + .con_id =3D "rt5677_irq", + }, + }, { + /* Audio jack detection IC */ + .board_info =3D { + .type =3D "ts3a227e", + .addr =3D 0x3b, + .dev_name =3D "ts3a227e", + .swnode =3D &lenovo_yb1_ts3a227e_node, + }, + .adapter_path =3D "\\_SB_.PCI0.I2C1", + .irq_data =3D { + .type =3D X86_ACPI_IRQ_TYPE_GPIOINT, + .chip =3D "INT33FF:00", + .index =3D 77, + .trigger =3D ACPI_EDGE_SENSITIVE, + .polarity =3D ACPI_ACTIVE_LOW, + .con_id =3D "ts3a227e_irq", + }, }, }; =20 @@ -284,6 +356,11 @@ static const struct software_node *lenovo_yb1_x90_lid_= swnodes[] =3D { NULL }; =20 +static const struct software_node *lenovo_yb1_x90_swnodes[] =3D { + &lenovo_yb1_rt5677_gpiochip_node, + NULL +}; + static int __init lenovo_yb1_x90_init(struct device *dev) { /* Enable the regulators used by the touchscreens */ @@ -311,6 +388,7 @@ const struct x86_dev_info lenovo_yogabook_x90_info __in= itconst =3D { .serdev_info =3D lenovo_yb1_x90_serdevs, .serdev_count =3D ARRAY_SIZE(lenovo_yb1_x90_serdevs), .gpio_button_swnodes =3D lenovo_yb1_x90_lid_swnodes, + .swnode_group =3D lenovo_yb1_x90_swnodes, .gpiochip_type =3D X86_GPIOCHIP_CHERRYVIEW, .init =3D lenovo_yb1_x90_init, }; @@ -327,15 +405,39 @@ static const struct x86_i2c_client_info lenovo_yogabo= ok_x91_i2c_clients[] __init }, .adapter_path =3D "\\_SB_.PCI0.I2C1", }, + { + /* Audio jack detection IC. Its configuration (I2C address and + * IRQ) is defined as additional resources in RTEK (10EC5677) + * ACPI node but define them here to simplify handling in + * the driver + */ + .board_info =3D { + .type =3D "ts3a227e", + .addr =3D 0x3b, + .dev_name =3D "ts3a227e", + .swnode =3D &lenovo_yb1_ts3a227e_node, + }, + .adapter_path =3D "\\_SB_.PCI0.I2C1", + .irq_data =3D { + .type =3D X86_ACPI_IRQ_TYPE_GPIOINT, + .chip =3D "INT33FF:00", + .index =3D 77, + .trigger =3D ACPI_EDGE_SENSITIVE, + .polarity =3D ACPI_ACTIVE_LOW, + .con_id =3D "ts3a227e_irq", + }, + }, }; =20 #define YB1_X91_DRV2604L_0_DEVICE "i2c-DRV2604:00" #define YB1_X91_DRV2604L_1_DEVICE "i2c-DRV2604:01" +#define YB1_X91_RT5677_DEVICE "i2c-10EC5677:00" =20 static int __init lenovo_yb1_x91_init(struct device *dev) { struct device *drv2604l_0_dev __free(put_device) =3D NULL; struct device *drv2604l_1_dev __free(put_device) =3D NULL; + struct device *rt5677_dev __free(put_device) =3D NULL; int ret =3D 0; =20 drv2604l_0_dev =3D bus_find_device_by_name(&i2c_bus_type, NULL, @@ -370,12 +472,34 @@ static int __init lenovo_yb1_x91_init(struct device *= dev) return ret; } =20 + rt5677_dev =3D bus_find_device_by_name(&i2c_bus_type, NULL, + YB1_X91_RT5677_DEVICE); + if (!rt5677_dev) { + pr_err("error: cannot find %s device\n", + YB1_X91_RT5677_DEVICE); + return -ENODEV; + } + + ret =3D device_create_managed_software_node(rt5677_dev, + lenovo_yb1_x9x_rt5677_props, NULL); + if (ret) { + pr_err("error: cannot create software node for %s\n", + YB1_X91_RT5677_DEVICE); + return ret; + } + return 0; } =20 +static const struct software_node *lenovo_yb1_x91_swnodes[] =3D { + &lenovo_yb1_rt5677_gpiochip_node, + NULL +}; + const struct x86_dev_info lenovo_yogabook_x91_info __initconst =3D { .i2c_client_info =3D lenovo_yogabook_x91_i2c_clients, .i2c_client_count =3D ARRAY_SIZE(lenovo_yogabook_x91_i2c_clients), + .swnode_group =3D lenovo_yb1_x91_swnodes, .gpiochip_type =3D X86_GPIOCHIP_CHERRYVIEW, .init =3D lenovo_yb1_x91_init, }; --=20 2.51.0