diff mbox series

[1/4] usb: cdns3: core: get role switch node from firmware

Message ID 20200331081005.32752-1-peter.chen@nxp.com (mailing list archive)
State Mainlined
Commit 23d6dd6c2ab6e177bc9ac19cb2bad9b8d120353c
Headers show
Series [1/4] usb: cdns3: core: get role switch node from firmware | expand

Commit Message

Peter Chen March 31, 2020, 8:10 a.m. UTC
After that, the role switch device (eg, Type-C device) could call
cdns3_role_set to finish the role switch.

Signed-off-by: Peter Chen <peter.chen@nxp.com>
---
 drivers/usb/cdns3/core.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Roger Quadros April 2, 2020, 8:53 a.m. UTC | #1
Hi Peter,

On 31/03/2020 11:10, Peter Chen wrote:
> After that, the role switch device (eg, Type-C device) could call
> cdns3_role_set to finish the role switch.
> 
> Signed-off-by: Peter Chen <peter.chen@nxp.com>

This does not apply on v5.6. What branch did you test this on?

cheers,
-roger

> ---
>   drivers/usb/cdns3/core.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c
> index 4aafba20f450..704c679a0c5d 100644
> --- a/drivers/usb/cdns3/core.c
> +++ b/drivers/usb/cdns3/core.c
> @@ -528,6 +528,8 @@ static int cdns3_probe(struct platform_device *pdev)
>   	sw_desc.get = cdns3_role_get;
>   	sw_desc.allow_userspace_control = true;
>   	sw_desc.driver_data = cdns;
> +	if (device_property_read_bool(dev, "usb-role-switch"))
> +		sw_desc.fwnode = dev->fwnode;
>   
>   	cdns->role_sw = usb_role_switch_register(dev, &sw_desc);
>   	if (IS_ERR(cdns->role_sw)) {
>
Peter Chen April 2, 2020, 9:24 a.m. UTC | #2
> 
> On 31/03/2020 11:10, Peter Chen wrote:
> > After that, the role switch device (eg, Type-C device) could call
> > cdns3_role_set to finish the role switch.
> >
> > Signed-off-by: Peter Chen <peter.chen@nxp.com>
> 
> This does not apply on v5.6. What branch did you test this on?
> 

Hi Roger,
 
I use 5.6-rc4.  Which conflict you have met? Do you have below patch?

8708a9fa2938 usb: roles: Provide the switch drivers handle to the switch in the API

Peter
Roger Quadros April 2, 2020, 9:26 a.m. UTC | #3
On 02/04/2020 12:24, Peter Chen wrote:
> 
>   
>>
>> On 31/03/2020 11:10, Peter Chen wrote:
>>> After that, the role switch device (eg, Type-C device) could call
>>> cdns3_role_set to finish the role switch.
>>>
>>> Signed-off-by: Peter Chen <peter.chen@nxp.com>
>>
>> This does not apply on v5.6. What branch did you test this on?
>>
> 
> Hi Roger,
>   
> I use 5.6-rc4.  Which conflict you have met? Do you have below patch?
> 
> 8708a9fa2938 usb: roles: Provide the switch drivers handle to the switch in the API

Applying: usb: cdns3: core: get role switch node from firmware
error: patch failed: drivers/usb/cdns3/core.c:528
error: drivers/usb/cdns3/core.c: patch does not apply
Patch failed at 0001 usb: cdns3: core: get role switch node from firmware
Use 'git am --show-current-patch' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

cheers,
-roger
Peter Chen April 2, 2020, 9:37 a.m. UTC | #4
> >>
> >
> > Hi Roger,
> >
> > I use 5.6-rc4.  Which conflict you have met? Do you have below patch?
> >
> > 8708a9fa2938 usb: roles: Provide the switch drivers handle to the
> > switch in the API
> 
> Applying: usb: cdns3: core: get role switch node from firmware
> error: patch failed: drivers/usb/cdns3/core.c:528
> error: drivers/usb/cdns3/core.c: patch does not apply Patch failed at 0001 usb:
> cdns3: core: get role switch node from firmware Use 'git am --show-current-patch'
> to see the failed patch When you have resolved this problem, run "git am --
> continue".
> If you prefer to skip this patch, run "git am --skip" instead.
> To restore the original branch and stop patching, run "git am --abort".
> 
 
I just tried the latest Greg's usb-next, it could apply. Do you have the patch I mentioned?
What's the conflict in source file?

Peter
Roger Quadros April 2, 2020, 9:45 a.m. UTC | #5
On 02/04/2020 12:37, Peter Chen wrote:
>>>>
>>>
>>> Hi Roger,
>>>
>>> I use 5.6-rc4.  Which conflict you have met? Do you have below patch?
>>>
>>> 8708a9fa2938 usb: roles: Provide the switch drivers handle to the
>>> switch in the API
>>
>> Applying: usb: cdns3: core: get role switch node from firmware
>> error: patch failed: drivers/usb/cdns3/core.c:528
>> error: drivers/usb/cdns3/core.c: patch does not apply Patch failed at 0001 usb:
>> cdns3: core: get role switch node from firmware Use 'git am --show-current-patch'
>> to see the failed patch When you have resolved this problem, run "git am --
>> continue".
>> If you prefer to skip this patch, run "git am --skip" instead.
>> To restore the original branch and stop patching, run "git am --abort".
>>
>   
> I just tried the latest Greg's usb-next, it could apply. Do you have the patch I mentioned?
> What's the conflict in source file?
> 

OK, it applies on usb-next. Thanks.

cheers,
-roger
Roger Quadros April 2, 2020, 11:49 a.m. UTC | #6
On 31/03/2020 11:10, Peter Chen wrote:
> After that, the role switch device (eg, Type-C device) could call
> cdns3_role_set to finish the role switch.
> 
> Signed-off-by: Peter Chen <peter.chen@nxp.com>

For this patch and all in the series

Reviewed-by: Roger Quadros <rogerq@ti.com>

> ---
>   drivers/usb/cdns3/core.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c
> index 4aafba20f450..704c679a0c5d 100644
> --- a/drivers/usb/cdns3/core.c
> +++ b/drivers/usb/cdns3/core.c
> @@ -528,6 +528,8 @@ static int cdns3_probe(struct platform_device *pdev)
>   	sw_desc.get = cdns3_role_get;
>   	sw_desc.allow_userspace_control = true;
>   	sw_desc.driver_data = cdns;
> +	if (device_property_read_bool(dev, "usb-role-switch"))
> +		sw_desc.fwnode = dev->fwnode;
>   
>   	cdns->role_sw = usb_role_switch_register(dev, &sw_desc);
>   	if (IS_ERR(cdns->role_sw)) {
>
diff mbox series

Patch

diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c
index 4aafba20f450..704c679a0c5d 100644
--- a/drivers/usb/cdns3/core.c
+++ b/drivers/usb/cdns3/core.c
@@ -528,6 +528,8 @@  static int cdns3_probe(struct platform_device *pdev)
 	sw_desc.get = cdns3_role_get;
 	sw_desc.allow_userspace_control = true;
 	sw_desc.driver_data = cdns;
+	if (device_property_read_bool(dev, "usb-role-switch"))
+		sw_desc.fwnode = dev->fwnode;
 
 	cdns->role_sw = usb_role_switch_register(dev, &sw_desc);
 	if (IS_ERR(cdns->role_sw)) {