[PATCH 7/25] UBUNTU hardy-lum lpia branch sync

Steve Conklin sconklin at canonical.com
Tue Mar 10 19:29:34 UTC 2009


>From 99d66990de0742b195284adc5214ccfedf9c87b5 Mon Sep 17 00:00:00 2001
From: Uri Shkolnik <uris at siano-ms.com>
Date: Fri, 6 Mar 2009 11:41:32 -0500
Subject: [PATCH] UBUNTU: sms1xxx: import changes from Siano
 OriginalAuthor: Uri Shkolnik <uris at siano-ms.com>
 OriginalLocation: http://linuxtv.org/hg/v4l-dvb/rev/6fc8d56e7790

This is a work-in-progress sync with Siano's internal repository.
Some changes had to be altered or dropped in order not to break the build.

Signed-off-by: Uri Shkolnik <uris at siano-ms.com>
Signed-off-by: Michael Krufky <mkrufky at linuxtv.org>
---
 ubuntu/media/sms1xxx/smscoreapi.c |  121 ++++++++++++++++++++++++++++++++-----
 ubuntu/media/sms1xxx/smscoreapi.h |   13 +---
 ubuntu/media/sms1xxx/smsdvb.c     |   23 ++++----
 ubuntu/media/sms1xxx/smsusb.c     |   10 +++-
 4 files changed, 130 insertions(+), 37 deletions(-)

diff --git a/ubuntu/media/sms1xxx/smscoreapi.c b/ubuntu/media/sms1xxx/smscoreapi.c
index b19dd9c..5d56f62 100644
--- a/ubuntu/media/sms1xxx/smscoreapi.c
+++ b/ubuntu/media/sms1xxx/smscoreapi.c
@@ -3,7 +3,7 @@
  *
  *  This file contains implementation for the interface to sms core component
  *
- *  author: Anatoly Greenblat
+ *  author: Uri Shkolnik
  *
  *  Copyright (c), 2005-2008 Siano Mobile Silicon, Inc.
  *
@@ -732,7 +732,7 @@ static char *smscore_fw_lkup[][SMS_NUM_OF_DEVICE_TYPES] = {
 	/*DVBH*/
 	{"none", "dvb_nova_12mhz.inp", "dvb_nova_12mhz_b0.inp", "none"},
 	/*TDMB*/
-	{"none", "tdmb_nova_12mhz.inp", "none", "none"},
+	{"none", "tdmb_nova_12mhz.inp", "tdmb_nova_12mhz_b0.inp", "none"},
 	/*DABIP*/
 	{"none", "none", "none", "none"},
 	/*BDA*/
@@ -960,10 +960,6 @@ void smscore_onresponse(struct smscore_device_t *coredev,
 #endif
 	/* If no client registered for type & id,
 	 * check for control client where type is not registered */
-#if 0
-	if (!client)
-		client = smscore_find_client(coredev, 0, phdr->msgDstId);
-#endif
 	if (client)
 		rc = client->onresponse_handler(client->context, cb);
 
@@ -1337,12 +1333,67 @@ static int __init smscore_module_init(void)
 	INIT_LIST_HEAD(&g_smscore_registry);
 	kmutex_init(&g_smscore_registrylock);
 
-	/* USB Register */
-	rc = smsusb_register();
+#if 0 /* def SMS_CHAR_CLIENT */
+	/* Char interface Register */
+	rc = smschar_register();
+	if (rc) {
+		sms_err("Error registering char device client.\n");
+		goto smschar_error;
+	}
+#endif
 
+#if 0 /* def SMS_DVB_CLIENT */
 	/* DVB Register */
 	rc = smsdvb_register();
+	if (rc) {
+		sms_err("Error registering DVB client.\n");
+		goto smsdvb_error;
+	}
+#endif
+
+#if 0 /* def SMS_NET_CLIENT */
+	/* DVB Register */
+	rc = smsnet_register();
+	if (rc) {
+		sms_err("Error registering Network client.\n");
+		goto smsnet_error;
+	}
+#endif
 
+#if 0 /* def SMS_USB_BUS_DRV */
+	/* USB Register */
+	rc = smsusb_register();
+	if (rc) {
+		sms_err("Error registering USB bus driver.\n");
+		goto sms_bus_drv_error;
+	}
+#endif
+
+#if 0 /* def SMS_SPI_BUS_DRV */
+	/* USB Register */
+	rc = smsspi_register();
+	if (rc) {
+		sms_err("Error registering spi bus driver.\n");
+		goto sms_bus_drv_error;
+	}
+#endif
+
+	return rc;
+#if 0
+sms_bus_drv_error:
+#endif /* 0 */
+#if 0 /* def SMS_NET_CLIENT */
+	smsnet_unregister();
+smsnet_error:
+#endif
+#if 0 /* def SMS_DVB_CLIENT */
+	smsdvb_unregister();
+smsdvb_error:
+#endif
+#if 0 /* def SMS_CHAR_CLIENT */
+	smschar_unregister();
+smschar_error:
+#endif
 	sms_debug("rc %d", rc);
 
 	return rc;
@@ -1350,6 +1401,30 @@ static int __init smscore_module_init(void)
 
 static void __exit smscore_module_exit(void)
 {
+#if 0 /* def SMS_CHAR_CLIENT */
+	/* Char interface UnRegister */
+	smschar_unregister();
+#endif
+
+#if 0 /* def SMS_DVB_CLIENT */
+	/* DVB UnRegister */
+	smsdvb_unregister();
+#endif
+
+#if 0 /* def SMS_NET_CLIENT */
+	/* NET UnRegister */
+	smsnet_unregister();
+#endif
+
+#if 0 /* def SMS_USB_BUS_DRV */
+	/* Unregister USB */
+	smsusb_unregister();
+#endif
+
+#if 0 /* def SMS_SPI_BUS_DRV */
+	/* Unregister SPI */
+	smsspi_unregister();
+#endif
 
 	kmutex_lock(&g_smscore_deviceslock);
 	while (!list_empty(&g_smscore_notifyees)) {
@@ -1373,18 +1448,34 @@ static void __exit smscore_module_exit(void)
 	}
 	kmutex_unlock(&g_smscore_registrylock);
 
-	/* DVB UnRegister */
-	smsdvb_unregister();
-
-	/* Unregister USB */
-	smsusb_unregister();
+//#ifdef DVB_CORE
+//	smsdvb_unregister();
+//#endif
 
 	sms_debug("");
 }
 
+EXPORT_SYMBOL(smscore_onresponse);
+EXPORT_SYMBOL(sms_get_board);
+EXPORT_SYMBOL(sms_debug);
+EXPORT_SYMBOL(smscore_putbuffer);
+EXPORT_SYMBOL(smscore_registry_getmode);
+EXPORT_SYMBOL(smscore_register_device);
+EXPORT_SYMBOL(smscore_set_board_id);
+EXPORT_SYMBOL(smscore_start_device);
+EXPORT_SYMBOL(smscore_unregister_device);
+EXPORT_SYMBOL(smscore_getbuffer);
+EXPORT_SYMBOL(smscore_get_device_mode);
+EXPORT_SYMBOL(smscore_register_client);
+EXPORT_SYMBOL(smscore_unregister_hotplug);
+EXPORT_SYMBOL(smsclient_sendrequest);
+EXPORT_SYMBOL(smscore_unregister_client);
+EXPORT_SYMBOL(smscore_get_board_id);
+EXPORT_SYMBOL(smscore_register_hotplug);
+
 module_init(smscore_module_init);
 module_exit(smscore_module_exit);
 
-MODULE_DESCRIPTION("Driver for the Siano SMS1XXX USB dongle");
-MODULE_AUTHOR("Siano Mobile Silicon,,, (doronc at siano-ms.com)");
+MODULE_DESCRIPTION("Siano MDTV Core module");
+MODULE_AUTHOR("Siano Mobile Silicon, Inc. (uris at siano-ms.com)");
 MODULE_LICENSE("GPL");
diff --git a/ubuntu/media/sms1xxx/smscoreapi.h b/ubuntu/media/sms1xxx/smscoreapi.h
index 266881e..b15c7a4 100644
--- a/ubuntu/media/sms1xxx/smscoreapi.h
+++ b/ubuntu/media/sms1xxx/smscoreapi.h
@@ -29,13 +29,13 @@
 #include <linux/scatterlist.h>
 #include <linux/types.h>
 #include <asm/page.h>
+#include <linux/mutex.h>
 
 #include "dmxdev.h"
 #include "dvbdev.h"
 #include "dvb_demux.h"
 #include "dvb_frontend.h"
 
-#include <linux/mutex.h>
 
 #define kmutex_init(_p_) mutex_init(_p_)
 #define kmutex_lock(_p_) mutex_lock(_p_)
@@ -562,10 +562,12 @@ extern int smsclient_sendrequest(struct smscore_client_t *client,
 extern void smscore_onresponse(struct smscore_device_t *coredev,
 			       struct smscore_buffer_t *cb);
 
-#if 0
+#if 1
 extern int smscore_get_common_buffer_size(struct smscore_device_t *coredev);
 extern int smscore_map_common_buffer(struct smscore_device_t *coredev,
 				      struct vm_area_struct *vma);
+extern int smscore_get_fw_filename(struct smscore_device_t *coredev, int mode, char* filename);
+extern int smscore_send_fw_file(struct smscore_device_t *coredev, u8* ufwbuf,int size);
 #endif
 
 extern
@@ -582,13 +584,6 @@ int smscore_get_board_id(struct smscore_device_t *core);
 
 int smscore_led_state(struct smscore_device_t *core, int led);
 
-/* smsdvb.c */
-int smsdvb_register(void);
-void smsdvb_unregister(void);
-
-/* smsusb.c */
-int smsusb_register(void);
-void smsusb_unregister(void);
 
 /* ------------------------------------------------------------------------ */
 
diff --git a/ubuntu/media/sms1xxx/smsdvb.c b/ubuntu/media/sms1xxx/smsdvb.c
index 7266f3d..c708ebd 100644
--- a/ubuntu/media/sms1xxx/smsdvb.c
+++ b/ubuntu/media/sms1xxx/smsdvb.c
@@ -1,7 +1,7 @@
 /*
  *  Driver for the Siano SMS1xxx USB dongle
  *
- *  author: Anatoly Greenblat
+ *  Author: Uri Shkolni
  *
  *  Copyright (c), 2005-2008 Siano Mobile Silicon, Inc.
  *
@@ -376,7 +376,7 @@ static void smsdvb_release(struct dvb_frontend *fe)
 
 static struct dvb_frontend_ops smsdvb_fe_ops = {
 	.info = {
-		.name			= "Siano Mobile Digital SMS1xxx",
+		.name			= "Siano Mobile Digital MDTV Receiver",
 		.type			= FE_OFDM,
 		.frequency_min		= 44250000,
 		.frequency_max		= 867250000,
@@ -418,16 +418,10 @@ static int smsdvb_hotplug(struct smscore_device_t *coredev,
 	if (!arrival)
 		return 0;
 
-	if (smscore_get_device_mode(coredev) != 4) {
-#if 1 /* new siano drop (1.2.17) does this -- yuck */
+	if (smscore_get_device_mode(coredev) != DEVICE_MODE_DVBT_BDA) {
 		sms_err("SMS Device mode is not set for "
 			"DVB operation.");
 		return 0;
-#else
-		rc = smscore_set_device_mode(coredev, 4);
-		if (rc < 0)
-			return rc;
-#endif
 	}
 
 	client = kzalloc(sizeof(struct smsdvb_client_t), GFP_KERNEL);
@@ -530,7 +524,7 @@ adapter_error:
 	return rc;
 }
 
-int smsdvb_register(void)
+int smsdvb_module_init(void)
 {
 	int rc;
 
@@ -544,7 +538,7 @@ int smsdvb_register(void)
 	return rc;
 }
 
-void smsdvb_unregister(void)
+void smsdvb_module_exit(void)
 {
 	smscore_unregister_hotplug(smsdvb_hotplug);
 
@@ -556,3 +550,10 @@ void smsdvb_unregister(void)
 
 	kmutex_unlock(&g_smsdvb_clientslock);
 }
+
+module_init(smsdvb_module_init);
+module_exit(smsdvb_module_exit);
+
+MODULE_DESCRIPTION("SMS DVB subsystem adaptation module");
+MODULE_AUTHOR("Siano Mobile Silicon, INC. (uris at siano-ms.com)");
+MODULE_LICENSE("GPL");
diff --git a/ubuntu/media/sms1xxx/smsusb.c b/ubuntu/media/sms1xxx/smsusb.c
index 50ca63b..a6df935 100644
--- a/ubuntu/media/sms1xxx/smsusb.c
+++ b/ubuntu/media/sms1xxx/smsusb.c
@@ -501,7 +501,7 @@ static struct usb_driver smsusb_driver = {
 	.resume			= smsusb_resume,
 };
 
-int smsusb_register(void)
+int smsusb_module_init(void)
 {
 	int rc = usb_register(&smsusb_driver);
 	if (rc)
@@ -512,10 +512,16 @@ int smsusb_register(void)
 	return rc;
 }
 
-void smsusb_unregister(void)
+void smsusb_module_exit(void)
 {
 	sms_debug("");
 	/* Regular USB Cleanup */
 	usb_deregister(&smsusb_driver);
 }
 
+module_init(smsusb_module_init);
+module_exit(smsusb_module_exit);
+
+MODULE_DESCRIPTION("Driver for the Siano SMS1XXX USB dongle");
+MODULE_AUTHOR("Siano Mobile Silicon, INC. (uris at siano-ms.com)");
+MODULE_LICENSE("GPL");
-- 
1.5.6.3





More information about the kernel-team mailing list