Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp2422557rdb; Tue, 14 Nov 2023 23:27:41 -0800 (PST) X-Google-Smtp-Source: AGHT+IEyfunT+Op2cqTpQBlqGN8yCMgEilqlKzFbCJnhV4H9k1rbRqq6/0jGE6hrYSPXTCchTtpV X-Received: by 2002:a17:90b:4c89:b0:27e:3342:5c1f with SMTP id my9-20020a17090b4c8900b0027e33425c1fmr9784949pjb.43.1700033261350; Tue, 14 Nov 2023 23:27:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700033261; cv=none; d=google.com; s=arc-20160816; b=exin56DpFXftRCiG3MsYNL1SYfbXjDUh+P+y233bu9IwjBkrSFT8/DWToIjV4sn2eX zYLq7Mn3TMfMocL/z/H5GTkDteAnglN+AquIpUKe6lvjHYy9nkATkQYo8VSaLvXbkNE7 l+DMUvXjbaq0IFiSxLwQE04LFZQ2lADMKROpCKtHjXuxlx+DJZwRexHTfzHReeYo940v 9TPNrKuEHoBPoDsL/8kT3a0hAeBflGKBaeR0Dc9AbbT7olJut0dMGlCFQVSDSUUedRR9 yFIbfO5qFN0CxXHGMRL2Ac45YuOCStCdgpI6mUd9DNWk6n/VBiHRym8uXbI58O2lnTsG c4dA== 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=0Wshl3oS64jv81j987GEIS4S9Uwf/vcR9TFxgrOUkhE=; fh=whP/ih+ZIFgu+ejqktAtHrOxYnPXQbaMqGNc5g+/Flo=; b=FfptbvrJ3PWE0mZpbHZsjfn+iBQXjdELb3FDkSLmq472VDeXbpwN2c97p+gtOuCvbR 9+Ux7z//ZpqgkliqDvcSmBky6J6UQQJOBYXjsLBmKYMfc9H7f2gVtTYnbc44EBdxbJ8w buEzSKERfjsgSSR2JIQIUy1TfjzSSgk403QcW+UPDZIA7AZdPH28IPztuOCBROrw72qG IeIWOpMAZlVr7hHGJS+E4OczhfLONwQrId9lQzGptPAIT1GsL1Df3TqEckXCZo1+16Of uHBVoRkGWVxl77lkhvIdmk/LzGrUWD2YlEWV0ZPQknl4b//0QESxJIHMquhYUsOrNbkh XjOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="MC/G7xp5"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id lk10-20020a17090b33ca00b00280216d7e36si10170145pjb.171.2023.11.14.23.27.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Nov 2023 23:27:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="MC/G7xp5"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 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 fry.vger.email (Postfix) with ESMTP id 7DFD58021321; Tue, 14 Nov 2023 23:27:38 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229551AbjKOH13 (ORCPT + 99 others); Wed, 15 Nov 2023 02:27:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234648AbjKOH12 (ORCPT ); Wed, 15 Nov 2023 02:27:28 -0500 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.115]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67F418E; Tue, 14 Nov 2023 23:27:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700033243; x=1731569243; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=CVjv4ZrpGDJbz1IrUPzrrK9YuYaL0aZL0iiRA1BpOhQ=; b=MC/G7xp5dXyn/r1I/bX8hWEJMe8OCrmnf8fCf44PqgNoRwBwTx/45u7r 39au94ODFUdIVHvofCB55hMEaiuve9rb5XlPJTnxkP1AvjIV3JqQCboDf UQ3h2ZkQ52O2gVUlhC9vq+RkPxNAM+8nPcZTLbpgx4V0yMxohu/9KOvIC xrZFx5WGLeO3CdQXS3BOdyiyHXFM1qFc1Yn2OW65AlNBv782/GP9ITh/T 4u8uOf6qMzphbI3u+z2wtZnZ20Cq2iEsYF9o33BaG5ExXOUzv1NrIKig0 r3IGtVy7k/Sg4qPzWAHCXgqWmPzfyiMUm5jFxnOChVplrEF1PkSSp9tHs Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10894"; a="390624057" X-IronPort-AV: E=Sophos;i="6.03,304,1694761200"; d="scan'208";a="390624057" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Nov 2023 23:27:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10894"; a="714800758" X-IronPort-AV: E=Sophos;i="6.03,304,1694761200"; d="scan'208";a="714800758" Received: from kuha.fi.intel.com ([10.237.72.185]) by orsmga003.jf.intel.com with SMTP; 14 Nov 2023 23:27:17 -0800 Received: by kuha.fi.intel.com (sSMTP sendmail emulation); Wed, 15 Nov 2023 09:27:16 +0200 Date: Wed, 15 Nov 2023 09:27:16 +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/3] usb: typec: change altmode SVID to u16 entry Message-ID: References: <20231113221528.749481-1-dmitry.baryshkov@linaro.org> <20231113221528.749481-3-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231113221528.749481-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 fry.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 (fry.vger.email [0.0.0.0]); Tue, 14 Nov 2023 23:27:38 -0800 (PST) On Tue, Nov 14, 2023 at 12:13:28AM +0200, Dmitry Baryshkov wrote: > As stated in the changelog for the commit 7b458a4c5d73 ("usb: typec: Add > typec_port_register_altmodes()"), the code should be adjusted according > to the AltMode bindings. As the SVID is 16 bits wide (according to the > USB PD Spec), use fwnode_property_read_u16() to read it. > > Acked-by: Hans de Goede > Signed-off-by: Dmitry Baryshkov Reviewed-by: Heikki Krogerus > --- > drivers/platform/x86/intel/chtwc_int33fe.c | 2 +- > drivers/usb/typec/class.c | 5 +++-- > 2 files changed, 4 insertions(+), 3 deletions(-) > > diff --git a/drivers/platform/x86/intel/chtwc_int33fe.c b/drivers/platform/x86/intel/chtwc_int33fe.c > index 848baecc1bb0..93f75ba1dafd 100644 > --- a/drivers/platform/x86/intel/chtwc_int33fe.c > +++ b/drivers/platform/x86/intel/chtwc_int33fe.c > @@ -136,7 +136,7 @@ static const struct software_node altmodes_node = { > }; > > static const struct property_entry dp_altmode_properties[] = { > - PROPERTY_ENTRY_U32("svid", 0xff01), > + PROPERTY_ENTRY_U16("svid", 0xff01), > PROPERTY_ENTRY_U32("vdo", 0x0c0086), > { } > }; > diff --git a/drivers/usb/typec/class.c b/drivers/usb/typec/class.c > index 6ec2a94e6fad..4251d44137b6 100644 > --- a/drivers/usb/typec/class.c > +++ b/drivers/usb/typec/class.c > @@ -2238,7 +2238,8 @@ void typec_port_register_altmodes(struct typec_port *port, > struct typec_altmode_desc desc; > struct typec_altmode *alt; > size_t index = 0; > - u32 svid, vdo; > + u16 svid; > + u32 vdo; > int ret; > > altmodes_node = device_get_named_child_node(&port->dev, "altmodes"); > @@ -2246,7 +2247,7 @@ void typec_port_register_altmodes(struct typec_port *port, > return; /* No altmodes specified */ > > fwnode_for_each_child_node(altmodes_node, child) { > - ret = fwnode_property_read_u32(child, "svid", &svid); > + ret = fwnode_property_read_u16(child, "svid", &svid); > if (ret) { > dev_err(&port->dev, "Error reading svid for altmode %s\n", > fwnode_get_name(child)); > -- > 2.42.0 -- heikki