Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1686313pxb; Wed, 9 Feb 2022 02:10:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJwNjsgC1quSbgnXAQjs8+BfPaSwtMILwzotAJceNCZRfAC/NF/trXyQghjdJ1XwC4Nd1iAj X-Received: by 2002:a17:90a:1902:: with SMTP id 2mr934472pjg.32.1644401445289; Wed, 09 Feb 2022 02:10:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1644401445; cv=pass; d=google.com; s=arc-20160816; b=08ifWQfEEJ5Pjxt3LxmcN8pNDF+IKJ9z8GPQ7d22FBYH0MHCFz+kcInaWPlfu0cfAo /FKc6EK/puKuh+RVzLBVkhC43lvAmWFQIlauQRZnLEMTMA9qWSjMyxtrOp1K4Q4IFWoJ Xarzdl9Da9KXLa/Iw2zYdrRymlB/xQcbPvefScOq8nvlgGM48v1DWBISYWm7MRvbuMPK LHKE0sMhsSKVVyVlgDtmRCZFKpdcoafvvVQ/a3Q9FfBeGzsKF8NUYDJUCMGk9Qh+CAX7 YylBD7HuoiGuAOiNzvu3TmjNDSoGxuF1h1TD1CdUu7yM3ZijChgnpPIaoNVQoXc+T+Bk fr3Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=Kt8Fp/Y/pmQcZnD69FCQva2VMtd4VeCEv+SvtIlJAyw=; b=QEmMKo1KJ7zPeMJC4uwkFViwKKWvIQwSzldake2yV8szDV50HH45qRZsxrT3PyRDjI O3EWLcd4kWV9zCAm/hEu8hXrCJSGxt3BrO02yzlNwv96kovO4peqmJoW41fRW+epWfbW Vc4EpQbhYdAyi02LXoM0EE1P+OysVk7MOt9niJ4ejSu3k0eC36Mw43YRzQvtodwKOi5j 2VRVckPKsqXA0z1Nh1Q9SrmYhTOsEteftxqvIv/rL6zLQeRYwBSLO0fMzTis2LNiBVPj T6BjUlQiL2fBVCt7HcS7Dcbev90b3GoY+qFxOP+Vyl0MYIlyr95KtMAsZ+ZLpTL0Uxij u7kw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quantacorp.onmicrosoft.com header.s=selector2-quantacorp-onmicrosoft-com header.b=CpQMWbU3; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id l13si2850311pfu.39.2022.02.09.02.10.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 02:10:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@quantacorp.onmicrosoft.com header.s=selector2-quantacorp-onmicrosoft-com header.b=CpQMWbU3; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2068BC103440; Wed, 9 Feb 2022 01:15:23 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346323AbiBIEOh (ORCPT + 99 others); Tue, 8 Feb 2022 23:14:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347362AbiBIDnz (ORCPT ); Tue, 8 Feb 2022 22:43:55 -0500 Received: from APC01-PSA-obe.outbound.protection.outlook.com (mail-psaapc01on2111.outbound.protection.outlook.com [40.107.255.111]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 672D2C0401C2; Tue, 8 Feb 2022 19:34:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GhqVR3Nak7kkIeMJwDlKkDaD8sALShvo8+p5ZpwEVK7cGp8cgpM51A9IiCLqqvh6eQnE5OyyL/qAeqIykbOZeAvSUco4fxGAJAnJ4WMLx4XzKDocZs727ohHUlW2Y2UQpkQULCjOd5leoXpPhAyVROJFTx6X0Naf4j4gdWF1TF8dkOFBwRE4+0ojVxLhS16HJqq/hR7mBjUXYXd/CNFdM9h1XoTI7k1QwVzZVK1Ozsl+LjWh9Rid0psbZOlnyuDSyoX5eG2NrKvDDbKHrLc1/Kaxh6S809AS6i5Ctfi0CTEv/4vozN1l4j3WXa/9j2E6Z0tVcYVBbHjFSRYnhgH/2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Kt8Fp/Y/pmQcZnD69FCQva2VMtd4VeCEv+SvtIlJAyw=; b=UvYvReRV7/wKC8qWc0gI0x17cPMS9OvvXs2atZX7WrUI83fSJgJ14wq9mm2NKrS7ZarvJtK1KIgF3Qb+mwjioHzwWv0lZelffEp7yxbceDxuDIR4b0nvf4nq7IkB8seLPJsBdOujyxa1plbzZyyqLdxnyPJtVhz6fahZQF/AykMovDeSj73VTl9HkfzkJnhA9tX0lU1wQ+lNJI7AuJwVfGUYEBCKXMcK74Iv10ylQqGQ9Db4oZp+7XfdCLqpCCvzWT7C7E0X+yY+rayPxmlQ6kaIymJECsZD3pE2JpcrEa3gxDIT6i2MOKN9gVox/3lsPxw1aIDmnqm8Ve1qiS2lew== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quantacorp.onmicrosoft.com; s=selector2-quantacorp-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Kt8Fp/Y/pmQcZnD69FCQva2VMtd4VeCEv+SvtIlJAyw=; b=CpQMWbU3JICDipVabzZX9XCdHn25PN97GGlzkOOA+LUms1P5QjvHuKmY4EG1j8aN82OXmNWvT0RtE9rAMvUWfs55Mal/USCPiQI+5qlzKcfwgzCXrgs5sU1hjR6k+raJUHwl8Kse8fsBpom0Y6LnfK3sjjEAQygUFNgycTyf0n4= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=quantatw.com; Received: from HK0PR04MB3282.apcprd04.prod.outlook.com (2603:1096:203:89::17) by HK0PR04MB3025.apcprd04.prod.outlook.com (2603:1096:203:3f::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.18; Wed, 9 Feb 2022 03:34:24 +0000 Received: from HK0PR04MB3282.apcprd04.prod.outlook.com ([fe80::8160:1a0:97e1:9e53]) by HK0PR04MB3282.apcprd04.prod.outlook.com ([fe80::8160:1a0:97e1:9e53%3]) with mapi id 15.20.4951.019; Wed, 9 Feb 2022 03:34:24 +0000 Message-ID: Date: Wed, 9 Feb 2022 11:34:23 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.0 Subject: Re: [PATCH v2 2/2] usb: typec: fusb302: add support of supported_pd_rev Content-Language: en-US To: Guenter Roeck , Heikki Krogerus , Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Patrick Williams References: <20220208082026.4855-1-potin.lai@quantatw.com> <20220208112226.9108-1-potin.lai@quantatw.com> <20220208112226.9108-3-potin.lai@quantatw.com> <1acc1733-da53-6255-5cad-15f79850f44f@roeck-us.net> From: Potin Lai In-Reply-To: <1acc1733-da53-6255-5cad-15f79850f44f@roeck-us.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: HK2PR04CA0073.apcprd04.prod.outlook.com (2603:1096:202:15::17) To HK0PR04MB3282.apcprd04.prod.outlook.com (2603:1096:203:89::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1d4cdf85-9be4-4bd2-7d78-08d9eb7d117b X-MS-TrafficTypeDiagnostic: HK0PR04MB3025:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8882; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fUiQ5FimRcgF+YH1E4sy/s//jrP2sb2OPhgxLj3TomQGXtuPSPly2KDfIBsZu3SwRUt1uIF7JC0QlfMypYxG+BXMiRzO8qu/P9XOM/PaFjjCfzuLFJ26SJtM2ZkV66VJiHafcDlZvI83r6DbDH78v8fkgAvLrAKBOBHu/GXR4pKgCXj4Bpv3qb1QkqOFqKQuZ0Px8djJFgS24DAQO5sZ5UREly/tHAcCxx/OYPkinSbvTFIN1VteYI6jf4GhgInLUU5W/x2S6qpFFLmqKiG81g0Dysxdt/BIF2ESmCj+IogjfC4W8uyt75FovghHnKyTZQR0OGe3v35b5jeCWE2s7OiV1f+bT2NLNUkDsfeMkdKF4d66vTscL8hpy6DBpe63xa1Qz3zepWYzrAY8xZS2EEj4SNFygILTONMli+2svndrnYbiS0egQBBwOxqHR3CqAEQz80dP2Vn2WAqDvf3B6mAhwGvT0COCZswRidEwJFmVladBs3sWsE90YtbWHzo3IfkjAuM27O+m8Gef/xcNugyvzxNlgySvjubWQwyElBVrTJsAZU1YUfxvJ8bojrBeXrwYIDtPcp5wQY8GwQwu8vDjqowI0PyNTGemULdi0VbLvn+Oy1wVJ1gnIX8buJ5ToUQh90Wsp5D7o9IxJM2D23jnKm01suOq/Hxl1WsJM3Pz6qqLkJ2KR7Dk+PPkobTiLXpJAC4lPj4l07uX/Lgf75BjuiYZBrmCIpPJwjN2AN1553DJmoyXJlUTIQktMcRc/Y58MMyG9hDxUk5PzxJ2fQ== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:HK0PR04MB3282.apcprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(316002)(53546011)(83380400001)(2906002)(38100700002)(110136005)(86362001)(31696002)(508600001)(38350700002)(6486002)(52116002)(36756003)(2616005)(186003)(26005)(5660300002)(31686004)(44832011)(6512007)(6506007)(8936002)(4326008)(8676002)(66556008)(66476007)(66946007)(45980500001)(43740500002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ZHN3L0JDa0pwZUZaY2V3a3BoWE8wYW5GOUdmM3NGRGxBZ1Q3M3ZEZmlENUtJ?= =?utf-8?B?OS9nT20zVmxzUXJVaG4yb2RrZG9jSkpzdlY1RGxLanZMb1dyalhDSVA5T3hx?= =?utf-8?B?ci9YRzRGV001QVU2WEN0VVl6TVpzcmNaaVJERjRaUktlZVFkZXlhTTI5ZU5P?= =?utf-8?B?aTNBbk5kQWJSSHIxVUVpai96YU9ET0VobHhNQk1sbGp5b3krRGh3ajZTa2V0?= =?utf-8?B?ZFRWcGwxUEJFNytPM3lqUGJEbkpTOVlSMURUTXcrRFE1c3FYUTVha3NBSHhJ?= =?utf-8?B?YnRvaDF6YSt2T2RhUEVIYnJDK2NKMVJHaVcybHIrTGFwbzVna2JpWE1EKzNX?= =?utf-8?B?SVgwa0l6LzljTEtZL05QS0ZHbWZKUGpwamZTZ2tUMUFoMERTTFJUUzZvbTFk?= =?utf-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antatw.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1d4cdf85-9be4-4bd2-7d78-08d9eb7d117b X-MS-Exchange-CrossTenant-AuthSource: HK0PR04MB3282.apcprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Feb 2022 03:34:24.8099 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 179b0327-07fc-4973-ac73-8de7313561b2 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: XMEg2uwb96jrQbLnk51Rja8BCLoeYIgaTHcJMput0z5LX8hz0Kpoqz9LrjUn0/P1dseBaukTaIa7KKEG6Unupg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: HK0PR04MB3025 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Guenter Roeck 於 2022/2/8 下午 11:22 寫道: > On 2/8/22 03:22, Potin Lai wrote: >> Add support for passing supported PD rev to TCPM. >> If "supported-pd-rev" property exist, then return supported_pd_rev as >> defined value in DTS, otherwise return PD_MAX_REV >> >> Example of DTS: >> >> fusb302: typec-portc@22 { >>      compatible = "fcs,fusb302"; >>      reg = <0x22>; >>      ... >>      supported-pd-rev=<1>; // PD_REV20 >>      ... >> }; >> > > The new property needs to be documented. However, I am not entirely sure > I understand why it is needed. Wouldn't the supported PD revision > be a chip (fusb302) specific constant ? If so, why does it need a > devicetree property ? I think that needs some additional explanation. > > Thanks, > Guenter > My initially intend was adding flexibility for developer to decided which PD revision they want to use for negotiation. I saw your reply in another patch,  I agree with you, it will be simple and consistent if move "supported-pd-rev" to tcpm fwnode as other capabilities. Just want to double confirm, is "usb-connector.yaml" right place to put documentation if adding "supported-pd-rev" in fwnode? Thanks, Potin >> Signed-off-by: Potin Lai >> --- >>   drivers/usb/typec/tcpm/fusb302.c | 20 ++++++++++++++++++++ >>   1 file changed, 20 insertions(+) >> >> diff --git a/drivers/usb/typec/tcpm/fusb302.c >> b/drivers/usb/typec/tcpm/fusb302.c >> index 72f9001b0792..8cff92d58b96 100644 >> --- a/drivers/usb/typec/tcpm/fusb302.c >> +++ b/drivers/usb/typec/tcpm/fusb302.c >> @@ -109,6 +109,9 @@ struct fusb302_chip { >>       enum typec_cc_status cc2; >>       u32 snk_pdo[PDO_MAX_OBJECTS]; >>   +    /* supported pd rev */ >> +    u32 supported_pd_rev; >> + >>   #ifdef CONFIG_DEBUG_FS >>       struct dentry *dentry; >>       /* lock for log buffer access */ >> @@ -1056,6 +1059,13 @@ static int tcpm_pd_transmit(struct tcpc_dev >> *dev, enum tcpm_transmit_type type, >>       return ret; >>   } >>   +static u32 tcpm_supported_pd_rev(struct tcpc_dev *dev) >> +{ >> +    struct fusb302_chip *chip = container_of(dev, struct fusb302_chip, >> +                         tcpc_dev); >> +    return chip->supported_pd_rev; >> +} >> + >>   static enum typec_cc_status fusb302_bc_lvl_to_cc(u8 bc_lvl) >>   { >>       if (bc_lvl == FUSB_REG_STATUS0_BC_LVL_1230_MAX) >> @@ -1129,6 +1139,7 @@ static void init_tcpc_dev(struct tcpc_dev >> *fusb302_tcpc_dev) >>       fusb302_tcpc_dev->set_roles = tcpm_set_roles; >>       fusb302_tcpc_dev->start_toggling = tcpm_start_toggling; >>       fusb302_tcpc_dev->pd_transmit = tcpm_pd_transmit; >> +    fusb302_tcpc_dev->supported_pd_rev = tcpm_supported_pd_rev; >>   } >>     static const char * const cc_polarity_name[] = { >> @@ -1683,6 +1694,7 @@ static int fusb302_probe(struct i2c_client >> *client, >>       struct fusb302_chip *chip; >>       struct i2c_adapter *adapter = client->adapter; >>       struct device *dev = &client->dev; >> +    struct device_node *np = dev->of_node; >>       const char *name; >>       int ret = 0; >>   @@ -1756,6 +1768,14 @@ static int fusb302_probe(struct i2c_client >> *client, >>           dev_err(dev, "cannot request IRQ for GPIO Int_N, ret=%d", >> ret); >>           goto tcpm_unregister_port; >>       } >> + >> +    if (of_property_read_u32(np, "supported-pd-rev", >> +                &chip->supported_pd_rev) < 0) { >> +        chip->supported_pd_rev = PD_MAX_REV; >> +    } else if (chip->supported_pd_rev > PD_MAX_REV) { >> +        chip->supported_pd_rev = PD_MAX_REV; >> +    } > > The else part is also checked in the tcpm code and thus seems > to be redundant. > >> + >>       enable_irq_wake(chip->gpio_int_n_irq); >>       i2c_set_clientdata(client, chip); >