]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
media: cx23885: Module option to disable analog video
authorBradford Love <brad@nextdimension.cc>
Tue, 17 Mar 2026 21:49:02 +0000 (16:49 -0500)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Wed, 25 Mar 2026 17:27:25 +0000 (18:27 +0100)
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>
drivers/media/pci/cx23885/cx23885-cards.c
drivers/media/pci/cx23885/cx23885-core.c
drivers/media/pci/cx23885/cx23885-dvb.c
drivers/media/pci/cx23885/cx23885.h

index da23e7dfeef5cb6c86a8cffc6e78a020768ee157..95a84709d5a67321f97374f283a41327c425da1d 100644 (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);
index 0892a5fd137daf6fda4eb857e5ccea79000717b8..4a8af8b88d84d4c603144f7b00bcc85895cae24e 100644 (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__);
index 05a7859cbe5795bdb7d54510fe617f48ab486986..f240ccda40ed2bec21fc0c3c44042395022a5b62 100644 (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;
index 8ba1f306238cb3c136c1fbae8d29b581aeb566e5..8653ee1d9ba6cd35ecd4eef63077fe7be436d4ba 100644 (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;