Received: by 2002:a05:6a10:6006:0:0:0:0 with SMTP id w6csp190066pxa; Wed, 26 Aug 2020 22:24:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzijuUWzhRYkQZJNBIR8jz0vGKVyyc3TVU37LJMEbx8+6OV+JGWUcvEtWfpWzm9QFc/f6uX X-Received: by 2002:a17:906:2b87:: with SMTP id m7mr12866911ejg.210.1598505844221; Wed, 26 Aug 2020 22:24:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598505844; cv=none; d=google.com; s=arc-20160816; b=CHZZBZVDwJZZC357oqsOX2M6DfRRXQS/D1aWHhAXLqpSenH6MBLIznIxOhJks8f4pG rV2dYv8+S9jMHdDH3b4xYuCliqzRM+Dr8ps4esvXYKSoVBk9VcSgjMfgVJ0YixfoNSb4 OSF/2Fe2iO/GnbPRa8T+R5jZxkeQmtNLb7W5p+H+3DACNq4SmqHf2V2HoQ40RC2eBUqJ xP7v64PRkD6G4OrGq84czGQYSNyceBLhsvZClLyTv1wugOIz1tRxkfLgyXwE3EkwtIHt Iw0e6K1zYN36yUPOhfdJm2KntVwPILuJLRiZx7NhBT5U5vLx+aiDeUrn5ao8Nu2EgVTb 5GYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:dlp-filter:cms-type :content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:organization:from:cc:to:subject :dkim-signature:dkim-filter; bh=wW91TW50iLW8IcWcwKwnAsRn7VzFUazAP9nnNaurKJU=; b=a8Xoq/5qoc49ojvZw+XOec+RyW9Ja9F+goplAFQUfOPZzvNIXIA33K4GEQ89o/6R/V pIt4n5YYUnW6hb/mpclBo7FUnueQ/GjSSDpbZDjTNzh8fdH3nP5HaTOgBpw7YMVaxx31 26ccZ8eXbRHX5l9MryHA02ZTHNsKi4nciYGPUC+ZgD9UAzPpqEUK7tymUZ9UBUzCKiUp oW4I7zemLMOHLD9yR4B7J3qkiXf7k6cMmDGtHWv1OdGEcOfry4bz/6ohGIu4R+MnZ6sQ Mi6rnunyk5N1iv5abhHJ+S2oTZpf192zU5H7ZhkMxIJQt438rFmr+yxeEcLTjltKqm8g s/+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=uD+4efF6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mf26si614544ejb.665.2020.08.26.22.23.40; Wed, 26 Aug 2020 22:24:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=uD+4efF6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726098AbgH0FXG (ORCPT + 99 others); Thu, 27 Aug 2020 01:23:06 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:54230 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726028AbgH0FXD (ORCPT ); Thu, 27 Aug 2020 01:23:03 -0400 Received: from epcas1p1.samsung.com (unknown [182.195.41.45]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20200827052258epoutp01054ac7727bb2404cbff9ba947897c054~vCIlgzgls2563125631epoutp01U for ; Thu, 27 Aug 2020 05:22:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20200827052258epoutp01054ac7727bb2404cbff9ba947897c054~vCIlgzgls2563125631epoutp01U DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1598505778; bh=wW91TW50iLW8IcWcwKwnAsRn7VzFUazAP9nnNaurKJU=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=uD+4efF6H8BjPf1iLXG+7TPovhDvvcH3c7vg3117VLMI3uDNu6yBWaeLiHnQMVJ6h MZUZmtCiEcRuIPk8QJM+NmgDp2xAEd5CpFmeqsui69EfDBJf31Cn6GZ6rUIBf3kJ96 +HG5KuKXYDKd7Qgi2CpxoLCIORaHD/9QjgeLwROE= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas1p3.samsung.com (KnoxPortal) with ESMTP id 20200827052258epcas1p3babea90cc670d94f502faa4443f3fa6b~vCIlBQf0A1562415624epcas1p3M; Thu, 27 Aug 2020 05:22:58 +0000 (GMT) Received: from epsmges1p4.samsung.com (unknown [182.195.40.153]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4BcWMg51LyzMqYm1; Thu, 27 Aug 2020 05:22:55 +0000 (GMT) Received: from epcas1p2.samsung.com ( [182.195.41.46]) by epsmges1p4.samsung.com (Symantec Messaging Gateway) with SMTP id C9.A2.28581.F23474F5; Thu, 27 Aug 2020 14:22:55 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas1p4.samsung.com (KnoxPortal) with ESMTPA id 20200827052255epcas1p4329493a9e626c8b1f5a660694c344bfc~vCIiNtrnS1965019650epcas1p4F; Thu, 27 Aug 2020 05:22:55 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200827052255epsmtrp206194b2387efecc05a9ad4af771b8496~vCIiMlbhQ1674616746epsmtrp2y; Thu, 27 Aug 2020 05:22:55 +0000 (GMT) X-AuditID: b6c32a38-2e3ff70000006fa5-2a-5f47432fae49 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 37.84.08303.F23474F5; Thu, 27 Aug 2020 14:22:55 +0900 (KST) Received: from [10.113.221.102] (unknown [10.113.221.102]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200827052254epsmtip21cd16d4ecbb1e70677087bdcea2cfca8~vCIhJdH_v1765817658epsmtip2r; Thu, 27 Aug 2020 05:22:53 +0000 (GMT) Subject: Re: [PATCH v2 2/2] extcon: ptn5150: Set the VBUS and POLARITY property state To: vadivel.muruganx.ramuthevar@linux.intel.com, linux-kernel@vger.kernel.org Cc: vijaikumar.kanagarajan@gmail.com, krzk@kernel.org, myungjoo.ham@samsung.com, heikki.krogerus@linux.intel.com, cheol.yong.kim@intel.com, qi-ming.wu@intel.com, yin1.li@intel.com From: Chanwoo Choi Organization: Samsung Electronics Message-ID: <55514836-b9cf-e937-b5d5-eb0535d98334@samsung.com> Date: Thu, 27 Aug 2020 14:35:20 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Thunderbird/59.0 MIME-Version: 1.0 In-Reply-To: <1e9360ee-22f6-2135-26c7-a5b25fe7776d@linux.intel.com> Content-Language: en-US Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKJsWRmVeSWpSXmKPExsWy7bCmnq6+s3u8wdPF6hbX30ZYdK3eyWJx /vwGdovLu+awWdxuXMFm8aVjPZvFhmP32Sxe7p/OatHUdJzNgdNj56y77B6L97xk8ti0qpPN Y97JQI++LasYPT5vkgtgi8q2yUhNTEktUkjNS85PycxLt1XyDo53jjc1MzDUNbS0MFdSyEvM TbVVcvEJ0HXLzAG6SUmhLDGnFCgUkFhcrKRvZ1OUX1qSqpCRX1xiq5RakJJTYFmgV5yYW1ya l66XnJ9rZWhgYGQKVJiQnbHi5FWWgt+KFa9/PmFsYLwn08XIySEhYCJx5vtppi5GLg4hgR2M Ere3r2GEcD4xSjTc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pPN Y97JQI++LasYPT5vkgtgi+KySUnNySxLLdK3S+DKWHHyKkvBb8WK1z+fMDYw3pPpYuTkkBAw kfhzbz9LFyMXh5DADkaJ2y9uskMkJCWmXTzK3MXIAWQLSxw+XAxR85ZR4v6Ov0wgNcIC4RIT VmxhA7FFBHwl1j+ezgxSxCywnVHi+PlrUFNvMkls2bQWbCqbgJbE/hc3wDr4BRQlrv54zAhi 8wrYSdzr3w8WZxFQlTg99TIriC0qECaxc8ljJogaQYmTM5+wgNicAs4Sr451gdUwC6hL/Jl3 iRnCFpe49WQ+E4QtL9G8dTbzBEbhWUjaZyFpmYWkZRaSlgWMLKsYJVMLinPTc4sNC4zyUsv1 ihNzi0vz0vWS83M3MYJjTUtrB+OeVR/0DjEycTAeYpTgYFYS4RW86BwvxJuSWFmVWpQfX1Sa k1p8iFGag0VJnPfrrIVxQgLpiSWp2ampBalFMFkmDk6pBqZNP1qTfHezZs73CdXOEfjsX3Co c+I/pu3+81dPPfe6dZaQtvBUl23eyQdeV0cd/HZ/r6/MCYM+W8aALyKWkZe7rmxVuaLxa8HJ Cz/2dLOvd9CLUxc16H+24qkTn3kzq3iTLsu/nZ1XZwZaxzpeUl57ZYkw28vsitxl5p/DfgWF LVedGL5++ye3SxpLQmcksTxJiu8Nrbw2pUujKLo6JmdP3fp/V2tOsNzm7lFas8NE/kHMAg2e s1ed1p0/mncq7RbDq7DMaw27w9uMFq2PUdhXsuScyVuDX9ZAzwY5sewIO9ZWH1AcERz6m3Gr xYLNt5lZXvz3imVpuv9lpiIX7763oU3WlieiEj24eIM+KbEUZyQaajEXFScCAMpNkp4kAwAA X-CMS-MailID: 20200827052255epcas1p4329493a9e626c8b1f5a660694c344bfc X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: SVC_REQ_APPROVE CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20200827035651epcas1p33a045925293860a361a3be0cf21a2e2a References: <20200827035633.37348-1-vadivel.muruganx.ramuthevar@linux.intel.com> <20200827035633.37348-3-vadivel.muruganx.ramuthevar@linux.intel.com> <1e9360ee-22f6-2135-26c7-a5b25fe7776d@linux.intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 8/27/20 2:17 PM, Ramuthevar, Vadivel MuruganX wrote: > Hi, > > On 27/8/2020 12:51 pm, Chanwoo Choi wrote: >> Hi, >> >> You better to change the 'state' word to 'capability'. >> Actually, this patch doesn't change the value of property. >> It set the capability value of property. >> >> "Set the VBUS and POLARITY property capability" > Thank you for the review comments, sure will update. >> >> On 8/27/20 12:56 PM, Ramuthevar,Vadivel MuruganX wrote: >>> From: Ramuthevar Vadivel Murugan >>> >>> Set the VBUS and POLARITY property state. >> >> ditto. Need to change the work from 'state' and 'capability'. > Noted. >> >>> >>> Signed-off-by: Ramuthevar Vadivel Murugan >>> --- >>>   drivers/extcon/extcon-ptn5150.c | 6 ++++++ >>>   1 file changed, 6 insertions(+) >>> >>> diff --git a/drivers/extcon/extcon-ptn5150.c b/drivers/extcon/extcon-ptn5150.c >>> index 8b930050a3f1..b5217a61615c 100644 >>> --- a/drivers/extcon/extcon-ptn5150.c >>> +++ b/drivers/extcon/extcon-ptn5150.c >>> @@ -279,6 +279,12 @@ static int ptn5150_i2c_probe(struct i2c_client *i2c) >>>           return ret; >>>       } >>>   +    extcon_set_property_capability(info->edev, EXTCON_USB, >>> +                       EXTCON_PROP_USB_VBUS); >>> +    extcon_set_property_capability(info->edev, EXTCON_USB_HOST, >>> +                       EXTCON_PROP_USB_VBUS); >>> +    extcon_set_property_capability(info->edev, EXTCON_USB_HOST, >>> +                       EXTCON_PROP_USB_TYPEC_POLARITY); >> >> Need to add blank line. > Noted. >> >> I understood that you set the property capability >> because of get_flipped() function of your patch[1]. >> >> But, I think that you need to change the value of EXTCON_PROP_USB_TYPEC_POLARITY >> when changing the state of EXTCON_USB_HOST. The polarity property value is always >> zero regardless of EXTCON_USB_HOST state as following: The get_flipped()[1] returns >> always the same *flipped value. >> >>     EXTCON_USB_HOST is 1, EXTCON_PROP_USB_TYPEC_POLARITY is 0 >>     EXTCON_USB_HOST is 0, EXTCON_PROP_USB_TYPEC_POLARITY is 0 > by default EXTCON_PROP_USB_TYPEC_POLARITY is 1 If you don't touch the value of EXTCON_PROP_USB_TYPEC_POLARITY property, EXTCON_PROP_USB_TYPEC_POLARITY has default value (0). >> >> If EXTCON_PROP_USB_TYPEC_POLARITY value is not related to any behavior, >> you don't need to get the property value from extcon consumer driver >> like drivers/phy/phy-lgm-usb.c. >> >> Actually, I don't understand why you don't handle the value >> of EXTCON_PROP_USB_TYPEC_POLARITY. >> >> Or, are there any case of what drivers/phy/phy-lgm-usb.c >> uses the different extcon device with EXTCON_PROP_USB_TYPEC_POLARITY property >> in the future? > Yes, you're right, user connect the different USB cable then we check polarity, accordingly driver proceeds, thanks! OK. >> >> So, do you set the EXTCON_PROP_USB_TYPEC_POLARITY capability >> for the extensibility in order to use other extcon device on later? > yes, that might be the case as well. OK. >> >> >> [1] https://protect2.fireeye.com/v1/url?k=1fb29698-422c0d72-1fb31dd7-0cc47a6cba04-3009aa7184024984&q=1&e=566e4565-e7db-4a90-b036-fc28dbdb742f&u=https%3A%2F%2Fwww.spinics.net%2Flists%2Fdevicetree%2Fmsg371828.html >> +static int get_flipped(struct tca_apb *ta, bool *flipped) >> +{ >> +    union extcon_property_value property; >> +    int ret; >> + >> +    ret = extcon_get_property(ta->phy.edev, EXTCON_USB_HOST, >> +                  EXTCON_PROP_USB_TYPEC_POLARITY, &property); >> +    if (ret) { >> +        dev_err(ta->phy.dev, "no polarity property from extcon\n"); >> +        return ret; >> +    } >> + >> +    *flipped = property.intval; >> + >> +    return ret; >> +} > Thank you for the gone through my usb-phy patch as well > > Regards > Vadivel >> >> >>>       /* Initialize PTN5150 device and print vendor id and version id */ >>>       ret = ptn5150_init_dev_type(info); >>>       if (ret) >>> >> >> > > -- Best Regards, Chanwoo Choi Samsung Electronics