diff mbox series

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

Message ID 1546105882-15693-5-git-send-email-brad@nextdimension.cc (mailing list archive)
State New, archived
Headers show
Series si2157: Analog tuning and optimizations | expand

Commit Message

Brad Love Dec. 29, 2018, 5:51 p.m. UTC
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(+)

Comments

Antti Palosaari Jan. 20, 2019, 5:17 p.m. UTC | #1
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. UTC | #2
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
>
>
>
diff mbox series

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;