<?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 Re: imx6 spidev cannot set spi_mode (CPOL = 1) in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/imx6-spidev-cannot-set-spi-mode-CPOL-1/m-p/748231#M116352</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the userspace, I open the /dev/spidevX.X and set the mode to be "SPI_MODE_2", which is for CPOL = 1.&amp;nbsp;&lt;/P&gt;&lt;P&gt;After setting, I read the mode back to verified if it is correctly set.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ioctl(fd, SPI_IOC_WR_MODE, &amp;amp;mode)&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ioctl(fd, SPI_IOC_RD_MODE, &amp;amp;mode)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also added some debug code in imx_spi.c and check if the&amp;nbsp;ECSPI register value change and verified that ECSCPI_CONFIGREG 's SCLK_POL bits are correctly set to be idle high.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/23779iBC3963740DB818BF/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 07 Jun 2018 01:49:59 GMT</pubDate>
    <dc:creator>jongjyhhsieh</dc:creator>
    <dc:date>2018-06-07T01:49:59Z</dc:date>
    <item>
      <title>imx6 spidev cannot set spi_mode (CPOL = 1)</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/imx6-spidev-cannot-set-spi-mode-CPOL-1/m-p/748229#M116350</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to use mx6q&amp;nbsp;spidev&amp;nbsp;to control a dac chip.&lt;/P&gt;&lt;P&gt;The chip requires CPOL to be enabled so that SCLK is high at idle and starts out with a falling edge.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have set the SPI_MODE_2(CPOL =1 , CPHA = 0) from user space via ioctrl to the /dev/spidevX.X and was able to read back the same mode from SPI_IOC_RD_MODE.&amp;nbsp;Though when I send spi data, the oscilloscope wave shows that CPOL remains zero at the idle and starts with a rising edge.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there any other setting required to change SPI_MODE?&lt;/P&gt;&lt;P&gt;any help would be appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;envrioment:&lt;/P&gt;&lt;P&gt;. imx6q&lt;/P&gt;&lt;P&gt;. linux kernel 3.0.101&amp;nbsp;&lt;/P&gt;&lt;P&gt;. imx_spi, spi_dev&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;John&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jun 2018 07:26:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/imx6-spidev-cannot-set-spi-mode-CPOL-1/m-p/748229#M116350</guid>
      <dc:creator>jongjyhhsieh</dc:creator>
      <dc:date>2018-06-04T07:26:54Z</dc:date>
    </item>
    <item>
      <title>Re: imx6 spidev cannot set spi_mode (CPOL = 1)</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/imx6-spidev-cannot-set-spi-mode-CPOL-1/m-p/748230#M116351</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi John,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how are you setting CPOL? If you set CPOL using memtool does it work?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Carlos&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Jun 2018 19:29:17 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/imx6-spidev-cannot-set-spi-mode-CPOL-1/m-p/748230#M116351</guid>
      <dc:creator>Carlos_Musich</dc:creator>
      <dc:date>2018-06-04T19:29:17Z</dc:date>
    </item>
    <item>
      <title>Re: imx6 spidev cannot set spi_mode (CPOL = 1)</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/imx6-spidev-cannot-set-spi-mode-CPOL-1/m-p/748231#M116352</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In the userspace, I open the /dev/spidevX.X and set the mode to be "SPI_MODE_2", which is for CPOL = 1.&amp;nbsp;&lt;/P&gt;&lt;P&gt;After setting, I read the mode back to verified if it is correctly set.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ioctl(fd, SPI_IOC_WR_MODE, &amp;amp;mode)&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ioctl(fd, SPI_IOC_RD_MODE, &amp;amp;mode)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I also added some debug code in imx_spi.c and check if the&amp;nbsp;ECSPI register value change and verified that ECSCPI_CONFIGREG 's SCLK_POL bits are correctly set to be idle high.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="pastedImage_1.png"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/23779iBC3963740DB818BF/image-size/large?v=v2&amp;amp;px=999" role="button" title="pastedImage_1.png" alt="pastedImage_1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jun 2018 01:49:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/imx6-spidev-cannot-set-spi-mode-CPOL-1/m-p/748231#M116352</guid>
      <dc:creator>jongjyhhsieh</dc:creator>
      <dc:date>2018-06-07T01:49:59Z</dc:date>
    </item>
    <item>
      <title>Re: imx6 spidev cannot set spi_mode (CPOL = 1)</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/imx6-spidev-cannot-set-spi-mode-CPOL-1/m-p/748232#M116353</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you please try setting it with the memtool and let me know if it changes?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Jun 2018 15:55:29 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/imx6-spidev-cannot-set-spi-mode-CPOL-1/m-p/748232#M116353</guid>
      <dc:creator>Carlos_Musich</dc:creator>
      <dc:date>2018-06-07T15:55:29Z</dc:date>
    </item>
  </channel>
</rss>

