si2168: Add ts_mode config.
Subsystems (4)
PATCH 1/1 si2168: Add ts_mode config.
This patch adds the TS mode as a config option:
- ts_mode added to config struct.
- Possible (interesting) values are
* Parallel mode = 0x06
* Serial mode = 0x03
Currently the modules using this demod only use parallel mode.
Regards,
Luis
--- drivers/media/dvb-frontends/si2168.c | 17 ++++++++++------- drivers/media/dvb-frontends/si2168.h | 6 ++++++ drivers/media/usb/dvb-usb/cxusb.c | 1 + drivers/media/usb/em28xx/em28xx-dvb.c | 1 + 4 files changed, 18 insertions(+), 7 deletions(-)
drivers/media/dvb-frontends/si2168.c +10 -7
@@ -297,13 +297,6 @@ static int si2168_set_frontend(struct dvb_frontend *fe)if (ret) goto err; -memcpy (cmd.args,"\x14\x00\x01\x10\x16\x00" ,6 ); - cmd.wlen =6 ; - cmd.rlen =4 ; - ret =si2168_cmd_execute (s, &cmd); -if (ret) - goto err; -memcpy (cmd.args,"\x14\x00\x09\x10\xe3\x18" ,6 ); cmd.wlen =6 ; cmd.rlen =4 ;
@@ -350,6 +343,7 @@ err:static int si2168_init (struct dvb_frontend *fe) {struct si2168 *s = fe->demodulator_priv; +struct si2168_config *config = s->client->dev.platform_data;int ret, len, remaining;const struct firmware *fw =NULL ;u8 *fw_file;
@@ -479,6 +473,15 @@ static int si2168_init(struct dvb_frontend *fe)dev_info (&s->client->dev,"%s: found a '%s' in warm state\n" ,KBUILD_MODNAME , si2168_ops.info.name); +/* Set TSMODE */ +memcpy (cmd.args,"\x14\x00\x01\x10\x10\x00" ,6 ); + cmd.args[4 ] |= config->ts_mode; + cmd.wlen =6 ; + cmd.rlen =4 ; + ret =si2168_cmd_execute (s, &cmd); +if (ret) + goto err; + s->active = true;return 0 ;
drivers/media/dvb-frontends/si2168.h +6 -0
@@ -34,6 +34,12 @@ struct si2168_config {* returned by driver */ struct i2c_adapter **i2c_adapter; + +/* TS mode */ + u8 ts_mode; }; +#define SI2168_TSMODE_PARALLEL 0x06 +#define SI2168_TSMODE_SERIAL 0x03 +#endif
drivers/media/usb/dvb-usb/cxusb.c +1 -0
@@ -1369,6 +1369,7 @@ static int cxusb_tt_ct2_4400_attach(struct dvb_usb_adapter *adap)/* attach frontend */ si2168_config.i2c_adapter = &adapter; si2168_config.fe = &adap->fe_adap[0 ].fe; + si2168_config.ts_mode =SI2168_TSMODE_PARALLEL ;memset (&info,0 ,sizeof (struct i2c_board_info ));strlcpy (info.type,"si2168" ,I2C_NAME_SIZE ); info.addr =0x64 ;
drivers/media/usb/em28xx/em28xx-dvb.c +1 -0
@@ -1525,6 +1525,7 @@ static int em28xx_dvb_init(struct em28xx *dev)/* attach demod */ si2168_config.i2c_adapter = &adapter; si2168_config.fe = &dvb->fe[0 ]; + si2168_config.ts_mode =SI2168_TSMODE_PARALLEL ;memset (&info,0 ,sizeof (struct i2c_board_info ));strlcpy (info.type,"si2168" ,I2C_NAME_SIZE ); info.addr =0x64 ;
Signature · 1 line
1.9.1
Moikka
This cannot work. You refer config struct that is coming outside of driver. That means, caller must keep stuct, but it does not, and I really don't even like idea to leave it responsibility of caller. Due to that you will need copy all config values to driver state before return from probe().
regards
Antti
Quoted 103 lines · Luis Alves
This patch adds the TS mode as a config option:
-ts_modeadded to config struct.
- Possible (interesting) values are
* Parallel mode =0x06
* Serial mode =0x03Currently the modules using this demod only use parallel mode.
Regards,
LuisSigned-off-by Luis Alves <[email protected]>--- drivers/media/dvb-frontends/si2168.c | 17 ++++++++++------- drivers/media/dvb-frontends/si2168.h | 6 ++++++ drivers/media/usb/dvb-usb/cxusb.c | 1 + drivers/media/usb/em28xx/em28xx-dvb.c | 1 + 4 files changed, 18 insertions(+), 7 deletions(-)drivers/media/dvb-frontends/si2168.c +10
-7@@ -297,13 +297,6 @@ static int si2168_set_frontend(struct dvb_frontend *fe)if (ret) goto err; -memcpy (cmd.args,"\x14\x00\x01\x10\x16\x00" ,6 ); - cmd.wlen =6 ; - cmd.rlen =4 ; - ret =si2168_cmd_execute (s, &cmd); -if (ret) - goto err; -memcpy (cmd.args,"\x14\x00\x09\x10\xe3\x18" ,6 ); cmd.wlen =6 ; cmd.rlen =4 ;@@ -350,6 +343,7 @@ err:static int si2168_init (struct dvb_frontend *fe) {struct si2168 *s = fe->demodulator_priv; +struct si2168_config *config = s->client->dev.platform_data;int ret, len, remaining;const struct firmware *fw =NULL ;u8 *fw_file;@@ -479,6 +473,15 @@ static int si2168_init(struct dvb_frontend *fe)dev_info (&s->client->dev,"%s: found a '%s' in warm state\n" ,KBUILD_MODNAME , si2168_ops.info.name); +/* Set TSMODE */ +memcpy (cmd.args,"\x14\x00\x01\x10\x10\x00" ,6 ); + cmd.args[4 ] |= config->ts_mode; + cmd.wlen =6 ; + cmd.rlen =4 ; + ret =si2168_cmd_execute (s, &cmd); +if (ret) + goto err; + s->active = true;return 0 ;drivers/media/dvb-frontends/si2168.h +6
-0@@ -34,6 +34,12 @@ struct si2168_config {* returned by driver */ struct i2c_adapter **i2c_adapter; + +/* TS mode */ + u8 ts_mode; }; +#define SI2168_TSMODE_PARALLEL 0x06 +#define SI2168_TSMODE_SERIAL 0x03 +#endif drivers/media/usb/dvb-usb/cxusb.c +1
-0@@ -1369,6 +1369,7 @@ static int cxusb_tt_ct2_4400_attach(struct dvb_usb_adapter *adap)/* attach frontend */ si2168_config.i2c_adapter = &adapter; si2168_config.fe = &adap->fe_adap[0 ].fe; + si2168_config.ts_mode =SI2168_TSMODE_PARALLEL ;memset (&info,0 ,sizeof (struct i2c_board_info ));strlcpy (info.type,"si2168" ,I2C_NAME_SIZE ); info.addr =0x64 ;drivers/media/usb/em28xx/em28xx-dvb.c +1
-0@@ -1525,6 +1525,7 @@ static int em28xx_dvb_init(struct em28xx *dev)/* attach demod */ si2168_config.i2c_adapter = &adapter; si2168_config.fe = &dvb->fe[0 ]; + si2168_config.ts_mode =SI2168_TSMODE_PARALLEL ;memset (&info,0 ,sizeof (struct i2c_board_info ));strlcpy (info.type,"si2168" ,I2C_NAME_SIZE ); info.addr =0x64 ;
Signature · 1 line
http://palosaari.fi/
Hi Antti,
Yes, I know. I already had asked Mauro to reject it (on irc).
I'll send a fixed one soon.
Regards,
Luis
Quoted 125 lines · Antti Palosaari
Moikka
This cannot work. You refer config struct that is coming outside of driver. That means, caller must keep stuct, but it does not, and I really don't even like idea to leave it responsibility of caller. Due to that you will need copy all config values to driver state before return fromprobe().regards
AnttiQuoted 103 lines · Luis Alves
This patch adds the TS mode as a config option:
-ts_modeadded to config struct.
- Possible (interesting) values are
* Parallel mode =0x06
* Serial mode =0x03Currently the modules using this demod only use parallel mode.
Regards,
LuisSigned-off-by Luis Alves <[email protected]>--- drivers/media/dvb-frontends/si2168.c | 17 ++++++++++------- drivers/media/dvb-frontends/si2168.h | 6 ++++++ drivers/media/usb/dvb-usb/cxusb.c | 1 + drivers/media/usb/em28xx/em28xx-dvb.c | 1 + 4 files changed, 18 insertions(+), 7 deletions(-)drivers/media/dvb-frontends/si2168.c +0
-7@@ -297,13 +297,6 @@ static int si2168_set_frontend(struct dvb_frontend *fe)if (ret) goto err; -memcpy (cmd.args,"\x14\x00\x01\x10\x16\x00" ,6 ); - cmd.wlen =6 ; - cmd.rlen =4 ; - ret =si2168_cmd_execute (s, &cmd); -if (ret) - goto err; -memcpy (cmd.args,"\x14\x00\x09\x10\xe3\x18" ,6 ); cmd.wlen =6 ;cmd.rlen = 4;drivers/media/dvb-frontends/si2168.c +10
-0@@ -350,6 +343,7 @@ err:static int si2168_init (struct dvb_frontend *fe) {struct si2168 *s = fe->demodulator_priv; +struct si2168_config *config = s->client->dev.platform_data;int ret, len, remaining;const struct firmware *fw =NULL ;u8 *fw_file;@@ -479,6 +473,15 @@ static int si2168_init(struct dvb_frontend *fe)dev_info (&s->client->dev,"%s: found a '%s' in warm state\n" ,KBUILD_MODNAME , si2168_ops.info.name); +/* Set TSMODE */ +memcpy (cmd.args,"\x14\x00\x01\x10\x10\x00" ,6 ); + cmd.args[4 ] |= config->ts_mode; + cmd.wlen =6 ; + cmd.rlen =4 ; + ret =si2168_cmd_execute (s, &cmd); +if (ret) + goto err; + s->active = true;return 0 ;drivers/media/dvb-frontends/si2168.h +6
-0@@ -34,6 +34,12 @@ struct si2168_config {* returned by driver */ struct i2c_adapter **i2c_adapter; + +/* TS mode */ + u8 ts_mode; }; +#define SI2168_TSMODE_PARALLEL 0x06 +#define SI2168_TSMODE_SERIAL 0x03 +#endif drivers/media/usb/dvb-usb/cxusb.c +1
-0@@ -1369,6 +1369,7 @@ static int cxusb_tt_ct2_4400_attach(struct dvb_usb_adapter *adap)/* attach frontend */ si2168_config.i2c_adapter = &adapter; si2168_config.fe = &adap->fe_adap[0 ].fe; + si2168_config.ts_mode =SI2168_TSMODE_PARALLEL ;memset (&info,0 ,sizeof (struct i2c_board_info ));strlcpy (info.type,"si2168" ,I2C_NAME_SIZE );info.addr = 0x64;drivers/media/usb/em28xx/em28xx-dvb.c +0
-0drivers/media/usb/em28xx/em28xx-dvb.c static int em28xx_dvb_init(struct em28xx *dev) · line 1531
Quoted 7 lines
drivers/media/usb/em28xx/em28xx-dvb.c +1
-0@@ -1525,6 +1525,7 @@ static int em28xx_dvb_init(struct em28xx *dev)/* attach demod */ si2168_config.i2c_adapter = &adapter; si2168_config.fe = &dvb->fe[0 ]; + si2168_config.ts_mode =SI2168_TSMODE_PARALLEL ;memset (&info,0 ,sizeof (struct i2c_board_info ));strlcpy (info.type,"si2168" ,I2C_NAME_SIZE ); info.addr =0x64 ;