diff options
author | Russ Gorby <russ.gorby@intel.com> | 2011-02-02 15:56:58 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-02-03 14:43:10 -0500 |
commit | 2f1522eccb09188f0008168f75420bc2fedc9cae (patch) | |
tree | 8b9fd188706ec80a763545960cf929ab0149a511 /drivers/tty | |
parent | a5f4dbf0ae972510faca799a809d3771fab323b7 (diff) |
serial: ifx6x60: expanded info available from platform data
Some platform attributes (e.g. max_hz, use_dma) were being intuited
from the modem type. These things should be specified by the platform
data.
Added max_hz, use_dma to ifx_modem_platform_data definition,
replaced is_6160 w/ modem_type, and changed clients accordingly
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 | 33 | ||||
-rw-r--r-- | drivers/tty/serial/ifx6x60.h | 4 |
2 files changed, 20 insertions, 17 deletions
diff --git a/drivers/tty/serial/ifx6x60.c b/drivers/tty/serial/ifx6x60.c index ab93763862d5..c42de7152eea 100644 --- a/drivers/tty/serial/ifx6x60.c +++ b/drivers/tty/serial/ifx6x60.c | |||
@@ -8,7 +8,7 @@ | |||
8 | * Jan Dumon <j.dumon@option.com> | 8 | * Jan Dumon <j.dumon@option.com> |
9 | * | 9 | * |
10 | * Copyright (C) 2009, 2010 Intel Corp | 10 | * Copyright (C) 2009, 2010 Intel Corp |
11 | * Russ Gorby <richardx.r.gorby@intel.com> | 11 | * Russ Gorby <russ.gorby@intel.com> |
12 | * | 12 | * |
13 | * This program is free software; you can redistribute it and/or modify | 13 | * This program is free software; you can redistribute it and/or modify |
14 | * it under the terms of the GNU General Public License version 2 as | 14 | * it under the terms of the GNU General Public License version 2 as |
@@ -732,7 +732,7 @@ static void ifx_spi_io(unsigned long data) | |||
732 | /* | 732 | /* |
733 | * setup dma pointers | 733 | * setup dma pointers |
734 | */ | 734 | */ |
735 | if (ifx_dev->is_6160) { | 735 | if (ifx_dev->use_dma) { |
736 | ifx_dev->spi_msg.is_dma_mapped = 1; | 736 | ifx_dev->spi_msg.is_dma_mapped = 1; |
737 | ifx_dev->tx_dma = ifx_dev->tx_bus; | 737 | ifx_dev->tx_dma = ifx_dev->tx_bus; |
738 | ifx_dev->rx_dma = ifx_dev->rx_bus; | 738 | ifx_dev->rx_dma = ifx_dev->rx_bus; |
@@ -960,7 +960,7 @@ static int ifx_spi_spi_probe(struct spi_device *spi) | |||
960 | { | 960 | { |
961 | int ret; | 961 | int ret; |
962 | int srdy; | 962 | int srdy; |
963 | struct ifx_modem_platform_data *pl_data = NULL; | 963 | struct ifx_modem_platform_data *pl_data; |
964 | struct ifx_spi_device *ifx_dev; | 964 | struct ifx_spi_device *ifx_dev; |
965 | 965 | ||
966 | if (saved_ifx_dev) { | 966 | if (saved_ifx_dev) { |
@@ -968,6 +968,12 @@ static int ifx_spi_spi_probe(struct spi_device *spi) | |||
968 | return -ENODEV; | 968 | return -ENODEV; |
969 | } | 969 | } |
970 | 970 | ||
971 | pl_data = (struct ifx_modem_platform_data *)spi->dev.platform_data; | ||
972 | if (!pl_data) { | ||
973 | dev_err(&spi->dev, "missing platform data!"); | ||
974 | return -ENODEV; | ||
975 | } | ||
976 | |||
971 | /* initialize structure to hold our device variables */ | 977 | /* initialize structure to hold our device variables */ |
972 | ifx_dev = kzalloc(sizeof(struct ifx_spi_device), GFP_KERNEL); | 978 | ifx_dev = kzalloc(sizeof(struct ifx_spi_device), GFP_KERNEL); |
973 | if (!ifx_dev) { | 979 | if (!ifx_dev) { |
@@ -983,7 +989,9 @@ static int ifx_spi_spi_probe(struct spi_device *spi) | |||
983 | init_timer(&ifx_dev->spi_timer); | 989 | init_timer(&ifx_dev->spi_timer); |
984 | ifx_dev->spi_timer.function = ifx_spi_timeout; | 990 | ifx_dev->spi_timer.function = ifx_spi_timeout; |
985 | ifx_dev->spi_timer.data = (unsigned long)ifx_dev; | 991 | ifx_dev->spi_timer.data = (unsigned long)ifx_dev; |
986 | ifx_dev->is_6160 = pl_data->is_6160; | 992 | ifx_dev->modem = pl_data->modem_type; |
993 | ifx_dev->use_dma = pl_data->use_dma; | ||
994 | ifx_dev->max_hz = pl_data->max_hz; | ||
987 | 995 | ||
988 | /* ensure SPI protocol flags are initialized to enable transfer */ | 996 | /* ensure SPI protocol flags are initialized to enable transfer */ |
989 | ifx_dev->spi_more = 0; | 997 | ifx_dev->spi_more = 0; |
@@ -1025,18 +1033,11 @@ static int ifx_spi_spi_probe(struct spi_device *spi) | |||
1025 | goto error_ret; | 1033 | goto error_ret; |
1026 | } | 1034 | } |
1027 | 1035 | ||
1028 | pl_data = (struct ifx_modem_platform_data *)spi->dev.platform_data; | 1036 | ifx_dev->gpio.reset = pl_data->rst_pmu; |
1029 | if (pl_data) { | 1037 | ifx_dev->gpio.po = pl_data->pwr_on; |
1030 | ifx_dev->gpio.reset = pl_data->rst_pmu; | 1038 | ifx_dev->gpio.mrdy = pl_data->mrdy; |
1031 | ifx_dev->gpio.po = pl_data->pwr_on; | 1039 | ifx_dev->gpio.srdy = pl_data->srdy; |
1032 | ifx_dev->gpio.mrdy = pl_data->mrdy; | 1040 | ifx_dev->gpio.reset_out = pl_data->rst_out; |
1033 | ifx_dev->gpio.srdy = pl_data->srdy; | ||
1034 | ifx_dev->gpio.reset_out = pl_data->rst_out; | ||
1035 | } else { | ||
1036 | dev_err(&spi->dev, "missing platform data!"); | ||
1037 | ret = -ENODEV; | ||
1038 | goto error_ret; | ||
1039 | } | ||
1040 | 1041 | ||
1041 | dev_info(&spi->dev, "gpios %d, %d, %d, %d, %d", | 1042 | dev_info(&spi->dev, "gpios %d, %d, %d, %d, %d", |
1042 | ifx_dev->gpio.reset, ifx_dev->gpio.po, ifx_dev->gpio.mrdy, | 1043 | ifx_dev->gpio.reset, ifx_dev->gpio.po, ifx_dev->gpio.mrdy, |
diff --git a/drivers/tty/serial/ifx6x60.h b/drivers/tty/serial/ifx6x60.h index deb7b8d977dc..0ec39b58ccc4 100644 --- a/drivers/tty/serial/ifx6x60.h +++ b/drivers/tty/serial/ifx6x60.h | |||
@@ -88,7 +88,9 @@ struct ifx_spi_device { | |||
88 | dma_addr_t rx_dma; | 88 | dma_addr_t rx_dma; |
89 | dma_addr_t tx_dma; | 89 | dma_addr_t tx_dma; |
90 | 90 | ||
91 | int is_6160; /* Modem type */ | 91 | int modem; /* Modem type */ |
92 | int use_dma; /* provide dma-able addrs in SPI msg */ | ||
93 | long max_hz; /* max SPI frequency */ | ||
92 | 94 | ||
93 | spinlock_t write_lock; | 95 | spinlock_t write_lock; |
94 | int write_pending; | 96 | int write_pending; |