Add Hauppauge HVR1955/1975 devices
Subsystems (3)
v5 cover Add Hauppauge HVR1955/1975 devices
Hauppauge device HVR1955 and HVR1975 are old Cypress based devices. When originally produced the demods were lacking upstream drivers and the tuner was unsupported. Well fast forward to now and the only thing missing is the identification of si2177 tuner in the si2157 driver, as well as extension of the pvrusb2 driver to accommodate i2c client devices and multiple frontends. This series addresses what is necessary.
QAM/ATSC are fully tested and work, the DVB tuning *should* work, but is completely untested. Both demod drivers are compatible with multiple frontend usage due to previous patches I've submitted, so things should work in pvrusb2 as well.
Composite video input is tested. Unable to test s-video, but it should work. Radio is fully untested. Analog TV is a work in progress, coming soon.
HVR-1955:
- LGDT3306a ATSC/QAM demod
- si2177 tuner
- cx25840 decoder for analog tv/composite/s-video/audio
HVR-1975 dual-frontend:
- LGDT3306a ATSC/QAM demod
- si2168 DVB-C/T/T2 demod
- si2177 tuner
- cx25840 decoder for analog tv/composite/s-video/audio
Since v4:
- Checkpatch strict fixes
Since v3:
- Fix firmware name to be consistent
Since v2:
- Patch 4/4 build fix
Changes since v1:
- Patch 4/4 build fixes and reorganization
Brad Love (4):
si2157: add detection of si2177 tuner
pvrusb2: Add multiple dvb frontend support
pvrusb2: Add i2c client demod/tuner support
pvrusb2: Add Hauppauge HVR1955/1975 devices
drivers/media/tuners/si2157.c | 6 + drivers/media/tuners/si2157_priv.h | 3 +- drivers/media/usb/pvrusb2/pvrusb2-cx2584x-v4l.c | 25 +++ drivers/media/usb/pvrusb2/pvrusb2-devattr.c | 202 +++++++++++++++++++++--- drivers/media/usb/pvrusb2/pvrusb2-devattr.h | 1 + drivers/media/usb/pvrusb2/pvrusb2-dvb.c | 88 ++++++++--- drivers/media/usb/pvrusb2/pvrusb2-dvb.h | 5 +- drivers/media/usb/pvrusb2/pvrusb2-fx2-cmd.h | 4 + drivers/media/usb/pvrusb2/pvrusb2-hdw.c | 36 ++++- 9 files changed, 330 insertions(+), 40 deletions(-)
Signature · 1 line
2.7.4
PATCH v5 1/4 si2157: add detection of si2177 tuner
Works in ATSC and QAM as is, DVB is completely untested.
Firmware required.
---
Changes since v4:
- No changes
Changes since v3:
- Fix firmware name to be consistent
drivers/media/tuners/si2157.c | 6 ++++++ drivers/media/tuners/si2157_priv.h | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-)
drivers/media/tuners/si2157.c +6 -0
@@ -138,6 +138,7 @@ static int si2157_init(struct dvb_frontend *fe) chip_id = cmd.args[1 ] <<24 | cmd.args[2 ] <<16 | cmd.args[3 ] <<8 | cmd.args[4 ] <<0 ; +#define SI2177_A30 ('A' << 24 | 77 << 16 | '3' << 8 | '0' << 0)#define SI2158_A20 ('A' << 24 | 58 << 16 | '2' << 8 | '0' << 0)#define SI2148_A20 ('A' << 24 | 48 << 16 | '2' << 8 | '0' << 0)#define SI2157_A30 ('A' << 24 | 57 << 16 | '3' << 8 | '0' << 0)
@@ -153,6 +154,9 @@ static int si2157_init(struct dvb_frontend *fe)case SI2141_A10 : fw_name =SI2141_A10_FIRMWARE ;break ; +case SI2177_A30 : + fw_name =SI2157_A30_FIRMWARE ; +break ;case SI2157_A30 :case SI2147_A30 :case SI2146_A10 :
@@ -529,6 +533,7 @@ static const struct i2c_device_id si2157_id_table[] = { {"si2157", SI2157_CHIPTYPE_SI2157}, {"si2146", SI2157_CHIPTYPE_SI2146}, {"si2141", SI2157_CHIPTYPE_SI2141}, + {"si2177", SI2157_CHIPTYPE_SI2177}, {} };MODULE_DEVICE_TABLE (i2c, si2157_id_table);
@@ -550,3 +555,4 @@ MODULE_AUTHOR("Antti Palosaari <[email protected]>");MODULE_LICENSE ("GPL" );MODULE_FIRMWARE (SI2158_A20_FIRMWARE );MODULE_FIRMWARE (SI2141_A10_FIRMWARE ); +MODULE_FIRMWARE (SI2157_A30_FIRMWARE );
drivers/media/tuners/si2157_priv.h +2 -1
@@ -50,6 +50,7 @@ struct si2157_dev {#define SI2157_CHIPTYPE_SI2157 0#define SI2157_CHIPTYPE_SI2146 1#define SI2157_CHIPTYPE_SI2141 2 +#define SI2157_CHIPTYPE_SI2177 3/* firmware command struct */ #define SI2157_ARGLEN 30
@@ -61,5 +62,5 @@ struct si2157_cmd {#define SI2158_A20_FIRMWARE "dvb-tuner-si2158-a20-01.fw"#define SI2141_A10_FIRMWARE "dvb-tuner-si2141-a10-01.fw" - +#define SI2157_A30_FIRMWARE "dvb-tuner-si2157-a30-01.fw"#endif
Signature · 1 line
2.7.4
PATCH v5 4/4 pvrusb2: Add Hauppauge HVR1955/1975 devices
In reply to Brad LoveIncludes support to identify and use two Hauppauge device. HVR-1955:
- LGDT3306a ATSC/QAM demod
- si2177 tuner
- cx25840 decoder for analog tv/composite/s-video/audio
HVR-1975 dual-frontend:
- LGDT3306a ATSC/QAM demod
- si2168 DVB-C/T/T2 demod
- si2177 tuner
- cx25840 decoder for analog tv/composite/s-video/audio
---
Since v4:
- checkpatch strict fixes
- change !0 initializations
Since v2:
- Fix build with VIDEO_PVRUSB2_DVB enabled Changes since v1:
- Fix build with VIDEO_PVRUSB2_DVB disabled
- Insert 160xxx code lower, so 75xxx profile is not split
- Reorganize 160xxx board profile
- Share config where possible
drivers/media/usb/pvrusb2/Kconfig | 2 + drivers/media/usb/pvrusb2/pvrusb2-cx2584x-v4l.c | 25 ++++ drivers/media/usb/pvrusb2/pvrusb2-devattr.c | 166 ++++++++++++++++++++++++ drivers/media/usb/pvrusb2/pvrusb2-devattr.h | 1 + drivers/media/usb/pvrusb2/pvrusb2-fx2-cmd.h | 4 + drivers/media/usb/pvrusb2/pvrusb2-hdw.c | 36 ++++- 6 files changed, 233 insertions(+), 1 deletion(-)
drivers/media/usb/pvrusb2/Kconfig +2 -0
@@ -41,6 +41,8 @@ config VIDEO_PVRUSB2_DVB select DVB_S5H1409 if MEDIA_SUBDRV_AUTOSELECT select DVB_S5H1411 if MEDIA_SUBDRV_AUTOSELECT select DVB_TDA10048 if MEDIA_SUBDRV_AUTOSELECT + select DVB_LGDT3306A if MEDIA_SUBDRV_AUTOSELECT + select DVB_SI2168 if MEDIA_SUBDRV_AUTOSELECT select MEDIA_TUNER_TDA18271 if MEDIA_SUBDRV_AUTOSELECT select MEDIA_TUNER_SIMPLE if MEDIA_SUBDRV_AUTOSELECT select MEDIA_TUNER_TDA8290 if MEDIA_SUBDRV_AUTOSELECT
drivers/media/usb/pvrusb2/pvrusb2-cx2584x-v4l.c +25 -0
@@ -111,10 +111,35 @@ static const struct routing_scheme routing_defav400 = { .cnt = ARRAY_SIZE(routing_schemeav400), }; +static const struct routing_scheme_item routing_scheme160xxx[] = { + [PVR2_CVAL_INPUT_TV ] = { + .vid =CX25840_COMPOSITE7 , + .aud =CX25840_AUDIO8 , + }, + [PVR2_CVAL_INPUT_RADIO ] = { + .vid =CX25840_COMPOSITE4 , + .aud =CX25840_AUDIO6 , + }, + [PVR2_CVAL_INPUT_COMPOSITE ] = { + .vid =CX25840_COMPOSITE3 , + .aud =CX25840_AUDIO_SERIAL , + }, + [PVR2_CVAL_INPUT_SVIDEO ] = { + .vid =CX25840_SVIDEO1 , + .aud =CX25840_AUDIO_SERIAL , + }, +}; + +static const struct routing_scheme routing_def160xxx = { + .def = routing_scheme160xxx, + .cnt =ARRAY_SIZE (routing_scheme160xxx), +}; +static const struct routing_scheme *routing_schemes[] = { [PVR2_ROUTING_SCHEME_HAUPPAUGE ] = &routing_def0, [PVR2_ROUTING_SCHEME_GOTVIEW ] = &routing_defgv, [PVR2_ROUTING_SCHEME_AV400 ] = &routing_defav400, + [PVR2_ROUTING_SCHEME_HAUP160XXX ] = &routing_def160xxx, };void pvr2_cx25840_subdev_update (struct pvr2_hdw *hdw,struct v4l2_subdev *sd)
drivers/media/usb/pvrusb2/pvrusb2-devattr.c +166 -0
185 lines not on this page · raw message
drivers/media/usb/pvrusb2/pvrusb2-devattr.h +1 -0
@@ -66,6 +66,7 @@ struct pvr2_string_table {#define PVR2_ROUTING_SCHEME_GOTVIEW 1#define PVR2_ROUTING_SCHEME_ONAIR 2#define PVR2_ROUTING_SCHEME_AV400 3 +#define PVR2_ROUTING_SCHEME_HAUP160XXX 4#define PVR2_DIGITAL_SCHEME_NONE 0#define PVR2_DIGITAL_SCHEME_HAUPPAUGE 1
drivers/media/usb/pvrusb2/pvrusb2-fx2-cmd.h +4 -0
@@ -38,6 +38,10 @@#define FX2CMD_FWPOST1 0x52u +/* These 2 only exist on Model 160xxx */ +#define FX2CMD_HCW_DEMOD_RESET_PIN 0xd4u +#define FX2CMD_HCW_MAKO_SLEEP_PIN 0xd5u +#define FX2CMD_POWER_OFF 0xdcu#define FX2CMD_POWER_ON 0xdeu
drivers/media/usb/pvrusb2/pvrusb2-hdw.c +35 -1
@@ -316,6 +316,8 @@ static const struct pvr2_fx2cmd_descdef pvr2_fx2cmd_desc[] = { {FX2CMD_ONAIR_DTV_STREAMING_OFF, "onair dtv stream off"}, {FX2CMD_ONAIR_DTV_POWER_ON, "onair dtv power on"}, {FX2CMD_ONAIR_DTV_POWER_OFF, "onair dtv power off"}, + {FX2CMD_HCW_DEMOD_RESET_PIN, "hcw demod reset pin"}, + {FX2CMD_HCW_MAKO_SLEEP_PIN, "hcw mako sleep pin"}, };
@@ -2139,10 +2141,28 @@ static void pvr2_hdw_setup_low(struct pvr2_hdw *hdw) ((0) << 16)); } -// This step MUST happen after the earlier powerup step. +/* This step MUST happen after the earlier powerup step */ pvr2_i2c_core_init (hdw);if (!pvr2_hdw_dev_ok (hdw))return ; +/* Reset demod only on Hauppauge 160xxx platform */ +if (hdw->usb_dev->descriptor.idVendor ==0x2040 && + (hdw->usb_dev->descriptor.idProduct ==0x7502 || + hdw->usb_dev->descriptor.idProduct ==0x7510 )) { +pr_info ("%s(): resetting 160xxx demod\n" , __func__); +/* TODO: not sure this is proper place to reset once only */ +pvr2_issue_simple_cmd (hdw, +FX2CMD_HCW_DEMOD_RESET_PIN | + (1 <<8 ) | + ((0 ) <<16 )); +usleep_range (10000 ,10500 ); +pvr2_issue_simple_cmd (hdw, +FX2CMD_HCW_DEMOD_RESET_PIN | + (1 <<8 ) | + ((1 ) <<16 )); +usleep_range (10000 ,10500 ); + } +pvr2_hdw_load_modules (hdw);if (!pvr2_hdw_dev_ok (hdw))return ;
@@ -4012,6 +4032,20 @@ int pvr2_hdw_cmd_decoder_reset(struct pvr2_hdw *hdw)static int pvr2_hdw_cmd_hcw_demod_reset (struct pvr2_hdw *hdw,int onoff) { hdw->flag_ok = !0 ; + +/* Use this for Hauppauge 160xxx only */ +if (hdw->usb_dev->descriptor.idVendor ==0x2040 && + (hdw->usb_dev->descriptor.idProduct ==0x7502 || + hdw->usb_dev->descriptor.idProduct ==0x7510 )) { +pr_debug ("%s(): resetting demod on Hauppauge 160xxx platform skipped\n" , + __func__); +/* Can't reset 160xxx or it will trash Demod tristate */ +return pvr2_issue_simple_cmd (hdw, +FX2CMD_HCW_MAKO_SLEEP_PIN | + (1 <<8 ) | + ((onoff ?1 :0 ) <<16 )); + } + return pvr2_issue_simple_cmd(hdw, FX2CMD_HCW_DEMOD_RESETIN | (1 << 8) |
Signature · 1 line
2.7.4
PATCH v5 3/4 pvrusb2: Add i2c client demod/tuner support
In reply to Brad Lovei2c client device is the "new" method to attach to dvb modules, include support for this functionality. Cleanup code has been added to init in case of failure, as well as to frontend exit.
Required by Hauppauge HVR-19x5 with si2168/lgdt3306a/si2177
---
Since v4:
- commit message expansion
drivers/media/usb/pvrusb2/pvrusb2-dvb.c | 11 +++++++++++ drivers/media/usb/pvrusb2/pvrusb2-dvb.h | 3 +++ 2 files changed, 14 insertions(+)
drivers/media/usb/pvrusb2/pvrusb2-dvb.c +11 -0
@@ -404,6 +404,9 @@ static int pvr2_dvb_frontend_init(struct pvr2_dvb_adapter *adap) fail_frontend0:dvb_frontend_detach (adap->fe[0 ]); adap->fe[0 ] =NULL ; +dvb_module_release (adap->i2c_client_tuner); +dvb_module_release (adap->i2c_client_demod[1 ]); +dvb_module_release (adap->i2c_client_demod[0 ]);return ret; }
@@ -420,6 +423,14 @@ static int pvr2_dvb_frontend_exit(struct pvr2_dvb_adapter *adap)dvb_frontend_detach (adap->fe[0 ]); adap->fe[0 ] =NULL ; } + +dvb_module_release (adap->i2c_client_tuner); + adap->i2c_client_tuner =NULL ; +dvb_module_release (adap->i2c_client_demod[1 ]); + adap->i2c_client_demod[1 ] =NULL ; +dvb_module_release (adap->i2c_client_demod[0 ]); + adap->i2c_client_demod[0 ] =NULL ; +return 0 ; }
drivers/media/usb/pvrusb2/pvrusb2-dvb.h +3 -0
@@ -20,6 +20,9 @@ struct pvr2_dvb_adapter {struct dvb_net dvb_net;struct dvb_frontend *fe[2 ]; +struct i2c_client *i2c_client_demod[2 ]; +struct i2c_client *i2c_client_tuner; +int feedcount;int max_feed_count;
Signature · 1 line
2.7.4
PATCH v5 2/4 pvrusb2: Add multiple dvb frontend support
In reply to Brad LoveMultiple frontends are required by Hauppauge HVR-1975, which is added in a later commit.
All changes are equivalent and backwards compatible. All current devices have been changed to use fe[0]
Code has been added to dvb init to support cleanup after failure.
---
Since v4:
- checkpatch strict fixes
- commit message expansion
drivers/media/usb/pvrusb2/pvrusb2-devattr.c | 46 ++++++++--------- drivers/media/usb/pvrusb2/pvrusb2-dvb.c | 77 ++++++++++++++++++++++------- drivers/media/usb/pvrusb2/pvrusb2-dvb.h | 2 +- 3 files changed, 82 insertions(+), 43 deletions(-)
drivers/media/usb/pvrusb2/pvrusb2-devattr.c +23 -23
@@ -188,10 +188,10 @@ static struct lgdt330x_config pvr2_lgdt3303_config = {static int pvr2_lgdt3303_attach (struct pvr2_dvb_adapter *adap) { - adap->fe =dvb_attach (lgdt330x_attach, &pvr2_lgdt3303_config, -0x0e , - &adap->channel.hdw->i2c_adap); -if (adap->fe) + adap->fe[0 ] =dvb_attach (lgdt330x_attach, &pvr2_lgdt3303_config, +0x0e , + &adap->channel.hdw->i2c_adap); +if (adap->fe[0 ])return 0 ;return -EIO ;
@@ -199,7 +199,7 @@ static int pvr2_lgdt3303_attach(struct pvr2_dvb_adapter *adap)static int pvr2_lgh06xf_attach (struct pvr2_dvb_adapter *adap) { -dvb_attach (simple_tuner_attach, adap->fe, +dvb_attach (simple_tuner_attach, adap->fe[0 ], &adap->channel.hdw->i2c_adap,0x61 ,TUNER_LG_TDVS_H06XF );
@@ -248,10 +248,10 @@ static struct lgdt330x_config pvr2_lgdt3302_config = {static int pvr2_lgdt3302_attach (struct pvr2_dvb_adapter *adap) { - adap->fe =dvb_attach (lgdt330x_attach, &pvr2_lgdt3302_config, -0x0e , - &adap->channel.hdw->i2c_adap); -if (adap->fe) + adap->fe[0 ] =dvb_attach (lgdt330x_attach, &pvr2_lgdt3302_config, +0x0e , + &adap->channel.hdw->i2c_adap); +if (adap->fe[0 ])return 0 ;return -EIO ;
@@ -259,7 +259,7 @@ static int pvr2_lgdt3302_attach(struct pvr2_dvb_adapter *adap)static int pvr2_fcv1236d_attach (struct pvr2_dvb_adapter *adap) { -dvb_attach (simple_tuner_attach, adap->fe, +dvb_attach (simple_tuner_attach, adap->fe[0 ], &adap->channel.hdw->i2c_adap,0x61 ,TUNER_PHILIPS_FCV1236D );
@@ -335,9 +335,9 @@ static struct tda18271_config hauppauge_tda18271_dvb_config = {static int pvr2_tda10048_attach (struct pvr2_dvb_adapter *adap) { - adap->fe =dvb_attach (tda10048_attach, &hauppauge_tda10048_config, - &adap->channel.hdw->i2c_adap); -if (adap->fe) + adap->fe[0 ] =dvb_attach (tda10048_attach, &hauppauge_tda10048_config, + &adap->channel.hdw->i2c_adap); +if (adap->fe[0 ])return 0 ;return -EIO ;
@@ -345,10 +345,10 @@ static int pvr2_tda10048_attach(struct pvr2_dvb_adapter *adap)static int pvr2_73xxx_tda18271_8295_attach (struct pvr2_dvb_adapter *adap) { -dvb_attach (tda829x_attach, adap->fe, +dvb_attach (tda829x_attach, adap->fe[0 ], &adap->channel.hdw->i2c_adap,0x42 , &tda829x_no_probe); -dvb_attach (tda18271_attach, adap->fe,0x60 , +dvb_attach (tda18271_attach, adap->fe[0 ],0x60 , &adap->channel.hdw->i2c_adap, &hauppauge_tda18271_dvb_config);
@@ -433,9 +433,9 @@ static struct tda18271_config hauppauge_tda18271_config = {static int pvr2_s5h1409_attach (struct pvr2_dvb_adapter *adap) { - adap->fe =dvb_attach (s5h1409_attach, &pvr2_s5h1409_config, - &adap->channel.hdw->i2c_adap); -if (adap->fe) + adap->fe[0 ] =dvb_attach (s5h1409_attach, &pvr2_s5h1409_config, + &adap->channel.hdw->i2c_adap); +if (adap->fe[0 ])return 0 ;return -EIO ;
@@ -443,9 +443,9 @@ static int pvr2_s5h1409_attach(struct pvr2_dvb_adapter *adap)static int pvr2_s5h1411_attach (struct pvr2_dvb_adapter *adap) { - adap->fe =dvb_attach (s5h1411_attach, &pvr2_s5h1411_config, - &adap->channel.hdw->i2c_adap); -if (adap->fe) + adap->fe[0 ] =dvb_attach (s5h1411_attach, &pvr2_s5h1411_config, + &adap->channel.hdw->i2c_adap); +if (adap->fe[0 ])return 0 ;return -EIO ;
@@ -453,10 +453,10 @@ static int pvr2_s5h1411_attach(struct pvr2_dvb_adapter *adap)static int pvr2_tda18271_8295_attach (struct pvr2_dvb_adapter *adap) { -dvb_attach (tda829x_attach, adap->fe, +dvb_attach (tda829x_attach, adap->fe[0 ], &adap->channel.hdw->i2c_adap,0x42 , &tda829x_no_probe); -dvb_attach (tda18271_attach, adap->fe,0x60 , +dvb_attach (tda18271_attach, adap->fe[0 ],0x60 , &adap->channel.hdw->i2c_adap, &hauppauge_tda18271_config);
drivers/media/usb/pvrusb2/pvrusb2-dvb.c +58 -19
100 lines not on this page · raw message
drivers/media/usb/pvrusb2/pvrusb2-dvb.h +1 -1
@@ -18,7 +18,7 @@ struct pvr2_dvb_adapter {struct dmxdev dmxdev;struct dvb_demux demux;struct dvb_net dvb_net; -struct dvb_frontend *fe; +struct dvb_frontend *fe[2 ];int feedcount;int max_feed_count;
Signature · 1 line
2.7.4
kbuild test robot
build botRe: [PATCH v5 4/4] pvrusb2: Add Hauppauge HVR1955/1975 devices
In reply to Brad LoveThank you for the patch! Perhaps something to improve:
Hi Brad,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on linuxtv-media/master]
[also build test WARNING on v5.2-rc2]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Brad-Love/Add-Hauppauge-HVR1955-1975-devices/20190602-191815 base: git://linuxtv.org/media_tree.git master config: xtensa-allyesconfig (attached as .config) compiler: xtensa-linux-gcc (GCC) 7.4.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=7.4.0 make.cross ARCH=xtensa
If you fix the issue, kindly add following tag
All warnings (new ones prefixed by >>):
>> drivers/media/usb/pvrusb2/pvrusb2-devattr.c:649:23: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
.fx2_firmware.lst = pvr2_fw1_names_160xxx,
^~~~~~~~~~~~~~~~~~~~~
drivers/media/usb/pvrusb2/pvrusb2-devattr.c:673:23: warning: initialization discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
.fx2_firmware.lst = pvr2_fw1_names_160xxx,
^~~~~~~~~~~~~~~~~~~~~vim +/const +649 drivers/media/usb/pvrusb2/pvrusb2-devattr.c
643
644 static const struct pvr2_device_desc pvr2_device_160000 = {
645 .description = "WinTV HVR-1975 Model 160000",
646 .shortname = "160000",
647 .client_table.lst = pvr2_cli_160xxx,
648 .client_table.cnt = ARRAY_SIZE(pvr2_cli_160xxx),
> 649 .fx2_firmware.lst = pvr2_fw1_names_160xxx,
650 .fx2_firmware.cnt = ARRAY_SIZE(pvr2_fw1_names_160xxx),
651 .default_tuner_type = TUNER_ABSENT,
652 .flag_has_cx25840 = 1,
653 .flag_has_hauppauge_rom = 1,
654 .flag_has_analogtuner = 1,
655 .flag_has_composite = 1,
656 .flag_has_svideo = 1,
657 .flag_fx2_16kb = 1,
658 .signal_routing_scheme = PVR2_ROUTING_SCHEME_HAUPPAUGE,
659 .digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE,
660 .default_std_mask = V4L2_STD_NTSC_M,
661 .led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
662 .ir_scheme = PVR2_IR_SCHEME_ZILOG,
663 #ifdef CONFIG_VIDEO_PVRUSB2_DVB
664 .dvb_props = &pvr2_160000_dvb_props,
665 #endif
666 };
667
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
kbuild test robot
build botRe: [PATCH v5 4/4] pvrusb2: Add Hauppauge HVR1955/1975 devices
In reply to Brad LoveThank you for the patch! Perhaps something to improve:
Hi Brad,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on linuxtv-media/master]
[also build test WARNING on v5.2-rc2 next-20190531]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Brad-Love/Add-Hauppauge-HVR1955-1975-devices/20190602-191815 base: git://linuxtv.org/media_tree.git master reproduce: # apt-get install sparse # sparse version: v0.6.1-rc1-7-g2b96cd8-dirty make ARCH=x86_64 allmodconfig make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag
sparse warnings: (new ones prefixed by >>)
>> drivers/media/usb/pvrusb2/pvrusb2-hdw.c:2149:37: sparse: sparse: restricted __le16 degrades to integer
drivers/media/usb/pvrusb2/pvrusb2-hdw.c:2150:38: sparse: sparse: restricted __le16 degrades to integer drivers/media/usb/pvrusb2/pvrusb2-hdw.c:2151:38: sparse: sparse: restricted __le16 degrades to integer drivers/media/usb/pvrusb2/pvrusb2-hdw.c:4037:37: sparse: sparse: restricted __le16 degrades to integer drivers/media/usb/pvrusb2/pvrusb2-hdw.c:4038:38: sparse: sparse: restricted __le16 degrades to integer drivers/media/usb/pvrusb2/pvrusb2-hdw.c:4039:38: sparse: sparse: restricted __le16 degrades to integer
--
>> drivers/media/usb/pvrusb2/pvrusb2-devattr.c:649:37: sparse: sparse: incorrect type in initializer (different modifiers) @@ expected char const **lst @@ got char cchar const **lst @@ >> drivers/media/usb/pvrusb2/pvrusb2-devattr.c:649:37: sparse: expected char const **lst >> drivers/media/usb/pvrusb2/pvrusb2-devattr.c:649:37: sparse: got char const *const *
drivers/media/usb/pvrusb2/pvrusb2-devattr.c:673:37: sparse: sparse: incorrect type in initializer (different modifiers) @@ expected char const **lst @@ got char cchar const **lst @@
drivers/media/usb/pvrusb2/pvrusb2-devattr.c:673:37: sparse: expected char const **lst
drivers/media/usb/pvrusb2/pvrusb2-devattr.c:673:37: sparse: got char const *const *
vim +2149 drivers/media/usb/pvrusb2/pvrusb2-hdw.c
2092
2093
2094 static void pvr2_hdw_setup_low(struct pvr2_hdw *hdw)
2095 {
2096 int ret;
2097 unsigned int idx;
2098 struct pvr2_ctrl *cptr;
2099 int reloadFl = 0;
2100 if (hdw->hdw_desc->fx2_firmware.cnt) {
2101 if (!reloadFl) {
2102 reloadFl =
2103 (hdw->usb_intf->cur_altsetting->desc.bNumEndpoints
2104 == 0);
2105 if (reloadFl) {
2106 pvr2_trace(PVR2_TRACE_INIT,
2107 "USB endpoint config looks strange; possibly firmware needs to be loaded");
2108 }
2109 }
2110 if (!reloadFl) {
2111 reloadFl = !pvr2_hdw_check_firmware(hdw);
2112 if (reloadFl) {
2113 pvr2_trace(PVR2_TRACE_INIT,
2114 "Check for FX2 firmware failed; possibly firmware needs to be loaded");
2115 }
2116 }
2117 if (reloadFl) {
2118 if (pvr2_upload_firmware1(hdw) != 0) {
2119 pvr2_trace(PVR2_TRACE_ERROR_LEGS,
2120 "Failure uploading firmware1");
2121 }
2122 return;
2123 }
2124 }
2125 hdw->fw1_state = FW1_STATE_OK;
2126
2127 if (!pvr2_hdw_dev_ok(hdw)) return;
2128
2129 hdw->force_dirty = !0;
2130
2131 if (!hdw->hdw_desc->flag_no_powerup) {
2132 pvr2_hdw_cmd_powerup(hdw);
2133 if (!pvr2_hdw_dev_ok(hdw)) return;
2134 }
2135
2136 /* Take the IR chip out of reset, if appropriate */
2137 if (hdw->ir_scheme_active == PVR2_IR_SCHEME_ZILOG) {
2138 pvr2_issue_simple_cmd(hdw,
2139 FX2CMD_HCW_ZILOG_RESET |
2140 (1 << 8) |
2141 ((0) << 16));
2142 }
2143
2144 /* This step MUST happen after the earlier powerup step */
2145 pvr2_i2c_core_init(hdw);
2146 if (!pvr2_hdw_dev_ok(hdw)) return;
2147
2148 /* Reset demod only on Hauppauge 160xxx platform */
> 2149 if (hdw->usb_dev->descriptor.idVendor == 0x2040 &&
2150 (hdw->usb_dev->descriptor.idProduct == 0x7502 ||
2151 hdw->usb_dev->descriptor.idProduct == 0x7510)) {
2152 pr_info("%s(): resetting 160xxx demod\n", __func__);
2153 /* TODO: not sure this is proper place to reset once only */
2154 pvr2_issue_simple_cmd(hdw,
2155 FX2CMD_HCW_DEMOD_RESET_PIN |
2156 (1 << 8) |
2157 ((0) << 16));
2158 usleep_range(10000, 10500);
2159 pvr2_issue_simple_cmd(hdw,
2160 FX2CMD_HCW_DEMOD_RESET_PIN |
2161 (1 << 8) |
2162 ((1) << 16));
2163 usleep_range(10000, 10500);
2164 }
2165
2166 pvr2_hdw_load_modules(hdw);
2167 if (!pvr2_hdw_dev_ok(hdw)) return;
2168
2169 v4l2_device_call_all(&hdw->v4l2_dev, 0, core, load_fw);
2170
2171 for (idx = 0; idx < CTRLDEF_COUNT; idx++) {
2172 cptr = hdw->controls + idx;
2173 if (cptr->info->skip_init) continue;
2174 if (!cptr->info->set_value) continue;
2175 cptr->info->set_value(cptr,~0,cptr->info->default_value);
2176 }
2177
2178 pvr2_hdw_cx25840_vbi_hack(hdw);
2179
2180 /* Set up special default values for the television and radio
2181 frequencies here. It's not really important what these defaults
2182 are, but I set them to something usable in the Chicago area just
2183 to make driver testing a little easier. */ 2184
2185 hdw->freqValTelevision = default_tv_freq;
2186 hdw->freqValRadio = default_radio_freq;
2187
2188 // Do not use pvr2_reset_ctl_endpoints() here. It is not
2189 // thread-safe against the normal pvr2_send_request() mechanism.
2190 // (We should make it thread safe).
2191
2192 if (hdw->hdw_desc->flag_has_hauppauge_rom) {
2193 ret = pvr2_hdw_get_eeprom_addr(hdw);
2194 if (!pvr2_hdw_dev_ok(hdw)) return;
2195 if (ret < 0) {
2196 pvr2_trace(PVR2_TRACE_ERROR_LEGS,
2197 "Unable to determine location of eeprom, skipping");
2198 } else {
2199 hdw->eeprom_addr = ret;
2200 pvr2_eeprom_analyze(hdw);
2201 if (!pvr2_hdw_dev_ok(hdw)) return;
2202 }
2203 } else {
2204 hdw->tuner_type = hdw->hdw_desc->default_tuner_type;
2205 hdw->tuner_updated = !0;
2206 hdw->std_mask_eeprom = V4L2_STD_ALL;
2207 }
2208
2209 if (hdw->serial_number) {
2210 idx = scnprintf(hdw->identifier, sizeof(hdw->identifier) - 1,
2211 "sn-%lu", hdw->serial_number);
2212 } else if (hdw->unit_number >= 0) {
2213 idx = scnprintf(hdw->identifier, sizeof(hdw->identifier) - 1,
2214 "unit-%c",
2215 hdw->unit_number + 'a');
2216 } else {
2217 idx = scnprintf(hdw->identifier, sizeof(hdw->identifier) - 1,
2218 "unit-??");
2219 }
2220 hdw->identifier[idx] = 0;
2221
2222 pvr2_hdw_setup_std(hdw);
2223
2224 if (!get_default_tuner_type(hdw)) {
2225 pvr2_trace(PVR2_TRACE_INIT,
2226 "pvr2_hdw_setup: Tuner type overridden to %d",
2227 hdw->tuner_type);
2228 }
2229
2230
2231 if (!pvr2_hdw_dev_ok(hdw)) return;
2232
2233 if (hdw->hdw_desc->signal_routing_scheme ==
2234 PVR2_ROUTING_SCHEME_GOTVIEW) {
2235 /* Ensure that GPIO 11 is set to output for GOTVIEW
2236 hardware. */
2237 pvr2_hdw_gpio_chg_dir(hdw,(1 << 11),~0);
2238 }
2239
2240 pvr2_hdw_commit_setup(hdw);
2241
2242 hdw->vid_stream = pvr2_stream_create();
2243 if (!pvr2_hdw_dev_ok(hdw)) return;
2244 pvr2_trace(PVR2_TRACE_INIT,
2245 "pvr2_hdw_setup: video stream is %p",hdw->vid_stream);
2246 if (hdw->vid_stream) {
2247 idx = get_default_error_tolerance(hdw);
2248 if (idx) {
2249 pvr2_trace(PVR2_TRACE_INIT,
2250 "pvr2_hdw_setup: video stream %p setting tolerance %u",
2251 hdw->vid_stream,idx);
2252 }
2253 pvr2_stream_setup(hdw->vid_stream,hdw->usb_dev,
2254 PVR2_VID_ENDPOINT,idx);
2255 }
2256
2257 if (!pvr2_hdw_dev_ok(hdw)) return;
2258
2259 hdw->flag_init_ok = !0;
2260
2261 pvr2_hdw_state_sched(hdw);
2262 }
2263
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation