Commit bf5e3ef0 authored by Antti Palosaari's avatar Antti Palosaari Committed by Mauro Carvalho Chehab

[media] cx23885: add support for DVB I2C SEC client

Add support for I2C SEC (satellite equipment controller) client.
Signed-off-by: default avatarAntti Palosaari <crope@iki.fi>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 8022f9af
...@@ -1190,6 +1190,7 @@ static int dvb_register(struct cx23885_tsport *port) ...@@ -1190,6 +1190,7 @@ static int dvb_register(struct cx23885_tsport *port)
struct i2c_board_info info; struct i2c_board_info info;
struct i2c_adapter *adapter; struct i2c_adapter *adapter;
struct i2c_client *client_demod = NULL, *client_tuner = NULL; struct i2c_client *client_demod = NULL, *client_tuner = NULL;
struct i2c_client *client_sec = NULL;
const struct m88ds3103_config *p_m88ds3103_config = NULL; const struct m88ds3103_config *p_m88ds3103_config = NULL;
int (*p_set_voltage)(struct dvb_frontend *fe, fe_sec_voltage_t voltage) = NULL; int (*p_set_voltage)(struct dvb_frontend *fe, fe_sec_voltage_t voltage) = NULL;
int mfe_shared = 0; /* bus not shared by default */ int mfe_shared = 0; /* bus not shared by default */
...@@ -2242,6 +2243,14 @@ static int dvb_register(struct cx23885_tsport *port) ...@@ -2242,6 +2243,14 @@ static int dvb_register(struct cx23885_tsport *port)
return 0; return 0;
frontend_detach: frontend_detach:
/* remove I2C client for SEC */
client_sec = port->i2c_client_sec;
if (client_sec) {
module_put(client_sec->dev.driver->owner);
i2c_unregister_device(client_sec);
port->i2c_client_sec = NULL;
}
/* remove I2C client for tuner */ /* remove I2C client for tuner */
client_tuner = port->i2c_client_tuner; client_tuner = port->i2c_client_tuner;
if (client_tuner) { if (client_tuner) {
...@@ -2343,6 +2352,13 @@ int cx23885_dvb_unregister(struct cx23885_tsport *port) ...@@ -2343,6 +2352,13 @@ int cx23885_dvb_unregister(struct cx23885_tsport *port)
i2c_unregister_device(client); i2c_unregister_device(client);
} }
/* remove I2C client for SEC */
client = port->i2c_client_sec;
if (client) {
module_put(client->dev.driver->owner);
i2c_unregister_device(client);
}
/* remove I2C client for tuner */ /* remove I2C client for tuner */
client = port->i2c_client_tuner; client = port->i2c_client_tuner;
if (client) { if (client) {
......
...@@ -304,6 +304,7 @@ struct cx23885_tsport { ...@@ -304,6 +304,7 @@ struct cx23885_tsport {
struct i2c_client *i2c_client_demod; struct i2c_client *i2c_client_demod;
struct i2c_client *i2c_client_tuner; struct i2c_client *i2c_client_tuner;
struct i2c_client *i2c_client_sec;
struct i2c_client *i2c_client_ci; struct i2c_client *i2c_client_ci;
int (*set_frontend)(struct dvb_frontend *fe); int (*set_frontend)(struct dvb_frontend *fe);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment