Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp944828rdh; Fri, 24 Nov 2023 01:32:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IEW1FP4JoumQHMoBU2CRrXAoJ0DqpKEcnurG11z36vD/TnqzDNjJDk8zCrqX9Zo6SGiOMp/ X-Received: by 2002:a17:902:8488:b0:1cc:5e1b:98b5 with SMTP id c8-20020a170902848800b001cc5e1b98b5mr1934461plo.66.1700818326340; Fri, 24 Nov 2023 01:32:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700818326; cv=none; d=google.com; s=arc-20160816; b=xpr5HoY3nPNgkpsvSaSt2z+a5v/Bka8+8uOXF1wXmUrh6ri3I/V9ZOzu6yAGPipaHA iVBdv/A/ZgL4gzSnBS7AXxZ2OApvRrME5y2hLx+W+KeHrp0wB0M2tdARGWEkAqt644DI oZS2e90rGWsErLslCufDwMD+YS9AbI6xeL2XTJsEiZnssGdy6l/VjfNmpxJa16PSvTPD ycjeYFWOKZ1SvZX0K86AMN7WoV+/epTjM8zzP96eWGYIHyTcQ/+S5ecy+EWrC7Ay/H4y s8lxfAmsMyEP6w2AzTU1m05aR88YTUHYBZEx4K4jScqDGBCmPVUocR1lav4Hgk6BeAyL LqJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=Hg82qz3yZX9+y2dKP+Dh927FIr1wsNozFKdPZalwa+8=; fh=whP/ih+ZIFgu+ejqktAtHrOxYnPXQbaMqGNc5g+/Flo=; b=qiB7zDJ1MHuWyjrXu5z7i8oQR+4qD2tFVu/PI5M9RAysTJg/JmyIVBSnsd5WyzIti0 cP+p+/cxK14ToLbw5rYKOp8agnYbkQpRuI0wF4r5ZydcOYFaD66n3f3/5+vZTvhAg7r2 7Btx4eeJeFiDFJcQxGvFc2EQWdqqU0KSTmQCK+DB3IkZk7L8RaW+TB9X2fXigrQ3QYQF ynnINzyE6oFXqTErZuhvty54uOeLpad+AHJeBr2mTXDE6fGXyoyWjQNro0nlehPrP01q EcgzNwx8UuQ77pYJcwB9X8uBOJi0eYs+7VyhZ4pnOtNJFcIrf0Uq3GWKJptl//Aqbc06 fMKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Y+qRxnI1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id s11-20020a170902ea0b00b001cfa17aba27si1543303plg.352.2023.11.24.01.32.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Nov 2023 01:32:06 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Y+qRxnI1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 29ABE80A13A0; Fri, 24 Nov 2023 01:32:04 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230344AbjKXJbu (ORCPT + 99 others); Fri, 24 Nov 2023 04:31:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229705AbjKXJbr (ORCPT ); Fri, 24 Nov 2023 04:31:47 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A41AED46; Fri, 24 Nov 2023 01:31:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700818314; x=1732354314; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=//oUXD9WMGcG6hQPFhgCT7QH/7I5uRzXFCu5VGSZo3M=; b=Y+qRxnI1e3hbthuxPdrdGhCO5b660cGM7iGuFz0QjxMtLJ4Lst5o/+qj X/pLjuEb3vWqEm1ItAAcclisJePmsMYm46VHKPCu3n3azf51bWqQydKqB E0aaFxZAM1JYro3258mFR3Pc7bKoPiKm7G9k37O+y95jqWZox6pY3qEBo LA5CxSGDluZGlIFkDS7d6v2Y79e7B+tZP5dHhbK1KsqaF48xtkwrSU6yD Tv5uyvQPPijsYbTTbASjd6c4YpdO1UUVIhLKpXU2MMUbZ5TGJmKXFFtZ5 0Esjab3yhmL6G2pNDAClWuJtn5bUdaAsNUPwCKU/JhCyhzJnbVYoRP4M2 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="371749822" X-IronPort-AV: E=Sophos;i="6.04,223,1695711600"; d="scan'208";a="371749822" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Nov 2023 01:31:54 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10902"; a="838034977" X-IronPort-AV: E=Sophos;i="6.04,223,1695711600"; d="scan'208";a="838034977" Received: from kuha.fi.intel.com ([10.237.72.185]) by fmsmga004.fm.intel.com with SMTP; 24 Nov 2023 01:31:49 -0800 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Fri, 24 Nov 2023 11:31:48 +0200 Date: Fri, 24 Nov 2023 11:31:48 +0200 From: Heikki Krogerus To: Dmitry Baryshkov Cc: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Andy Gross , Bjorn Andersson , Konrad Dybcio , Hans de Goede , Ilpo =?iso-8859-1?Q?J=E4rvinen?= , Mark Gross , Greg Kroah-Hartman , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, platform-driver-x86@vger.kernel.org, linux-usb@vger.kernel.org Subject: Re: [PATCH v2 2/2] usb: typec: tcpm: Parse Accessory Mode information Message-ID: References: <20231121202925.2481471-1-dmitry.baryshkov@linaro.org> <20231121202925.2481471-3-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231121202925.2481471-3-dmitry.baryshkov@linaro.org> X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Fri, 24 Nov 2023 01:32:04 -0800 (PST) On Tue, Nov 21, 2023 at 10:27:00PM +0200, Dmitry Baryshkov wrote: > Some of the boards supported by the TCPM drivers can support USB-C > Accessory Modes (Analog Audio, Debug). Parse information about supported > modes from the device tree. > > Signed-off-by: Dmitry Baryshkov Reviewed-by: Heikki Krogerus > --- > drivers/usb/typec/tcpm/tcpm.c | 9 +++++++++ > 1 file changed, 9 insertions(+) > > diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c > index 6e843c511b85..ba2926846269 100644 > --- a/drivers/usb/typec/tcpm/tcpm.c > +++ b/drivers/usb/typec/tcpm/tcpm.c > @@ -6114,6 +6114,7 @@ static int tcpm_fw_get_caps(struct tcpm_port *port, > { > const char *opmode_str; > int ret; > + int mode; > u32 mw, frs_current; > > if (!fwnode) > @@ -6132,6 +6133,14 @@ static int tcpm_fw_get_caps(struct tcpm_port *port, > if (ret < 0) > return ret; > > + mode = 0; > + > + if (fwnode_property_read_bool(fwnode, "accessory-mode-audio")) > + port->typec_caps.accessory[mode++] = TYPEC_ACCESSORY_AUDIO; > + > + if (fwnode_property_read_bool(fwnode, "accessory-mode-debug")) > + port->typec_caps.accessory[mode++] = TYPEC_ACCESSORY_DEBUG; > + > port->port_type = port->typec_caps.type; > port->pd_supported = !fwnode_property_read_bool(fwnode, "pd-disable"); > > -- > 2.42.0 -- heikki