hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/media/usb/dvb-usb/pctv452e.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * PCTV 452e DVB driver
34 *
....@@ -5,11 +6,6 @@
56 *
67 * TT connect S2-3650-CI Common Interface support, MAC readout
78 * Copyright (C) 2008 Michael H. Schimek <mschimek@gmx.at>
8
- *
9
- * This program is free software; you can redistribute it and/or
10
- * modify it under the terms of the GNU General Public License as
11
- * published by the Free Software Foundation; either version 2 of
12
- * the License, or (at your option) any later version.
139 */
1410
1511 /* dvb usb framework */
....@@ -24,6 +20,7 @@
2420 #include "stb6100.h"
2521 #include "stb6100_cfg.h"
2622 /* FE Power */
23
+#include "isl6423.h"
2724 #include "lnbp22.h"
2825
2926 #include <media/dvb_ca_en50221.h>
....@@ -85,6 +82,13 @@
8582 static struct stb0899_postproc pctv45e_postproc[] = {
8683 { PCTV_LED_GPIO, STB0899_GPIOPULLUP },
8784 { 0, 0 }
85
+};
86
+
87
+static struct isl6423_config pctv452e_isl6423_config = {
88
+ .current_max = SEC_CURRENT_515m,
89
+ .curlim = SEC_CURRENT_LIM_ON,
90
+ .mod_extern = 1,
91
+ .addr = 0x08,
8892 };
8993
9094 /*
....@@ -528,13 +532,13 @@
528532
529533 rx = b0 + 5;
530534
531
- /* hmm where shoud this should go? */
535
+ /* hmm where should this should go? */
532536 ret = usb_set_interface(d->udev, 0, ISOC_INTERFACE_ALTERNATIVE);
533537 if (ret != 0)
534538 info("%s: Warning set interface returned: %d\n",
535539 __func__, ret);
536540
537
- /* this is a one-time initialization, dont know where to put */
541
+ /* this is a one-time initialization, don't know where to put */
538542 b0[0] = 0xaa;
539543 b0[1] = state->c++;
540544 b0[2] = PCTV_CMD_RESET;
....@@ -913,15 +917,23 @@
913917 &a->dev->i2c_adap);
914918 if (!a->fe_adap[0].fe)
915919 return -ENODEV;
916
- if ((dvb_attach(lnbp22_attach, a->fe_adap[0].fe,
917
- &a->dev->i2c_adap)) == NULL)
918
- err("Cannot attach lnbp22\n");
919920
920921 id = a->dev->desc->warm_ids[0];
921
- if (USB_VID_TECHNOTREND == id->idVendor
922
- && USB_PID_TECHNOTREND_CONNECT_S2_3650_CI == id->idProduct)
922
+ if (id->idVendor == USB_VID_TECHNOTREND &&
923
+ id->idProduct == USB_PID_TECHNOTREND_CONNECT_S2_3650_CI) {
924
+ if (dvb_attach(lnbp22_attach,
925
+ a->fe_adap[0].fe,
926
+ &a->dev->i2c_adap) == NULL) {
927
+ err("Cannot attach lnbp22\n");
928
+ }
923929 /* Error ignored. */
924930 tt3650_ci_init(a);
931
+ } else if (dvb_attach(isl6423_attach,
932
+ a->fe_adap[0].fe,
933
+ &a->dev->i2c_adap,
934
+ &pctv452e_isl6423_config) == NULL) {
935
+ err("Cannot attach isl6423\n");
936
+ }
925937
926938 return 0;
927939 }