V4L/DVB (13157): dvb_frontend: represent all DVBS2API commands via macro
authorMauro Carvalho Chehab <mchehab@redhat.com>
Fri, 23 Oct 2009 23:09:42 +0000 (20:09 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Sat, 5 Dec 2009 20:40:37 +0000 (18:40 -0200)
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/dvb-core/dvb_frontend.c

index e9ec8e9110562ead1959755d19e9a29209af695f..07461222a7f50b43a2bebca01f7d21368081ab7a 100644 (file)
@@ -895,104 +895,27 @@ static int dvb_frontend_clear_cache(struct dvb_frontend *fe)
 }
 
 static struct dtv_cmds_h dtv_cmds[] = {
-       [DTV_TUNE] = {
-               .name   = "DTV_TUNE",
-               .cmd    = DTV_TUNE,
-               .set    = 1,
-       },
-       [DTV_CLEAR] = {
-               .name   = "DTV_CLEAR",
-               .cmd    = DTV_CLEAR,
-               .set    = 1,
-       },
+       _DTV_CMD(DTV_TUNE, 1, 0),
+       _DTV_CMD(DTV_CLEAR, 1, 0),
 
        /* Set */
-       [DTV_FREQUENCY] = {
-               .name   = "DTV_FREQUENCY",
-               .cmd    = DTV_FREQUENCY,
-               .set    = 1,
-       },
-       [DTV_BANDWIDTH_HZ] = {
-               .name   = "DTV_BANDWIDTH_HZ",
-               .cmd    = DTV_BANDWIDTH_HZ,
-               .set    = 1,
-       },
-       [DTV_MODULATION] = {
-               .name   = "DTV_MODULATION",
-               .cmd    = DTV_MODULATION,
-               .set    = 1,
-       },
-       [DTV_INVERSION] = {
-               .name   = "DTV_INVERSION",
-               .cmd    = DTV_INVERSION,
-               .set    = 1,
-       },
-       [DTV_DISEQC_MASTER] = {
-               .name   = "DTV_DISEQC_MASTER",
-               .cmd    = DTV_DISEQC_MASTER,
-               .set    = 1,
-               .buffer = 1,
-       },
-       [DTV_SYMBOL_RATE] = {
-               .name   = "DTV_SYMBOL_RATE",
-               .cmd    = DTV_SYMBOL_RATE,
-               .set    = 1,
-       },
-       [DTV_INNER_FEC] = {
-               .name   = "DTV_INNER_FEC",
-               .cmd    = DTV_INNER_FEC,
-               .set    = 1,
-       },
-       [DTV_VOLTAGE] = {
-               .name   = "DTV_VOLTAGE",
-               .cmd    = DTV_VOLTAGE,
-               .set    = 1,
-       },
-       [DTV_TONE] = {
-               .name   = "DTV_TONE",
-               .cmd    = DTV_TONE,
-               .set    = 1,
-       },
-       [DTV_PILOT] = {
-               .name   = "DTV_PILOT",
-               .cmd    = DTV_PILOT,
-               .set    = 1,
-       },
-       [DTV_ROLLOFF] = {
-               .name   = "DTV_ROLLOFF",
-               .cmd    = DTV_ROLLOFF,
-               .set    = 1,
-       },
-       [DTV_DELIVERY_SYSTEM] = {
-               .name   = "DTV_DELIVERY_SYSTEM",
-               .cmd    = DTV_DELIVERY_SYSTEM,
-               .set    = 1,
-       },
-       [DTV_HIERARCHY] = {
-               .name   = "DTV_HIERARCHY",
-               .cmd    = DTV_HIERARCHY,
-               .set    = 1,
-       },
-       [DTV_CODE_RATE_HP] = {
-               .name   = "DTV_CODE_RATE_HP",
-               .cmd    = DTV_CODE_RATE_HP,
-               .set    = 1,
-       },
-       [DTV_CODE_RATE_LP] = {
-               .name   = "DTV_CODE_RATE_LP",
-               .cmd    = DTV_CODE_RATE_LP,
-               .set    = 1,
-       },
-       [DTV_GUARD_INTERVAL] = {
-               .name   = "DTV_GUARD_INTERVAL",
-               .cmd    = DTV_GUARD_INTERVAL,
-               .set    = 1,
-       },
-       [DTV_TRANSMISSION_MODE] = {
-               .name   = "DTV_TRANSMISSION_MODE",
-               .cmd    = DTV_TRANSMISSION_MODE,
-               .set    = 1,
-       },
+       _DTV_CMD(DTV_FREQUENCY, 1, 0),
+       _DTV_CMD(DTV_BANDWIDTH_HZ, 1, 0),
+       _DTV_CMD(DTV_MODULATION, 1, 0),
+       _DTV_CMD(DTV_INVERSION, 1, 0),
+       _DTV_CMD(DTV_DISEQC_MASTER, 1, 1),
+       _DTV_CMD(DTV_SYMBOL_RATE, 1, 0),
+       _DTV_CMD(DTV_INNER_FEC, 1, 0),
+       _DTV_CMD(DTV_VOLTAGE, 1, 0),
+       _DTV_CMD(DTV_TONE, 1, 0),
+       _DTV_CMD(DTV_PILOT, 1, 0),
+       _DTV_CMD(DTV_ROLLOFF, 1, 0),
+       _DTV_CMD(DTV_DELIVERY_SYSTEM, 1, 0),
+       _DTV_CMD(DTV_HIERARCHY, 1, 0),
+       _DTV_CMD(DTV_CODE_RATE_HP, 1, 0),
+       _DTV_CMD(DTV_CODE_RATE_LP, 1, 0),
+       _DTV_CMD(DTV_GUARD_INTERVAL, 1, 0),
+       _DTV_CMD(DTV_TRANSMISSION_MODE, 1, 0),
 
        _DTV_CMD(DTV_ISDBT_PARTIAL_RECEPTION, 1, 0),
        _DTV_CMD(DTV_ISDBT_SOUND_BROADCASTING, 1, 0),
@@ -1035,43 +958,13 @@ static struct dtv_cmds_h dtv_cmds[] = {
        _DTV_CMD(DTV_ISDBS_TS_ID, 1, 0),
 
        /* Get */
-       [DTV_DISEQC_SLAVE_REPLY] = {
-               .name   = "DTV_DISEQC_SLAVE_REPLY",
-               .cmd    = DTV_DISEQC_SLAVE_REPLY,
-               .set    = 0,
-               .buffer = 1,
-       },
-
-       [DTV_API_VERSION] = {
-               .name   = "DTV_API_VERSION",
-               .cmd    = DTV_API_VERSION,
-               .set    = 0,
-       },
-       [DTV_CODE_RATE_HP] = {
-               .name   = "DTV_CODE_RATE_HP",
-               .cmd    = DTV_CODE_RATE_HP,
-               .set    = 0,
-       },
-       [DTV_CODE_RATE_LP] = {
-               .name   = "DTV_CODE_RATE_LP",
-               .cmd    = DTV_CODE_RATE_LP,
-               .set    = 0,
-       },
-       [DTV_GUARD_INTERVAL] = {
-               .name   = "DTV_GUARD_INTERVAL",
-               .cmd    = DTV_GUARD_INTERVAL,
-               .set    = 0,
-       },
-       [DTV_TRANSMISSION_MODE] = {
-               .name   = "DTV_TRANSMISSION_MODE",
-               .cmd    = DTV_TRANSMISSION_MODE,
-               .set    = 0,
-       },
-       [DTV_HIERARCHY] = {
-               .name   = "DTV_HIERARCHY",
-               .cmd    = DTV_HIERARCHY,
-               .set    = 0,
-       },
+       _DTV_CMD(DTV_DISEQC_SLAVE_REPLY, 0, 1),
+       _DTV_CMD(DTV_API_VERSION, 0, 0),
+       _DTV_CMD(DTV_CODE_RATE_HP, 0, 0),
+       _DTV_CMD(DTV_CODE_RATE_LP, 0, 0),
+       _DTV_CMD(DTV_GUARD_INTERVAL, 0, 0),
+       _DTV_CMD(DTV_TRANSMISSION_MODE, 0, 0),
+       _DTV_CMD(DTV_HIERARCHY, 0, 0),
 };
 
 static void dtv_property_dump(struct dtv_property *tvp)