LinuxTV Patchwork [04/13] si2157: Add clock and pin setup for si2141

login
register
mail settings
Submitter Brad Love
Date Dec. 29, 2018, 5:51 p.m.
Message ID <1546105882-15693-5-git-send-email-brad@nextdimension.cc>
Download mbox | patch
Permalink /patch/53675/
State Not Applicable
Headers show

Comments

Brad Love - Dec. 29, 2018, 5:51 p.m.
Include some missing setup for si2141

Signed-off-by: Brad Love <brad@nextdimension.cc>
---
 drivers/media/tuners/si2157.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
Antti Palosaari - Jan. 20, 2019, 5:17 p.m.
On 12/29/18 7:51 PM, Brad Love wrote:
> Include some missing setup for si2141
> 
> Signed-off-by: Brad Love <brad@nextdimension.cc>
> ---
>   drivers/media/tuners/si2157.c | 17 +++++++++++++++++
>   1 file changed, 17 insertions(+)
> 
> diff --git a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c
> index f3a60a1..1ad2d42 100644
> --- a/drivers/media/tuners/si2157.c
> +++ b/drivers/media/tuners/si2157.c
> @@ -236,6 +236,23 @@ static int si2157_init(struct dvb_frontend *fe)
>   	dev_info(&client->dev, "firmware version: %c.%c.%d\n",
>   			cmd.args[6], cmd.args[7], cmd.args[8]);
>   
> +	if (dev->chiptype == SI2157_CHIPTYPE_SI2141) {
> +		/* set clock */
> +		memcpy(cmd.args, "\xc0\x00\x0d", 3);
> +		cmd.wlen = 3;
> +		cmd.rlen = 1;
> +		ret = si2157_cmd_execute(client, &cmd);
> +		if (ret)
> +			goto err;
> +		/* setup PIN */
> +		memcpy(cmd.args, "\x12\x80\x80\x85\x00\x81\x00", 7);
> +		cmd.wlen = 7;
> +		cmd.rlen = 7;
> +		ret = si2157_cmd_execute(client, &cmd);
> +		if (ret)
> +			goto err;
> +	}
> +
>   	/* enable tuner status flags */
>   	memcpy(cmd.args, "\x14\x00\x01\x05\x01\x00", 6);
>   	cmd.wlen = 6;
> 

Si2141 is working in my understanding, why these are required?


regards
Antti
Brad Love - Jan. 22, 2019, 5:10 p.m.
Hi Antti,


On 20/01/2019 11.17, Antti Palosaari wrote:
>
> On 12/29/18 7:51 PM, Brad Love wrote:
>> Include some missing setup for si2141
>>
>> Signed-off-by: Brad Love <brad@nextdimension.cc>
>> ---
>>   drivers/media/tuners/si2157.c | 17 +++++++++++++++++
>>   1 file changed, 17 insertions(+)
>>
>> diff --git a/drivers/media/tuners/si2157.c
>> b/drivers/media/tuners/si2157.c
>> index f3a60a1..1ad2d42 100644
>> --- a/drivers/media/tuners/si2157.c
>> +++ b/drivers/media/tuners/si2157.c
>> @@ -236,6 +236,23 @@ static int si2157_init(struct dvb_frontend *fe)
>>       dev_info(&client->dev, "firmware version: %c.%c.%d\n",
>>               cmd.args[6], cmd.args[7], cmd.args[8]);
>>   +    if (dev->chiptype == SI2157_CHIPTYPE_SI2141) {
>> +        /* set clock */
>> +        memcpy(cmd.args, "\xc0\x00\x0d", 3);
>> +        cmd.wlen = 3;
>> +        cmd.rlen = 1;
>> +        ret = si2157_cmd_execute(client, &cmd);
>> +        if (ret)
>> +            goto err;
>> +        /* setup PIN */
>> +        memcpy(cmd.args, "\x12\x80\x80\x85\x00\x81\x00", 7);
>> +        cmd.wlen = 7;
>> +        cmd.rlen = 7;
>> +        ret = si2157_cmd_execute(client, &cmd);
>> +        if (ret)
>> +            goto err;
>> +    }
>> +
>>       /* enable tuner status flags */
>>       memcpy(cmd.args, "\x14\x00\x01\x05\x01\x00", 6);
>>       cmd.wlen = 6;
>>
>
> Si2141 is working in my understanding, why these are required?
>

Apologies, this setting was necessary on a "dvbsky device" that
hauppauge was considering supporting. It never reached production in the
end, but this artifact stayed around anyways. I will drop this patch
from a v2 series.

Regards,

Brad






>
> regards
> Antti
>
>
>

Patch

diff --git a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c
index f3a60a1..1ad2d42 100644
--- a/drivers/media/tuners/si2157.c
+++ b/drivers/media/tuners/si2157.c
@@ -236,6 +236,23 @@  static int si2157_init(struct dvb_frontend *fe)
 	dev_info(&client->dev, "firmware version: %c.%c.%d\n",
 			cmd.args[6], cmd.args[7], cmd.args[8]);
 
+	if (dev->chiptype == SI2157_CHIPTYPE_SI2141) {
+		/* set clock */
+		memcpy(cmd.args, "\xc0\x00\x0d", 3);
+		cmd.wlen = 3;
+		cmd.rlen = 1;
+		ret = si2157_cmd_execute(client, &cmd);
+		if (ret)
+			goto err;
+		/* setup PIN */
+		memcpy(cmd.args, "\x12\x80\x80\x85\x00\x81\x00", 7);
+		cmd.wlen = 7;
+		cmd.rlen = 7;
+		ret = si2157_cmd_execute(client, &cmd);
+		if (ret)
+			goto err;
+	}
+
 	/* enable tuner status flags */
 	memcpy(cmd.args, "\x14\x00\x01\x05\x01\x00", 6);
 	cmd.wlen = 6;

Privacy Policy