[media] siano: use defines for firmware names
authorMauro Carvalho Chehab <mchehab@redhat.com>
Tue, 19 Mar 2013 20:02:54 +0000 (17:02 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Thu, 21 Mar 2013 10:54:13 +0000 (07:54 -0300)
There are too many firmwares there. As we need to add
MODULE_FIMWARE() macros, the better is to define their names
on just one place and use the macros for both cards/device type
tables and MODULE_FIRMWARE().

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/common/siano/sms-cards.c
drivers/media/common/siano/smscoreapi.c
drivers/media/common/siano/smscoreapi.h

index bb6e558b8120ef3f3398543d1c945b831ee8453d..6680134d23367c47ce8d6c2f27806244e44cba34 100644 (file)
@@ -54,26 +54,26 @@ static struct sms_board sms_boards[] = {
        [SMS1XXX_BOARD_HAUPPAUGE_CATAMOUNT] = {
                .name   = "Hauppauge Catamount",
                .type   = SMS_STELLAR,
-               .fw[DEVICE_MODE_DVBT_BDA] = "sms1xxx-stellar-dvbt-01.fw",
+               .fw[DEVICE_MODE_DVBT_BDA] = SMS_FW_DVBT_STELLAR,
                .default_mode = DEVICE_MODE_DVBT_BDA,
        },
        [SMS1XXX_BOARD_HAUPPAUGE_OKEMO_A] = {
                .name   = "Hauppauge Okemo-A",
                .type   = SMS_NOVA_A0,
-               .fw[DEVICE_MODE_DVBT_BDA] = "sms1xxx-nova-a-dvbt-01.fw",
+               .fw[DEVICE_MODE_DVBT_BDA] = SMS_FW_DVBT_NOVA_A,
                .default_mode = DEVICE_MODE_DVBT_BDA,
        },
        [SMS1XXX_BOARD_HAUPPAUGE_OKEMO_B] = {
                .name   = "Hauppauge Okemo-B",
                .type   = SMS_NOVA_B0,
-               .fw[DEVICE_MODE_DVBT_BDA] = "sms1xxx-nova-b-dvbt-01.fw",
+               .fw[DEVICE_MODE_DVBT_BDA] = SMS_FW_DVBT_NOVA_B,
                .default_mode = DEVICE_MODE_DVBT_BDA,
        },
        [SMS1XXX_BOARD_HAUPPAUGE_WINDHAM] = {
                .name   = "Hauppauge WinTV MiniStick",
                .type   = SMS_NOVA_B0,
-               .fw[DEVICE_MODE_ISDBT_BDA] = "sms1xxx-hcw-55xxx-isdbt-02.fw",
-               .fw[DEVICE_MODE_DVBT_BDA] = "sms1xxx-hcw-55xxx-dvbt-02.fw",
+               .fw[DEVICE_MODE_ISDBT_BDA] = SMS_FW_ISDBT_HCW_55XXX,
+               .fw[DEVICE_MODE_DVBT_BDA]  = SMS_FW_DVBT_HCW_55XXX,
                .default_mode = DEVICE_MODE_DVBT_BDA,
                .rc_codes = RC_MAP_HAUPPAUGE,
                .board_cfg.leds_power = 26,
@@ -87,7 +87,7 @@ static struct sms_board sms_boards[] = {
        [SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD] = {
                .name   = "Hauppauge WinTV MiniCard",
                .type   = SMS_NOVA_B0,
-               .fw[DEVICE_MODE_DVBT_BDA] = "sms1xxx-hcw-55xxx-dvbt-02.fw",
+               .fw[DEVICE_MODE_DVBT_BDA] = SMS_FW_DVBT_HCW_55XXX,
                .default_mode = DEVICE_MODE_DVBT_BDA,
                .lna_ctrl  = 29,
                .board_cfg.foreign_lna0_ctrl = 29,
@@ -97,7 +97,7 @@ static struct sms_board sms_boards[] = {
        [SMS1XXX_BOARD_HAUPPAUGE_TIGER_MINICARD_R2] = {
                .name   = "Hauppauge WinTV MiniCard",
                .type   = SMS_NOVA_B0,
-               .fw[DEVICE_MODE_DVBT_BDA] = "sms1xxx-hcw-55xxx-dvbt-02.fw",
+               .fw[DEVICE_MODE_DVBT_BDA] = SMS_FW_DVBT_HCW_55XXX,
                .default_mode = DEVICE_MODE_DVBT_BDA,
                .lna_ctrl  = -1,
        },
index b5e40aa9651a7fdbbf8bf1e712a2f6ff2b1f84d7..b7aa63f9d9f68c743ef1a4af5df9c7253ff19464 100644 (file)
@@ -1048,50 +1048,50 @@ exit_fw_download:
 
 static char *smscore_fw_lkup[][DEVICE_MODE_MAX] = {
        [SMS_NOVA_A0] = {
-               [DEVICE_MODE_DVBT]              = "dvb_nova_12mhz.inp",
-               [DEVICE_MODE_DVBH]              = "dvb_nova_12mhz.inp",
-               [DEVICE_MODE_DAB_TDMB]          = "tdmb_nova_12mhz.inp",
-               [DEVICE_MODE_DVBT_BDA]          = "dvb_nova_12mhz.inp",
-               [DEVICE_MODE_ISDBT]             = "isdbt_nova_12mhz.inp",
-               [DEVICE_MODE_ISDBT_BDA]         = "isdbt_nova_12mhz.inp",
+               [DEVICE_MODE_DVBT]              = SMS_FW_DVB_NOVA_12MHZ,
+               [DEVICE_MODE_DVBH]              = SMS_FW_DVB_NOVA_12MHZ,
+               [DEVICE_MODE_DAB_TDMB]          = SMS_FW_TDMB_NOVA_12MHZ,
+               [DEVICE_MODE_DVBT_BDA]          = SMS_FW_DVB_NOVA_12MHZ,
+               [DEVICE_MODE_ISDBT]             = SMS_FW_ISDBT_NOVA_12MHZ,
+               [DEVICE_MODE_ISDBT_BDA]         = SMS_FW_ISDBT_NOVA_12MHZ,
        },
        [SMS_NOVA_B0] = {
-               [DEVICE_MODE_DVBT]              = "dvb_nova_12mhz_b0.inp",
-               [DEVICE_MODE_DVBH]              = "dvb_nova_12mhz_b0.inp",
-               [DEVICE_MODE_DAB_TDMB]          = "tdmb_nova_12mhz_b0.inp",
-               [DEVICE_MODE_DVBT_BDA]          = "dvb_nova_12mhz_b0.inp",
-               [DEVICE_MODE_ISDBT]             = "isdbt_nova_12mhz_b0.inp",
-               [DEVICE_MODE_ISDBT_BDA]         = "isdbt_nova_12mhz_b0.inp",
-               [DEVICE_MODE_FM_RADIO]          = "fm_radio.inp",
-               [DEVICE_MODE_FM_RADIO_BDA]      = "fm_radio.inp",
+               [DEVICE_MODE_DVBT]              = SMS_FW_DVB_NOVA_12MHZ_B0,
+               [DEVICE_MODE_DVBH]              = SMS_FW_DVB_NOVA_12MHZ_B0,
+               [DEVICE_MODE_DAB_TDMB]          = SMS_FW_TDMB_NOVA_12MHZ_B0,
+               [DEVICE_MODE_DVBT_BDA]          = SMS_FW_DVB_NOVA_12MHZ_B0,
+               [DEVICE_MODE_ISDBT]             = SMS_FW_ISDBT_NOVA_12MHZ_B0,
+               [DEVICE_MODE_ISDBT_BDA]         = SMS_FW_ISDBT_NOVA_12MHZ_B0,
+               [DEVICE_MODE_FM_RADIO]          = SMS_FW_FM_RADIO,
+               [DEVICE_MODE_FM_RADIO_BDA]      = SMS_FW_FM_RADIO,
        },
        [SMS_VEGA] = {
-               [DEVICE_MODE_CMMB]              = "cmmb_vega_12mhz.inp",
+               [DEVICE_MODE_CMMB]              = SMS_FW_CMMB_VEGA_12MHZ,
        },
        [SMS_VENICE] = {
-               [DEVICE_MODE_CMMB]              = "cmmb_venice_12mhz.inp",
+               [DEVICE_MODE_CMMB]              = SMS_FW_CMMB_VENICE_12MHZ,
        },
        [SMS_MING] = {
-               [DEVICE_MODE_CMMB]              = "cmmb_ming_app.inp",
+               [DEVICE_MODE_CMMB]              = SMS_FW_CMMB_MING_APP,
        },
        [SMS_PELE] = {
-               [DEVICE_MODE_ISDBT]             = "isdbt_pele.inp",
-               [DEVICE_MODE_ISDBT_BDA]         = "isdbt_pele.inp",
+               [DEVICE_MODE_ISDBT]             = SMS_FW_ISDBT_PELE,
+               [DEVICE_MODE_ISDBT_BDA]         = SMS_FW_ISDBT_PELE,
        },
        [SMS_RIO] = {
-               [DEVICE_MODE_DVBT]              = "dvb_rio.inp",
-               [DEVICE_MODE_DVBH]              = "dvbh_rio.inp",
-               [DEVICE_MODE_DVBT_BDA]          = "dvb_rio.inp",
-               [DEVICE_MODE_ISDBT]             = "isdbt_rio.inp",
-               [DEVICE_MODE_ISDBT_BDA]         = "isdbt_rio.inp",
-               [DEVICE_MODE_FM_RADIO]          = "fm_radio_rio.inp",
-               [DEVICE_MODE_FM_RADIO_BDA]      = "fm_radio_rio.inp",
+               [DEVICE_MODE_DVBT]              = SMS_FW_DVB_RIO,
+               [DEVICE_MODE_DVBH]              = SMS_FW_DVBH_RIO,
+               [DEVICE_MODE_DVBT_BDA]          = SMS_FW_DVB_RIO,
+               [DEVICE_MODE_ISDBT]             = SMS_FW_ISDBT_RIO,
+               [DEVICE_MODE_ISDBT_BDA]         = SMS_FW_ISDBT_RIO,
+               [DEVICE_MODE_FM_RADIO]          = SMS_FW_FM_RADIO_RIO,
+               [DEVICE_MODE_FM_RADIO_BDA]      = SMS_FW_FM_RADIO_RIO,
        },
        [SMS_DENVER_1530] = {
-               [DEVICE_MODE_ATSC]              = "atsc_denver.inp",
+               [DEVICE_MODE_ATSC]              = SMS_FW_ATSC_DENVER,
        },
        [SMS_DENVER_2160] = {
-               [DEVICE_MODE_DAB_TDMB]          = "tdmb_denver.inp",
+               [DEVICE_MODE_DAB_TDMB]          = SMS_FW_TDMB_DENVER,
        },
 };
 
index 53b81cbc1bda9e3ddba5c6caec611659f0e92c86..a9672e04c64ffefa0ca219d6f2bc28421e236959 100644 (file)
@@ -44,6 +44,30 @@ along with this program.  If not, see <http://www.gnu.org/licenses/>.
 #define min(a, b) (((a) < (b)) ? (a) : (b))
 #endif
 
+/* Define the firmware names used by the driver */
+#define SMS_FW_ATSC_DENVER         "atsc_denver.inp"
+#define SMS_FW_CMMB_MING_APP       "cmmb_ming_app.inp"
+#define SMS_FW_CMMB_VEGA_12MHZ     "cmmb_vega_12mhz.inp"
+#define SMS_FW_CMMB_VENICE_12MHZ   "cmmb_venice_12mhz.inp"
+#define SMS_FW_DVBH_RIO            "dvbh_rio.inp"
+#define SMS_FW_DVB_NOVA_12MHZ_B0   "dvb_nova_12mhz_b0.inp"
+#define SMS_FW_DVB_NOVA_12MHZ      "dvb_nova_12mhz.inp"
+#define SMS_FW_DVB_RIO             "dvb_rio.inp"
+#define SMS_FW_FM_RADIO            "fm_radio.inp"
+#define SMS_FW_FM_RADIO_RIO        "fm_radio_rio.inp"
+#define SMS_FW_DVBT_HCW_55XXX      "sms1xxx-hcw-55xxx-dvbt-02.fw"
+#define SMS_FW_ISDBT_HCW_55XXX     "sms1xxx-hcw-55xxx-isdbt-02.fw"
+#define SMS_FW_ISDBT_NOVA_12MHZ_B0 "isdbt_nova_12mhz_b0.inp"
+#define SMS_FW_ISDBT_NOVA_12MHZ    "isdbt_nova_12mhz.inp"
+#define SMS_FW_ISDBT_PELE          "isdbt_pele.inp"
+#define SMS_FW_ISDBT_RIO           "isdbt_rio.inp"
+#define SMS_FW_DVBT_NOVA_A         "sms1xxx-nova-a-dvbt-01.fw"
+#define SMS_FW_DVBT_NOVA_B         "sms1xxx-nova-b-dvbt-01.fw"
+#define SMS_FW_DVBT_STELLAR        "sms1xxx-stellar-dvbt-01.fw"
+#define SMS_FW_TDMB_DENVER         "tdmb_denver.inp"
+#define SMS_FW_TDMB_NOVA_12MHZ_B0  "tdmb_nova_12mhz_b0.inp"
+#define SMS_FW_TDMB_NOVA_12MHZ     "tdmb_nova_12mhz.inp"
+
 #define SMS_PROTOCOL_MAX_RAOUNDTRIP_MS                 (10000)
 #define SMS_ALLOC_ALIGNMENT                            128
 #define SMS_DMA_ALIGNMENT                              16