<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How can we redectect usb charger? in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/How-can-we-redectect-usb-charger/m-p/1094857#M160402</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We have a condition where the usb power pins makes connections without the data pins when charger &lt;SPAN style="left: 162.483px; top: 868.747px; font-size: 15px; font-family: sans-serif; transform: scaleX(0.987429);"&gt;D+/D&lt;/SPAN&gt;&lt;SPAN style="left: 197px; top: 868.747px; font-size: 15px; font-family: sans-serif; transform: scaleX(1.09633);"&gt;– detection occurs. Thus the usb charger is detect as SCP which we're relying on to set charging current. Is there a way to trigger a redetection or how an implementation can be made?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="left: 197px; top: 868.747px; font-size: 15px; font-family: sans-serif; transform: scaleX(1.09633);"&gt;Using imx7&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6;" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;PRE&gt;&lt;SPAN style="font-size: 11px;"&gt;static int imx7d_charger_primary_detection(struct imx_usbmisc_data *data)&lt;/SPAN&gt;
&lt;SPAN style="font-size: 11px;"&gt;{
.....&lt;/SPAN&gt;
&lt;SPAN style="font-size: 11px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;/* Check if it is a charger */&lt;/SPAN&gt;
&lt;SPAN style="font-size: 11px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;val = readl(usbmisc-&amp;gt;base + MX7D_USB_OTG_PHY_STATUS);&lt;/SPAN&gt;
&lt;SPAN style="font-size: 11px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if (!(val &amp;amp; MX7D_USB_OTG_PHY_STATUS_CHRGDET)) {
        // We're landing in here when we normally wouldn't&lt;/SPAN&gt;
&lt;SPAN style="font-size: 11px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;dev_dbg(charger-&amp;gt;dev, "It is a standard downstream port\n");&lt;/SPAN&gt;
&lt;SPAN style="font-size: 11px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;charger-&amp;gt;psy_desc.type = POWER_SUPPLY_TYPE_USB;&lt;/SPAN&gt;
&lt;SPAN style="font-size: 11px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;charger-&amp;gt;max_current = 500;&lt;/SPAN&gt;
&lt;SPAN style="font-size: 11px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/SPAN&gt;
&lt;SPAN style="font-size: 11px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;return 0;&lt;/SPAN&gt;
&lt;SPAN style="font-size: 11px;"&gt;}&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 26 Jun 2020 23:05:26 GMT</pubDate>
    <dc:creator>prosper</dc:creator>
    <dc:date>2020-06-26T23:05:26Z</dc:date>
    <item>
      <title>How can we redectect usb charger?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-can-we-redectect-usb-charger/m-p/1094857#M160402</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We have a condition where the usb power pins makes connections without the data pins when charger &lt;SPAN style="left: 162.483px; top: 868.747px; font-size: 15px; font-family: sans-serif; transform: scaleX(0.987429);"&gt;D+/D&lt;/SPAN&gt;&lt;SPAN style="left: 197px; top: 868.747px; font-size: 15px; font-family: sans-serif; transform: scaleX(1.09633);"&gt;– detection occurs. Thus the usb charger is detect as SCP which we're relying on to set charging current. Is there a way to trigger a redetection or how an implementation can be made?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="left: 197px; top: 868.747px; font-size: 15px; font-family: sans-serif; transform: scaleX(1.09633);"&gt;Using imx7&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE class="j-table jiveBorder" style="border: 1px solid #c6c6c6;" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;PRE&gt;&lt;SPAN style="font-size: 11px;"&gt;static int imx7d_charger_primary_detection(struct imx_usbmisc_data *data)&lt;/SPAN&gt;
&lt;SPAN style="font-size: 11px;"&gt;{
.....&lt;/SPAN&gt;
&lt;SPAN style="font-size: 11px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;/* Check if it is a charger */&lt;/SPAN&gt;
&lt;SPAN style="font-size: 11px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;val = readl(usbmisc-&amp;gt;base + MX7D_USB_OTG_PHY_STATUS);&lt;/SPAN&gt;
&lt;SPAN style="font-size: 11px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;if (!(val &amp;amp; MX7D_USB_OTG_PHY_STATUS_CHRGDET)) {
        // We're landing in here when we normally wouldn't&lt;/SPAN&gt;
&lt;SPAN style="font-size: 11px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;dev_dbg(charger-&amp;gt;dev, "It is a standard downstream port\n");&lt;/SPAN&gt;
&lt;SPAN style="font-size: 11px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;charger-&amp;gt;psy_desc.type = POWER_SUPPLY_TYPE_USB;&lt;/SPAN&gt;
&lt;SPAN style="font-size: 11px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;charger-&amp;gt;max_current = 500;&lt;/SPAN&gt;
&lt;SPAN style="font-size: 11px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;}&lt;/SPAN&gt;
&lt;SPAN style="font-size: 11px;"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;return 0;&lt;/SPAN&gt;
&lt;SPAN style="font-size: 11px;"&gt;}&lt;/SPAN&gt;&lt;/PRE&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 26 Jun 2020 23:05:26 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-can-we-redectect-usb-charger/m-p/1094857#M160402</guid>
      <dc:creator>prosper</dc:creator>
      <dc:date>2020-06-26T23:05:26Z</dc:date>
    </item>
    <item>
      <title>Re: How can we redectect usb charger?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-can-we-redectect-usb-charger/m-p/1094858#M160403</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the charger does have Dp/Dm connected in the plug but the detection happened before the Dp/Dm pins make contact, then it is sufficient to delay the detection.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i.e. when VBUS is detected, wait ~100 ms before calling the imx7d_charger_primary_detection() routine, to allow for signals to settle. (or put a delay in the detection routine).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Redetection afterwards is more difficult because the enumeration may have started. Enumeration will start when the device enables the 1.5K Dp pull-up resistor in the phy and this happens automatically when the controller is started (USB_CMD.RS bit is set).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If the charger detector is enabled whilst the controller is running, the communication with the host will be distorted and the charger detection may return incorrect results.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope it helps!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR,&lt;/P&gt;&lt;P&gt;Ivan.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jun 2020 16:37:00 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-can-we-redectect-usb-charger/m-p/1094858#M160403</guid>
      <dc:creator>IvanRuiz</dc:creator>
      <dc:date>2020-06-30T16:37:00Z</dc:date>
    </item>
    <item>
      <title>Re: How can we redectect usb charger?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-can-we-redectect-usb-charger/m-p/1094859#M160404</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ivan,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;If the charger does have Dp/Dm connected in the plug but the detection happened before the Dp/Dm pins make contact, then it is sufficient to delay the detection.&lt;/P&gt;&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i.e. when VBUS is detected, wait ~100 ms before calling the imx7d_charger_primary_detection() routine, to allow for signals to settle. (or put a delay in the detection routine).&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;The primary issue is that the usb insertion notch is position just after the power pin makes contact but the data pins do not. So unfortunately event a long delay may not be sufficient. Hardware solution is being looked at by someone else.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;Redetection afterwards is more difficult because the enumeration may have started. Enumeration will start when the device enables the 1.5K Dp pull-up resistor in the phy and this happens automatically when the controller is started (USB_CMD.RS bit is set).&lt;P style="min-height: 8pt; padding: 0px;"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If the charger detector is enabled whilst the controller is running, the communication with the host will be distorted and the charger detection may return incorrect results.&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;OL&gt;&lt;LI&gt;What if we restrict the redetection to DCP or since we can determine that, restrict it to devices that do not talk to the controller?&lt;/LI&gt;&lt;LI&gt;Is the controller even running when connected if the Dp and Dm is floating?&lt;/LI&gt;&lt;LI&gt;Is there a way to determine that Dp and Dm were floating during detection?&lt;/LI&gt;&lt;LI&gt;Is it possible to stop the controller?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Prosper&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Jun 2020 21:16:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-can-we-redectect-usb-charger/m-p/1094859#M160404</guid>
      <dc:creator>prosper</dc:creator>
      <dc:date>2020-06-30T21:16:02Z</dc:date>
    </item>
    <item>
      <title>Re: How can we redectect usb charger?</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/How-can-we-redectect-usb-charger/m-p/1094860#M160405</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As I mentioned before, the optimal procedure is to respect USB specifications&amp;nbsp;also in regards of&amp;nbsp;the hardware.&lt;/P&gt;&lt;P&gt;Enumeration will start when the device enables the D+ pull-up resistor in the PHY and this happens automatically when the controller is started -&amp;gt; USB_CMD.RS bit is set.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;You will find details in the USB Battery charging specification, available at the &lt;A href="http://www.usb.org"&gt;www.usb.org&lt;/A&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;Have a nice day!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;BR,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;Ivan.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jul 2020 19:09:05 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/How-can-we-redectect-usb-charger/m-p/1094860#M160405</guid>
      <dc:creator>IvanRuiz</dc:creator>
      <dc:date>2020-07-03T19:09:05Z</dc:date>
    </item>
  </channel>
</rss>

