<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/drivers/spi/spi-dw-core.c, branch linux-6.12.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.12.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.12.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2024-06-10T11:48:58Z</updated>
<entry>
<title>spi: dw: Use new spi_xfer_is_dma_mapped() helper</title>
<updated>2024-06-10T11:48:58Z</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2024-05-31T19:42:34Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=0fb66b81dbf91a60fa4acbf7de26a1958410ef0a'/>
<id>urn:sha1:0fb66b81dbf91a60fa4acbf7de26a1958410ef0a</id>
<content type='text'>
Replace a few lines of code by calling a spi_xfer_is_dma_mapped() helper.

Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Reviewed-by: Serge Semin &lt;fancer.lancer@gmail.com&gt;
Tested-by: Neil Armstrong &lt;neil.armstrong@linaro.org&gt; # on SM8650-QRD
Link: https://lore.kernel.org/r/20240531194723.1761567-3-andriy.shevchenko@linux.intel.com
Tested-by: Nícolas F. R. A. Prado &lt;nfraprado@collabora.com&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>spi: dw: Add a number of native CS auto-detection</title>
<updated>2024-05-03T02:09:23Z</updated>
<author>
<name>Serge Semin</name>
<email>fancer.lancer@gmail.com</email>
</author>
<published>2024-04-24T15:06:43Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=e164be7e1e9373bd10e6b79924b0a6374752775e'/>
<id>urn:sha1:e164be7e1e9373bd10e6b79924b0a6374752775e</id>
<content type='text'>
Aside with the FIFO depth and DFS field size it's possible to auto-detect
a number of native chip-select synthesized in the DW APB/AHB SSI IP-core.
It can be done just by writing ones to the SER register. The number of
writable flags in the register is limited by the SSI_NUM_SLAVES IP-core
synthesize parameter. All the upper flags are read-only and wired to zero.
Based on that let's add the number of native CS auto-detection procedure
so the low-level platform drivers wouldn't need to manually set it up
unless it's required to set a constraint due to platform-specific reasons
(for instance, due to a hardware bug).

Signed-off-by: Serge Semin &lt;fancer.lancer@gmail.com&gt;
Reviewed-by: Andy Shevchenko &lt;andy@kernel.org&gt;
Link: https://lore.kernel.org/r/20240424150657.9678-3-fancer.lancer@gmail.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>spi: dw: Convert to using BITS_TO_BYTES() macro</title>
<updated>2024-05-03T02:09:22Z</updated>
<author>
<name>Serge Semin</name>
<email>fancer.lancer@gmail.com</email>
</author>
<published>2024-04-24T15:06:42Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=11ae2e63b2a517742d233c4e5b67b898c797973e'/>
<id>urn:sha1:11ae2e63b2a517742d233c4e5b67b898c797973e</id>
<content type='text'>
Since commit dd3e7cba1627 ("ocfs2/dlm: move BITS_TO_BYTES() to bitops.h
for wider use") there is a generic helper available to calculate a number
of bytes needed to accommodate the specified number of bits. Let's use it
instead of the hard-coded DIV_ROUND_UP() macro function.

Signed-off-by: Serge Semin &lt;fancer.lancer@gmail.com&gt;
Reviewed-by: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Link: https://lore.kernel.org/r/20240424150657.9678-2-fancer.lancer@gmail.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>spi: dw: switch to use modern name</title>
<updated>2023-08-07T13:38:33Z</updated>
<author>
<name>Yang Yingliang</name>
<email>yangyingliang@huawei.com</email>
</author>
<published>2023-07-28T09:32:19Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=eefc6c5c2451126c27f4098536d659d07635a1b1'/>
<id>urn:sha1:eefc6c5c2451126c27f4098536d659d07635a1b1</id>
<content type='text'>
Change legacy name master to modern name host or controller.

No functional changed.

Signed-off-by: Yang Yingliang &lt;yangyingliang@huawei.com&gt;
Link: https://lore.kernel.org/r/20230728093221.3312026-20-yangyingliang@huawei.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>spi: Rename SPI_MASTER_GPIO_SS to SPI_CONTROLLER_GPIO_SS</title>
<updated>2023-07-11T13:12:56Z</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2023-07-10T15:49:30Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=82238d2cbd99ebd09dda48fb7c1c8802097da6a2'/>
<id>urn:sha1:82238d2cbd99ebd09dda48fb7c1c8802097da6a2</id>
<content type='text'>
Rename SPI_MASTER_GPIO_SS to SPI_CONTROLLER_GPIO_SS and
convert the users to SPI_CONTROLLER_GPIO_SS to follow
the new naming shema.

Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20230710154932.68377-14-andriy.shevchenko@linux.intel.com
Reviewed-by: Serge Semin &lt;fancer.lancer@gmail.com&gt;
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>spi: dw: Drop empty line from DebugFS init function</title>
<updated>2023-05-31T11:25:17Z</updated>
<author>
<name>Serge Semin</name>
<email>Sergey.Semin@baikalelectronics.ru</email>
</author>
<published>2023-05-30T22:17:25Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=3ecd5a728903b3057012043f98464c20cea1cdbb'/>
<id>urn:sha1:3ecd5a728903b3057012043f98464c20cea1cdbb</id>
<content type='text'>
Just drop a redundant empty line from the dw_spi_debugfs_init() function
left in the framework of the commit 0178f1e5d984 ("spi-dw-core.c: Fix
error checking for debugfs_create_dir") after removing the last return
statement.

Signed-off-by: Serge Semin &lt;Sergey.Semin@baikalelectronics.ru&gt;
Link: https://lore.kernel.org/r/20230530221725.26319-1-Sergey.Semin@baikalelectronics.ru
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>spi-dw-core.c: Fix error checking for debugfs_create_dir</title>
<updated>2023-05-30T12:47:04Z</updated>
<author>
<name>Osama Muhammad</name>
<email>osmtendev@gmail.com</email>
</author>
<published>2023-05-20T22:40:25Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=0178f1e5d9845a31024eddd37e93a182e2dbab5d'/>
<id>urn:sha1:0178f1e5d9845a31024eddd37e93a182e2dbab5d</id>
<content type='text'>
This patch fixes the error checking in spi-dw-core.c in
debugfs_create_dir. The DebugFS kernel API is developed in
a way that the caller can safely ignore the errors that
occur during the creation of DebugFS nodes.

Signed-off-by: Osama Muhammad &lt;osmtendev@gmail.com&gt;
Link: https://lore.kernel.org/r/20230520224025.14928-1-osmtendev@gmail.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>spi: dw: Round of n_bytes to power of 2</title>
<updated>2023-05-15T01:46:18Z</updated>
<author>
<name>Joy Chakraborty</name>
<email>joychakr@google.com</email>
</author>
<published>2023-05-12T10:47:45Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=9f34baf67e4d08908fd94ff29c825bb673295336'/>
<id>urn:sha1:9f34baf67e4d08908fd94ff29c825bb673295336</id>
<content type='text'>
n_bytes variable in the driver represents the number of bytes per word
that needs to be sent/copied to fifo. Bits/word can be between 8 and 32
bits from the client but in memory they are a power of 2, same is mentioned
in spi.h header:
"
 * @bits_per_word: Data transfers involve one or more words; word sizes
 *      like eight or 12 bits are common.  In-memory wordsizes are
 *      powers of two bytes (e.g. 20 bit samples use 32 bits).
 *      This may be changed by the device's driver, or left at the
 *      default (0) indicating protocol words are eight bit bytes.
 *      The spi_transfer.bits_per_word can override this for each transfer.
"

Hence, round of n_bytes to a power of 2 to avoid values like 3 which
would generate unalligned/odd accesses to memory/fifo.

* tested on Baikal-T1 based system with DW SPI-looped back interface
transferring a chunk of data with DFS:8,12,16.

Fixes: a51acc2400d4 ("spi: dw: Add support for 32-bits max xfer size")
Suggested-by: Andy Shevchenko &lt;andriy.shevchenko@intel.com
Signed-off-by: Joy Chakraborty &lt;joychakr@google.com
Reviewed-by: Serge Semin &lt;fancer.lancer@gmail.com
Tested-by: Serge Semin &lt;fancer.lancer@gmail.com
Link: https://lore.kernel.org/r/20230512104746.1797865-4-joychakr@google.com
Signed-off-by: Mark Brown &lt;broonie@kernel.org
</content>
</entry>
<entry>
<title>spi: Replace all spi-&gt;chip_select and spi-&gt;cs_gpiod references with function call</title>
<updated>2023-03-11T12:34:01Z</updated>
<author>
<name>Amit Kumar Mahapatra via Alsa-devel</name>
<email>alsa-devel@alsa-project.org</email>
</author>
<published>2023-03-10T17:32:03Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=9e264f3f85a56cc109cc2d6010a48aa89d5c1ff1'/>
<id>urn:sha1:9e264f3f85a56cc109cc2d6010a48aa89d5c1ff1</id>
<content type='text'>
Supporting multi-cs in spi drivers would require the chip_select &amp; cs_gpiod
members of struct spi_device to be an array. But changing the type of these
members to array would break the spi driver functionality. To make the
transition smoother introduced four new APIs to get/set the
spi-&gt;chip_select &amp; spi-&gt;cs_gpiod and replaced all spi-&gt;chip_select and
spi-&gt;cs_gpiod references with get or set API calls.
While adding multi-cs support in further patches the chip_select &amp; cs_gpiod
members of the spi_device structure would be converted to arrays &amp; the
"idx" parameter of the APIs would be used as array index i.e.,
spi-&gt;chip_select[idx] &amp; spi-&gt;cs_gpiod[idx] respectively.

Signed-off-by: Amit Kumar Mahapatra &lt;amit.kumar-mahapatra@amd.com&gt;
Acked-by: Heiko Stuebner &lt;heiko@sntech.de&gt; # Rockchip drivers
Reviewed-by: Michal Simek &lt;michal.simek@amd.com&gt;
Reviewed-by: Cédric Le Goater &lt;clg@kaod.org&gt; # Aspeed driver
Reviewed-by: Dhruva Gole &lt;d-gole@ti.com&gt; # SPI Cadence QSPI
Reviewed-by: Patrice Chotard &lt;patrice.chotard@foss.st.com&gt; # spi-stm32-qspi
Acked-by: William Zhang &lt;william.zhang@broadcom.com&gt; # bcm63xx-hsspi driver
Reviewed-by: Serge Semin &lt;fancer.lancer@gmail.com&gt; # DW SSI part
Link: https://lore.kernel.org/r/167847070432.26.15076794204368669839@mailman-core.alsa-project.org
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
<entry>
<title>spi: dw: Fix wrong FIFO level setting for long xfers</title>
<updated>2023-01-27T16:38:04Z</updated>
<author>
<name>Serge Semin</name>
<email>Sergey.Semin@baikalelectronics.ru</email>
</author>
<published>2023-01-13T18:59:42Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=c63b8fd14a7db719f8252038a790638728c4eb66'/>
<id>urn:sha1:c63b8fd14a7db719f8252038a790638728c4eb66</id>
<content type='text'>
Due to using the u16 type in the min_t() macros the SPI transfer length
will be cast to word before participating in the conditional statement
implied by the macro. Thus if the transfer length is greater than 64KB the
Tx/Rx FIFO threshold level value will be determined by the leftover of the
truncated after the type-case length. In the worst case it will cause the
dramatical performance drop due to the "Tx FIFO Empty" or "Rx FIFO Full"
interrupts triggered on each xfer word sent/received to/from the bus.

The problem can be easily fixed by specifying the unsigned int type in the
min_t() macros thus preventing the possible data loss.

Fixes: ea11370fffdf ("spi: dw: get TX level without an additional variable")
Reported-by: Sergey Nazarov &lt;Sergey.Nazarov@baikalelectronics.ru&gt;
Signed-off-by: Serge Semin &lt;Sergey.Semin@baikalelectronics.ru&gt;
Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20230113185942.2516-1-Sergey.Semin@baikalelectronics.ru
Signed-off-by: Mark Brown &lt;broonie@kernel.org&gt;
</content>
</entry>
</feed>
