Message ID | 20231113221528.749481-3-dmitry.baryshkov@linaro.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp1507560vqg; Mon, 13 Nov 2023 14:16:10 -0800 (PST) X-Google-Smtp-Source: AGHT+IFx3bxlpawyMGXscVXoc+8ZQprdIubD8l8nBBjtVtZxF9umSgf7jQhVDbW3mpwutuc6m0p1 X-Received: by 2002:a17:90b:190b:b0:280:982:aa9f with SMTP id mp11-20020a17090b190b00b002800982aa9fmr1263899pjb.7.1699913769751; Mon, 13 Nov 2023 14:16:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699913769; cv=none; d=google.com; s=arc-20160816; b=wbvFLdRDskZB4+2hqrS+6Ts3Wy76leEi1f/knaXxtadLzyRNAfcqG15UTVhPta8Eua QT7LkJ9G6QzlxlLRwxiqirLuyHwlpjiqUoEI3zBRqbWbeeMiMMU5P3xCI2jhyJoQn6y0 zT9nJBBm7xF5mCVDzdHUJVbmq1oiIym4EV1o0raWxAFpY1lSgp3G5bP6NnJEPHJ03VEs WiuxozP9tvczVIuLSjNr0TPDZXL3PBJfROhuMJw2Yi6joG88EbaaDoKe2PdB3deHBKX/ KKHQgPLwyAVPLmwot5coHPD9bviN0qAYr1ItGaQQBuFE25M3ucjE2Cd2gJ3UwirwtD6u +y2A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=RBpcWEbnLvBhiTJXnEVisEI+IX+1EldtrM+V5goA5pE=; fh=A3blBdamKtq5kPtlpYpz4l6zGyY+ur9G2hKXzMhYY3Y=; b=cB3ftsTlOLdafhpFCsNu5DMb/Y9cvUiW1ECwTx55pHknJyLweKgY9r7rqkjtwRAovy 6FO3QS0PQDwX7LcN1aIoHoozMnx6K5cdmd27Sq0s14lXvDOPwtT94ZkfHJ821YtugUUI trtvmLA3OFzgzOOdkhwc1mABvMYO3wYMWiDpa8rdmvGGTlP6+/1wyV+M6YyYteQ+Wc2D FCR46OdSxdwNIwrz/k+pbNemc2GMXDUh3niw8WpWLENZ2F5IefGhoJSQX5qzhYhjnUYr 1QRVEX1JeaZ5a6EMw45nI0epuWQ4XNmswx+6iPI3yTbsEZ2QqZ+YsxiEHAnC9mj/6OAl jL+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=C3fUERUe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id 30-20020a17090a01de00b0028017a2a8f5si6684099pjd.121.2023.11.13.14.16.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Nov 2023 14:16:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=C3fUERUe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 63B3980A533D; Mon, 13 Nov 2023 14:16:07 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231855AbjKMWPm (ORCPT <rfc822;lhua1029@gmail.com> + 30 others); Mon, 13 Nov 2023 17:15:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231516AbjKMWPg (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 13 Nov 2023 17:15:36 -0500 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 033E61702 for <linux-kernel@vger.kernel.org>; Mon, 13 Nov 2023 14:15:33 -0800 (PST) Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-5098e423ba2so7107690e87.2 for <linux-kernel@vger.kernel.org>; Mon, 13 Nov 2023 14:15:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1699913731; x=1700518531; darn=vger.kernel.org; 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=RBpcWEbnLvBhiTJXnEVisEI+IX+1EldtrM+V5goA5pE=; b=C3fUERUe051TpKigfOA1CLAL8o0/6V4MvehicDZ/xRQGY4AMAtsnKA0tqa4zbAj2ST OGq/3Ev7Q8yove2G4kp2rSTHqy5iei71niSaAr6LkENIUSm9ntxKLDKjR67+vr6PFz7z DYq4nftOEgmsUdCzjth0Bb6OfGRtd6QZtoPCk8PNbDEw7DgMrNz9xHjpzJdLZuG5ZPoM fHge0EoI6jR3P2oPn7VKtHUVtwSBu5P0YozIfwIiVin/xmgJ0Jr2Gkk6lH06C/2iZva1 9RNz5U8GREVOwTl8V385xx7s8CNeziisE7U1C4Jf7s9y+VO1E1RHJPvOO2RHQgDIG89N 2OOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699913731; x=1700518531; 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=RBpcWEbnLvBhiTJXnEVisEI+IX+1EldtrM+V5goA5pE=; b=TOePB8XN+1GAsSNeYzkn2WuXRKuWk0Co0ADtBo6g9peGpS7/G6/2IWBwH3/sYe+39I w+Eywm5NrafAJCVMePvbS4Zg6SrQLPeCfu1ZiWUYNC9jClaqv+2viHIsFC6Z5b5gcRmW 8sBGCIgjIB3YjvAtY3ZuX9EVNFEn5cCPeYktbrLUMvK3BGRX4I3InSFj3NJ3Ea+KHZb8 y1/EgVgW3ImJ3yJJiqucw/vW+QKVX4RRPufJEAowOUiW+tkF+/AJNGRZ60Ztu15Nimsz AvEmVIAtvVL5S4VVTVFPggwALoeCcjh6bqSez/3JoD4QxbFJMdZGSESxmwPuTFCexyDi iMfA== X-Gm-Message-State: AOJu0YxrRj8jvxfT9B7IAPl5QqiDKKjyBOSTdS1p7qg173VhbZ6+0PLW w6zX2BUV/RKerDt5mzkS5tK+fg== X-Received: by 2002:a05:6512:291:b0:500:d970:6541 with SMTP id j17-20020a056512029100b00500d9706541mr4969377lfp.39.1699913731320; Mon, 13 Nov 2023 14:15:31 -0800 (PST) Received: from eriador.lan (dzdqv0yyyyyyyyyyybcwt-3.rev.dnainternet.fi. [2001:14ba:a0db:1f00::8a5]) by smtp.gmail.com with ESMTPSA id w8-20020a0565120b0800b00507f18af7e0sm1097578lfu.4.2023.11.13.14.15.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Nov 2023 14:15:30 -0800 (PST) From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> To: Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Andy Gross <agross@kernel.org>, Bjorn Andersson <andersson@kernel.org>, Konrad Dybcio <konrad.dybcio@linaro.org>, Hans de Goede <hdegoede@redhat.com>, =?utf-8?q?Ilpo_J=C3=A4rvinen?= <ilpo.jarvinen@linux.intel.com>, Mark Gross <markgross@kernel.org>, Heikki Krogerus <heikki.krogerus@linux.intel.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: 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: [PATCH v2 2/3] usb: typec: change altmode SVID to u16 entry Date: Tue, 14 Nov 2023 00:13:28 +0200 Message-ID: <20231113221528.749481-3-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231113221528.749481-1-dmitry.baryshkov@linaro.org> References: <20231113221528.749481-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 agentk.vger.email Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Mon, 13 Nov 2023 14:16:07 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782488780885129916 X-GMAIL-MSGID: 1782488780885129916 |
Series |
dt-bindings: connector: usb: provide bindings for altmodes
|
|
Commit Message
Dmitry Baryshkov
Nov. 13, 2023, 10:13 p.m. UTC
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 <hdegoede@redhat.com> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> --- drivers/platform/x86/intel/chtwc_int33fe.c | 2 +- drivers/usb/typec/class.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-)
Comments
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 <hdegoede@redhat.com> > Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> > --- > 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
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));