|
@@ -55,6 +55,8 @@
|
|
#include "mb86a20s.h"
|
|
#include "mb86a20s.h"
|
|
#include "m88ds3103.h"
|
|
#include "m88ds3103.h"
|
|
#include "m88ts2022.h"
|
|
#include "m88ts2022.h"
|
|
|
|
+#include "si2168.h"
|
|
|
|
+#include "si2157.h"
|
|
|
|
|
|
MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>");
|
|
MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@infradead.org>");
|
|
MODULE_LICENSE("GPL");
|
|
MODULE_LICENSE("GPL");
|
|
@@ -93,6 +95,7 @@ struct em28xx_dvb {
|
|
struct semaphore pll_mutex;
|
|
struct semaphore pll_mutex;
|
|
bool dont_attach_fe1;
|
|
bool dont_attach_fe1;
|
|
int lna_gpio;
|
|
int lna_gpio;
|
|
|
|
+ struct i2c_client *i2c_client_demod;
|
|
struct i2c_client *i2c_client_tuner;
|
|
struct i2c_client *i2c_client_tuner;
|
|
};
|
|
};
|
|
|
|
|
|
@@ -1496,6 +1499,62 @@ static int em28xx_dvb_init(struct em28xx *dev)
|
|
dvb->i2c_client_tuner = client;
|
|
dvb->i2c_client_tuner = client;
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
|
|
+ case EM28178_BOARD_PCTV_292E:
|
|
|
|
+ {
|
|
|
|
+ struct i2c_adapter *adapter;
|
|
|
|
+ struct i2c_client *client;
|
|
|
|
+ struct i2c_board_info info;
|
|
|
|
+ struct si2168_config si2168_config;
|
|
|
|
+ struct si2157_config si2157_config;
|
|
|
|
+
|
|
|
|
+ /* attach demod */
|
|
|
|
+ si2168_config.i2c_adapter = &adapter;
|
|
|
|
+ si2168_config.fe = &dvb->fe[0];
|
|
|
|
+ memset(&info, 0, sizeof(struct i2c_board_info));
|
|
|
|
+ strlcpy(info.type, "si2168", I2C_NAME_SIZE);
|
|
|
|
+ info.addr = 0x64;
|
|
|
|
+ info.platform_data = &si2168_config;
|
|
|
|
+ request_module(info.type);
|
|
|
|
+ client = i2c_new_device(&dev->i2c_adap[dev->def_i2c_bus], &info);
|
|
|
|
+ if (client == NULL || client->dev.driver == NULL) {
|
|
|
|
+ result = -ENODEV;
|
|
|
|
+ goto out_free;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (!try_module_get(client->dev.driver->owner)) {
|
|
|
|
+ i2c_unregister_device(client);
|
|
|
|
+ result = -ENODEV;
|
|
|
|
+ goto out_free;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ dvb->i2c_client_demod = client;
|
|
|
|
+
|
|
|
|
+ /* attach tuner */
|
|
|
|
+ si2157_config.fe = dvb->fe[0];
|
|
|
|
+ memset(&info, 0, sizeof(struct i2c_board_info));
|
|
|
|
+ strlcpy(info.type, "si2157", I2C_NAME_SIZE);
|
|
|
|
+ info.addr = 0x60;
|
|
|
|
+ info.platform_data = &si2157_config;
|
|
|
|
+ request_module(info.type);
|
|
|
|
+ client = i2c_new_device(adapter, &info);
|
|
|
|
+ if (client == NULL || client->dev.driver == NULL) {
|
|
|
|
+ module_put(dvb->i2c_client_demod->dev.driver->owner);
|
|
|
|
+ i2c_unregister_device(dvb->i2c_client_demod);
|
|
|
|
+ result = -ENODEV;
|
|
|
|
+ goto out_free;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (!try_module_get(client->dev.driver->owner)) {
|
|
|
|
+ i2c_unregister_device(client);
|
|
|
|
+ module_put(dvb->i2c_client_demod->dev.driver->owner);
|
|
|
|
+ i2c_unregister_device(dvb->i2c_client_demod);
|
|
|
|
+ result = -ENODEV;
|
|
|
|
+ goto out_free;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ dvb->i2c_client_tuner = client;
|
|
|
|
+ }
|
|
|
|
+ break;
|
|
default:
|
|
default:
|
|
em28xx_errdev("/2: The frontend of your DVB/ATSC card"
|
|
em28xx_errdev("/2: The frontend of your DVB/ATSC card"
|
|
" isn't supported yet\n");
|
|
" isn't supported yet\n");
|
|
@@ -1582,6 +1641,13 @@ static int em28xx_dvb_fini(struct em28xx *dev)
|
|
i2c_unregister_device(client);
|
|
i2c_unregister_device(client);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /* remove I2C demod */
|
|
|
|
+ client = dvb->i2c_client_demod;
|
|
|
|
+ if (client) {
|
|
|
|
+ module_put(client->dev.driver->owner);
|
|
|
|
+ i2c_unregister_device(client);
|
|
|
|
+ }
|
|
|
|
+
|
|
em28xx_unregister_dvb(dvb);
|
|
em28xx_unregister_dvb(dvb);
|
|
kfree(dvb);
|
|
kfree(dvb);
|
|
dev->dvb = NULL;
|
|
dev->dvb = NULL;
|
|
@@ -1647,6 +1713,13 @@ static int em28xx_dvb_resume(struct em28xx *dev)
|
|
i2c_unregister_device(client);
|
|
i2c_unregister_device(client);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /* remove I2C demod */
|
|
|
|
+ client = dvb->i2c_client_demod;
|
|
|
|
+ if (client) {
|
|
|
|
+ module_put(client->dev.driver->owner);
|
|
|
|
+ i2c_unregister_device(client);
|
|
|
|
+ }
|
|
|
|
+
|
|
em28xx_unregister_dvb(dvb);
|
|
em28xx_unregister_dvb(dvb);
|
|
kfree(dvb);
|
|
kfree(dvb);
|
|
dev->dvb = NULL;
|
|
dev->dvb = NULL;
|