media: cx23885: Module option to disable analog video

Initialized and left to themselves some boards with analog inputs,
on some modern platforms can throw critical errors which prevents
even digital from working thereafter. If analog is never used this
module parameter allows analog to be disabled on a card by card
basis.

It is already possible to disable analog audio.

For example, to disable for Hauppauge QuadHD with analog functionality:

options cx23885 disable_analog_video=56,57

can be placed insode of /etc/modprobe.d/cx23885.conf

Signed-off-by: Bradford Love <brad@nextdimension.cc>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
This commit is contained in:
Bradford Love 2026-03-17 16:49:02 -05:00 committed by Hans Verkuil
parent 96c6d8e138
commit 08b34f01a9
4 changed files with 22 additions and 3 deletions

View File

@ -2443,6 +2443,9 @@ void cx23885_card_setup(struct cx23885_dev *dev)
case CX23885_BOARD_VIEWCAST_460E:
case CX23885_BOARD_AVERMEDIA_CE310B:
case CX23885_BOARD_AVERMEDIA_H789C:
if (dev->disable_analog)
break;
dev->sd_cx25840 = v4l2_i2c_new_subdev(&dev->v4l2_dev,
&dev->i2c_bus[2].i2c_adap,
"cx25840", 0x88 >> 1, NULL);

View File

@ -48,6 +48,11 @@ static unsigned int debug;
module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "enable debug messages");
static unsigned int disable_analog_video[8] = { 0, 0, 0, 0, 0, 0, 0, 0};
static int disable_analog_argc;
module_param_array(disable_analog_video, int, &disable_analog_argc, 0644);
MODULE_PARM_DESC(disable_analog_video, "disable analog video for card type");
static unsigned int card[] = {[0 ... (CX23885_MAXBOARDS - 1)] = UNSET };
module_param_array(card, int, NULL, 0444);
MODULE_PARM_DESC(card, "card type");
@ -924,6 +929,13 @@ static int cx23885_dev_setup(struct cx23885_dev *dev)
dev->board = CX23885_BOARD_HAUPPAUGE_QUADHD_DVB_885;
}
for (i = 0; i < disable_analog_argc; i++) {
if (disable_analog_video[i] == dev->board) {
pr_warn("Disabling analog for board %d\n", dev->board);
dev->disable_analog = 1;
}
}
/* If the user specific a clk freq override, apply it */
if (cx23885_boards[dev->board].clk_freq > 0)
dev->clk_freq = cx23885_boards[dev->board].clk_freq;
@ -1043,7 +1055,8 @@ static int cx23885_dev_setup(struct cx23885_dev *dev)
cx23885_gpio_enable(dev, 0x300, 0);
}
if (cx23885_boards[dev->board].porta == CX23885_ANALOG_VIDEO) {
if (cx23885_boards[dev->board].porta == CX23885_ANALOG_VIDEO &&
!dev->disable_analog) {
if (cx23885_video_register(dev) < 0) {
pr_err("%s() Failed to register analog video adapters on VID_A\n",
__func__);

View File

@ -2373,7 +2373,8 @@ static int dvb_register(struct cx23885_tsport *port)
port->i2c_client_tuner = client_tuner;
/* we only attach tuner for analog on the 888 version */
if (dev->board == CX23885_BOARD_HAUPPAUGE_QUADHD_DVB) {
if (dev->board == CX23885_BOARD_HAUPPAUGE_QUADHD_DVB &&
!dev->disable_analog) {
pr_info("%s(): QUADHD_DVB analog setup\n",
__func__);
dev->ts1.analog_fe.tuner_priv = client_tuner;
@ -2466,7 +2467,8 @@ static int dvb_register(struct cx23885_tsport *port)
port->i2c_client_tuner = client_tuner;
/* we only attach tuner for analog on the 888 version */
if (dev->board == CX23885_BOARD_HAUPPAUGE_QUADHD_ATSC) {
if (dev->board == CX23885_BOARD_HAUPPAUGE_QUADHD_ATSC &&
!dev->disable_analog) {
pr_info("%s(): QUADHD_ATSC analog setup\n",
__func__);
dev->ts1.analog_fe.tuner_priv = client_tuner;

View File

@ -404,6 +404,7 @@ struct cx23885_dev {
unsigned char radio_addr;
struct v4l2_subdev *sd_cx25840;
struct work_struct cx25840_work;
unsigned int disable_analog;
/* Infrared */
struct v4l2_subdev *sd_ir;