From cc7185f96b8e9132c28118367f6c84569939c37d Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Tue, 16 Dec 2008 00:56:08 -0500 Subject: sms1xxx: enable rf switch on Hauppauge Tiger devices From: Michael Krufky Priority: normal Signed-off-by: Michael Krufky --- linux/drivers/media/dvb/siano/sms-cards.c | 23 +++++++++++++++++++++-- linux/drivers/media/dvb/siano/sms-cards.h | 3 ++- linux/drivers/media/dvb/siano/smsdvb.c | 19 +++++++++++++++++++ 3 files changed, 42 insertions(+), 3 deletions(-) diff --git a/linux/drivers/media/dvb/siano/sms-cards.c b/linux/drivers/media/dvb/siano/sms-cards.c index 79f5715c0..6c8faeb74 100644 --- a/linux/drivers/media/dvb/siano/sms-cards.c +++ b/linux/drivers/media/dvb/siano/sms-cards.c @@ -117,6 +117,7 @@ static struct sms_board sms_boards[] = { .type = SMS_NOVA_B0, .fw[DEVICE_MODE_DVBT_BDA] = "sms1xxx-hcw-55xxx-dvbt-02.fw", .lna_ctrl = 29, + .rf_switch = 17, }, [SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD_R2] = { .name = "Hauppauge WinTV MiniCard", @@ -199,8 +200,8 @@ int sms_board_power(struct smscore_device_t *coredev, int onoff) case SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD_R2: case SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD: /* LNA */ - sms_set_gpio(coredev, - board->lna_ctrl, onoff ? 1 : 0); + if (!onoff) + sms_set_gpio(coredev, board->lna_ctrl, 0); break; } return 0; @@ -227,3 +228,21 @@ int sms_board_led_feedback(struct smscore_device_t *coredev, int led) } return 0; } + +int sms_board_lna_control(struct smscore_device_t *coredev, int onoff) +{ + int board_id = smscore_get_board_id(coredev); + struct sms_board *board = sms_get_board(board_id); + + sms_debug("%s: LNA %s", __func__, onoff ? "enabled" : "disabled"); + + switch (board_id) { + case SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD_R2: + case SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD: + sms_set_gpio(coredev, + board->rf_switch, onoff ? 1 : 0); + return sms_set_gpio(coredev, + board->lna_ctrl, onoff ? 1 : 0); + } + return -EINVAL; +} diff --git a/linux/drivers/media/dvb/siano/sms-cards.h b/linux/drivers/media/dvb/siano/sms-cards.h index 8e0fe9fd2..fe292aaea 100644 --- a/linux/drivers/media/dvb/siano/sms-cards.h +++ b/linux/drivers/media/dvb/siano/sms-cards.h @@ -40,7 +40,7 @@ struct sms_board { char *name, *fw[DEVICE_MODE_MAX]; /* gpios */ - int led_power, led_hi, led_lo, lna_ctrl; + int led_power, led_hi, led_lo, lna_ctrl, rf_switch; }; struct sms_board *sms_get_board(int id); @@ -52,6 +52,7 @@ int sms_board_setup(struct smscore_device_t *coredev); #define SMS_LED_HI 2 int sms_board_led_feedback(struct smscore_device_t *coredev, int led); int sms_board_power(struct smscore_device_t *coredev, int onoff); +int sms_board_lna_control(struct smscore_device_t *coredev, int onoff); extern struct usb_device_id smsusb_id_table[]; diff --git a/linux/drivers/media/dvb/siano/smsdvb.c b/linux/drivers/media/dvb/siano/smsdvb.c index bbc87fe2e..a2efb402e 100644 --- a/linux/drivers/media/dvb/siano/smsdvb.c +++ b/linux/drivers/media/dvb/siano/smsdvb.c @@ -262,6 +262,7 @@ static int smsdvb_set_frontend(struct dvb_frontend *fe, struct SmsMsgHdr_ST Msg; u32 Data[3]; } Msg; + int ret; Msg.Msg.msgSrcId = DVBT_BDA_CONTROL_MSG_ID; Msg.Msg.msgDstId = HIF_TASK; @@ -285,6 +286,24 @@ static int smsdvb_set_frontend(struct dvb_frontend *fe, default: return -EINVAL; } + /* Disable LNA, if any. An error is returned if no LNA is present */ + ret = sms_board_lna_control(client->coredev, 0); + if (ret == 0) { + fe_status_t status; + + /* tune with LNA off at first */ + ret = smsdvb_sendrequest_and_wait(client, &Msg, sizeof(Msg), + &client->tune_done); + + smsdvb_read_status(fe, &status); + + if (status & FE_HAS_LOCK) + return ret; + + /* previous tune didnt lock - enable LNA and tune again */ + sms_board_lna_control(client->coredev, 1); + } + return smsdvb_sendrequest_and_wait(client, &Msg, sizeof(Msg), &client->tune_done); } -- cgit v1.2.3 From 5180a035b637308ddd873e58c46fdedbecb061f6 Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Sun, 31 Aug 2008 16:15:47 -0400 Subject: sms1xxx: move definition of struct smsdvb_client_t into smsdvb.c From: Michael Krufky Nobody uses struct smsdvb_client_t other than smsdvb.c -- this does not need to be inside smscoreapi.h Priority: normal Signed-off-by: Michael Krufky --- linux/drivers/media/dvb/siano/smscoreapi.h | 21 --------------------- linux/drivers/media/dvb/siano/smsdvb.c | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/linux/drivers/media/dvb/siano/smscoreapi.h b/linux/drivers/media/dvb/siano/smscoreapi.h index 1ab277767..0469f1bd8 100644 --- a/linux/drivers/media/dvb/siano/smscoreapi.h +++ b/linux/drivers/media/dvb/siano/smscoreapi.h @@ -523,27 +523,6 @@ struct smscore_gpio_config { u8 outputdriving; }; -struct smsdvb_client_t { - struct list_head entry; - - struct smscore_device_t *coredev; - struct smscore_client_t *smsclient; - - struct dvb_adapter adapter; - struct dvb_demux demux; - struct dmxdev dmxdev; - struct dvb_frontend frontend; - - fe_status_t fe_status; - int fe_ber, fe_snr, fe_unc, fe_signal_strength; - - struct completion tune_done, stat_done; - - /* todo: save freq/band instead whole struct */ - struct dvb_frontend_parameters fe_params; - -}; - extern void smscore_registry_setmode(char *devpath, int mode); extern int smscore_registry_getmode(char *devpath); diff --git a/linux/drivers/media/dvb/siano/smsdvb.c b/linux/drivers/media/dvb/siano/smsdvb.c index a2efb402e..68f3f31bb 100644 --- a/linux/drivers/media/dvb/siano/smsdvb.c +++ b/linux/drivers/media/dvb/siano/smsdvb.c @@ -27,6 +27,26 @@ DVB_DEFINE_MOD_OPT_ADAPTER_NR(adapter_nr); +struct smsdvb_client_t { + struct list_head entry; + + struct smscore_device_t *coredev; + struct smscore_client_t *smsclient; + + struct dvb_adapter adapter; + struct dvb_demux demux; + struct dmxdev dmxdev; + struct dvb_frontend frontend; + + fe_status_t fe_status; + int fe_ber, fe_snr, fe_unc, fe_signal_strength; + + struct completion tune_done, stat_done; + + /* todo: save freq/band instead whole struct */ + struct dvb_frontend_parameters fe_params; +}; + static struct list_head g_smsdvb_clients; static struct mutex g_smsdvb_clientslock; -- cgit v1.2.3 From c058193ee17449d1cb5e4685cab530b95bbb2b1b Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Sat, 30 Aug 2008 23:44:04 -0400 Subject: sms1xxx: restore smsusb_driver.name to smsusb From: Uri Shkolnik The sms1xxx driver will be broken down into smaller modules, so the original name, smsusb, is more appropriate. Signed-off-by: Uri Shkolnik Signed-off-by: Michael Krufky --- linux/drivers/media/dvb/siano/smsusb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/drivers/media/dvb/siano/smsusb.c b/linux/drivers/media/dvb/siano/smsusb.c index fd191b0ef..7a04b34b0 100644 --- a/linux/drivers/media/dvb/siano/smsusb.c +++ b/linux/drivers/media/dvb/siano/smsusb.c @@ -479,7 +479,7 @@ static int smsusb_resume(struct usb_interface *intf) } static struct usb_driver smsusb_driver = { - .name = "sms1xxx", + .name = "smsusb", .probe = smsusb_probe, .disconnect = smsusb_disconnect, .id_table = smsusb_id_table, -- cgit v1.2.3 From ddc98ba47b865fb467edeb186cb64ae65d608e26 Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Sun, 31 Aug 2008 16:03:15 -0400 Subject: sms1xxx: move smsusb_id_table into smsusb.c From: Michael Krufky Move the usb_device_id table to the smsusb module in preparation for the sms1xxx module to be split into sub-modules. This will allow the smsusb driver to start up automatically upon insertion of the USB device. Priority: normal Signed-off-by: Michael Krufky --- linux/drivers/media/dvb/siano/sms-cards.c | 47 ------------------------------- linux/drivers/media/dvb/siano/sms-cards.h | 2 -- linux/drivers/media/dvb/siano/smsusb.c | 47 +++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 49 deletions(-) diff --git a/linux/drivers/media/dvb/siano/sms-cards.c b/linux/drivers/media/dvb/siano/sms-cards.c index 6c8faeb74..39f83faa2 100644 --- a/linux/drivers/media/dvb/siano/sms-cards.c +++ b/linux/drivers/media/dvb/siano/sms-cards.c @@ -19,53 +19,6 @@ #include "sms-cards.h" -struct usb_device_id smsusb_id_table[] = { -#ifdef CONFIG_DVB_SIANO_SMS1XXX_SMS_IDS - { USB_DEVICE(0x187f, 0x0010), - .driver_info = SMS1XXX_BOARD_SIANO_STELLAR }, - { USB_DEVICE(0x187f, 0x0100), - .driver_info = SMS1XXX_BOARD_SIANO_STELLAR }, - { USB_DEVICE(0x187f, 0x0200), - .driver_info = SMS1XXX_BOARD_SIANO_NOVA_A }, - { USB_DEVICE(0x187f, 0x0201), - .driver_info = SMS1XXX_BOARD_SIANO_NOVA_B }, - { USB_DEVICE(0x187f, 0x0300), - .driver_info = SMS1XXX_BOARD_SIANO_VEGA }, -#endif - { USB_DEVICE(0x2040, 0x1700), - .driver_info = SMS1XXX_BOARD_HAUPPAUGE_CATAMOUNT }, - { USB_DEVICE(0x2040, 0x1800), - .driver_info = SMS1XXX_BOARD_HAUPPAUGE_OKEMO_A }, - { USB_DEVICE(0x2040, 0x1801), - .driver_info = SMS1XXX_BOARD_HAUPPAUGE_OKEMO_B }, - { USB_DEVICE(0x2040, 0x2000), - .driver_info = SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD }, - { USB_DEVICE(0x2040, 0x2009), - .driver_info = SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD_R2 }, - { USB_DEVICE(0x2040, 0x200a), - .driver_info = SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD }, - { USB_DEVICE(0x2040, 0x2010), - .driver_info = SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD }, - { USB_DEVICE(0x2040, 0x2011), - .driver_info = SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD }, - { USB_DEVICE(0x2040, 0x2019), - .driver_info = SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD }, - { USB_DEVICE(0x2040, 0x5500), - .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, - { USB_DEVICE(0x2040, 0x5510), - .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, - { USB_DEVICE(0x2040, 0x5520), - .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, - { USB_DEVICE(0x2040, 0x5530), - .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, - { USB_DEVICE(0x2040, 0x5580), - .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, - { USB_DEVICE(0x2040, 0x5590), - .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, - { } /* Terminating entry */ -}; -MODULE_DEVICE_TABLE(usb, smsusb_id_table); - static struct sms_board sms_boards[] = { [SMS_BOARD_UNKNOWN] = { .name = "Unknown board", diff --git a/linux/drivers/media/dvb/siano/sms-cards.h b/linux/drivers/media/dvb/siano/sms-cards.h index fe292aaea..8f539a2e5 100644 --- a/linux/drivers/media/dvb/siano/sms-cards.h +++ b/linux/drivers/media/dvb/siano/sms-cards.h @@ -54,6 +54,4 @@ int sms_board_led_feedback(struct smscore_device_t *coredev, int led); int sms_board_power(struct smscore_device_t *coredev, int onoff); int sms_board_lna_control(struct smscore_device_t *coredev, int onoff); -extern struct usb_device_id smsusb_id_table[]; - #endif /* __SMS_CARDS_H__ */ diff --git a/linux/drivers/media/dvb/siano/smsusb.c b/linux/drivers/media/dvb/siano/smsusb.c index 7a04b34b0..19005c26b 100644 --- a/linux/drivers/media/dvb/siano/smsusb.c +++ b/linux/drivers/media/dvb/siano/smsusb.c @@ -478,6 +478,53 @@ static int smsusb_resume(struct usb_interface *intf) return 0; } +struct usb_device_id smsusb_id_table[] = { +#ifdef CONFIG_DVB_SIANO_SMS1XXX_SMS_IDS + { USB_DEVICE(0x187f, 0x0010), + .driver_info = SMS1XXX_BOARD_SIANO_STELLAR }, + { USB_DEVICE(0x187f, 0x0100), + .driver_info = SMS1XXX_BOARD_SIANO_STELLAR }, + { USB_DEVICE(0x187f, 0x0200), + .driver_info = SMS1XXX_BOARD_SIANO_NOVA_A }, + { USB_DEVICE(0x187f, 0x0201), + .driver_info = SMS1XXX_BOARD_SIANO_NOVA_B }, + { USB_DEVICE(0x187f, 0x0300), + .driver_info = SMS1XXX_BOARD_SIANO_VEGA }, +#endif + { USB_DEVICE(0x2040, 0x1700), + .driver_info = SMS1XXX_BOARD_HAUPPAUGE_CATAMOUNT }, + { USB_DEVICE(0x2040, 0x1800), + .driver_info = SMS1XXX_BOARD_HAUPPAUGE_OKEMO_A }, + { USB_DEVICE(0x2040, 0x1801), + .driver_info = SMS1XXX_BOARD_HAUPPAUGE_OKEMO_B }, + { USB_DEVICE(0x2040, 0x2000), + .driver_info = SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD }, + { USB_DEVICE(0x2040, 0x2009), + .driver_info = SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD_R2 }, + { USB_DEVICE(0x2040, 0x200a), + .driver_info = SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD }, + { USB_DEVICE(0x2040, 0x2010), + .driver_info = SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD }, + { USB_DEVICE(0x2040, 0x2011), + .driver_info = SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD }, + { USB_DEVICE(0x2040, 0x2019), + .driver_info = SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD }, + { USB_DEVICE(0x2040, 0x5500), + .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, + { USB_DEVICE(0x2040, 0x5510), + .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, + { USB_DEVICE(0x2040, 0x5520), + .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, + { USB_DEVICE(0x2040, 0x5530), + .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, + { USB_DEVICE(0x2040, 0x5580), + .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, + { USB_DEVICE(0x2040, 0x5590), + .driver_info = SMS1XXX_BOARD_HAUPPAUGE_WINDHAM }, + { } /* Terminating entry */ +}; +MODULE_DEVICE_TABLE(usb, smsusb_id_table); + static struct usb_driver smsusb_driver = { .name = "smsusb", .probe = smsusb_probe, -- cgit v1.2.3 From e8a3398295b9a981e3c19553f7908bebe95de079 Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Sat, 30 Aug 2008 23:44:04 -0400 Subject: import changes from Siano From: Uri Shkolnik Import the following changes from Uri Shkolnik * Two-ways merge with Siano internal repository * Continuing with DVB sub-system separation * kconfig and makefile updates * Code cleanup 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. This breaks normal operation for the current driver, but it is being committed now for tracking purposes. These changes introduce the following checkpatch.pl violations: ERROR: do not use C99 // comments 156: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1373: +//#ifdef DVB_CORE ERROR: do not use C99 // comments 157: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1374: +// smsdvb_unregister(); ERROR: do not use C99 // comments 158: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1375: +//#endif WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable 163: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1380: +EXPORT_SYMBOL(smscore_onresponse); WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable 164: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1381: +EXPORT_SYMBOL(sms_get_board); WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable 165: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1382: +EXPORT_SYMBOL(sms_debug); WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable 166: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1383: +EXPORT_SYMBOL(smscore_putbuffer); WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable 167: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1384: +EXPORT_SYMBOL(smscore_registry_getmode); WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable 168: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1385: +EXPORT_SYMBOL(smscore_register_device); WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable 169: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1386: +EXPORT_SYMBOL(smscore_set_board_id); WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable 170: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1387: +EXPORT_SYMBOL(smscore_start_device); WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable 171: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1388: +EXPORT_SYMBOL(smsusb_id_table); WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable 172: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1389: +EXPORT_SYMBOL(smscore_unregister_device); WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable 173: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1390: +EXPORT_SYMBOL(smscore_getbuffer); WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable 174: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1391: +EXPORT_SYMBOL(smscore_get_device_mode); WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable 175: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1392: +EXPORT_SYMBOL(smscore_register_client); WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable 176: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1393: +EXPORT_SYMBOL(smscore_unregister_hotplug); WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable 177: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1394: +EXPORT_SYMBOL(smsclient_sendrequest); WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable 178: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1395: +EXPORT_SYMBOL(smscore_unregister_client); WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable 179: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1396: +EXPORT_SYMBOL(smscore_get_board_id); WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable 180: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1397: +EXPORT_SYMBOL(smscore_register_hotplug); WARNING: line over 80 characters 391: FILE: linux/drivers/media/dvb/siano/smscoreapi.h:398: +extern int smscore_get_fw_filename(struct smscore_device_t *coredev, int mode, char* filename); ERROR: "foo* bar" should be "foo *bar" 391: FILE: linux/drivers/media/dvb/siano/smscoreapi.h:398: +extern int smscore_get_fw_filename(struct smscore_device_t *coredev, int mode, char* filename); WARNING: line over 80 characters 392: FILE: linux/drivers/media/dvb/siano/smscoreapi.h:399: +extern int smscore_send_fw_file(struct smscore_device_t *coredev, u8* ufwbuf,int size); ERROR: "foo* bar" should be "foo *bar" 392: FILE: linux/drivers/media/dvb/siano/smscoreapi.h:399: +extern int smscore_send_fw_file(struct smscore_device_t *coredev, u8* ufwbuf,int size); ERROR: space required after that ',' (ctx:VxV) 392: FILE: linux/drivers/media/dvb/siano/smscoreapi.h:399: +extern int smscore_send_fw_file(struct smscore_device_t *coredev, u8* ufwbuf,int size); ^ WARNING: __func__ should be used instead of gcc specific __FUNCTION__ 489: FILE: linux/drivers/media/dvb/siano/smsusb.c:443: + printk(KERN_INFO"%s Entering status %d.\n", __FUNCTION__, msg.event); WARNING: __func__ should be used instead of gcc specific __FUNCTION__ 501: FILE: linux/drivers/media/dvb/siano/smsusb.c:455: + printk(KERN_INFO "%s Entering.\n", __FUNCTION__); ERROR: space prohibited before that '++' (ctx:WxB) 505: FILE: linux/drivers/media/dvb/siano/smsusb.c:459: + for (i = 0; i < intf->cur_altsetting->desc.bNumEndpoints; i ++) ^ WARNING: __func__ should be used instead of gcc specific __FUNCTION__ 517: FILE: linux/drivers/media/dvb/siano/smsusb.c:471: + __FUNCTION__, rc); total: 7 errors, 23 warnings, 524 lines checked Priority: normal Signed-off-by: Uri Shkolnik Signed-off-by: Michael Krufky --- linux/drivers/media/dvb/siano/Makefile | 4 +- linux/drivers/media/dvb/siano/smscoreapi.c | 121 +++++++++++++++++++++++++---- linux/drivers/media/dvb/siano/smscoreapi.h | 15 ++-- linux/drivers/media/dvb/siano/smsdvb.c | 23 +++--- linux/drivers/media/dvb/siano/smsusb.c | 10 ++- 5 files changed, 134 insertions(+), 39 deletions(-) diff --git a/linux/drivers/media/dvb/siano/Makefile b/linux/drivers/media/dvb/siano/Makefile index ee0737af9..bcf93f482 100644 --- a/linux/drivers/media/dvb/siano/Makefile +++ b/linux/drivers/media/dvb/siano/Makefile @@ -1,6 +1,8 @@ -sms1xxx-objs := smscoreapi.o smsusb.o smsdvb.o sms-cards.o +sms1xxx-objs := smscoreapi.o sms-cards.o obj-$(CONFIG_DVB_SIANO_SMS1XXX) += sms1xxx.o +obj-$(CONFIG_DVB_SIANO_SMS1XXX) += smsusb.o +obj-$(CONFIG_DVB_SIANO_SMS1XXX) += smsdvb.o EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core diff --git a/linux/drivers/media/dvb/siano/smscoreapi.c b/linux/drivers/media/dvb/siano/smscoreapi.c index b19dd9c7d..5d56f6295 100644 --- a/linux/drivers/media/dvb/siano/smscoreapi.c +++ b/linux/drivers/media/dvb/siano/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@siano-ms.com)"); +MODULE_DESCRIPTION("Siano MDTV Core module"); +MODULE_AUTHOR("Siano Mobile Silicon, Inc. (uris@siano-ms.com)"); MODULE_LICENSE("GPL"); diff --git a/linux/drivers/media/dvb/siano/smscoreapi.h b/linux/drivers/media/dvb/siano/smscoreapi.h index 0469f1bd8..2134a2fb7 100644 --- a/linux/drivers/media/dvb/siano/smscoreapi.h +++ b/linux/drivers/media/dvb/siano/smscoreapi.h @@ -29,14 +29,14 @@ #include #include #include - +#include #include "compat.h" + #include "dmxdev.h" #include "dvbdev.h" #include "dvb_demux.h" #include "dvb_frontend.h" -#include #define kmutex_init(_p_) mutex_init(_p_) #define kmutex_lock(_p_) mutex_lock(_p_) @@ -551,10 +551,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 @@ -571,13 +573,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/linux/drivers/media/dvb/siano/smsdvb.c b/linux/drivers/media/dvb/siano/smsdvb.c index 68f3f31bb..c91f6f242 100644 --- a/linux/drivers/media/dvb/siano/smsdvb.c +++ b/linux/drivers/media/dvb/siano/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. * @@ -371,7 +371,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, @@ -413,16 +413,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); @@ -521,7 +515,7 @@ adapter_error: return rc; } -int smsdvb_register(void) +int smsdvb_module_init(void) { int rc; @@ -535,7 +529,7 @@ int smsdvb_register(void) return rc; } -void smsdvb_unregister(void) +void smsdvb_module_exit(void) { smscore_unregister_hotplug(smsdvb_hotplug); @@ -547,3 +541,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@siano-ms.com)"); +MODULE_LICENSE("GPL"); diff --git a/linux/drivers/media/dvb/siano/smsusb.c b/linux/drivers/media/dvb/siano/smsusb.c index 19005c26b..eb12b08df 100644 --- a/linux/drivers/media/dvb/siano/smsusb.c +++ b/linux/drivers/media/dvb/siano/smsusb.c @@ -535,7 +535,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) @@ -546,10 +546,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@siano-ms.com)"); +MODULE_LICENSE("GPL"); -- cgit v1.2.3 From 319b736506ba8f695f973876299c72930508f68c Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Sun, 31 Aug 2008 15:08:15 -0400 Subject: sms1xxx: fix checkpatch.pl violations introduced by previous changeset From: Michael Krufky Fix checkpatch.pl violations introduced by previous changeset: ERROR: do not use C99 // comments 156: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1373: +//#ifdef DVB_CORE ERROR: do not use C99 // comments 157: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1374: +// smsdvb_unregister(); ERROR: do not use C99 // comments 158: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1375: +//#endif WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable 163: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1380: +EXPORT_SYMBOL(smscore_onresponse); WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable 164: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1381: +EXPORT_SYMBOL(sms_get_board); WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable 165: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1382: +EXPORT_SYMBOL(sms_debug); WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable 166: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1383: +EXPORT_SYMBOL(smscore_putbuffer); WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable 167: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1384: +EXPORT_SYMBOL(smscore_registry_getmode); WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable 168: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1385: +EXPORT_SYMBOL(smscore_register_device); WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable 169: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1386: +EXPORT_SYMBOL(smscore_set_board_id); WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable 170: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1387: +EXPORT_SYMBOL(smscore_start_device); WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable 171: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1388: +EXPORT_SYMBOL(smsusb_id_table); WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable 172: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1389: +EXPORT_SYMBOL(smscore_unregister_device); WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable 173: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1390: +EXPORT_SYMBOL(smscore_getbuffer); WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable 174: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1391: +EXPORT_SYMBOL(smscore_get_device_mode); WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable 175: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1392: +EXPORT_SYMBOL(smscore_register_client); WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable 176: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1393: +EXPORT_SYMBOL(smscore_unregister_hotplug); WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable 177: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1394: +EXPORT_SYMBOL(smsclient_sendrequest); WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable 178: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1395: +EXPORT_SYMBOL(smscore_unregister_client); WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable 179: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1396: +EXPORT_SYMBOL(smscore_get_board_id); WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable 180: FILE: linux/drivers/media/dvb/siano/smscoreapi.c:1397: +EXPORT_SYMBOL(smscore_register_hotplug); WARNING: line over 80 characters 391: FILE: linux/drivers/media/dvb/siano/smscoreapi.h:398: +extern int smscore_get_fw_filename(struct smscore_device_t *coredev, int mode, char* filename); ERROR: "foo* bar" should be "foo *bar" 391: FILE: linux/drivers/media/dvb/siano/smscoreapi.h:398: +extern int smscore_get_fw_filename(struct smscore_device_t *coredev, int mode, char* filename); WARNING: line over 80 characters 392: FILE: linux/drivers/media/dvb/siano/smscoreapi.h:399: +extern int smscore_send_fw_file(struct smscore_device_t *coredev, u8* ufwbuf,int size); ERROR: "foo* bar" should be "foo *bar" 392: FILE: linux/drivers/media/dvb/siano/smscoreapi.h:399: +extern int smscore_send_fw_file(struct smscore_device_t *coredev, u8* ufwbuf,int size); ERROR: space required after that ',' (ctx:VxV) 392: FILE: linux/drivers/media/dvb/siano/smscoreapi.h:399: +extern int smscore_send_fw_file(struct smscore_device_t *coredev, u8* ufwbuf,int size); ^ WARNING: __func__ should be used instead of gcc specific __FUNCTION__ 489: FILE: linux/drivers/media/dvb/siano/smsusb.c:443: + printk(KERN_INFO"%s Entering status %d.\n", __FUNCTION__, msg.event); WARNING: __func__ should be used instead of gcc specific __FUNCTION__ 501: FILE: linux/drivers/media/dvb/siano/smsusb.c:455: + printk(KERN_INFO "%s Entering.\n", __FUNCTION__); ERROR: space prohibited before that '++' (ctx:WxB) 505: FILE: linux/drivers/media/dvb/siano/smsusb.c:459: + for (i = 0; i < intf->cur_altsetting->desc.bNumEndpoints; i ++) ^ WARNING: __func__ should be used instead of gcc specific __FUNCTION__ 517: FILE: linux/drivers/media/dvb/siano/smsusb.c:471: + __FUNCTION__, rc); Priority: normal Signed-off-by: Michael Krufky --- linux/drivers/media/dvb/siano/sms-cards.c | 5 ++++ linux/drivers/media/dvb/siano/smscoreapi.c | 41 +++++++++++++----------------- linux/drivers/media/dvb/siano/smscoreapi.h | 10 +++++--- linux/drivers/media/dvb/siano/smsdvb.c | 4 +++ linux/drivers/media/dvb/siano/smsusb.c | 13 ++++++---- 5 files changed, 40 insertions(+), 33 deletions(-) diff --git a/linux/drivers/media/dvb/siano/sms-cards.c b/linux/drivers/media/dvb/siano/sms-cards.c index 39f83faa2..4fa86f5b7 100644 --- a/linux/drivers/media/dvb/siano/sms-cards.c +++ b/linux/drivers/media/dvb/siano/sms-cards.c @@ -86,6 +86,7 @@ struct sms_board *sms_get_board(int id) return &sms_boards[id]; } +EXPORT_SYMBOL(sms_get_board); static int sms_set_gpio(struct smscore_device_t *coredev, int pin, int enable) { @@ -138,6 +139,7 @@ int sms_board_setup(struct smscore_device_t *coredev) } return 0; } +EXPORT_SYMBOL(sms_board_setup); int sms_board_power(struct smscore_device_t *coredev, int onoff) { @@ -159,6 +161,7 @@ int sms_board_power(struct smscore_device_t *coredev, int onoff) } return 0; } +EXPORT_SYMBOL(sms_board_power); int sms_board_led_feedback(struct smscore_device_t *coredev, int led) { @@ -181,6 +184,7 @@ int sms_board_led_feedback(struct smscore_device_t *coredev, int led) } return 0; } +EXPORT_SYMBOL(sms_board_led_feedback); int sms_board_lna_control(struct smscore_device_t *coredev, int onoff) { @@ -199,3 +203,4 @@ int sms_board_lna_control(struct smscore_device_t *coredev, int onoff) } return -EINVAL; } +EXPORT_SYMBOL(sms_board_lna_control); diff --git a/linux/drivers/media/dvb/siano/smscoreapi.c b/linux/drivers/media/dvb/siano/smscoreapi.c index 5d56f6295..8cb36f540 100644 --- a/linux/drivers/media/dvb/siano/smscoreapi.c +++ b/linux/drivers/media/dvb/siano/smscoreapi.c @@ -34,8 +34,8 @@ #include "smscoreapi.h" #include "sms-cards.h" -int sms_debug; -module_param_named(debug, sms_debug, int, 0644); +int sms_dbg; +module_param_named(debug, sms_dbg, int, 0644); MODULE_PARM_DESC(debug, "set debug level (info=1, adv=2 (or-able))"); struct smscore_device_notifyee_t { @@ -105,11 +105,13 @@ int smscore_led_state(struct smscore_device_t *core, int led) core->led_state = led; return core->led_state; } +EXPORT_SYMBOL(smscore_set_board_id); int smscore_get_board_id(struct smscore_device_t *core) { return core->board_id; } +EXPORT_SYMBOL(smscore_get_board_id); struct smscore_registry_entry_t { struct list_head entry; @@ -170,6 +172,7 @@ int smscore_registry_getmode(char *devpath) return default_mode; } +EXPORT_SYMBOL(smscore_registry_getmode); static enum sms_device_type_st smscore_registry_gettype(char *devpath) { @@ -261,6 +264,7 @@ int smscore_register_hotplug(hotplug_t hotplug) return rc; } +EXPORT_SYMBOL(smscore_register_hotplug); /** * unregister a client callback that called when device plugged in/unplugged @@ -289,6 +293,7 @@ void smscore_unregister_hotplug(hotplug_t hotplug) kmutex_unlock(&g_smscore_deviceslock); } +EXPORT_SYMBOL(smscore_unregister_hotplug); static void smscore_notify_clients(struct smscore_device_t *coredev) { @@ -432,6 +437,7 @@ int smscore_register_device(struct smsdevice_params_t *params, return 0; } +EXPORT_SYMBOL(smscore_register_device); /** * sets initial device mode and notifies client hotplugs that device is ready @@ -460,6 +466,7 @@ int smscore_start_device(struct smscore_device_t *coredev) return rc; } +EXPORT_SYMBOL(smscore_start_device); static int smscore_sendrequest_and_wait(struct smscore_device_t *coredev, void *buffer, size_t size, @@ -688,6 +695,7 @@ void smscore_unregister_device(struct smscore_device_t *coredev) sms_info("device %p destroyed", coredev); } +EXPORT_SYMBOL(smscore_unregister_device); static int smscore_detect_mode(struct smscore_device_t *coredev) { @@ -879,6 +887,7 @@ int smscore_get_device_mode(struct smscore_device_t *coredev) { return coredev->mode; } +EXPORT_SYMBOL(smscore_get_device_mode); /** * find client by response id & type within the clients list. @@ -1013,6 +1022,7 @@ void smscore_onresponse(struct smscore_device_t *coredev, smscore_putbuffer(coredev, cb); } } +EXPORT_SYMBOL(smscore_onresponse); /** * return pointer to next free buffer descriptor from core pool @@ -1038,6 +1048,7 @@ struct smscore_buffer_t *smscore_getbuffer(struct smscore_device_t *coredev) return cb; } +EXPORT_SYMBOL(smscore_getbuffer); /** * return buffer descriptor to a pool @@ -1052,6 +1063,7 @@ void smscore_putbuffer(struct smscore_device_t *coredev, { list_add_locked(&cb->entry, &coredev->buffers, &coredev->bufferslock); } +EXPORT_SYMBOL(smscore_putbuffer); static int smscore_validate_client(struct smscore_device_t *coredev, struct smscore_client_t *client, @@ -1131,6 +1143,7 @@ int smscore_register_client(struct smscore_device_t *coredev, return 0; } +EXPORT_SYMBOL(smscore_register_client); /** * frees smsclient object and all subclients associated with it @@ -1161,6 +1174,7 @@ void smscore_unregister_client(struct smscore_client_t *client) spin_unlock_irqrestore(&coredev->clientslock, flags); } +EXPORT_SYMBOL(smscore_unregister_client); /** * verifies that source id is not taken by another client, @@ -1200,6 +1214,7 @@ int smsclient_sendrequest(struct smscore_client_t *client, return coredev->sendrequest_handler(coredev->context, buffer, size); } +EXPORT_SYMBOL(smsclient_sendrequest); #if 0 /** @@ -1448,31 +1463,9 @@ static void __exit smscore_module_exit(void) } kmutex_unlock(&g_smscore_registrylock); -//#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); diff --git a/linux/drivers/media/dvb/siano/smscoreapi.h b/linux/drivers/media/dvb/siano/smscoreapi.h index 2134a2fb7..14dcbdd80 100644 --- a/linux/drivers/media/dvb/siano/smscoreapi.h +++ b/linux/drivers/media/dvb/siano/smscoreapi.h @@ -555,8 +555,10 @@ extern void smscore_onresponse(struct smscore_device_t *coredev, 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); +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 @@ -576,7 +578,7 @@ int smscore_led_state(struct smscore_device_t *core, int led); /* ------------------------------------------------------------------------ */ -extern int sms_debug; +extern int sms_dbg; #define DBG_INFO 1 #define DBG_ADV 2 @@ -585,7 +587,7 @@ extern int sms_debug; printk(kern "%s: " fmt "\n", __func__, ##arg) #define dprintk(kern, lvl, fmt, arg...) do {\ - if (sms_debug & lvl) \ + if (sms_dbg & lvl) \ sms_printk(kern, fmt, ##arg); } while (0) #define sms_log(fmt, arg...) sms_printk(KERN_INFO, fmt, ##arg) diff --git a/linux/drivers/media/dvb/siano/smsdvb.c b/linux/drivers/media/dvb/siano/smsdvb.c index c91f6f242..f7f5569c1 100644 --- a/linux/drivers/media/dvb/siano/smsdvb.c +++ b/linux/drivers/media/dvb/siano/smsdvb.c @@ -50,6 +50,10 @@ struct smsdvb_client_t { static struct list_head g_smsdvb_clients; static struct mutex g_smsdvb_clientslock; +int sms_dbg; +module_param_named(debug, sms_dbg, int, 0644); +MODULE_PARM_DESC(debug, "set debug level (info=1, adv=2 (or-able))"); + static int smsdvb_onresponse(void *context, struct smscore_buffer_t *cb) { struct smsdvb_client_t *client = (struct smsdvb_client_t *) context; diff --git a/linux/drivers/media/dvb/siano/smsusb.c b/linux/drivers/media/dvb/siano/smsusb.c index eb12b08df..e5c378e46 100644 --- a/linux/drivers/media/dvb/siano/smsusb.c +++ b/linux/drivers/media/dvb/siano/smsusb.c @@ -27,6 +27,10 @@ #include "smscoreapi.h" #include "sms-cards.h" +int sms_dbg; +module_param_named(debug, sms_dbg, int, 0644); +MODULE_PARM_DESC(debug, "set debug level (info=1, adv=2 (or-able))"); + #define USB1_BUFFER_SIZE 0x1000 #define USB2_BUFFER_SIZE 0x4000 @@ -440,7 +444,7 @@ static int smsusb_suspend(struct usb_interface *intf, pm_message_t msg) { struct smsusb_device_t *dev = (struct smsusb_device_t *)usb_get_intfdata(intf); - printk(KERN_INFO "%s Entering status %d.\n", __func__, msg.event); + printk(KERN_INFO "%s: Entering status %d.\n", __func__, msg.event); smsusb_stop_streaming(dev); return 0; } @@ -452,7 +456,7 @@ static int smsusb_resume(struct usb_interface *intf) (struct smsusb_device_t *)usb_get_intfdata(intf); struct usb_device *udev = interface_to_usbdev(intf); - printk(KERN_INFO "%s Entering.\n", __func__); + printk(KERN_INFO "%s: Entering.\n", __func__); usb_clear_halt(udev, usb_rcvbulkpipe(udev, 0x81)); usb_clear_halt(udev, usb_rcvbulkpipe(udev, 0x02)); @@ -467,9 +471,8 @@ static int smsusb_resume(struct usb_interface *intf) intf->cur_altsetting->desc. bInterfaceNumber, 0); if (rc < 0) { - printk(KERN_INFO - "%s usb_set_interface failed, rc %d\n", - __func__, rc); + printk(KERN_INFO "%s usb_set_interface failed, " + "rc %d\n", __func__, rc); return rc; } } -- cgit v1.2.3 From 7d89270edcc221ddc81a48fb810066488b224b25 Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Sun, 31 Aug 2008 16:39:58 -0400 Subject: sms1xxx: load smsdvb module automatically based on device id From: Michael Krufky The smsdvb module was separated from the core and usb code. This change loads smsdvb automatically for driver configurations that depend on it. Priority: normal Signed-off-by: Michael Krufky --- linux/drivers/media/dvb/siano/sms-cards.c | 17 +++++++++++++++++ linux/drivers/media/dvb/siano/sms-cards.h | 2 ++ linux/drivers/media/dvb/siano/smsusb.c | 1 + 3 files changed, 20 insertions(+) diff --git a/linux/drivers/media/dvb/siano/sms-cards.c b/linux/drivers/media/dvb/siano/sms-cards.c index 4fa86f5b7..44df81a81 100644 --- a/linux/drivers/media/dvb/siano/sms-cards.c +++ b/linux/drivers/media/dvb/siano/sms-cards.c @@ -204,3 +204,20 @@ int sms_board_lna_control(struct smscore_device_t *coredev, int onoff) return -EINVAL; } EXPORT_SYMBOL(sms_board_lna_control); + +int sms_board_load_modules(int id) +{ + switch (id) { + case SMS1XXX_BOARD_HAUPPAUGE_CATAMOUNT: + case SMS1XXX_BOARD_HAUPPAUGE_OKEMO_A: + case SMS1XXX_BOARD_HAUPPAUGE_OKEMO_B: + case SMS1XXX_BOARD_HAUPPAUGE_WINDHAM: + request_module("smsdvb"); + break; + default: + /* do nothing */ + break; + } + return 0; +} +EXPORT_SYMBOL(sms_board_load_modules); diff --git a/linux/drivers/media/dvb/siano/sms-cards.h b/linux/drivers/media/dvb/siano/sms-cards.h index 8f539a2e5..64d74c59c 100644 --- a/linux/drivers/media/dvb/siano/sms-cards.h +++ b/linux/drivers/media/dvb/siano/sms-cards.h @@ -54,4 +54,6 @@ int sms_board_led_feedback(struct smscore_device_t *coredev, int led); int sms_board_power(struct smscore_device_t *coredev, int onoff); int sms_board_lna_control(struct smscore_device_t *coredev, int onoff); +extern int sms_board_load_modules(int id); + #endif /* __SMS_CARDS_H__ */ diff --git a/linux/drivers/media/dvb/siano/smsusb.c b/linux/drivers/media/dvb/siano/smsusb.c index e5c378e46..a2da36122 100644 --- a/linux/drivers/media/dvb/siano/smsusb.c +++ b/linux/drivers/media/dvb/siano/smsusb.c @@ -432,6 +432,7 @@ static int smsusb_probe(struct usb_interface *intf, rc = smsusb_init_device(intf, id->driver_info); sms_info("rc %d", rc); + sms_board_load_modules(id->driver_info); return rc; } -- cgit v1.2.3 From 9c48ff787617a8ab6870134701fa0ee1e7df608e Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Thu, 26 Feb 2009 16:32:36 -0500 Subject: siano: convert EXPORT_SYMBOL to EXPORT_SYMBOL_GPL From: Michael Krufky As pointed out by Mauro Chehab, we should always use EXPORT_SYMBOL_GPL instead of EXPORT_SYMBOL wherever possible. A message was posted to the linux-media mailing list about this, checking with Uri Shkolnik of Siano Mobile Silicon if this is okay to convert. As per Uri's response to this email, it is OK for us to make this conversion. http://www.spinics.net/lists/linux-media/msg02200.html Priority: normal Signed-off-by: Michael Krufky --- linux/drivers/media/dvb/siano/sms-cards.c | 12 ++++++------ linux/drivers/media/dvb/siano/smscoreapi.c | 30 +++++++++++++++--------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/linux/drivers/media/dvb/siano/sms-cards.c b/linux/drivers/media/dvb/siano/sms-cards.c index 44df81a81..66f591937 100644 --- a/linux/drivers/media/dvb/siano/sms-cards.c +++ b/linux/drivers/media/dvb/siano/sms-cards.c @@ -86,7 +86,7 @@ struct sms_board *sms_get_board(int id) return &sms_boards[id]; } -EXPORT_SYMBOL(sms_get_board); +EXPORT_SYMBOL_GPL(sms_get_board); static int sms_set_gpio(struct smscore_device_t *coredev, int pin, int enable) { @@ -139,7 +139,7 @@ int sms_board_setup(struct smscore_device_t *coredev) } return 0; } -EXPORT_SYMBOL(sms_board_setup); +EXPORT_SYMBOL_GPL(sms_board_setup); int sms_board_power(struct smscore_device_t *coredev, int onoff) { @@ -161,7 +161,7 @@ int sms_board_power(struct smscore_device_t *coredev, int onoff) } return 0; } -EXPORT_SYMBOL(sms_board_power); +EXPORT_SYMBOL_GPL(sms_board_power); int sms_board_led_feedback(struct smscore_device_t *coredev, int led) { @@ -184,7 +184,7 @@ int sms_board_led_feedback(struct smscore_device_t *coredev, int led) } return 0; } -EXPORT_SYMBOL(sms_board_led_feedback); +EXPORT_SYMBOL_GPL(sms_board_led_feedback); int sms_board_lna_control(struct smscore_device_t *coredev, int onoff) { @@ -203,7 +203,7 @@ int sms_board_lna_control(struct smscore_device_t *coredev, int onoff) } return -EINVAL; } -EXPORT_SYMBOL(sms_board_lna_control); +EXPORT_SYMBOL_GPL(sms_board_lna_control); int sms_board_load_modules(int id) { @@ -220,4 +220,4 @@ int sms_board_load_modules(int id) } return 0; } -EXPORT_SYMBOL(sms_board_load_modules); +EXPORT_SYMBOL_GPL(sms_board_load_modules); diff --git a/linux/drivers/media/dvb/siano/smscoreapi.c b/linux/drivers/media/dvb/siano/smscoreapi.c index 8cb36f540..812b57ab7 100644 --- a/linux/drivers/media/dvb/siano/smscoreapi.c +++ b/linux/drivers/media/dvb/siano/smscoreapi.c @@ -105,13 +105,13 @@ int smscore_led_state(struct smscore_device_t *core, int led) core->led_state = led; return core->led_state; } -EXPORT_SYMBOL(smscore_set_board_id); +EXPORT_SYMBOL_GPL(smscore_set_board_id); int smscore_get_board_id(struct smscore_device_t *core) { return core->board_id; } -EXPORT_SYMBOL(smscore_get_board_id); +EXPORT_SYMBOL_GPL(smscore_get_board_id); struct smscore_registry_entry_t { struct list_head entry; @@ -172,7 +172,7 @@ int smscore_registry_getmode(char *devpath) return default_mode; } -EXPORT_SYMBOL(smscore_registry_getmode); +EXPORT_SYMBOL_GPL(smscore_registry_getmode); static enum sms_device_type_st smscore_registry_gettype(char *devpath) { @@ -264,7 +264,7 @@ int smscore_register_hotplug(hotplug_t hotplug) return rc; } -EXPORT_SYMBOL(smscore_register_hotplug); +EXPORT_SYMBOL_GPL(smscore_register_hotplug); /** * unregister a client callback that called when device plugged in/unplugged @@ -293,7 +293,7 @@ void smscore_unregister_hotplug(hotplug_t hotplug) kmutex_unlock(&g_smscore_deviceslock); } -EXPORT_SYMBOL(smscore_unregister_hotplug); +EXPORT_SYMBOL_GPL(smscore_unregister_hotplug); static void smscore_notify_clients(struct smscore_device_t *coredev) { @@ -437,7 +437,7 @@ int smscore_register_device(struct smsdevice_params_t *params, return 0; } -EXPORT_SYMBOL(smscore_register_device); +EXPORT_SYMBOL_GPL(smscore_register_device); /** * sets initial device mode and notifies client hotplugs that device is ready @@ -466,7 +466,7 @@ int smscore_start_device(struct smscore_device_t *coredev) return rc; } -EXPORT_SYMBOL(smscore_start_device); +EXPORT_SYMBOL_GPL(smscore_start_device); static int smscore_sendrequest_and_wait(struct smscore_device_t *coredev, void *buffer, size_t size, @@ -695,7 +695,7 @@ void smscore_unregister_device(struct smscore_device_t *coredev) sms_info("device %p destroyed", coredev); } -EXPORT_SYMBOL(smscore_unregister_device); +EXPORT_SYMBOL_GPL(smscore_unregister_device); static int smscore_detect_mode(struct smscore_device_t *coredev) { @@ -887,7 +887,7 @@ int smscore_get_device_mode(struct smscore_device_t *coredev) { return coredev->mode; } -EXPORT_SYMBOL(smscore_get_device_mode); +EXPORT_SYMBOL_GPL(smscore_get_device_mode); /** * find client by response id & type within the clients list. @@ -1022,7 +1022,7 @@ void smscore_onresponse(struct smscore_device_t *coredev, smscore_putbuffer(coredev, cb); } } -EXPORT_SYMBOL(smscore_onresponse); +EXPORT_SYMBOL_GPL(smscore_onresponse); /** * return pointer to next free buffer descriptor from core pool @@ -1048,7 +1048,7 @@ struct smscore_buffer_t *smscore_getbuffer(struct smscore_device_t *coredev) return cb; } -EXPORT_SYMBOL(smscore_getbuffer); +EXPORT_SYMBOL_GPL(smscore_getbuffer); /** * return buffer descriptor to a pool @@ -1063,7 +1063,7 @@ void smscore_putbuffer(struct smscore_device_t *coredev, { list_add_locked(&cb->entry, &coredev->buffers, &coredev->bufferslock); } -EXPORT_SYMBOL(smscore_putbuffer); +EXPORT_SYMBOL_GPL(smscore_putbuffer); static int smscore_validate_client(struct smscore_device_t *coredev, struct smscore_client_t *client, @@ -1143,7 +1143,7 @@ int smscore_register_client(struct smscore_device_t *coredev, return 0; } -EXPORT_SYMBOL(smscore_register_client); +EXPORT_SYMBOL_GPL(smscore_register_client); /** * frees smsclient object and all subclients associated with it @@ -1174,7 +1174,7 @@ void smscore_unregister_client(struct smscore_client_t *client) spin_unlock_irqrestore(&coredev->clientslock, flags); } -EXPORT_SYMBOL(smscore_unregister_client); +EXPORT_SYMBOL_GPL(smscore_unregister_client); /** * verifies that source id is not taken by another client, @@ -1214,7 +1214,7 @@ int smsclient_sendrequest(struct smscore_client_t *client, return coredev->sendrequest_handler(coredev->context, buffer, size); } -EXPORT_SYMBOL(smsclient_sendrequest); +EXPORT_SYMBOL_GPL(smsclient_sendrequest); #if 0 /** -- cgit v1.2.3