diff options
author | Russ Gorby <russ.gorby@intel.com> | 2011-02-07 15:02:31 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-02-17 14:16:15 -0500 |
commit | 2aff8d90a073e5a07e1ff5a94779d6a21fb72dd2 (patch) | |
tree | dbe4ec15ca988d3b4e020fdc1cde9ece98f46c8a /drivers/tty | |
parent | 1b79b440576b80bace7b6fa012a57ed91d763b5f (diff) |
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 <russ.gorby@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/ifx6x60.c | 9 |
1 files changed, 9 insertions, 0 deletions
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 @@ | |||
67 | #define IFX_SPI_MORE_MASK 0x10 | 67 | #define IFX_SPI_MORE_MASK 0x10 |
68 | #define IFX_SPI_MORE_BIT 12 /* bit position in u16 */ | 68 | #define IFX_SPI_MORE_BIT 12 /* bit position in u16 */ |
69 | #define IFX_SPI_CTS_BIT 13 /* bit position in u16 */ | 69 | #define IFX_SPI_CTS_BIT 13 /* bit position in u16 */ |
70 | #define IFX_SPI_MODE SPI_MODE_1 | ||
70 | #define IFX_SPI_TTY_ID 0 | 71 | #define IFX_SPI_TTY_ID 0 |
71 | #define IFX_SPI_TIMEOUT_SEC 2 | 72 | #define IFX_SPI_TIMEOUT_SEC 2 |
72 | #define IFX_SPI_HEADER_0 (-1) | 73 | #define IFX_SPI_HEADER_0 (-1) |
@@ -992,7 +993,15 @@ static int ifx_spi_spi_probe(struct spi_device *spi) | |||
992 | ifx_dev->modem = pl_data->modem_type; | 993 | ifx_dev->modem = pl_data->modem_type; |
993 | ifx_dev->use_dma = pl_data->use_dma; | 994 | ifx_dev->use_dma = pl_data->use_dma; |
994 | ifx_dev->max_hz = pl_data->max_hz; | 995 | ifx_dev->max_hz = pl_data->max_hz; |
996 | /* initialize spi mode, etc */ | ||
995 | spi->max_speed_hz = ifx_dev->max_hz; | 997 | spi->max_speed_hz = ifx_dev->max_hz; |
998 | spi->mode = IFX_SPI_MODE | (SPI_LOOP & spi->mode); | ||
999 | spi->bits_per_word = spi_bpw; | ||
1000 | ret = spi_setup(spi); | ||
1001 | if (ret) { | ||
1002 | dev_err(&spi->dev, "SPI setup wasn't successful %d", ret); | ||
1003 | return -ENODEV; | ||
1004 | } | ||
996 | 1005 | ||
997 | /* ensure SPI protocol flags are initialized to enable transfer */ | 1006 | /* ensure SPI protocol flags are initialized to enable transfer */ |
998 | ifx_dev->spi_more = 0; | 1007 | ifx_dev->spi_more = 0; |