diff options
author | Antti Palosaari <crope@iki.fi> | 2011-07-24 19:29:16 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-07-31 00:26:41 -0400 |
commit | bfd4500c9abf3e70e9c563bcba5675bd302f5a4e (patch) | |
tree | bd81a12af0b18784f961a6c58755f7163eb7f16b /drivers/media/dvb/dvb-usb/cxusb.c | |
parent | 6d51477470728074cea396a0127d73c5590dd441 (diff) |
[media] dvb-usb: prepare for multi-frontend support (MFE)
Change adapter FE pointer as array of FE pointers.
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb/dvb-usb/cxusb.c')
-rw-r--r-- | drivers/media/dvb/dvb-usb/cxusb.c | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/drivers/media/dvb/dvb-usb/cxusb.c b/drivers/media/dvb/dvb-usb/cxusb.c index acb5fb2d2e73..a76f431d6a26 100644 --- a/drivers/media/dvb/dvb-usb/cxusb.c +++ b/drivers/media/dvb/dvb-usb/cxusb.c | |||
@@ -725,7 +725,7 @@ static struct max2165_config mygica_d689_max2165_cfg = { | |||
725 | /* Callbacks for DVB USB */ | 725 | /* Callbacks for DVB USB */ |
726 | static int cxusb_fmd1216me_tuner_attach(struct dvb_usb_adapter *adap) | 726 | static int cxusb_fmd1216me_tuner_attach(struct dvb_usb_adapter *adap) |
727 | { | 727 | { |
728 | dvb_attach(simple_tuner_attach, adap->fe, | 728 | dvb_attach(simple_tuner_attach, adap->fe[0], |
729 | &adap->dev->i2c_adap, 0x61, | 729 | &adap->dev->i2c_adap, 0x61, |
730 | TUNER_PHILIPS_FMD1216ME_MK3); | 730 | TUNER_PHILIPS_FMD1216ME_MK3); |
731 | return 0; | 731 | return 0; |
@@ -733,27 +733,27 @@ static int cxusb_fmd1216me_tuner_attach(struct dvb_usb_adapter *adap) | |||
733 | 733 | ||
734 | static int cxusb_dee1601_tuner_attach(struct dvb_usb_adapter *adap) | 734 | static int cxusb_dee1601_tuner_attach(struct dvb_usb_adapter *adap) |
735 | { | 735 | { |
736 | dvb_attach(dvb_pll_attach, adap->fe, 0x61, | 736 | dvb_attach(dvb_pll_attach, adap->fe[0], 0x61, |
737 | NULL, DVB_PLL_THOMSON_DTT7579); | 737 | NULL, DVB_PLL_THOMSON_DTT7579); |
738 | return 0; | 738 | return 0; |
739 | } | 739 | } |
740 | 740 | ||
741 | static int cxusb_lgz201_tuner_attach(struct dvb_usb_adapter *adap) | 741 | static int cxusb_lgz201_tuner_attach(struct dvb_usb_adapter *adap) |
742 | { | 742 | { |
743 | dvb_attach(dvb_pll_attach, adap->fe, 0x61, NULL, DVB_PLL_LG_Z201); | 743 | dvb_attach(dvb_pll_attach, adap->fe[0], 0x61, NULL, DVB_PLL_LG_Z201); |
744 | return 0; | 744 | return 0; |
745 | } | 745 | } |
746 | 746 | ||
747 | static int cxusb_dtt7579_tuner_attach(struct dvb_usb_adapter *adap) | 747 | static int cxusb_dtt7579_tuner_attach(struct dvb_usb_adapter *adap) |
748 | { | 748 | { |
749 | dvb_attach(dvb_pll_attach, adap->fe, 0x60, | 749 | dvb_attach(dvb_pll_attach, adap->fe[0], 0x60, |
750 | NULL, DVB_PLL_THOMSON_DTT7579); | 750 | NULL, DVB_PLL_THOMSON_DTT7579); |
751 | return 0; | 751 | return 0; |
752 | } | 752 | } |
753 | 753 | ||
754 | static int cxusb_lgh064f_tuner_attach(struct dvb_usb_adapter *adap) | 754 | static int cxusb_lgh064f_tuner_attach(struct dvb_usb_adapter *adap) |
755 | { | 755 | { |
756 | dvb_attach(simple_tuner_attach, adap->fe, | 756 | dvb_attach(simple_tuner_attach, adap->fe[0], |
757 | &adap->dev->i2c_adap, 0x61, TUNER_LG_TDVS_H06XF); | 757 | &adap->dev->i2c_adap, 0x61, TUNER_LG_TDVS_H06XF); |
758 | return 0; | 758 | return 0; |
759 | } | 759 | } |
@@ -795,9 +795,9 @@ static int cxusb_dvico_xc3028_tuner_attach(struct dvb_usb_adapter *adap) | |||
795 | }; | 795 | }; |
796 | 796 | ||
797 | /* FIXME: generalize & move to common area */ | 797 | /* FIXME: generalize & move to common area */ |
798 | adap->fe->callback = dvico_bluebird_xc2028_callback; | 798 | adap->fe[0]->callback = dvico_bluebird_xc2028_callback; |
799 | 799 | ||
800 | fe = dvb_attach(xc2028_attach, adap->fe, &cfg); | 800 | fe = dvb_attach(xc2028_attach, adap->fe[0], &cfg); |
801 | if (fe == NULL || fe->ops.tuner_ops.set_config == NULL) | 801 | if (fe == NULL || fe->ops.tuner_ops.set_config == NULL) |
802 | return -EIO; | 802 | return -EIO; |
803 | 803 | ||
@@ -808,7 +808,7 @@ static int cxusb_dvico_xc3028_tuner_attach(struct dvb_usb_adapter *adap) | |||
808 | 808 | ||
809 | static int cxusb_mxl5003s_tuner_attach(struct dvb_usb_adapter *adap) | 809 | static int cxusb_mxl5003s_tuner_attach(struct dvb_usb_adapter *adap) |
810 | { | 810 | { |
811 | dvb_attach(mxl5005s_attach, adap->fe, | 811 | dvb_attach(mxl5005s_attach, adap->fe[0], |
812 | &adap->dev->i2c_adap, &aver_a868r_tuner); | 812 | &adap->dev->i2c_adap, &aver_a868r_tuner); |
813 | return 0; | 813 | return 0; |
814 | } | 814 | } |
@@ -816,7 +816,7 @@ static int cxusb_mxl5003s_tuner_attach(struct dvb_usb_adapter *adap) | |||
816 | static int cxusb_d680_dmb_tuner_attach(struct dvb_usb_adapter *adap) | 816 | static int cxusb_d680_dmb_tuner_attach(struct dvb_usb_adapter *adap) |
817 | { | 817 | { |
818 | struct dvb_frontend *fe; | 818 | struct dvb_frontend *fe; |
819 | fe = dvb_attach(mxl5005s_attach, adap->fe, | 819 | fe = dvb_attach(mxl5005s_attach, adap->fe[0], |
820 | &adap->dev->i2c_adap, &d680_dmb_tuner); | 820 | &adap->dev->i2c_adap, &d680_dmb_tuner); |
821 | return (fe == NULL) ? -EIO : 0; | 821 | return (fe == NULL) ? -EIO : 0; |
822 | } | 822 | } |
@@ -824,7 +824,7 @@ static int cxusb_d680_dmb_tuner_attach(struct dvb_usb_adapter *adap) | |||
824 | static int cxusb_mygica_d689_tuner_attach(struct dvb_usb_adapter *adap) | 824 | static int cxusb_mygica_d689_tuner_attach(struct dvb_usb_adapter *adap) |
825 | { | 825 | { |
826 | struct dvb_frontend *fe; | 826 | struct dvb_frontend *fe; |
827 | fe = dvb_attach(max2165_attach, adap->fe, | 827 | fe = dvb_attach(max2165_attach, adap->fe[0], |
828 | &adap->dev->i2c_adap, &mygica_d689_max2165_cfg); | 828 | &adap->dev->i2c_adap, &mygica_d689_max2165_cfg); |
829 | return (fe == NULL) ? -EIO : 0; | 829 | return (fe == NULL) ? -EIO : 0; |
830 | } | 830 | } |
@@ -837,7 +837,7 @@ static int cxusb_cx22702_frontend_attach(struct dvb_usb_adapter *adap) | |||
837 | 837 | ||
838 | cxusb_ctrl_msg(adap->dev, CMD_DIGITAL, NULL, 0, &b, 1); | 838 | cxusb_ctrl_msg(adap->dev, CMD_DIGITAL, NULL, 0, &b, 1); |
839 | 839 | ||
840 | if ((adap->fe = dvb_attach(cx22702_attach, &cxusb_cx22702_config, | 840 | if ((adap->fe[0] = dvb_attach(cx22702_attach, &cxusb_cx22702_config, |
841 | &adap->dev->i2c_adap)) != NULL) | 841 | &adap->dev->i2c_adap)) != NULL) |
842 | return 0; | 842 | return 0; |
843 | 843 | ||
@@ -851,7 +851,7 @@ static int cxusb_lgdt3303_frontend_attach(struct dvb_usb_adapter *adap) | |||
851 | 851 | ||
852 | cxusb_ctrl_msg(adap->dev, CMD_DIGITAL, NULL, 0, NULL, 0); | 852 | cxusb_ctrl_msg(adap->dev, CMD_DIGITAL, NULL, 0, NULL, 0); |
853 | 853 | ||
854 | if ((adap->fe = dvb_attach(lgdt330x_attach, &cxusb_lgdt3303_config, | 854 | if ((adap->fe[0] = dvb_attach(lgdt330x_attach, &cxusb_lgdt3303_config, |
855 | &adap->dev->i2c_adap)) != NULL) | 855 | &adap->dev->i2c_adap)) != NULL) |
856 | return 0; | 856 | return 0; |
857 | 857 | ||
@@ -860,9 +860,9 @@ static int cxusb_lgdt3303_frontend_attach(struct dvb_usb_adapter *adap) | |||
860 | 860 | ||
861 | static int cxusb_aver_lgdt3303_frontend_attach(struct dvb_usb_adapter *adap) | 861 | static int cxusb_aver_lgdt3303_frontend_attach(struct dvb_usb_adapter *adap) |
862 | { | 862 | { |
863 | adap->fe = dvb_attach(lgdt330x_attach, &cxusb_aver_lgdt3303_config, | 863 | adap->fe[0] = dvb_attach(lgdt330x_attach, &cxusb_aver_lgdt3303_config, |
864 | &adap->dev->i2c_adap); | 864 | &adap->dev->i2c_adap); |
865 | if (adap->fe != NULL) | 865 | if (adap->fe[0] != NULL) |
866 | return 0; | 866 | return 0; |
867 | 867 | ||
868 | return -EIO; | 868 | return -EIO; |
@@ -876,7 +876,7 @@ static int cxusb_mt352_frontend_attach(struct dvb_usb_adapter *adap) | |||
876 | 876 | ||
877 | cxusb_ctrl_msg(adap->dev, CMD_DIGITAL, NULL, 0, NULL, 0); | 877 | cxusb_ctrl_msg(adap->dev, CMD_DIGITAL, NULL, 0, NULL, 0); |
878 | 878 | ||
879 | if ((adap->fe = dvb_attach(mt352_attach, &cxusb_mt352_config, | 879 | if ((adap->fe[0] = dvb_attach(mt352_attach, &cxusb_mt352_config, |
880 | &adap->dev->i2c_adap)) != NULL) | 880 | &adap->dev->i2c_adap)) != NULL) |
881 | return 0; | 881 | return 0; |
882 | 882 | ||
@@ -890,9 +890,9 @@ static int cxusb_dee1601_frontend_attach(struct dvb_usb_adapter *adap) | |||
890 | 890 | ||
891 | cxusb_ctrl_msg(adap->dev, CMD_DIGITAL, NULL, 0, NULL, 0); | 891 | cxusb_ctrl_msg(adap->dev, CMD_DIGITAL, NULL, 0, NULL, 0); |
892 | 892 | ||
893 | if (((adap->fe = dvb_attach(mt352_attach, &cxusb_dee1601_config, | 893 | if (((adap->fe[0] = dvb_attach(mt352_attach, &cxusb_dee1601_config, |
894 | &adap->dev->i2c_adap)) != NULL) || | 894 | &adap->dev->i2c_adap)) != NULL) || |
895 | ((adap->fe = dvb_attach(zl10353_attach, | 895 | ((adap->fe[0] = dvb_attach(zl10353_attach, |
896 | &cxusb_zl10353_dee1601_config, | 896 | &cxusb_zl10353_dee1601_config, |
897 | &adap->dev->i2c_adap)) != NULL)) | 897 | &adap->dev->i2c_adap)) != NULL)) |
898 | return 0; | 898 | return 0; |
@@ -917,7 +917,7 @@ static int cxusb_dualdig4_frontend_attach(struct dvb_usb_adapter *adap) | |||
917 | cxusb_bluebird_gpio_pulse(adap->dev, 0x01, 1); | 917 | cxusb_bluebird_gpio_pulse(adap->dev, 0x01, 1); |
918 | cxusb_bluebird_gpio_pulse(adap->dev, 0x02, 1); | 918 | cxusb_bluebird_gpio_pulse(adap->dev, 0x02, 1); |
919 | 919 | ||
920 | if ((adap->fe = dvb_attach(zl10353_attach, | 920 | if ((adap->fe[0] = dvb_attach(zl10353_attach, |
921 | &cxusb_zl10353_xc3028_config_no_i2c_gate, | 921 | &cxusb_zl10353_xc3028_config_no_i2c_gate, |
922 | &adap->dev->i2c_adap)) == NULL) | 922 | &adap->dev->i2c_adap)) == NULL) |
923 | return -EIO; | 923 | return -EIO; |
@@ -1031,9 +1031,9 @@ static int cxusb_dualdig4_rev2_frontend_attach(struct dvb_usb_adapter *adap) | |||
1031 | return -ENODEV; | 1031 | return -ENODEV; |
1032 | } | 1032 | } |
1033 | 1033 | ||
1034 | adap->fe = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80, | 1034 | adap->fe[0] = dvb_attach(dib7000p_attach, &adap->dev->i2c_adap, 0x80, |
1035 | &cxusb_dualdig4_rev2_config); | 1035 | &cxusb_dualdig4_rev2_config); |
1036 | if (adap->fe == NULL) | 1036 | if (adap->fe[0] == NULL) |
1037 | return -EIO; | 1037 | return -EIO; |
1038 | 1038 | ||
1039 | return 0; | 1039 | return 0; |
@@ -1084,15 +1084,15 @@ static int cxusb_dualdig4_rev2_tuner_attach(struct dvb_usb_adapter *adap) | |||
1084 | { | 1084 | { |
1085 | struct dib0700_adapter_state *st = adap->priv; | 1085 | struct dib0700_adapter_state *st = adap->priv; |
1086 | struct i2c_adapter *tun_i2c = | 1086 | struct i2c_adapter *tun_i2c = |
1087 | dib7000p_get_i2c_master(adap->fe, | 1087 | dib7000p_get_i2c_master(adap->fe[0], |
1088 | DIBX000_I2C_INTERFACE_TUNER, 1); | 1088 | DIBX000_I2C_INTERFACE_TUNER, 1); |
1089 | 1089 | ||
1090 | if (dvb_attach(dib0070_attach, adap->fe, tun_i2c, | 1090 | if (dvb_attach(dib0070_attach, adap->fe[0], tun_i2c, |
1091 | &dib7070p_dib0070_config) == NULL) | 1091 | &dib7070p_dib0070_config) == NULL) |
1092 | return -ENODEV; | 1092 | return -ENODEV; |
1093 | 1093 | ||
1094 | st->set_param_save = adap->fe->ops.tuner_ops.set_params; | 1094 | st->set_param_save = adap->fe[0]->ops.tuner_ops.set_params; |
1095 | adap->fe->ops.tuner_ops.set_params = dib7070_set_param_override; | 1095 | adap->fe[0]->ops.tuner_ops.set_params = dib7070_set_param_override; |
1096 | return 0; | 1096 | return 0; |
1097 | } | 1097 | } |
1098 | 1098 | ||
@@ -1108,12 +1108,12 @@ static int cxusb_nano2_frontend_attach(struct dvb_usb_adapter *adap) | |||
1108 | cxusb_bluebird_gpio_pulse(adap->dev, 0x01, 1); | 1108 | cxusb_bluebird_gpio_pulse(adap->dev, 0x01, 1); |
1109 | cxusb_bluebird_gpio_pulse(adap->dev, 0x02, 1); | 1109 | cxusb_bluebird_gpio_pulse(adap->dev, 0x02, 1); |
1110 | 1110 | ||
1111 | if ((adap->fe = dvb_attach(zl10353_attach, | 1111 | if ((adap->fe[0] = dvb_attach(zl10353_attach, |
1112 | &cxusb_zl10353_xc3028_config, | 1112 | &cxusb_zl10353_xc3028_config, |
1113 | &adap->dev->i2c_adap)) != NULL) | 1113 | &adap->dev->i2c_adap)) != NULL) |
1114 | return 0; | 1114 | return 0; |
1115 | 1115 | ||
1116 | if ((adap->fe = dvb_attach(mt352_attach, | 1116 | if ((adap->fe[0] = dvb_attach(mt352_attach, |
1117 | &cxusb_mt352_xc3028_config, | 1117 | &cxusb_mt352_xc3028_config, |
1118 | &adap->dev->i2c_adap)) != NULL) | 1118 | &adap->dev->i2c_adap)) != NULL) |
1119 | return 0; | 1119 | return 0; |
@@ -1172,8 +1172,8 @@ static int cxusb_d680_dmb_frontend_attach(struct dvb_usb_adapter *adap) | |||
1172 | msleep(100); | 1172 | msleep(100); |
1173 | 1173 | ||
1174 | /* Attach frontend */ | 1174 | /* Attach frontend */ |
1175 | adap->fe = dvb_attach(lgs8gxx_attach, &d680_lgs8gl5_cfg, &d->i2c_adap); | 1175 | adap->fe[0] = dvb_attach(lgs8gxx_attach, &d680_lgs8gl5_cfg, &d->i2c_adap); |
1176 | if (adap->fe == NULL) | 1176 | if (adap->fe[0] == NULL) |
1177 | return -EIO; | 1177 | return -EIO; |
1178 | 1178 | ||
1179 | return 0; | 1179 | return 0; |
@@ -1223,9 +1223,9 @@ static int cxusb_mygica_d689_frontend_attach(struct dvb_usb_adapter *adap) | |||
1223 | msleep(100); | 1223 | msleep(100); |
1224 | 1224 | ||
1225 | /* Attach frontend */ | 1225 | /* Attach frontend */ |
1226 | adap->fe = dvb_attach(atbm8830_attach, &mygica_d689_atbm8830_cfg, | 1226 | adap->fe[0] = dvb_attach(atbm8830_attach, &mygica_d689_atbm8830_cfg, |
1227 | &d->i2c_adap); | 1227 | &d->i2c_adap); |
1228 | if (adap->fe == NULL) | 1228 | if (adap->fe[0] == NULL) |
1229 | return -EIO; | 1229 | return -EIO; |
1230 | 1230 | ||
1231 | return 0; | 1231 | return 0; |