linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] si2157: Add support for spectrum inversion
       [not found] <1405411120-9569-1-git-send-email-zzam@gentoo.org>
@ 2014-07-15  7:58 ` Matthias Schwarzott
  2014-07-15 11:08   ` Antti Palosaari
  2014-07-15  7:58 ` [PATCH 2/2] si2157: Add get_if_frequency callback Matthias Schwarzott
  1 sibling, 1 reply; 11+ messages in thread
From: Matthias Schwarzott @ 2014-07-15  7:58 UTC (permalink / raw)
  To: crope; +Cc: Matthias Schwarzott, Linux Media Mailing List

This is needed for PCTV 522e support.
Modify all users of si2157_config to correctly initialize all not
mentioned values to 0.

Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
---
 drivers/media/tuners/si2157.c         | 3 +++
 drivers/media/tuners/si2157.h         | 5 +++++
 drivers/media/tuners/si2157_priv.h    | 1 +
 drivers/media/usb/dvb-usb/cxusb.c     | 3 +--
 drivers/media/usb/em28xx/em28xx-dvb.c | 5 +++--
 5 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c
index 329004f..4dbd3f1 100644
--- a/drivers/media/tuners/si2157.c
+++ b/drivers/media/tuners/si2157.c
@@ -253,6 +253,8 @@ static int si2157_set_params(struct dvb_frontend *fe)
 
 	memcpy(cmd.args, "\x14\x00\x03\x07\x00\x00", 6);
 	cmd.args[4] = delivery_system | bandwidth;
+	if (s->inversion)
+		cmd.args[5] = 0x01;
 	cmd.wlen = 6;
 	cmd.rlen = 1;
 	ret = si2157_cmd_execute(s, &cmd);
@@ -307,6 +309,7 @@ static int si2157_probe(struct i2c_client *client,
 
 	s->client = client;
 	s->fe = cfg->fe;
+	s->inversion = cfg->inversion;
 	mutex_init(&s->i2c_mutex);
 
 	/* check if the tuner is there */
diff --git a/drivers/media/tuners/si2157.h b/drivers/media/tuners/si2157.h
index 4465c46..6da4d5d 100644
--- a/drivers/media/tuners/si2157.h
+++ b/drivers/media/tuners/si2157.h
@@ -29,6 +29,11 @@ struct si2157_config {
 	 * frontend
 	 */
 	struct dvb_frontend *fe;
+
+	/*
+	 * Spectral Inversion
+	 */
+	bool inversion;
 };
 
 #endif
diff --git a/drivers/media/tuners/si2157_priv.h b/drivers/media/tuners/si2157_priv.h
index db79f3c..3ddab5e 100644
--- a/drivers/media/tuners/si2157_priv.h
+++ b/drivers/media/tuners/si2157_priv.h
@@ -26,6 +26,7 @@ struct si2157 {
 	struct i2c_client *client;
 	struct dvb_frontend *fe;
 	bool active;
+	bool inversion;
 };
 
 /* firmare command struct */
diff --git a/drivers/media/usb/dvb-usb/cxusb.c b/drivers/media/usb/dvb-usb/cxusb.c
index ad20c39..c94a704 100644
--- a/drivers/media/usb/dvb-usb/cxusb.c
+++ b/drivers/media/usb/dvb-usb/cxusb.c
@@ -1337,7 +1337,7 @@ static int cxusb_tt_ct2_4400_attach(struct dvb_usb_adapter *adap)
 	struct i2c_client *client_tuner;
 	struct i2c_board_info info;
 	struct si2168_config si2168_config;
-	struct si2157_config si2157_config;
+	struct si2157_config si2157_config = { .fe = adap->fe_adap[0].fe };
 
 	/* reset the tuner */
 	if (cxusb_tt_ct2_4400_gpio_tuner(d, 0) < 0) {
@@ -1371,7 +1371,6 @@ static int cxusb_tt_ct2_4400_attach(struct dvb_usb_adapter *adap)
 	st->i2c_client_demod = client_demod;
 
 	/* attach tuner */
-	si2157_config.fe = adap->fe_adap[0].fe;
 	memset(&info, 0, sizeof(struct i2c_board_info));
 	strlcpy(info.type, "si2157", I2C_NAME_SIZE);
 	info.addr = 0x60;
diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c
index a121ed9..d472dc9 100644
--- a/drivers/media/usb/em28xx/em28xx-dvb.c
+++ b/drivers/media/usb/em28xx/em28xx-dvb.c
@@ -1520,7 +1520,9 @@ static int em28xx_dvb_init(struct em28xx *dev)
 			struct i2c_client *client;
 			struct i2c_board_info info;
 			struct si2168_config si2168_config;
-			struct si2157_config si2157_config;
+			struct si2157_config si2157_config = {
+				.fe = dvb->fe[0]
+			};
 
 			/* attach demod */
 			si2168_config.i2c_adapter = &adapter;
@@ -1545,7 +1547,6 @@ static int em28xx_dvb_init(struct em28xx *dev)
 			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;
-- 
2.0.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/2] si2157: Add get_if_frequency callback
       [not found] <1405411120-9569-1-git-send-email-zzam@gentoo.org>
  2014-07-15  7:58 ` [PATCH 1/2] si2157: Add support for spectrum inversion Matthias Schwarzott
@ 2014-07-15  7:58 ` Matthias Schwarzott
  2014-07-15 11:08   ` Antti Palosaari
  1 sibling, 1 reply; 11+ messages in thread
From: Matthias Schwarzott @ 2014-07-15  7:58 UTC (permalink / raw)
  To: crope; +Cc: Matthias Schwarzott, Linux Media Mailing List

This is needed for PCTV 522e support.

Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
---
 drivers/media/tuners/si2157.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c
index 4dbd3f1..06153fa 100644
--- a/drivers/media/tuners/si2157.c
+++ b/drivers/media/tuners/si2157.c
@@ -279,6 +279,12 @@ err:
 	return ret;
 }
 
+static int si2157_get_if_frequency(struct dvb_frontend *fe, u32 *frequency)
+{
+	*frequency = 5000000; /* default value of property 0x0706 */
+	return 0;
+}
+
 static const struct dvb_tuner_ops si2157_tuner_ops = {
 	.info = {
 		.name           = "Silicon Labs Si2157/Si2158",
@@ -289,6 +295,7 @@ static const struct dvb_tuner_ops si2157_tuner_ops = {
 	.init = si2157_init,
 	.sleep = si2157_sleep,
 	.set_params = si2157_set_params,
+	.get_if_frequency = si2157_get_if_frequency,
 };
 
 static int si2157_probe(struct i2c_client *client,
-- 
2.0.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/2] si2157: Add support for spectrum inversion
  2014-07-15  7:58 ` [PATCH 1/2] si2157: Add support for spectrum inversion Matthias Schwarzott
@ 2014-07-15 11:08   ` Antti Palosaari
  2014-07-15 19:26     ` Matthias Schwarzott
  0 siblings, 1 reply; 11+ messages in thread
From: Antti Palosaari @ 2014-07-15 11:08 UTC (permalink / raw)
  To: Matthias Schwarzott; +Cc: Linux Media Mailing List

Moikka Matthias!
Idea of patch is correct, but I think implementation not. You set FE to 
si2157_config on variable define, but on that point FE is NULL. FE 
pointer is populated by demodulator driver, si2168. Right?

And you could split that to 3 patches too, one for prepare em28xx, one 
for cxusb and last is patch itself.

regards
Antti


On 07/15/2014 10:58 AM, Matthias Schwarzott wrote:
> This is needed for PCTV 522e support.
> Modify all users of si2157_config to correctly initialize all not
> mentioned values to 0.
>
> Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
> ---
>   drivers/media/tuners/si2157.c         | 3 +++
>   drivers/media/tuners/si2157.h         | 5 +++++
>   drivers/media/tuners/si2157_priv.h    | 1 +
>   drivers/media/usb/dvb-usb/cxusb.c     | 3 +--
>   drivers/media/usb/em28xx/em28xx-dvb.c | 5 +++--
>   5 files changed, 13 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c
> index 329004f..4dbd3f1 100644
> --- a/drivers/media/tuners/si2157.c
> +++ b/drivers/media/tuners/si2157.c
> @@ -253,6 +253,8 @@ static int si2157_set_params(struct dvb_frontend *fe)
>
>   	memcpy(cmd.args, "\x14\x00\x03\x07\x00\x00", 6);
>   	cmd.args[4] = delivery_system | bandwidth;
> +	if (s->inversion)
> +		cmd.args[5] = 0x01;
>   	cmd.wlen = 6;
>   	cmd.rlen = 1;
>   	ret = si2157_cmd_execute(s, &cmd);
> @@ -307,6 +309,7 @@ static int si2157_probe(struct i2c_client *client,
>
>   	s->client = client;
>   	s->fe = cfg->fe;
> +	s->inversion = cfg->inversion;
>   	mutex_init(&s->i2c_mutex);
>
>   	/* check if the tuner is there */
> diff --git a/drivers/media/tuners/si2157.h b/drivers/media/tuners/si2157.h
> index 4465c46..6da4d5d 100644
> --- a/drivers/media/tuners/si2157.h
> +++ b/drivers/media/tuners/si2157.h
> @@ -29,6 +29,11 @@ struct si2157_config {
>   	 * frontend
>   	 */
>   	struct dvb_frontend *fe;
> +
> +	/*
> +	 * Spectral Inversion
> +	 */
> +	bool inversion;
>   };
>
>   #endif
> diff --git a/drivers/media/tuners/si2157_priv.h b/drivers/media/tuners/si2157_priv.h
> index db79f3c..3ddab5e 100644
> --- a/drivers/media/tuners/si2157_priv.h
> +++ b/drivers/media/tuners/si2157_priv.h
> @@ -26,6 +26,7 @@ struct si2157 {
>   	struct i2c_client *client;
>   	struct dvb_frontend *fe;
>   	bool active;
> +	bool inversion;
>   };
>
>   /* firmare command struct */
> diff --git a/drivers/media/usb/dvb-usb/cxusb.c b/drivers/media/usb/dvb-usb/cxusb.c
> index ad20c39..c94a704 100644
> --- a/drivers/media/usb/dvb-usb/cxusb.c
> +++ b/drivers/media/usb/dvb-usb/cxusb.c
> @@ -1337,7 +1337,7 @@ static int cxusb_tt_ct2_4400_attach(struct dvb_usb_adapter *adap)
>   	struct i2c_client *client_tuner;
>   	struct i2c_board_info info;
>   	struct si2168_config si2168_config;
> -	struct si2157_config si2157_config;
> +	struct si2157_config si2157_config = { .fe = adap->fe_adap[0].fe };
>
>   	/* reset the tuner */
>   	if (cxusb_tt_ct2_4400_gpio_tuner(d, 0) < 0) {
> @@ -1371,7 +1371,6 @@ static int cxusb_tt_ct2_4400_attach(struct dvb_usb_adapter *adap)
>   	st->i2c_client_demod = client_demod;
>
>   	/* attach tuner */
> -	si2157_config.fe = adap->fe_adap[0].fe;
>   	memset(&info, 0, sizeof(struct i2c_board_info));
>   	strlcpy(info.type, "si2157", I2C_NAME_SIZE);
>   	info.addr = 0x60;
> diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c
> index a121ed9..d472dc9 100644
> --- a/drivers/media/usb/em28xx/em28xx-dvb.c
> +++ b/drivers/media/usb/em28xx/em28xx-dvb.c
> @@ -1520,7 +1520,9 @@ static int em28xx_dvb_init(struct em28xx *dev)
>   			struct i2c_client *client;
>   			struct i2c_board_info info;
>   			struct si2168_config si2168_config;
> -			struct si2157_config si2157_config;
> +			struct si2157_config si2157_config = {
> +				.fe = dvb->fe[0]
> +			};
>
>   			/* attach demod */
>   			si2168_config.i2c_adapter = &adapter;
> @@ -1545,7 +1547,6 @@ static int em28xx_dvb_init(struct em28xx *dev)
>   			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;
>

-- 
http://palosaari.fi/

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/2] si2157: Add get_if_frequency callback
  2014-07-15  7:58 ` [PATCH 2/2] si2157: Add get_if_frequency callback Matthias Schwarzott
@ 2014-07-15 11:08   ` Antti Palosaari
  0 siblings, 0 replies; 11+ messages in thread
From: Antti Palosaari @ 2014-07-15 11:08 UTC (permalink / raw)
  To: Matthias Schwarzott; +Cc: Linux Media Mailing List

Looks correct, I will apply that.

regards
Antti

On 07/15/2014 10:58 AM, Matthias Schwarzott wrote:
> This is needed for PCTV 522e support.
>
> Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
> ---
>   drivers/media/tuners/si2157.c | 7 +++++++
>   1 file changed, 7 insertions(+)
>
> diff --git a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c
> index 4dbd3f1..06153fa 100644
> --- a/drivers/media/tuners/si2157.c
> +++ b/drivers/media/tuners/si2157.c
> @@ -279,6 +279,12 @@ err:
>   	return ret;
>   }
>
> +static int si2157_get_if_frequency(struct dvb_frontend *fe, u32 *frequency)
> +{
> +	*frequency = 5000000; /* default value of property 0x0706 */
> +	return 0;
> +}
> +
>   static const struct dvb_tuner_ops si2157_tuner_ops = {
>   	.info = {
>   		.name           = "Silicon Labs Si2157/Si2158",
> @@ -289,6 +295,7 @@ static const struct dvb_tuner_ops si2157_tuner_ops = {
>   	.init = si2157_init,
>   	.sleep = si2157_sleep,
>   	.set_params = si2157_set_params,
> +	.get_if_frequency = si2157_get_if_frequency,
>   };
>
>   static int si2157_probe(struct i2c_client *client,
>

-- 
http://palosaari.fi/

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/2] si2157: Add support for spectrum inversion
  2014-07-15 11:08   ` Antti Palosaari
@ 2014-07-15 19:26     ` Matthias Schwarzott
  2014-07-15 19:34       ` [PATCH 1/3] cxusb: Prepare for si2157 driver getting more parameters Matthias Schwarzott
                         ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: Matthias Schwarzott @ 2014-07-15 19:26 UTC (permalink / raw)
  To: Antti Palosaari; +Cc: Linux Media Mailing List

On 15.07.2014 13:08, Antti Palosaari wrote:
> Moikka Matthias!
> Idea of patch is correct, but I think implementation not. You set FE to
> si2157_config on variable define, but on that point FE is NULL. FE
> pointer is populated by demodulator driver, si2168. Right?

Right, I looked into si2168_probe, it sets this pointer.

> 
> And you could split that to 3 patches too, one for prepare em28xx, one
> for cxusb and last is patch itself.

Yes, I split it accordingly.
Here is the new series based on the silabs branch.

Btw. When will these patches be merged to the master branch?

Regards
Matthias


^ permalink raw reply	[flat|nested] 11+ messages in thread

* [PATCH 1/3] cxusb: Prepare for si2157 driver getting more parameters
  2014-07-15 19:26     ` Matthias Schwarzott
@ 2014-07-15 19:34       ` Matthias Schwarzott
  2014-07-19  2:15         ` Antti Palosaari
  2014-07-15 19:34       ` [PATCH 2/3] em28xx-dvb: " Matthias Schwarzott
  2014-07-15 19:34       ` [PATCH 3/3] si2157: Add support for spectral inversion Matthias Schwarzott
  2 siblings, 1 reply; 11+ messages in thread
From: Matthias Schwarzott @ 2014-07-15 19:34 UTC (permalink / raw)
  To: crope, linux-media; +Cc: Matthias Schwarzott

Modify all users of si2157_config to correctly initialize all not
listed values to 0.

Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
---
 drivers/media/usb/dvb-usb/cxusb.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/usb/dvb-usb/cxusb.c b/drivers/media/usb/dvb-usb/cxusb.c
index ad20c39..285213c 100644
--- a/drivers/media/usb/dvb-usb/cxusb.c
+++ b/drivers/media/usb/dvb-usb/cxusb.c
@@ -1371,6 +1371,7 @@ static int cxusb_tt_ct2_4400_attach(struct dvb_usb_adapter *adap)
 	st->i2c_client_demod = client_demod;
 
 	/* attach tuner */
+	memset(&si2157_config, 0, sizeof(si2157_config));
 	si2157_config.fe = adap->fe_adap[0].fe;
 	memset(&info, 0, sizeof(struct i2c_board_info));
 	strlcpy(info.type, "si2157", I2C_NAME_SIZE);
-- 
2.0.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 2/3] em28xx-dvb: Prepare for si2157 driver getting more parameters
  2014-07-15 19:26     ` Matthias Schwarzott
  2014-07-15 19:34       ` [PATCH 1/3] cxusb: Prepare for si2157 driver getting more parameters Matthias Schwarzott
@ 2014-07-15 19:34       ` Matthias Schwarzott
  2014-07-19  2:16         ` Antti Palosaari
  2014-07-15 19:34       ` [PATCH 3/3] si2157: Add support for spectral inversion Matthias Schwarzott
  2 siblings, 1 reply; 11+ messages in thread
From: Matthias Schwarzott @ 2014-07-15 19:34 UTC (permalink / raw)
  To: crope, linux-media; +Cc: Matthias Schwarzott

Modify all users of si2157_config to correctly initialize all not
listed values to 0.

Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
---
 drivers/media/usb/em28xx/em28xx-dvb.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c
index a121ed9..96a0bdb 100644
--- a/drivers/media/usb/em28xx/em28xx-dvb.c
+++ b/drivers/media/usb/em28xx/em28xx-dvb.c
@@ -1545,6 +1545,7 @@ static int em28xx_dvb_init(struct em28xx *dev)
 			dvb->i2c_client_demod = client;
 
 			/* attach tuner */
+			memset(&si2157_config, 0, sizeof(si2157_config));
 			si2157_config.fe = dvb->fe[0];
 			memset(&info, 0, sizeof(struct i2c_board_info));
 			strlcpy(info.type, "si2157", I2C_NAME_SIZE);
-- 
2.0.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* [PATCH 3/3] si2157: Add support for spectral inversion
  2014-07-15 19:26     ` Matthias Schwarzott
  2014-07-15 19:34       ` [PATCH 1/3] cxusb: Prepare for si2157 driver getting more parameters Matthias Schwarzott
  2014-07-15 19:34       ` [PATCH 2/3] em28xx-dvb: " Matthias Schwarzott
@ 2014-07-15 19:34       ` Matthias Schwarzott
  2014-07-19  2:25         ` Antti Palosaari
  2 siblings, 1 reply; 11+ messages in thread
From: Matthias Schwarzott @ 2014-07-15 19:34 UTC (permalink / raw)
  To: crope, linux-media; +Cc: Matthias Schwarzott

This is needed for PCTV 522e support.

Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
---
 drivers/media/tuners/si2157.c      | 3 +++
 drivers/media/tuners/si2157.h      | 5 +++++
 drivers/media/tuners/si2157_priv.h | 1 +
 3 files changed, 9 insertions(+)

diff --git a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c
index 91808e8..06153fa 100644
--- a/drivers/media/tuners/si2157.c
+++ b/drivers/media/tuners/si2157.c
@@ -253,6 +253,8 @@ static int si2157_set_params(struct dvb_frontend *fe)
 
 	memcpy(cmd.args, "\x14\x00\x03\x07\x00\x00", 6);
 	cmd.args[4] = delivery_system | bandwidth;
+	if (s->inversion)
+		cmd.args[5] = 0x01;
 	cmd.wlen = 6;
 	cmd.rlen = 1;
 	ret = si2157_cmd_execute(s, &cmd);
@@ -314,6 +316,7 @@ static int si2157_probe(struct i2c_client *client,
 
 	s->client = client;
 	s->fe = cfg->fe;
+	s->inversion = cfg->inversion;
 	mutex_init(&s->i2c_mutex);
 
 	/* check if the tuner is there */
diff --git a/drivers/media/tuners/si2157.h b/drivers/media/tuners/si2157.h
index 4465c46..6da4d5d 100644
--- a/drivers/media/tuners/si2157.h
+++ b/drivers/media/tuners/si2157.h
@@ -29,6 +29,11 @@ struct si2157_config {
 	 * frontend
 	 */
 	struct dvb_frontend *fe;
+
+	/*
+	 * Spectral Inversion
+	 */
+	bool inversion;
 };
 
 #endif
diff --git a/drivers/media/tuners/si2157_priv.h b/drivers/media/tuners/si2157_priv.h
index db79f3c..3ddab5e 100644
--- a/drivers/media/tuners/si2157_priv.h
+++ b/drivers/media/tuners/si2157_priv.h
@@ -26,6 +26,7 @@ struct si2157 {
 	struct i2c_client *client;
 	struct dvb_frontend *fe;
 	bool active;
+	bool inversion;
 };
 
 /* firmare command struct */
-- 
2.0.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

* Re: [PATCH 1/3] cxusb: Prepare for si2157 driver getting more parameters
  2014-07-15 19:34       ` [PATCH 1/3] cxusb: Prepare for si2157 driver getting more parameters Matthias Schwarzott
@ 2014-07-19  2:15         ` Antti Palosaari
  0 siblings, 0 replies; 11+ messages in thread
From: Antti Palosaari @ 2014-07-19  2:15 UTC (permalink / raw)
  To: Matthias Schwarzott, linux-media

Patch applied.

http://git.linuxtv.org/cgit.cgi/anttip/media_tree.git/log/?h=silabs

Antti

On 07/15/2014 10:34 PM, Matthias Schwarzott wrote:
> Modify all users of si2157_config to correctly initialize all not
> listed values to 0.
>
> Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
> ---
>   drivers/media/usb/dvb-usb/cxusb.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/media/usb/dvb-usb/cxusb.c b/drivers/media/usb/dvb-usb/cxusb.c
> index ad20c39..285213c 100644
> --- a/drivers/media/usb/dvb-usb/cxusb.c
> +++ b/drivers/media/usb/dvb-usb/cxusb.c
> @@ -1371,6 +1371,7 @@ static int cxusb_tt_ct2_4400_attach(struct dvb_usb_adapter *adap)
>   	st->i2c_client_demod = client_demod;
>
>   	/* attach tuner */
> +	memset(&si2157_config, 0, sizeof(si2157_config));
>   	si2157_config.fe = adap->fe_adap[0].fe;
>   	memset(&info, 0, sizeof(struct i2c_board_info));
>   	strlcpy(info.type, "si2157", I2C_NAME_SIZE);
>

-- 
http://palosaari.fi/

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 2/3] em28xx-dvb: Prepare for si2157 driver getting more parameters
  2014-07-15 19:34       ` [PATCH 2/3] em28xx-dvb: " Matthias Schwarzott
@ 2014-07-19  2:16         ` Antti Palosaari
  0 siblings, 0 replies; 11+ messages in thread
From: Antti Palosaari @ 2014-07-19  2:16 UTC (permalink / raw)
  To: Matthias Schwarzott, linux-media

Patch applied.

http://git.linuxtv.org/cgit.cgi/anttip/media_tree.git/log/?h=silabs

Antti


On 07/15/2014 10:34 PM, Matthias Schwarzott wrote:
> Modify all users of si2157_config to correctly initialize all not
> listed values to 0.
>
> Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
> ---
>   drivers/media/usb/em28xx/em28xx-dvb.c | 1 +
>   1 file changed, 1 insertion(+)
>
> diff --git a/drivers/media/usb/em28xx/em28xx-dvb.c b/drivers/media/usb/em28xx/em28xx-dvb.c
> index a121ed9..96a0bdb 100644
> --- a/drivers/media/usb/em28xx/em28xx-dvb.c
> +++ b/drivers/media/usb/em28xx/em28xx-dvb.c
> @@ -1545,6 +1545,7 @@ static int em28xx_dvb_init(struct em28xx *dev)
>   			dvb->i2c_client_demod = client;
>
>   			/* attach tuner */
> +			memset(&si2157_config, 0, sizeof(si2157_config));
>   			si2157_config.fe = dvb->fe[0];
>   			memset(&info, 0, sizeof(struct i2c_board_info));
>   			strlcpy(info.type, "si2157", I2C_NAME_SIZE);
>

-- 
http://palosaari.fi/

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: [PATCH 3/3] si2157: Add support for spectral inversion
  2014-07-15 19:34       ` [PATCH 3/3] si2157: Add support for spectral inversion Matthias Schwarzott
@ 2014-07-19  2:25         ` Antti Palosaari
  0 siblings, 0 replies; 11+ messages in thread
From: Antti Palosaari @ 2014-07-19  2:25 UTC (permalink / raw)
  To: Matthias Schwarzott, linux-media

Patch applied.

http://git.linuxtv.org/cgit.cgi/anttip/media_tree.git/log/?h=silabs

However, it is usually demod which fixes inverted IF. There was only one 
other tuner driver having IF spectrum inversion, Mxl5007t.

Logically looking signal goes from tuner to demod and when it goes out 
from tuner it is correct, but when it arrives to demod input it is 
inverted (on case IF wiring is cross-connected). So it even logically 
belongs to demod, IMHO.

regards
Antti



On 07/15/2014 10:34 PM, Matthias Schwarzott wrote:
> This is needed for PCTV 522e support.
>
> Signed-off-by: Matthias Schwarzott <zzam@gentoo.org>
> ---
>   drivers/media/tuners/si2157.c      | 3 +++
>   drivers/media/tuners/si2157.h      | 5 +++++
>   drivers/media/tuners/si2157_priv.h | 1 +
>   3 files changed, 9 insertions(+)
>
> diff --git a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c
> index 91808e8..06153fa 100644
> --- a/drivers/media/tuners/si2157.c
> +++ b/drivers/media/tuners/si2157.c
> @@ -253,6 +253,8 @@ static int si2157_set_params(struct dvb_frontend *fe)
>
>   	memcpy(cmd.args, "\x14\x00\x03\x07\x00\x00", 6);
>   	cmd.args[4] = delivery_system | bandwidth;
> +	if (s->inversion)
> +		cmd.args[5] = 0x01;
>   	cmd.wlen = 6;
>   	cmd.rlen = 1;
>   	ret = si2157_cmd_execute(s, &cmd);
> @@ -314,6 +316,7 @@ static int si2157_probe(struct i2c_client *client,
>
>   	s->client = client;
>   	s->fe = cfg->fe;
> +	s->inversion = cfg->inversion;
>   	mutex_init(&s->i2c_mutex);
>
>   	/* check if the tuner is there */
> diff --git a/drivers/media/tuners/si2157.h b/drivers/media/tuners/si2157.h
> index 4465c46..6da4d5d 100644
> --- a/drivers/media/tuners/si2157.h
> +++ b/drivers/media/tuners/si2157.h
> @@ -29,6 +29,11 @@ struct si2157_config {
>   	 * frontend
>   	 */
>   	struct dvb_frontend *fe;
> +
> +	/*
> +	 * Spectral Inversion
> +	 */
> +	bool inversion;
>   };
>
>   #endif
> diff --git a/drivers/media/tuners/si2157_priv.h b/drivers/media/tuners/si2157_priv.h
> index db79f3c..3ddab5e 100644
> --- a/drivers/media/tuners/si2157_priv.h
> +++ b/drivers/media/tuners/si2157_priv.h
> @@ -26,6 +26,7 @@ struct si2157 {
>   	struct i2c_client *client;
>   	struct dvb_frontend *fe;
>   	bool active;
> +	bool inversion;
>   };
>
>   /* firmare command struct */
>

-- 
http://palosaari.fi/

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-07-19  2:25 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1405411120-9569-1-git-send-email-zzam@gentoo.org>
2014-07-15  7:58 ` [PATCH 1/2] si2157: Add support for spectrum inversion Matthias Schwarzott
2014-07-15 11:08   ` Antti Palosaari
2014-07-15 19:26     ` Matthias Schwarzott
2014-07-15 19:34       ` [PATCH 1/3] cxusb: Prepare for si2157 driver getting more parameters Matthias Schwarzott
2014-07-19  2:15         ` Antti Palosaari
2014-07-15 19:34       ` [PATCH 2/3] em28xx-dvb: " Matthias Schwarzott
2014-07-19  2:16         ` Antti Palosaari
2014-07-15 19:34       ` [PATCH 3/3] si2157: Add support for spectral inversion Matthias Schwarzott
2014-07-19  2:25         ` Antti Palosaari
2014-07-15  7:58 ` [PATCH 2/2] si2157: Add get_if_frequency callback Matthias Schwarzott
2014-07-15 11:08   ` Antti Palosaari

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).