From nobody Fri Dec 19 08:56:37 2025 Received: from mail-pl1-f201.google.com (mail-pl1-f201.google.com [209.85.214.201]) (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 100B9533D6 for ; Thu, 9 Oct 2025 01:03:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759971802; cv=none; b=EbgWy5W4HGDAZR417HMLcdNKxfqNrTf0EuSuWyVfsHHhkL45TnkkuqpZTZxjlGSXy8drjVxhbxEEDz0QiokARM6ExKrQ6psx0+qAd7z4RGrUyJY7SOeoaSaJe/9lekrhMaYQ0DVUcNQuYr5IOr6kMSUMMcE+cPXCNYbKg0YhI2M= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759971802; c=relaxed/simple; bh=FdWz06FUR8AR1uAl3wTfj9n2BioEbn7zOnkyos3KuZY=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=b0wzr6z7GoIxYeLyICTj35xZ5v05WofBpKMctGnjbpAlMFvgwPIeJU34dnfdAh1YunpgsiHR5B8MtgWMtVnKyHb9WOBrBG8wtpJRzSwHz8kWKCVby4GfayDzzXsMcAucpfeSzOswz38eDm2sb2eijKgjSmkPtcTEhwhrpUEJtNY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--jthies.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=TPoyhliH; arc=none smtp.client-ip=209.85.214.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--jthies.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="TPoyhliH" Received: by mail-pl1-f201.google.com with SMTP id d9443c01a7336-28c58e009d1so12127185ad.3 for ; Wed, 08 Oct 2025 18:03:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1759971799; x=1760576599; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=9PK081DUWtNx4HfeEFM5F2Wg1a6MRRDecC9Tgqx96lM=; b=TPoyhliH6s3vVXATVGDvTYS4a/CIb2j466QNwaJwD785TmxC2XPWSei6J4ogSBkhq+ U2XmK4MwkCKAMNXNp0uyRuKvVgjYPe7BPZeGFIHd8dY4GuO+IWDU6YzJ2n395QeiguXG AoRiB9oAv8fGzgx5vnkC3jSsw9rxZnf6KITAdhi4CoKkY5wJEQZmXru8nr6nPN5tKtxy XBq8pAa1g2K+x6T6Z0wl+4S2I7AhQLmjy8bkiNjJKSZG/mi6JDNzBG8BUM7jHDTobvlx 9m7eZSP7ZOJm6csQMjl4r88bHj2DLU8xICCqSIFXGj/cARaUzA65XtnjFVDRulfQzBUP UubA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1759971799; x=1760576599; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:x-gm-message-state:from:to:cc:subject :date:message-id:reply-to; bh=9PK081DUWtNx4HfeEFM5F2Wg1a6MRRDecC9Tgqx96lM=; b=mI74MI+IWvJ7VRdjskvLD/6GH5KRGQNo0S1CUsA0eFNYD0ZzjUVZMSvHG+jSNCtbf1 ySMCMbJe0curbubc/QzmZTFnlsdPeWN0jiRFqJkj04C1Qj8HXjaKudVGwXgqUxb7A2yX miqvapyijtkKsxdrK3eMG5MKaCqrE951CJoK75v9ckSeSwqiwkx14Dtzhagfdj/E8hCc NYpVGCrGYgXPX/qt4PC3yTay6Ics2ZEo5h9gUQ/PqNytqVIIcFA9Ifo0kP8vCGFHcW6H yQ56QcQuPQnbFQEJGgvtyD7ka4QKDQzf0kQvVB8yTV1BJKsgrAZcqXBzeVtbQHwivWpq +OFw== X-Forwarded-Encrypted: i=1; AJvYcCX0ol5Q8MKMCH8EiSsuxHO0PtMA6P2S/xFUNdKEw5VOXfDKQB18YqlIuZGF4e34wWvFhJYALCDQKopQqsE=@vger.kernel.org X-Gm-Message-State: AOJu0YwMH/1pk8VyZEgLYBXKE7sKEVVMFu/NRbgOi0SGf7P7oZQ/tTy3 1XkqdfBFgwWx5Rfv7JP3S2cR5NvOYxw+XHLQOVJZAOy+JKJCHNDLxsZmTq+oS826XLTjDxS/N3I D8sh26w== X-Google-Smtp-Source: AGHT+IF6Ef5HS/jsjPnjXWi2U116WXq2EAEcLkV6Ztc8hjYkYYaXlariTxuV8NKw8zY9XwFYXy1JjMx6vIg= X-Received: from plnq5.prod.google.com ([2002:a17:902:f785:b0:267:ddd1:bc97]) (user=jthies job=prod-delivery.src-stubby-dispatcher) by 2002:a17:903:3c4d:b0:267:44e6:11d3 with SMTP id d9443c01a7336-29027379986mr72867335ad.21.1759971799367; Wed, 08 Oct 2025 18:03:19 -0700 (PDT) Date: Thu, 9 Oct 2025 01:03:06 +0000 In-Reply-To: <20251009010312.2203812-1-jthies@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20251009010312.2203812-1-jthies@google.com> X-Mailer: git-send-email 2.51.0.710.ga91ca5db03-goog Message-ID: <20251009010312.2203812-2-jthies@google.com> Subject: [PATCH v3 1/3] dt-bindings: chrome: Add cros-ec-ucsi compatibility to typec binding From: Jameson Thies To: akuchynski@chromium.org, abhishekpandit@chromium.org, krzk+dt@kernel.org, robh@kernel.org, bleung@chromium.org, heikki.krogerus@linux.intel.com, ukaszb@chromium.org, tzungbi@kernel.org Cc: devicetree@vger.kernel.org, chrome-platform@lists.linux.dev, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Jameson Thies Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Chrome OS devices with discrete power delivery controllers (PDCs) allow the host to read port status and control port behavior through a USB Type-C Connector System Software (UCSI) interface with the embedded controller (EC). This uses a separate interface driver than other Chrome OS devices with a Type-C port manager in the EC FW. Those use a host command interface supported by cros-ec-typec. Add a cros-ec-ucsi compatibility string to the existing cros-ec-typec binding. Additionally, update maintainer list to reflect cros-ec-ucsi and cros-ec-typec driver maintainers. Signed-off-by: Jameson Thies Reviewed-by: Benson Leung Reviewed-by: Rob Herring (Arm) --- .../bindings/chrome/google,cros-ec-typec.yaml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/chrome/google,cros-ec-typec.= yaml b/Documentation/devicetree/bindings/chrome/google,cros-ec-typec.yaml index 9f9816fbecbc..fd1a459879bd 100644 --- a/Documentation/devicetree/bindings/chrome/google,cros-ec-typec.yaml +++ b/Documentation/devicetree/bindings/chrome/google,cros-ec-typec.yaml @@ -8,17 +8,28 @@ title: Google Chrome OS EC(Embedded Controller) Type C po= rt driver. =20 maintainers: - Benson Leung - - Prashant Malani + - Abhishek Pandit-Subedi + - Andrei Kuchynski + - =C5=81ukasz Bartosik + - Jameson Thies =20 description: Chrome OS devices have an Embedded Controller(EC) which has access to Type C port state. This node is intended to allow the host to read and - control the Type C ports. The node for this device should be under a - cros-ec node like google,cros-ec-spi. + control the Type C ports. This binding is compatible with both the + cros-ec-typec and cros-ec-ucsi drivers. The cros-ec-typec driver + supports the host command interface used by the Chrome OS EC with a + built-in Type-C port manager and external Type-C Port Controller + (TCPC). The cros-ec-ucsi driver supports the USB Type-C Connector + System Software (UCSI) interface used by the Chrome OS EC when the + platform has a separate power delivery controller (PDC). The node for + this device should be under a cros-ec node like google,cros-ec-spi. =20 properties: compatible: - const: google,cros-ec-typec + enum: + - google,cros-ec-typec + - google,cros-ec-ucsi =20 '#address-cells': const: 1 --=20 2.51.0.710.ga91ca5db03-goog From nobody Fri Dec 19 08:56:37 2025 Received: from mail-pg1-f201.google.com (mail-pg1-f201.google.com [209.85.215.201]) (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 AB54814F9FB for ; Thu, 9 Oct 2025 01:03:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759971803; cv=none; b=sibEkn89jLma39zzo/2oYHQnv7k695sE+yTM5gyj9/uEaNpNiACUJTLmQp1QiJo9eUDyAQhp8DTC5T9hZA8rADI1s3G0yXluPICpLXIOhJTu0t0hvSAwr7M8STjpOtDKxoqSa6kYRcq45wIm0+Xqdhzqj/+kzjR+mM6l3z7z6L4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759971803; c=relaxed/simple; bh=tSONzkd/O/+rs+POwDj3o16Z3uPD6VSUJul2FCsIGzM=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=sahuib5VsJbB9XU+iju8MmY/SQ/Jo3vbqMg8ClkkK73zsRueW5z8k6H/RuS3OL6HTTxuLSOUYtDRC/SjL29nlbUvrzArc2rDJ1Ia26ackGoOznVeFzgsRvbzofdY64FkRPHVHF8fmg1sUtrAKaIKtU2p+v9xPipRd23czyhuERQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--jthies.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=23iLFegt; arc=none smtp.client-ip=209.85.215.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--jthies.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="23iLFegt" Received: by mail-pg1-f201.google.com with SMTP id 41be03b00d2f7-b62f9247dd1so506657a12.0 for ; Wed, 08 Oct 2025 18:03:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1759971801; x=1760576601; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=g/4YIFu4sS9h/R2pTNo5KqxfeVEIXuxRpdzIrSZfq5Y=; b=23iLFegtmjncrs/yt3YWctcS4S6Fxu2d3wNSec/GEUgIKs2nNclPm/93Noi5a4cNNG BwNI4E0uqbE2Y6PflMFVZFrxzx0IIeh2n3eIZ9cPK7CTCaCVaoBA9imisaJN+sNkhQzj dkr2C0pSOTyGBmJrS5ZBcFWjRc9ZgoHP23znpM9lVIpFhWUYKu7ePrjL/CsioA6v0KsU 8TsjavBec8yivNWlBh+VvH6HIfKxpHnwizo/iqVLdqXo1SCxrvla8Cb4YyIDpWs1e+Go UVZS43X0qFr74MRcudWmZUePCe5okhcGit0FDGhZlPO9bGigfFnZTVQ7JWu5EB22KdJ+ XNkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1759971801; x=1760576601; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=g/4YIFu4sS9h/R2pTNo5KqxfeVEIXuxRpdzIrSZfq5Y=; b=NacGsL/DW2vmKryg/i9CXmZarrm75SSeCppPN9ajMhtbNESwFL02wS/8iNrPSCpRqT X4aXxyN/j5bL/LfdAr4gUjfscgcck0uhNu0AjWpkpcsxZTUeAPtk+ez0B5fAs0O/qdgR 4c2uacnEkVI45Ba/bxLf/XONYgw1j7/xxi9qLvMuJyfk4EDSDo+39nYz66Q9XVKxOESq yhuGmiLk42Uy+BmuIyZhfLdWyeZ9ATj9YFEE6/f9FOfVqly4y653V+pvgnwu6eZc4/SE Mzcc38IBTyiQIIcAY8FQpGX/QClXxpFDtqcZpbxaW5uXS28aOY3oC8wnpAZk79Rt3odl qftQ== X-Forwarded-Encrypted: i=1; AJvYcCWjjboneANhSG76gyelE8+vmKT9V8Vl0e1kmVNS+Tt0oVzw1MmfEYaJ451nobQlpJZdUGm+L8ycFZMK3E0=@vger.kernel.org X-Gm-Message-State: AOJu0YxIAlaToVvvxgJR5zZKYcmWv6rGMKsR3K9mwgATZAPmCY/XJrgu Mc66eotSnHtW9mveAKL9xdz8MSmR2Du4n27IibV5YpboBl8HoavExiAehto+JDU5JUHzzb+HVoC spy4mjg== X-Google-Smtp-Source: AGHT+IHp9lhngu8Gcn0L1T1mTc3AnO+MfrO5+f6Ss5kpMxPs3s4Tw2S+ucM0AiCl634GfbIg65sr8/46cQg= X-Received: from pjbbt21.prod.google.com ([2002:a17:90a:f015:b0:32e:a3c3:df27]) (user=jthies job=prod-delivery.src-stubby-dispatcher) by 2002:a17:90b:1e0a:b0:334:cb89:bde6 with SMTP id 98e67ed59e1d1-33b51105dcemr6509867a91.4.1759971800738; Wed, 08 Oct 2025 18:03:20 -0700 (PDT) Date: Thu, 9 Oct 2025 01:03:07 +0000 In-Reply-To: <20251009010312.2203812-1-jthies@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20251009010312.2203812-1-jthies@google.com> X-Mailer: git-send-email 2.51.0.710.ga91ca5db03-goog Message-ID: <20251009010312.2203812-3-jthies@google.com> Subject: [PATCH v3 2/3] usb: typec: cros_ec_ucsi: Load driver from OF and ACPI definitions From: Jameson Thies To: akuchynski@chromium.org, abhishekpandit@chromium.org, krzk+dt@kernel.org, robh@kernel.org, bleung@chromium.org, heikki.krogerus@linux.intel.com, ukaszb@chromium.org, tzungbi@kernel.org Cc: devicetree@vger.kernel.org, chrome-platform@lists.linux.dev, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Jameson Thies Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Add support for cros_ec_ucsi to load based on "google,cros-ec-ucsi" compatible devices and "GOOG0021" ACPI nodes. Signed-off-by: Jameson Thies Reviewed-by: Heikki Krogerus Reviewed-by: Benson Leung --- drivers/usb/typec/ucsi/cros_ec_ucsi.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/drivers/usb/typec/ucsi/cros_ec_ucsi.c b/drivers/usb/typec/ucsi= /cros_ec_ucsi.c index eed2a7d0ebc6..62b80ad85a68 100644 --- a/drivers/usb/typec/ucsi/cros_ec_ucsi.c +++ b/drivers/usb/typec/ucsi/cros_ec_ucsi.c @@ -5,11 +5,13 @@ * Copyright 2024 Google LLC. */ =20 +#include #include #include #include #include #include +#include #include #include #include @@ -235,7 +237,6 @@ static void cros_ucsi_destroy(struct cros_ucsi_data *ud= ata) static int cros_ucsi_probe(struct platform_device *pdev) { struct device *dev =3D &pdev->dev; - struct cros_ec_dev *ec_data =3D dev_get_drvdata(dev->parent); struct cros_ucsi_data *udata; int ret; =20 @@ -244,8 +245,11 @@ static int cros_ucsi_probe(struct platform_device *pde= v) return -ENOMEM; =20 udata->dev =3D dev; + if (is_acpi_device_node(dev->fwnode) || is_of_node(dev->fwnode)) + udata->ec =3D dev_get_drvdata(dev->parent); + else + udata->ec =3D ((struct cros_ec_dev *)dev_get_drvdata(dev->parent))->ec_d= ev; =20 - udata->ec =3D ec_data->ec_dev; if (!udata->ec) return dev_err_probe(dev, -ENODEV, "couldn't find parent EC device\n"); =20 @@ -326,10 +330,24 @@ static const struct platform_device_id cros_ucsi_id[]= =3D { }; MODULE_DEVICE_TABLE(platform, cros_ucsi_id); =20 +static const struct acpi_device_id cros_ec_ucsi_acpi_device_ids[] =3D { + { "GOOG0021", 0 }, + { } +}; +MODULE_DEVICE_TABLE(acpi, cros_ec_ucsi_acpi_device_ids); + +static const struct of_device_id cros_ucsi_of_match[] =3D { + { .compatible =3D "google,cros-ec-ucsi", }, + {} +}; +MODULE_DEVICE_TABLE(of, cros_ucsi_of_match); + static struct platform_driver cros_ucsi_driver =3D { .driver =3D { .name =3D KBUILD_MODNAME, .pm =3D &cros_ucsi_pm_ops, + .acpi_match_table =3D cros_ec_ucsi_acpi_device_ids, + .of_match_table =3D cros_ucsi_of_match, }, .id_table =3D cros_ucsi_id, .probe =3D cros_ucsi_probe, --=20 2.51.0.710.ga91ca5db03-goog From nobody Fri Dec 19 08:56:37 2025 Received: from mail-oa1-f73.google.com (mail-oa1-f73.google.com [209.85.160.73]) (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 20331176FB1 for ; Thu, 9 Oct 2025 01:03:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.73 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759971804; cv=none; b=emha6x4S8VLc/fiKOQS/ZPwYpEMyhv/VA42kRIhHt2GkR/pKkA7290wx9TIS/y9Hw2DmiccMr0s5y5F36lfouqpteBaTLDy1aRUyfHk2kIQ7OPh2aabWc1NQRX+hNLx2akRLR/lHjWuFl26U73UjL0RAgw2LsFu3u0Vl+qMucAo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759971804; c=relaxed/simple; bh=00pwX8rLB5k8Lb3COtxEncyyDckCIf4Wtb9DdeVqR3Q=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=LK9/weTWVluREXye1N6yFMODSfsHe3u0e4/DfoNg7kd5xDQnHwKtGOgV3NKdjgcz67fbNiliYK4zy+gthaGXIJ8/VEr0RYHVVX+YQpA3+WR2IsNjtiNiyCHxBMLE7Npaumht4dPmsn+dm7PB8f5Jtf3buc2f30GBVWUuLvSt7eQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--jthies.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=DUtQdUQ/; arc=none smtp.client-ip=209.85.160.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--jthies.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="DUtQdUQ/" Received: by mail-oa1-f73.google.com with SMTP id 586e51a60fabf-30cce8e3ceaso1002225fac.1 for ; Wed, 08 Oct 2025 18:03:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1759971802; x=1760576602; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=kCeRiv6OyS5ejnolBPMxDl1i4JKGbiO+/woSsXQ2sg0=; b=DUtQdUQ/KdrO3VMrApaSW5GRZJsnbHPigjWw5EYvd8qpxISNbqxCl+bYLTpVYDWRiE 835bSiCZwOWJojPkizxRHGEGYzeAP6FQ7onghHkvLJ4SZYjrpriPhYMOJLsvhE1IwWU4 UvUXsIG+Xm4RQ4ArONKMsEF/icJcpIN5p2nENXLUmkqQGuo7zngW/W5q80GJ1syF6v28 q/VJk97izsVHNgAQqvlaWXGuiOP88I20yCdNADSq/OPHKn4MAxdE2Rm2v2v0lxN+DAv6 ecoqOHMOMLCOl/1jjbYDA8+chSch+mz8WP5lCZOkNMIQz1zUpLt1oJPvYwb2r/hGnCBS fN0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1759971802; x=1760576602; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=kCeRiv6OyS5ejnolBPMxDl1i4JKGbiO+/woSsXQ2sg0=; b=QF/UajQHcSlFVAbl/DYTfAhVkX6VMY3C2LHPW1pCLc0L39Kq6MEAe0G6VvP46sKqd+ CVHheVOn17vgT/TT9WILxL32PhZBEdIEjsA2miMgKcdTwEOeEZ/Tl7fgiVEpyppRqmhP kYbToK1Q/EJ0BkJ5LN/PBCCuVOIc6w29LHxlQiLVk6NLYtUc/5psWrGigonMn1XpkuzT RNF7T0rCy/u/O9/pwjFpqhT0yPteny0fSZMe2HvLr4fPWfat98J1SqD2Bztn68dOlnEW NLAXW3GdUZ8fi/h1+fIAFvQyadmv28q5pFyuh5+KTHTfYfKngq3xf8SkwijZz6akFKHx aX6A== X-Forwarded-Encrypted: i=1; AJvYcCXcqY9erEcjrUT8Yg2NknP4GQAseClJ6XgRQ+iGk8Q9FSxIhfq67vPgTtILLkMrJD2cO6A1e0RafN9Azjc=@vger.kernel.org X-Gm-Message-State: AOJu0YxN2nadJVxq/PzvbtcOn3Pm/Ni9VqWqWt1SotopTB6QXJmDV9L3 sanP5J5N76xtvvhToQjhjM1zK6yqrVi0eWzrEWsBjW/7iDcliLr7LRpw34hk3D+uPMyDrmNVPqf 3qZHDSQ== X-Google-Smtp-Source: AGHT+IF0qbDcxH3MGVrqr+Rn2sXSBv3+09P7txZ+7QoM8RfbyeoIQUaC8Byu4yqvRximfoLKLV3kORtUsFI= X-Received: from oabyy48.prod.google.com ([2002:a05:6871:25b0:b0:34b:1c16:5c46]) (user=jthies job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6870:e992:b0:3b1:8e5d:d42a with SMTP id 586e51a60fabf-3c0fb72a8famr2648272fac.49.1759971802265; Wed, 08 Oct 2025 18:03:22 -0700 (PDT) Date: Thu, 9 Oct 2025 01:03:08 +0000 In-Reply-To: <20251009010312.2203812-1-jthies@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20251009010312.2203812-1-jthies@google.com> X-Mailer: git-send-email 2.51.0.710.ga91ca5db03-goog Message-ID: <20251009010312.2203812-4-jthies@google.com> Subject: [PATCH v3 3/3] mfd: cros_ec: Don't add cros_ec_ucsi if it is defined in OF or ACPI From: Jameson Thies To: akuchynski@chromium.org, abhishekpandit@chromium.org, krzk+dt@kernel.org, robh@kernel.org, bleung@chromium.org, heikki.krogerus@linux.intel.com, ukaszb@chromium.org, tzungbi@kernel.org Cc: devicetree@vger.kernel.org, chrome-platform@lists.linux.dev, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Jameson Thies Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" On devices with a UCSI PPM in the EC, check for cros_ec_ucsi to be defined in the OF device tree or an ACPI node. If it is defined by either OF or ACPI, it does not need to be added as a subdevice of cros_ec_dev. Signed-off-by: Jameson Thies Reviewed-by: Benson Leung --- drivers/mfd/cros_ec_dev.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/drivers/mfd/cros_ec_dev.c b/drivers/mfd/cros_ec_dev.c index dc80a272726b..1928c2ea2b8f 100644 --- a/drivers/mfd/cros_ec_dev.c +++ b/drivers/mfd/cros_ec_dev.c @@ -5,6 +5,7 @@ * Copyright (C) 2014 Google, Inc. */ =20 +#include #include #include #include @@ -131,11 +132,6 @@ static const struct cros_feature_to_cells cros_subdevi= ces[] =3D { .mfd_cells =3D cros_ec_rtc_cells, .num_cells =3D ARRAY_SIZE(cros_ec_rtc_cells), }, - { - .id =3D EC_FEATURE_UCSI_PPM, - .mfd_cells =3D cros_ec_ucsi_cells, - .num_cells =3D ARRAY_SIZE(cros_ec_ucsi_cells), - }, { .id =3D EC_FEATURE_HANG_DETECT, .mfd_cells =3D cros_ec_wdt_cells, @@ -264,6 +260,23 @@ static int ec_device_probe(struct platform_device *pde= v) } } =20 + /* + * FW nodes can load cros_ec_ucsi, but early PDC devices did not define + * the required nodes. On PDC systems without FW nodes for cros_ec_ucsi, + * the driver should be added as an mfd subdevice. + */ + if (cros_ec_check_features(ec, EC_FEATURE_USB_PD) && + cros_ec_check_features(ec, EC_FEATURE_UCSI_PPM) && + !acpi_dev_found("GOOG0021") && + !of_find_compatible_node(NULL, NULL, "google,cros-ec-ucsi")) { + retval =3D mfd_add_hotplug_devices(ec->dev, + cros_ec_ucsi_cells, + ARRAY_SIZE(cros_ec_ucsi_cells)); + + if (retval) + dev_warn(ec->dev, "failed to add cros_ec_ucsi: %d\n", retval); + } + /* * UCSI provides power supply information so we don't need to separately * load the cros_usbpd_charger driver. --=20 2.51.0.710.ga91ca5db03-goog