Received: by 2002:a05:6500:1b8f:b0:1fa:5c73:8e2d with SMTP id df15csp801912lqb; Wed, 29 May 2024 10:52:33 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWpI6ZQI2EU57tXaZ4QMBbXiVqvFH/cP2i3GAahy5FxRVtICR0O+7XKR45MXPrL7JGQ1K2y+0yho7OKq0r5P6KmtbHKu7tW4lq60dWG+g== X-Google-Smtp-Source: AGHT+IHUVwqV2aLuCm34uqo1QVDlLWEyumY/uGSxa92MEaXRjlPUZybEXNK911wnZoOMj9BCsMp9 X-Received: by 2002:a05:6870:c081:b0:250:1322:34c0 with SMTP id 586e51a60fabf-250132277a3mr7632411fac.10.1717005153290; Wed, 29 May 2024 10:52:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717005153; cv=pass; d=google.com; s=arc-20160816; b=ZwW8MOSxBRI5hTpkGg2kEICkfjyWzZEsZFx9otmVAKae+AewxuSiOIWUnCiAF4RIT5 8XtxTxAAV6qoHHzen0Aeu0IzOl31k27T9L0PK+NeWdia4G0B7+duJ0FNlfIcDCgQM0lN zoKEi9kcZoR9G6qT9EIVbROWm8m0qe6lK+dBX0noWoIEG5VHm+QUC/X15D8wv4PuEM5C sfoTcCeLFis9H7RNbOKkbxQUHnkzkuEBEUI6jBNUWQTlksOYE1Lm3+zv6fHRar+WWi38 oJSmMLj4a2YN3OuVsu7HjZ6lf4O1zfhFvzhCXcBbP/pCazmMxOoTLJgoc6FZ/SXmp/X2 enfg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-id:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:references:message-id:in-reply-to:subject:cc:to:date :from:dkim-signature; bh=U3JJ7PRNhBsogoTfqJ2DDM7jSkspQyVttDx4aZsug48=; fh=l6ginnCGrmvvZF0AxP3GM6UABnTEV9eURThsgEFF6OY=; b=LoQJWfq19A1I2osypMcOo5KziOqSNlnoSxu6ewVGKqaXtd8rw/K2IiO7qSVfSggX/L FAQb9HQlpGWUi0yhro14xISBklWX6OC8awH/RCKHltUwBSUxUyLgNPlsZHNRqR0DMiUz tVUCNsWs4Bcy9edj6Fu8r3kBcea+2aTTbPnR/k17QjQc/4XgcdXDoPT2FmuB+UdzX6++ 3Z0WDAVp8Z/QxB1Bwi1CceoLbrSuMGJ+h0X9Um6PH3FJovSi8Kn4lbp5XG7BTaO9qjrs sn3BY0s5SgTnJr5/C5NtA7I+XAP+/pscZ9VpCiGnv2dX+Z3ABnXZZIE/CeT/iPRa2S38 SuFQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ChGCLx22; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-194360-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194360-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-794abcac34dsi1389843085a.77.2024.05.29.10.52.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 May 2024 10:52:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-194360-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=ChGCLx22; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-194360-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-194360-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 40CB21C21C1D for ; Wed, 29 May 2024 15:26:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C9615181326; Wed, 29 May 2024 15:26:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="ChGCLx22" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AD7C017DE0F; Wed, 29 May 2024 15:26:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.13 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716996394; cv=none; b=q2qCZ0wffEzFGcp/I8JoHVSpzkBcJ0X90CPW5ocCgTO1fwnvMk8t6DS+RpSCjU0gZZ3SX6C7YcVfZrhYqtJujPGojxwWUBf9oIHjj3UWtddAMUUj5ARmvw1Eo3iMtClis34HIFIx80DMprz1LjfTPqmoqzlI0pQQMTd+3UDzMgg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716996394; c=relaxed/simple; bh=wo336CkD1y3kvT7y2cjNBDeC4dlb8iXbUrJSZN/WcXw=; h=From:Date:To:cc:Subject:In-Reply-To:Message-ID:References: MIME-Version:Content-Type; b=k6Eh2py9qBKteHNuldKXRUltpb1Ja04kZEdW/QJ4l7mYuXAkuq96/TscFBfIQBBA0H9R4buyCOB1bNBOfckb5/QdGDmfp9IgfrIMwoDz1G0zfu6KicM6nGsZBySOaLMDQwCmMibpp3RsuLecW4/EJ3QgaSi+MM3bWBLLwxZyFCQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=ChGCLx22; arc=none smtp.client-ip=192.198.163.13 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716996393; x=1748532393; h=from:date:to:cc:subject:in-reply-to:message-id: references:mime-version:content-id; bh=wo336CkD1y3kvT7y2cjNBDeC4dlb8iXbUrJSZN/WcXw=; b=ChGCLx2258aBNZscjFfzVD8MU+ajUsD5TveRR/mLD9uOAz5li0WCbu8O 0dJePwhEzujPXfPTq2CH0fLDvzbCJTJieeDK5j/jWhalnduK954OSCfjW tDrXpWOMgcM8MD0NcZWsacrEjgQ4xuIzvrH9Adesaz+wuDJQLNi+UDU8S fjUadPIqP30u1JBxWfkfWafUbt6FisgVcWl4iU+9d1sxqLFU2nCQtCkJx RMqbV8gtNdbxbyZ816T03btnMsKlav/fYL8zbi1yohw3smClxD3/MyBrh JbTc3UCl4lUrKFfy32bISdu1FhRcogTTgYD4nLfjY2sM3udk55461UG95 A==; X-CSE-ConnectionGUID: /MTqi3cSTn6zBorId+rASw== X-CSE-MsgGUID: aW9qEvI9QGKjFdf6pYNUhw== X-IronPort-AV: E=McAfee;i="6600,9927,11087"; a="16357618" X-IronPort-AV: E=Sophos;i="6.08,198,1712646000"; d="scan'208";a="16357618" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by fmvoesa107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 May 2024 08:26:16 -0700 X-CSE-ConnectionGUID: tFxFCcgbRZanUkkNBCx9rg== X-CSE-MsgGUID: QvoOnNOCTS+PgaWckhHpqw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,198,1712646000"; d="scan'208";a="35533515" Received: from ijarvine-desk1.ger.corp.intel.com (HELO localhost) ([10.245.247.149]) by orviesa009-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 May 2024 08:26:11 -0700 From: =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= Date: Wed, 29 May 2024 18:26:07 +0300 (EEST) To: Dmitry Baryshkov cc: Sebastian Reichel , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Hans de Goede , Bryan O'Donoghue , Heikki Krogerus , Greg Kroah-Hartman , Konrad Dybcio , linux-pm@vger.kernel.org, devicetree@vger.kernel.org, LKML , platform-driver-x86@vger.kernel.org, linux-usb@vger.kernel.org, linux-arm-msm@vger.kernel.org, Nikita Travkin Subject: Re: [PATCH v4 3/6] usb: typec: ucsi: add Lenovo Yoga C630 glue driver In-Reply-To: Message-ID: <97448807-e567-05a4-9361-efcc84b5f07f@linux.intel.com> References: <20240528-yoga-ec-driver-v4-0-4fa8dfaae7b6@linaro.org> <20240528-yoga-ec-driver-v4-3-4fa8dfaae7b6@linaro.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/mixed; BOUNDARY="8323328-268320193-1716996253=:1108" Content-ID: This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323328-268320193-1716996253=:1108 Content-Type: text/plain; CHARSET=ISO-8859-15 Content-Transfer-Encoding: QUOTED-PRINTABLE Content-ID: <6d420af6-f53c-8618-6400-2923bec3ea61@linux.intel.com> On Wed, 29 May 2024, Dmitry Baryshkov wrote: > On Wed, 29 May 2024 at 17:20, Ilpo J=E4rvinen > wrote: > > > > On Tue, 28 May 2024, Dmitry Baryshkov wrote: > > > > > The Lenovo Yoga C630 WOS laptop provides implements UCSI interface in > > > the onboard EC. Add glue driver to interface the platform's UCSI > > > implementation. > > > > > > Signed-off-by: Dmitry Baryshkov > > > --- > > > drivers/usb/typec/ucsi/Kconfig | 9 ++ > > > drivers/usb/typec/ucsi/Makefile | 1 + > > > drivers/usb/typec/ucsi/ucsi_yoga_c630.c | 189 ++++++++++++++++++++++= ++++++++++ > > > 3 files changed, 199 insertions(+) > > > > > > diff --git a/drivers/usb/typec/ucsi/Kconfig b/drivers/usb/typec/ucsi/= Kconfig > > > index bdcb1764cfae..680e1b87b152 100644 > > > --- a/drivers/usb/typec/ucsi/Kconfig > > > +++ b/drivers/usb/typec/ucsi/Kconfig > > > @@ -69,4 +69,13 @@ config UCSI_PMIC_GLINK > > > To compile the driver as a module, choose M here: the module = will be > > > called ucsi_glink. > > > > > > +config UCSI_LENOVO_YOGA_C630 > > > + tristate "UCSI Interface Driver for Lenovo Yoga C630" > > > + depends on EC_LENOVO_YOGA_C630 > > > + help > > > + This driver enables UCSI support on the Lenovo Yoga C630 lapt= op. > > > + > > > + To compile the driver as a module, choose M here: the module = will be > > > + called ucsi_yoga_c630. > > > + > > > endif > > > diff --git a/drivers/usb/typec/ucsi/Makefile b/drivers/usb/typec/ucsi= /Makefile > > > index b4679f94696b..aed41d23887b 100644 > > > --- a/drivers/usb/typec/ucsi/Makefile > > > +++ b/drivers/usb/typec/ucsi/Makefile > > > @@ -21,3 +21,4 @@ obj-$(CONFIG_UCSI_ACPI) +=3D uc= si_acpi.o > > > obj-$(CONFIG_UCSI_CCG) +=3D ucsi_ccg.o > > > obj-$(CONFIG_UCSI_STM32G0) +=3D ucsi_stm32g0.o > > > obj-$(CONFIG_UCSI_PMIC_GLINK) +=3D ucsi_glink.o > > > +obj-$(CONFIG_UCSI_LENOVO_YOGA_C630) +=3D ucsi_yoga_c630.o > > > diff --git a/drivers/usb/typec/ucsi/ucsi_yoga_c630.c b/drivers/usb/ty= pec/ucsi/ucsi_yoga_c630.c > > > new file mode 100644 > > > index 000000000000..ca1ab5c81b87 > > > --- /dev/null > > > +++ b/drivers/usb/typec/ucsi/ucsi_yoga_c630.c > > > @@ -0,0 +1,189 @@ > > > +// SPDX-License-Identifier: GPL-2.0-only > > > +/* > > > + * Copyright (c) 2022-2024, Linaro Ltd > > > + * Authors: > > > + * Bjorn Andersson > > > + * Dmitry Baryshkov > > > + */ > > > +#include > > > +#include > > > +#include > > > + > > > +#include "ucsi.h" > > > + > > > +struct yoga_c630_ucsi { > > > + struct yoga_c630_ec *ec; > > > + struct ucsi *ucsi; > > > + struct notifier_block nb; > > > + struct completion complete; > > > > Add includes for what you used here. > > > > > + unsigned long flags; > > > +#define UCSI_C630_COMMAND_PENDING 0 > > > +#define UCSI_C630_ACK_PENDING 1 > > > + u16 version; > > > +}; > > > + > > > +static int yoga_c630_ucsi_read(struct ucsi *ucsi, unsigned int offs= et, > > > > extra space > > > > > + void *val, size_t val_len) > > > +{ > > > + struct yoga_c630_ucsi *uec =3D ucsi_get_drvdata(ucsi); > > > > Missing include for ucsi_get_drvdata >=20 > I'll review my includes, but this comment and the comment for > ucsi_operations are clearly wrong. There is a corresponding include. Ah, sorry about that. I completely missed there was that local include. --=20 i. --8323328-268320193-1716996253=:1108--