linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roger Quadros <rogerq@ti.com>
To: Pawel Laszczak <pawell@cadence.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Cc: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Alan Douglas <adouglas@cadence.com>,
	"jbergsagel@ti.com" <jbergsagel@ti.com>,
	"nsekhar@ti.com" <nsekhar@ti.com>, "nm@ti.com" <nm@ti.com>,
	Suresh Punnoose <sureshp@cadence.com>,
	"peter.chen@nxp.com" <peter.chen@nxp.com>,
	Pawel Jez <pjez@cadence.com>, Rahul Kumar <kurahul@cadence.com>
Subject: [RFC,v2,05/15] usb:cdns3: Added DRD support
Date: Tue, 27 Nov 2018 14:10:36 +0200	[thread overview]
Message-ID: <5BFD343C.3010407@ti.com> (raw)

Pawel,

On 27/11/18 13:29, Pawel Laszczak wrote:
> Hi Roger
> 
>>>> Patch adds supports for detecting Host/Device mode.
>>>> +
>>>> +static int cdns3_otg_get_id(struct cdns3 *cdns)
>>>> +{
>>>> +	int id;
>>>> +
>>>> +	id = readl(&cdns->otg_regs->sts) & OTGSTS_ID_VALUE;
>>>> +	dev_dbg(cdns->dev, "OTG ID: %d", id);
>>>> +	return id;
>>>> +}
>>>> +
>>>> +int cdns3_is_host(struct cdns3 *cdns)
>>>> +{
>>>> +	if (cdns->current_dr_mode == USB_DR_MODE_HOST)
>>>> +		return 1;
>>>
>>> Why do you need this?
>>
>> I assumed that some SoC could have cut DRD /OTG and Device or Host part.
>> In such case the driver cannot be based on ID pin.
>> For only HOST it's not a problem because
>> the standard XHCI driver will be used.  Probably I will remove this fragment.
> 
> I've removed this condition but it is necessary and I've  restored it again. 
> When driver works in only HOST mode then ID is always 0. 
> For current_dr_mode == USB_DR_MODE_HOST driver has to just simple 
> returns 1.  
> current_dr_mode  can be changed from user space depending on dr_mode field. 

OK.

> 
> I have the additional question. Because I have many changes in source code if I should 
> post the next RFC PATCH v3 or should I wait for comments for rest patches ?

I will need a day to review the remaining patches. So maybe it is better to wait?

> 
>>>
>>>> +	else if (cdns->current_dr_mode == USB_DR_MODE_OTG)
>>>> +		if (!cdns3_otg_get_id(cdns))
>>>> +			return 1;
>>>> +
>>>> +	return 0;
>>>> +}
>>>> +
> Thanks,
> Cheers,
> Pawel
> 

cheers,
-roger

             reply	other threads:[~2018-11-27 12:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-27 12:10 Roger Quadros [this message]
  -- strict thread matches above, loose matches on Subject: below --
2018-12-06  7:25 [RFC,v2,05/15] usb:cdns3: Added DRD support Pawel Laszczak
2018-12-04  9:18 Peter Chen
2018-11-27 11:29 Pawel Laszczak
2018-11-26 10:15 Roger Quadros
2018-11-26 10:09 Pawel Laszczak
2018-11-26  9:39 Roger Quadros
2018-11-26  8:39 Pawel Laszczak
2018-11-26  8:07 Roger Quadros
2018-11-26  7:23 Pawel Laszczak
2018-11-23 14:51 Roger Quadros
2018-11-18 10:09 Pawel Laszczak

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5BFD343C.3010407@ti.com \
    --to=rogerq@ti.com \
    --cc=adouglas@cadence.com \
    --cc=devicetree@vger.kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jbergsagel@ti.com \
    --cc=kurahul@cadence.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=nsekhar@ti.com \
    --cc=pawell@cadence.com \
    --cc=peter.chen@nxp.com \
    --cc=pjez@cadence.com \
    --cc=sureshp@cadence.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).