From patchwork Tue Dec 3 14:23:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?=C5=81ukasz_Bartosik?= X-Patchwork-Id: 13892537 Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) (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 60B501F6663 for ; Tue, 3 Dec 2024 14:23:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733235836; cv=none; b=ITjs0v9Y1A8ZnGUrNRnMlxFHC6l2drRp24RzDI4xFfrxcVXKfWRXarHbwvVSPlImJ0y5i5XHJmEeoObbKzecyuOaOttQDeUHwIbGgjAsKE55s9WzWIE8xnuJKobsTiz/Jd7kOk0IvIRawAXXnhxLelKLE+mniGGyYMipIxjfZXw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733235836; c=relaxed/simple; bh=FsVPWUYW3r8+vYPca7TkDYiQezN0cxbYZZeUC077jgw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ou3wJurR+AhG4229DTT4e4xuhGZis8cR90GRCDZuVdn2sa+uAU0QmVCz3mvoDNzZ8PRd/FZ+YnXg3gE08FDkNegy7Q1M9dT51D378ra8Vkj71wGmXpe1Pmdom7v5Bnx5xhEbGiK/Pz4GWhQLguQAowwlLBLxgpIliUt9lDUJRcw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=mOuRTvMe; arc=none smtp.client-ip=209.85.218.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="mOuRTvMe" Received: by mail-ej1-f49.google.com with SMTP id a640c23a62f3a-aa5f1909d6fso170083966b.3 for ; Tue, 03 Dec 2024 06:23:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1733235833; x=1733840633; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/VBmObv79eNi+4KOGkigLjUPpqUoMrzCTZAwaSnc+fc=; b=mOuRTvMeH2wEhMqWuHAdO7C0kIRyDSTk8wB1QdbMzxLFg00JX/O4Czxa8dXvN1kjkB k1HHOmdTYuOOPQfMPxSonFJi42PxSrFy5jXdvQMeJ76MtsmyG5HqRrXp+Zgl9eyrW6XL JjoLWvCIYnn/Q/PVOs1JtZXHvqp6lwI8z95ag= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733235833; x=1733840633; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/VBmObv79eNi+4KOGkigLjUPpqUoMrzCTZAwaSnc+fc=; b=iVA966lh64LSiJh+b7klkbHBEOzZpIbkWO3+JX0E1Sb6nFWXcX4ge4nPZIw+Ueg7Ku F6F7zd8aLS/vcLFNv2mAVEao4R7OBu4fyFMMsMfE/DSI2qIFePJH9zfot7wZRsKjIrUk Mbe3ecskOJzHzTyPZ14JmZwhAvYfspUqz+E1zfKU7kBdxd7cXhXJ/4JDtSpYPdftGkhd G2ub58+1vL1SnVsJGA9NWyv4SJhjLgKcf4fbS/fHllDi2LrISjW2USBAq5G8LeFuuzVI 7I4p0+MpU+ftOpvpM8VHhZ2c2xRXHki9tm7ek+Dimz5M51RAUwEhS6VaHs6W+1ljFwkU r3RQ== X-Forwarded-Encrypted: i=1; AJvYcCVmZLGPHRWuch3VdR7cxCk8/+B0xUrZ+4edl4xmVxXQHvkSyZmWqAGg0BjqR6TyT6FBlimZoj/gyO6HP00KuBo=@lists.linux.dev X-Gm-Message-State: AOJu0YwV09VL4C/cUlsxkiF64CQsz6yxcYXr9d0I5Azxip7nLEAwgfKs Y5spZY+zG4eN4+QNu+yjBB9/BPXM38wID76r+AM8i9q3z+am4AKJwAC5cq0x X-Gm-Gg: ASbGncskviND3Igy0G/0oImkVS5yHXtw8htawTnWS9KaC7bc4iapn6U+/w/PLqs4Yo1 xaPNu5AY35HE/hJ0H8MdeKQT75DV07FAoBQPvaDkBtSbm6g7ewMEXhaxzDxa2Qpwd0nXn7vzimv X1qf6XiY0KsXcd2CF5HS7dy40Gr0DpVLm9Nn6vQjl9JmDk/ZxOdPdrd9yekB8OqkhNx/B5d2moD lDIOSxzerCfZh653+oQo3PVdnIQI6uz/wkA5zINbpqRpI9irIYitSPsbUuyxbf/d+N8OquVRBdq btYqNnNh3m1BUv/iyboovIXuyM0dlGzDj/Q= X-Google-Smtp-Source: AGHT+IEZs3URavmq9Pv+Mk1092umnpPrKs+K6WF+0iktUlUPJg2Ncc6/ZTiR5axE8RkDJuW0va7iEA== X-Received: by 2002:a17:906:328d:b0:aa5:30c0:384b with SMTP id a640c23a62f3a-aa5f7d4d1f6mr193222066b.24.1733235832723; Tue, 03 Dec 2024 06:23:52 -0800 (PST) Received: from ukaszb-ng.c.googlers.com.com (103.45.147.34.bc.googleusercontent.com. [34.147.45.103]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-aa5998e6a64sm618272466b.96.2024.12.03.06.23.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Dec 2024 06:23:52 -0800 (PST) From: =?utf-8?q?=C5=81ukasz_Bartosik?= To: Heikki Krogerus , Greg Kroah-Hartman , Benson Leung , Dmitry Baryshkov Cc: Abhishek Pandit-Subedi , Jameson Thies , Pavan Holla , Tzung-Bi Shih , linux-usb@vger.kernel.org, chrome-platform@lists.linux.dev Subject: [PATCH v9 1/2] platform/chrome: Update ChromeOS EC header for UCSI Date: Tue, 3 Dec 2024 14:23:13 +0000 Message-ID: <20241203142314.3892422-2-ukaszb@chromium.org> X-Mailer: git-send-email 2.47.0.338.g60cca15819-goog In-Reply-To: <20241203142314.3892422-1-ukaszb@chromium.org> References: <20241203142314.3892422-1-ukaszb@chromium.org> Precedence: bulk X-Mailing-List: chrome-platform@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Pavan Holla Add EC host commands for reading and writing UCSI structures in the EC. The corresponding kernel driver is cros-ec-ucsi. Also update PD events supported by the EC. Acked-by: Tzung-Bi Shih Signed-off-by: Pavan Holla Signed-off-by: Ɓukasz Bartosik --- .../linux/platform_data/cros_ec_commands.h | 28 ++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/include/linux/platform_data/cros_ec_commands.h b/include/linux/platform_data/cros_ec_commands.h index b3c4993e656e..ecf290a0c98f 100644 --- a/include/linux/platform_data/cros_ec_commands.h +++ b/include/linux/platform_data/cros_ec_commands.h @@ -5044,8 +5044,11 @@ struct ec_response_pd_status { #define PD_EVENT_POWER_CHANGE BIT(1) #define PD_EVENT_IDENTITY_RECEIVED BIT(2) #define PD_EVENT_DATA_SWAP BIT(3) +#define PD_EVENT_TYPEC BIT(4) +#define PD_EVENT_PPM BIT(5) + struct ec_response_host_event_status { - uint32_t status; /* PD MCU host event status */ + uint32_t status; /* PD MCU host event status */ } __ec_align4; /* Set USB type-C port role and muxes */ @@ -6105,6 +6108,29 @@ struct ec_response_typec_vdm_response { #undef VDO_MAX_SIZE +/* + * UCSI OPM-PPM commands + * + * These commands are used for communication between OPM and PPM. + * Only UCSI3.0 is tested. + */ + +#define EC_CMD_UCSI_PPM_SET 0x0140 + +/* The data size is stored in the host command protocol header. */ +struct ec_params_ucsi_ppm_set { + uint16_t offset; + uint8_t data[]; +} __ec_align2; + +#define EC_CMD_UCSI_PPM_GET 0x0141 + +/* For 'GET' sub-commands, data will be returned as a raw payload. */ +struct ec_params_ucsi_ppm_get { + uint16_t offset; + uint8_t size; +} __ec_align2; + /*****************************************************************************/ /* The command range 0x200-0x2FF is reserved for Rotor. */