From: Mark Brown <hidden> Date: 2012-07-18 11:28:38
When gpio_request() fails the driver logged the failure but while it'd
try to print an error code in the non-DT case it didn't pass the error
code in so garbage would be logged and in the DT case the error wasn't
logged.
Further, in the non-DT case the error code was then overwritten with -EBUSY
depriving the caller of information and breaking automatic probe deferral
pushing back from the GPIO level. Also reformat the non-DT log message
so it's not word wrapped and we can grep for it.
Signed-off-by: Mark Brown <redacted>
---
drivers/spi/spi-s3c64xx.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
From: Mark Brown <hidden> Date: 2012-07-18 11:28:39
No call was being made by the GPIO driver to put the GPIO into output
mode meaning that the calls to gpio_set_value() which were being done
were not valid. A similar issue appears to exist with the DT GPIO
requests but as they appear to be being used for pinmux it's less clear
to me that we want to configure them.
Without this fix Cragganmore systems can't talk to their SPI devices.
Signed-off-by: Mark Brown <redacted>
---
drivers/spi/spi-s3c64xx.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
@@ -892,7 +892,8 @@ static int s3c64xx_spi_setup(struct spi_device *spi)}if(!spi_get_ctldata(spi)){-err=gpio_request(cs->line,dev_name(&spi->dev));+err=gpio_request_one(cs->line,GPIOF_OUT_INIT_HIGH,+dev_name(&spi->dev));if(err){dev_err(&spi->dev,"Failed to get /CS gpio [%d]: %d\n",
From: Mark Brown <hidden> Date: 2012-07-18 11:28:40
Saves some error handling and a small amount of code.
Signed-off-by: Mark Brown <redacted>
Reviewed-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Acked-by: Linus Walleij <redacted>
---
drivers/spi/spi-s3c64xx.c | 18 +-----------------
1 file changed, 1 insertion(+), 17 deletions(-)
@@ -1278,14 +1278,7 @@ static int __init s3c64xx_spi_probe(struct platform_device *pdev)/* the spi->mode bits understood by this driver: */master->mode_bits=SPI_CPOL|SPI_CPHA|SPI_CS_HIGH;-if(request_mem_region(mem_res->start,-resource_size(mem_res),pdev->name)==NULL){-dev_err(&pdev->dev,"Req mem region failed\n");-ret=-ENXIO;-gotoerr0;-}--sdd->regs=ioremap(mem_res->start,resource_size(mem_res));+sdd->regs=devm_request_and_ioremap(&pdev->dev,mem_res);if(sdd->regs==NULL){dev_err(&pdev->dev,"Unable to remap IO\n");ret=-ENXIO;
From: Mark Brown <hidden> Date: 2012-07-18 11:28:41
They have very few users and they're both just doing a single register
write so the advantage of having the macro is a bit limited. An inline
function might make sense but it's as easy to just do the writes directly.
Signed-off-by: Mark Brown <redacted>
Acked-by: Linus Walleij <redacted>
---
drivers/spi/spi-s3c64xx.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
@@ -737,14 +732,15 @@ static int s3c64xx_spi_transfer_one_message(struct spi_master *master,enable_cs(sdd,spi);/* Start the signals */-S3C64XX_SPI_ACT(sdd);+writel(0,sdd->regs+S3C64XX_SPI_SLAVE_SEL);spin_unlock_irqrestore(&sdd->lock,flags);status=wait_for_xfer(sdd,xfer,use_dma);/* Quiese the signals */-S3C64XX_SPI_DEACT(sdd);+writel(S3C64XX_SPI_SLAVE_SIG_INACT,+sdd->regs+S3C64XX_SPI_SLAVE_SEL);if(status){dev_err(&spi->dev,"I/O Error: "
@@ -1030,7 +1026,7 @@ static void s3c64xx_spi_hwinit(struct s3c64xx_spi_driver_data *sdd, int channel)sdd->cur_speed=0;-S3C64XX_SPI_DEACT(sdd);+writel(S3C64XX_SPI_SLAVE_SIG_INACT,sdd->regs+S3C64XX_SPI_SLAVE_SEL);/* Disable Interrupts - we use Polling if not DMA mode */writel(0,regs+S3C64XX_SPI_INT_EN);
From: Kukjin Kim <hidden> Date: 2012-07-19 06:46:11
Mark Brown wrote:
quoted hunk
When gpio_request() fails the driver logged the failure but while it'd
try to print an error code in the non-DT case it didn't pass the error
code in so garbage would be logged and in the DT case the error wasn't
logged.
Further, in the non-DT case the error code was then overwritten with -
EBUSY
depriving the caller of information and breaking automatic probe deferral
pushing back from the GPIO level. Also reformat the non-DT log message
so it's not word wrapped and we can grep for it.
Signed-off-by: Mark Brown <redacted>
---
drivers/spi/spi-s3c64xx.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
Mark, thanks for your re-work 3th and 4th patches in this series :-)
Looks good to me, applied this series.
Thanks.
Best regards,
Kgene.
--
Kukjin Kim [off-list ref], Senior Engineer,
SW Solution Development Team, Samsung Electronics Co., Ltd.