Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1236871

Re: [PATCH v2 5/8] spi: imx: Add support for loopback for ECSPI controllers

From "Bondarenko, Anton" <Anton_Bondarenko@mentor.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 5/8] spi: imx: Add support for loopback for ECSPI controllers
Date 2015-10-01 02:20 +0200
Message-ID <qezLk-44g-23@gated-at.bofh.it> (permalink)
References <qcFrQ-8B-9@gated-at.bofh.it> <qcFBw-zc-13@gated-at.bofh.it> <qezLk-44g-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 30.09.2015 10:42, Robin Gong wrote:
> On Fri, Sep 25, 2015 at 07:57:12PM +0200, Anton Bondarenko wrote:
>> @@ -370,8 +374,12 @@ static int __maybe_unused mx51_ecspi_config(struct spi_imx_data *spi_imx,
>>  	if (config->mode & SPI_CS_HIGH)
>>  		cfg |= MX51_ECSPI_CONFIG_SSBPOL(config->cs);
>>  
>> +	if (config->mode & SPI_LOOP)
>> +		lpb |= MX51_ECSPI_LOOP;
>> +
>>  	writel(ctrl, spi_imx->base + MX51_ECSPI_CTRL);
>>  	writel(cfg, spi_imx->base + MX51_ECSPI_CONFIG);
>> +	writel(lpb, spi_imx->base + MX51_ECSPI_TEST);
> It's better write this MX51_ECSPI_TEST only in LOOP mode.
LOOP mode can be set dynamically. This mean we should be able to set and clear the flag.
Currently only LOOP flag is used. I did not find any problems with writing 0 in the rest
fields of TEST register.
>>  
>>  	/*
>>  	 * Wait until the changes in the configuration register CONFIGREG
>> @@ -1276,12 +1287,13 @@ static int spi_imx_probe(struct platform_device *pdev)
>>  	spi_imx->bitbang.master->cleanup = spi_imx_cleanup;
>>  	spi_imx->bitbang.master->prepare_message = spi_imx_prepare_message;
>>  	spi_imx->bitbang.master->unprepare_message = spi_imx_unprepare_message;
>> -	spi_imx->bitbang.master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH;
>> +	spi_imx->bitbang.master->mode_bits = SPI_CPOL | SPI_CPHA |
>> +				SPI_CS_HIGH;
> Any change?
Will be fixed in V3
>>  
>> -	init_completion(&spi_imx->xfer_done);
>> +	if (is_imx5x_ecspi(spi_imx))
>> +		spi_imx->bitbang.master->mode_bits |= SPI_LOOP;
>>  
>> -	spi_imx->devtype_data = of_id ? of_id->data :
>> -		(struct spi_imx_devtype_data *) pdev->id_entry->driver_data;
>> +	init_completion(&spi_imx->xfer_done);
>>  
>>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>>  	spi_imx->base = devm_ioremap_resource(&pdev->dev, res);
>> -- 
>> 2.5.2
>>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH v2 0/8] Improvements for SPI IMX driver for Freescale IMX53 and IMX6 families Anton Bondarenko <anton_bondarenko@mentor.com> - 2015-09-25 20:00 +0200
  [PATCH v2 2/8] spi: imx: replace fixed timeout with calculated one Anton Bondarenko <anton_bondarenko@mentor.com> - 2015-09-25 20:10 +0200
    Re: [PATCH v2 2/8] spi: imx: replace fixed timeout with calculated  one "Bondarenko, Anton" <Anton_Bondarenko@mentor.com> - 2015-10-01 02:20 +0200
  [PATCH v2 5/8] spi: imx: Add support for loopback for ECSPI controllers Anton Bondarenko <anton_bondarenko@mentor.com> - 2015-09-25 20:10 +0200
    Re: [PATCH v2 5/8] spi: imx: Add support for loopback for ECSPI  controllers "Bondarenko, Anton" <Anton_Bondarenko@mentor.com> - 2015-10-01 02:20 +0200

csiph-web