aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/phone_svn
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/phone_svn')
-rw-r--r--drivers/phone_svn/Kconfig10
-rw-r--r--drivers/phone_svn/ipc_spi/spi_data.c7
-rw-r--r--drivers/phone_svn/ipc_spi/spi_data.h1
-rw-r--r--drivers/phone_svn/ipc_spi/spi_dev.c8
-rw-r--r--drivers/phone_svn/ipc_spi/spi_dev.h4
-rw-r--r--drivers/phone_svn/ipc_spi/spi_main.c37
6 files changed, 31 insertions, 36 deletions
diff --git a/drivers/phone_svn/Kconfig b/drivers/phone_svn/Kconfig
index 9146f77..9ec8615 100644
--- a/drivers/phone_svn/Kconfig
+++ b/drivers/phone_svn/Kconfig
@@ -58,14 +58,4 @@ config CHN_CMCC_SPI_SPRD
depends on SAMSUNG_PHONE_SVNET
default n
-config SEC_MODEM_M0_TD
- tristate "Samsung M0-TD modemctl driver"
- depends on SAMSUNG_PHONE_SVNET
- default n
-
-config WORKQUEUE_FRONT
- tristate "IPC_SPI workqueue front"
- depends on SAMSUNG_PHONE_SVNET
- default n
-
endif # SAMSUNG_PHONE_SVNET
diff --git a/drivers/phone_svn/ipc_spi/spi_data.c b/drivers/phone_svn/ipc_spi/spi_data.c
index ecd62ab..0171884 100644
--- a/drivers/phone_svn/ipc_spi/spi_data.c
+++ b/drivers/phone_svn/ipc_spi/spi_data.c
@@ -39,7 +39,6 @@ struct spi_data_div_buf *spi_div_buf;
char *gspi_data_prepare_packet;
char *gspi_data_packet_buf;
-char *gspi_data_sync_buf;
static int _prepare_tx_type_packet(void *buf,
struct spi_data_queue_info *queue_info,
@@ -98,7 +97,6 @@ void spi_data_queue_init(void)
gspi_data_prepare_packet = (char *) spi_os_vmalloc(
SPI_DEV_MAX_PACKET_SIZE);
gspi_data_packet_buf = (char *) spi_os_malloc(SPI_DEV_MAX_PACKET_SIZE);
- gspi_data_sync_buf = (char *) spi_os_malloc(SPI_DEV_MAX_PACKET_SIZE);
for (i = 0 ; i < SPI_DATA_QUEUE_TYPE_NB ; i++) {
spi_queue_info[i].header = &spi_queue[i];
@@ -171,11 +169,6 @@ void spi_data_queue_destroy(void)
gspi_data_packet_buf = NULL;
}
- if (gspi_data_sync_buf != NULL) {
- spi_os_free(gspi_data_sync_buf);
- gspi_data_sync_buf = NULL;
- }
-
if (spi_div_buf != NULL) {
spi_os_vfree(spi_div_buf);
spi_div_buf = NULL;
diff --git a/drivers/phone_svn/ipc_spi/spi_data.h b/drivers/phone_svn/ipc_spi/spi_data.h
index ceb23c8..6698bda 100644
--- a/drivers/phone_svn/ipc_spi/spi_data.h
+++ b/drivers/phone_svn/ipc_spi/spi_data.h
@@ -106,7 +106,6 @@ extern void *ipc_spi_get_queue_buff(void);
extern struct spi_data_queue *spi_data_queue;
extern struct spi_data_queue_info *spi_queue_info;
extern char *gspi_data_packet_buf;
-extern char *gspi_data_sync_buf;
extern void spi_data_queue_init(void);
extern void spi_data_queue_destroy(void);
diff --git a/drivers/phone_svn/ipc_spi/spi_dev.c b/drivers/phone_svn/ipc_spi/spi_dev.c
index 54746d9..a1e97dc 100644
--- a/drivers/phone_svn/ipc_spi/spi_dev.c
+++ b/drivers/phone_svn/ipc_spi/spi_dev.c
@@ -133,11 +133,11 @@ Return value 0 : success
***********************************************************/
-int spi_dev_send(void *buf, void *sync_buf, unsigned int length)
+int spi_dev_send(void *buf, unsigned int length)
{
int result = 0;
- result = ipc_spi_tx_rx_sync(buf, sync_buf, length);
+ result = ipc_spi_tx_rx_sync(buf, 0, length);
return result;
}
@@ -160,11 +160,11 @@ Return value 0 : success
***********************************************************/
-int spi_dev_receive(void *sync_buf, void *buf, unsigned int length)
+int spi_dev_receive(void *buf, unsigned int length)
{
int value = 0;
- value = ipc_spi_tx_rx_sync(sync_buf, buf, length);
+ value = ipc_spi_tx_rx_sync(0, buf, length);
return value;
}
diff --git a/drivers/phone_svn/ipc_spi/spi_dev.h b/drivers/phone_svn/ipc_spi/spi_dev.h
index 6da9e64..9a077e5 100644
--- a/drivers/phone_svn/ipc_spi/spi_dev.h
+++ b/drivers/phone_svn/ipc_spi/spi_dev.h
@@ -34,8 +34,8 @@ extern int spi_is_restart;
extern void spi_dev_init(void *data);
extern void spi_dev_destroy(void);
-extern int spi_dev_send(void *buf, void * sync_buf, unsigned int length);
-extern int spi_dev_receive(void *sync_buf, void *buf, unsigned int length);
+extern int spi_dev_send(void *buf, unsigned int length);
+extern int spi_dev_receive(void *buf, unsigned int length);
extern void spi_dev_set_gpio(int gpio_id, enum SPI_DEV_GPIOLEVEL_T value);
extern enum SPI_DEV_GPIOLEVEL_T spi_dev_get_gpio(int gpio_id);
extern int spi_dev_reigster_irq_handler(int gpio_id,
diff --git a/drivers/phone_svn/ipc_spi/spi_main.c b/drivers/phone_svn/ipc_spi/spi_main.c
index 6b104fa..bb1765c 100644
--- a/drivers/phone_svn/ipc_spi/spi_main.c
+++ b/drivers/phone_svn/ipc_spi/spi_main.c
@@ -211,7 +211,6 @@ static void _start_packet_tx(void)
if (spi_data_check_tx_queue() == 0)
return;
-
/* check SUB SRDY state */
if (spi_dev_get_gpio(spi_dev_gpio_subsrdy) ==
SPI_DEV_GPIOLEVEL_HIGH) {
@@ -231,6 +230,9 @@ static void _start_packet_tx(void)
return;
}
+ if (spi_main_state == SPI_MAIN_STATE_END)
+ return;
+
/* change state SPI_MAIN_STATE_IDLE to SPI_MAIN_STATE_TX_WAIT */
spi_main_state = SPI_MAIN_STATE_TX_WAIT;
@@ -292,24 +294,37 @@ static void _start_packet_tx(void)
static void _start_packet_tx_send(void)
{
char *spi_packet_buf = NULL;
- char *spi_sync_buf = NULL;
/* change state SPI_MAIN_STATE_TX_WAIT to SPI_MAIN_STATE_TX_SENDING */
spi_main_state = SPI_MAIN_STATE_TX_SENDING;
spi_packet_buf = gspi_data_packet_buf;
- spi_sync_buf = gspi_data_sync_buf;
spi_os_memset(spi_packet_buf, 0, SPI_DEV_MAX_PACKET_SIZE);
- spi_os_memset(spi_sync_buf, 0, SPI_DEV_MAX_PACKET_SIZE);
spi_data_prepare_tx_packet(spi_packet_buf);
- if (spi_dev_send((void *)spi_packet_buf, (void *)spi_sync_buf,
+ if (spi_dev_send((void *)spi_packet_buf,
SPI_DEV_MAX_PACKET_SIZE) != 0) {
/* TODO: save failed packet */
/* back data to each queue */
SPI_OS_ERROR(("[SPI] spi_dev_send fail\n"));
- panic("[SPI] spi_dev_send\n");
+
+ spi_dev_set_gpio(spi_dev_gpio_submrdy, SPI_DEV_GPIOLEVEL_HIGH);
+
+ while (spi_dev_get_gpio(spi_dev_gpio_subsrdy) ==
+ SPI_DEV_GPIOLEVEL_LOW) {
+ };
+
+ spi_os_sleep(1);
+
+ if (spi_dev_send((void *)spi_packet_buf,
+ SPI_DEV_MAX_PACKET_SIZE) != 0) {
+ panic("[SPI] spi_dev_send\n");
+ } else {
+ SPI_OS_ERROR(("[SPI] spi_dev_send\n"));
+ }
+
+ spi_dev_set_gpio(spi_dev_gpio_submrdy, SPI_DEV_GPIOLEVEL_LOW);
}
spi_main_state = SPI_MAIN_STATE_TX_TERMINATE;
@@ -331,7 +346,6 @@ static void _start_packet_tx_send(void)
static void _start_packet_receive(void)
{
char *spi_packet_buf = NULL;
- char *spi_sync_buf = NULL;
struct spi_data_packet_header spi_receive_packet_header = {0, };
int i = 0;
@@ -344,12 +358,13 @@ static void _start_packet_receive(void)
if (get_console_suspended())
return;
- spi_main_state = SPI_MAIN_STATE_RX_WAIT;
+ if (spi_main_state == SPI_MAIN_STATE_END)
+ return;
+ spi_main_state = SPI_MAIN_STATE_RX_WAIT;
spi_dev_set_gpio(spi_dev_gpio_submrdy, SPI_DEV_GPIOLEVEL_HIGH);
-
/* check SUBSRDY state */
while (spi_dev_get_gpio(spi_dev_gpio_subsrdy) ==
SPI_DEV_GPIOLEVEL_LOW) {
@@ -384,12 +399,10 @@ static void _start_packet_receive(void)
return;
spi_packet_buf = gspi_data_packet_buf;
- spi_sync_buf = gspi_data_sync_buf;
spi_os_memset(spi_packet_buf, 0, SPI_DEV_MAX_PACKET_SIZE);
- spi_os_memset(spi_sync_buf, 0, SPI_DEV_MAX_PACKET_SIZE);
- if (spi_dev_receive((void *)spi_sync_buf, (void *)spi_packet_buf,
+ if (spi_dev_receive((void *)spi_packet_buf,
SPI_DEV_MAX_PACKET_SIZE) == 0) {
/* parsing SPI packet */
spi_os_memcpy(&spi_receive_packet_header, spi_packet_buf,