Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1218239rbb; Mon, 26 Feb 2024 02:32:10 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVn5U9QahZ0FUorXn6GKNajCRXyZwD25lbS476XVqcEfcPiIrdFDco5KUDP0DHhYkzjpRYeXJk4V1KSX1yFwyy6v6xumtk+J1NNb1BfUQ== X-Google-Smtp-Source: AGHT+IHL+UZVsWkMfQTVinubQxHwUHZzLBTYrYlojNIZvxwCiS5kfI/r/+2npwBrFqkkXgmqqzg9 X-Received: by 2002:a05:622a:50d:b0:42e:876d:f633 with SMTP id l13-20020a05622a050d00b0042e876df633mr2096489qtx.53.1708943529983; Mon, 26 Feb 2024 02:32:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708943529; cv=pass; d=google.com; s=arc-20160816; b=DWEsLpbhLKULaMGui+X2Cbr46XJG560zpun3L9pcrMFdR3+eC79a+SpUcdDZDJKBGW MUNtJoICX+KaKQ2E4AFznHgJP+7iRXipX06mSI6uVpHzOPSm69c6tpcSFpTXqp04lVxO MNaYWeS/iMbnso/yle+ZHjUWVZNk4lKP/oRgFOYQcntg/quz0N8mmoIy9lQCzFfYh5+G CbIYpptu88bJPN371FLmYTeGDb8xQgFE1Rpmwy6hy8MixrTsmDIdS/FUvVFjOXqP7Rze tX7hoUez8wG8+GgnIaC7YZIywnl/g2U9YGX2TnrtLrSDnladKRKLdgTT9dU0oir+httA KiHA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Jz9h7a/pFDjMVe1wETtb/P6Ds1CpmyLdCHqc3MVF+3w=; fh=fLpzG6lWPuTjSo3vhlaGkIz4YLLpgic0aefZvGZputU=; b=ZCxSOIq7rOUGO96uXBxORDfeZsUVzvGq+x1NLANsA1kYoMLKplMrd6UukrNYGzIpDt 1J1vwjgj8gwB9bS/1uUEYIcuip6rv9rLvSwj/gFkA7FpPU1wOS4r4vUGA1eRyLzOtlPM ujye/H7EjXhAe0HhnfC2gf2osHvBTMMgVVITdGGVBg0iMFqNM9ecQaRTQkXbu8lQzzLC sXxana+e/MIJdSko4w3Nit++6EUR/mPEXimdbP9LoIXf+kc/L4iorW35p0NuQV5xFH2i zrzQadEPDI+v/bhGcnLWtP8cjXNs/HVmvL/agFLfMyOoRkEB395yMgRPtvsrQKqY0fYQ 5Ttg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=f8OJ5cOB; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-80720-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80720-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. [147.75.199.223]) by mx.google.com with ESMTPS id x26-20020ac86b5a000000b0042dace44a88si4799868qts.457.2024.02.26.02.32.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 02:32:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-80720-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=f8OJ5cOB; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-80720-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-80720-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 B741C1C21BEF for ; Mon, 26 Feb 2024 08:03:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 38E8A1C6A6; Mon, 26 Feb 2024 08:03:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="f8OJ5cOB" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.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 C43571CA81; Mon, 26 Feb 2024 08:03:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.13 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708934618; cv=none; b=Zcy41NQkkf4fwydcLEdXnnEprQuOEQ9RTZxtNxaRsqcLtqbFRVSr1Cd1fymAUZ8iVc7iB811Y1UPodkp/745LrtCfavdYFmVJfC0bgJUr0RH9tD0Sv2dZmJx6cmRKZFM6wwr0xLMTdbtPMRnIKTJ7h9I9s63BkVy8bKP0udomGI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708934618; c=relaxed/simple; bh=lKCJAGB8b/UhlOF810+HmhG2QMowiBaclTzfZnZ3Rek=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=eBgNbB0lQRQz9baGhKFcvjPvNNQm8AL03SZZxlk4Vemn5wjczymwn7TNJdiy14HqTXfa5dxu5rda1vlqNHijnvHKvf1Brqg67IRaEK1miqE7EKGBN3bldi0PEhOjHNWuAFboEtchITTdYqaoL3JCMozLggIU1L0YS3oJ9tY9LHI= 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=f8OJ5cOB; arc=none smtp.client-ip=198.175.65.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=1708934617; x=1740470617; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=lKCJAGB8b/UhlOF810+HmhG2QMowiBaclTzfZnZ3Rek=; b=f8OJ5cOB4oXDe7fEC6jABrWbgoBekqZpkUm+XsHOfzKirAfl+roFRCFe Sj4MKbtT1mB24tAIELdPFnHURVfIhw//RCKh7Mg0B1bH19EDPFNuNI4qt anAg0/Pvh2h8oTOVNRNgvQn/WzFLI07nkjP2KFtLsEO7ld0mon/Ii3j/E GZSODn+2CUrNVV9qiFwlF5t6MiT6iMok0hx0J3O+OLDzELn/O254YEKkI M70gpSJ4Wy6v4bs5jlGVZFmbGTdPbQ6Xl8HMHVIToMiDp+NeSSQBZdm5l O9JFgnF3fFZzFGsf3tR/8xRO/paCz0XhsShh1J3Z/f43FLyLQHJjtH6Km w==; X-IronPort-AV: E=McAfee;i="6600,9927,10995"; a="14335908" X-IronPort-AV: E=Sophos;i="6.06,185,1705392000"; d="scan'208";a="14335908" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orvoesa105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Feb 2024 00:03:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10995"; a="937029451" X-IronPort-AV: E=Sophos;i="6.06,185,1705392000"; d="scan'208";a="937029451" Received: from kuha.fi.intel.com ([10.237.72.185]) by fmsmga001.fm.intel.com with SMTP; 26 Feb 2024 00:03:31 -0800 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Mon, 26 Feb 2024 10:03:30 +0200 Date: Mon, 26 Feb 2024 10:03:30 +0200 From: Heikki Krogerus To: Marco Felsch Cc: gregkh@linuxfoundation.org, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, linux@roeck-us.net, jun.li@nxp.com, devicetree@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: Re: [PATCH v3 3/4] usb: typec: tcpm: add support to set tcpc connector orientatition Message-ID: References: <20240222210903.208901-1-m.felsch@pengutronix.de> <20240222210903.208901-4-m.felsch@pengutronix.de> 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=us-ascii Content-Disposition: inline In-Reply-To: <20240222210903.208901-4-m.felsch@pengutronix.de> On Thu, Feb 22, 2024 at 10:09:02PM +0100, Marco Felsch wrote: > This adds the support to set the connector orientation value > accordingly. This is part of the optional CONFIG_STANDARD_OUTPUT > register 0x18, specified within the USB port controller spsicification > rev. 2.0 [1]. > > [1] https://www.usb.org/sites/default/files/documents/usb-port_controller_specification_rev2.0_v1.0_0.pdf > > Signed-off-by: Marco Felsch Reviewed-by: Heikki Krogerus > --- > v3: > - no changes > v2: > - no changes > > drivers/usb/typec/tcpm/tcpm.c | 6 ++++++ > include/linux/usb/tcpm.h | 2 ++ > 2 files changed, 8 insertions(+) > > diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c > index 5945e3a2b0f7..85ca26687324 100644 > --- a/drivers/usb/typec/tcpm/tcpm.c > +++ b/drivers/usb/typec/tcpm/tcpm.c > @@ -1099,6 +1099,12 @@ static int tcpm_set_roles(struct tcpm_port *port, bool attached, > if (ret < 0) > return ret; > > + if (port->tcpc->set_orientation) { > + ret = port->tcpc->set_orientation(port->tcpc, orientation); > + if (ret < 0) > + return ret; > + } > + > port->pwr_role = role; > port->data_role = data; > typec_set_data_role(port->typec_port, data); > diff --git a/include/linux/usb/tcpm.h b/include/linux/usb/tcpm.h > index 65fac5e1f317..93b681ff3ef9 100644 > --- a/include/linux/usb/tcpm.h > +++ b/include/linux/usb/tcpm.h > @@ -133,6 +133,8 @@ struct tcpc_dev { > enum typec_cc_status *cc2); > int (*set_polarity)(struct tcpc_dev *dev, > enum typec_cc_polarity polarity); > + int (*set_orientation)(struct tcpc_dev *dev, > + enum typec_orientation orientation); > int (*set_vconn)(struct tcpc_dev *dev, bool on); > int (*set_vbus)(struct tcpc_dev *dev, bool on, bool charge); > int (*set_current_limit)(struct tcpc_dev *dev, u32 max_ma, u32 mv); > -- > 2.39.2 -- heikki