[lkml]   [2021]   [Jun]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] spi: atmel: Fix CS and initialization bug
On 6/29/21 9:47 AM, Mark Brown wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> On Tue, Jun 29, 2021 at 09:29:14AM -0700, Dan Sneddon wrote:
>> spi_setup won't get programmed into the hardware. This patch makes
>> sure the cs_activate call is made even with a gpio controlled chip
>> select.
>In what way does it do that? I can't tell what the patch is supposed >to

The SPI_MASTER_GPIO_SS flag has to be set so that the set_cs function
gets called even when using gpio cs pins.

>> - enable =3D (!!(spi->mode & SPI_CS_HIGH) =3D=3D enable);
>> =20
>> - if (enable) {
>> + if ((enable && (spi->mode & SPI_CS_HIGH))
>> + || (!enable && !(spi->mode & SPI_CS_HIGH))) {
>This looks especially suspicious.
It's due to the fact that the spi core tells set_cs if the cs should be
high or low, not active or disabled. This logic is to convert from
high/low to active/disabled.

 \ /
  Last update: 2021-06-29 19:03    [W:0.068 / U:0.680 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site