From: Russ Gorby Date: Mon, 7 Feb 2011 20:02:31 +0000 (-0800) Subject: serial: ifx6x60: probe routine needs to call spi_setup X-Git-Tag: MMI-PSA29.97-13-9~20522^2~53 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2aff8d90a073e5a07e1ff5a94779d6a21fb72dd2;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git serial: ifx6x60: probe routine needs to call spi_setup The probe routine should call spi_setup() to configure the SPI bus so it can properly communicate with the device. E.g. the device operates in SPI mode 1. Called spi_setup to configure SPI mode, max_speed_hz, and bpw Signed-off-by: Russ Gorby Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/tty/serial/ifx6x60.c b/drivers/tty/serial/ifx6x60.c index 766f0c3aabcf..59e9cb87b7de 100644 --- a/drivers/tty/serial/ifx6x60.c +++ b/drivers/tty/serial/ifx6x60.c @@ -67,6 +67,7 @@ #define IFX_SPI_MORE_MASK 0x10 #define IFX_SPI_MORE_BIT 12 /* bit position in u16 */ #define IFX_SPI_CTS_BIT 13 /* bit position in u16 */ +#define IFX_SPI_MODE SPI_MODE_1 #define IFX_SPI_TTY_ID 0 #define IFX_SPI_TIMEOUT_SEC 2 #define IFX_SPI_HEADER_0 (-1) @@ -992,7 +993,15 @@ static int ifx_spi_spi_probe(struct spi_device *spi) ifx_dev->modem = pl_data->modem_type; ifx_dev->use_dma = pl_data->use_dma; ifx_dev->max_hz = pl_data->max_hz; + /* initialize spi mode, etc */ spi->max_speed_hz = ifx_dev->max_hz; + spi->mode = IFX_SPI_MODE | (SPI_LOOP & spi->mode); + spi->bits_per_word = spi_bpw; + ret = spi_setup(spi); + if (ret) { + dev_err(&spi->dev, "SPI setup wasn't successful %d", ret); + return -ENODEV; + } /* ensure SPI protocol flags are initialized to enable transfer */ ifx_dev->spi_more = 0;