diff mbox series

[1/4] si2157: add detection of si2177 tuner

Message ID 1545343031-20935-2-git-send-email-brad@nextdimension.cc (mailing list archive)
State New, archived
Headers show
Series Add Hauppauge HVR1955/1975 devices | expand

Commit Message

Brad Love Dec. 20, 2018, 9:57 p.m. UTC
Works in ATSC and QAM as is, DVB is completely untested.

Firmware required.

Signed-off-by: Brad Love <brad@nextdimension.cc>
---
 drivers/media/tuners/si2157.c      | 6 ++++++
 drivers/media/tuners/si2157_priv.h | 3 ++-
 2 files changed, 8 insertions(+), 1 deletion(-)

Comments

Antti Palosaari Jan. 9, 2019, 5:36 p.m. UTC | #1
On 12/20/18 11:57 PM, Brad Love wrote:
> Works in ATSC and QAM as is, DVB is completely untested.
> 
> Firmware required.
> 
> Signed-off-by: Brad Love <brad@nextdimension.cc>
> ---
>   drivers/media/tuners/si2157.c      | 6 ++++++
>   drivers/media/tuners/si2157_priv.h | 3 ++-


>   #define SI2158_A20_FIRMWARE "dvb-tuner-si2158-a20-01.fw"
>   #define SI2141_A10_FIRMWARE "dvb-tuner-si2141-a10-01.fw"
> -
> +#define SI2157_A30_FIRMWARE "dvb-tuner-si2157-a30-05.fw"

Why you added 05 to that file name? I added that spare number for cases 
you have to replace firmware to another for some reason thus by default 
case it should be 01.

regards
Antti
Brad Love Jan. 15, 2019, 4:32 p.m. UTC | #2
Hi Antti,


On 09/01/2019 11.36, Antti Palosaari wrote:
> On 12/20/18 11:57 PM, Brad Love wrote:
>> Works in ATSC and QAM as is, DVB is completely untested.
>>
>> Firmware required.
>>
>> Signed-off-by: Brad Love <brad@nextdimension.cc>
>> ---
>>   drivers/media/tuners/si2157.c      | 6 ++++++
>>   drivers/media/tuners/si2157_priv.h | 3 ++-
>
>
>>   #define SI2158_A20_FIRMWARE "dvb-tuner-si2158-a20-01.fw"
>>   #define SI2141_A10_FIRMWARE "dvb-tuner-si2141-a10-01.fw"
>> -
>> +#define SI2157_A30_FIRMWARE "dvb-tuner-si2157-a30-05.fw"
>
> Why you added 05 to that file name? I added that spare number for
> cases you have to replace firmware to another for some reason thus by
> default case it should be 01.
>

Barring any explanation of the naming convention, I made it look similar
to the previous two, while reflecting the firmware version. This is
firmware 3.0.5. I have no problem "starting from 1", but reflecting the
firmware version seemed like the sane idea. I'll resubmit if desired.

Regards,

Brad





> regards
> Antti
>
Mauro Carvalho Chehab Jan. 15, 2019, 5:23 p.m. UTC | #3
Em Tue, 15 Jan 2019 10:32:01 -0600
Brad Love <brad@nextdimension.cc> escreveu:

> Hi Antti,
> 
> 
> On 09/01/2019 11.36, Antti Palosaari wrote:
> > On 12/20/18 11:57 PM, Brad Love wrote:  
> >> Works in ATSC and QAM as is, DVB is completely untested.
> >>
> >> Firmware required.
> >>
> >> Signed-off-by: Brad Love <brad@nextdimension.cc>
> >> ---
> >>   drivers/media/tuners/si2157.c      | 6 ++++++
> >>   drivers/media/tuners/si2157_priv.h | 3 ++-  
> >
> >  
> >>   #define SI2158_A20_FIRMWARE "dvb-tuner-si2158-a20-01.fw"
> >>   #define SI2141_A10_FIRMWARE "dvb-tuner-si2141-a10-01.fw"
> >> -
> >> +#define SI2157_A30_FIRMWARE "dvb-tuner-si2157-a30-05.fw"  
> >
> > Why you added 05 to that file name? I added that spare number for
> > cases you have to replace firmware to another for some reason thus by
> > default case it should be 01.
> >  
> 
> Barring any explanation of the naming convention, I made it look similar
> to the previous two, while reflecting the firmware version. This is
> firmware 3.0.5. I have no problem "starting from 1", but reflecting the
> firmware version seemed like the sane idea. I'll resubmit if desired.

Hi Antti,

Whatever firmware name convention policy you decide works for me, but
it would be really cool if you could send a patch ading a comment just
before the firmware naming macros documenting it, as it would avoid 
further discussions and patch resubmissions ;-)

Thanks,
Mauro
diff mbox series

Patch

diff --git a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c
index d389f1f..3d21af5 100644
--- a/drivers/media/tuners/si2157.c
+++ b/drivers/media/tuners/si2157.c
@@ -138,6 +138,7 @@  static int si2157_init(struct dvb_frontend *fe)
 	chip_id = cmd.args[1] << 24 | cmd.args[2] << 16 | cmd.args[3] << 8 |
 			cmd.args[4] << 0;
 
+	#define SI2177_A30 ('A' << 24 | 77 << 16 | '3' << 8 | '0' << 0)
 	#define SI2158_A20 ('A' << 24 | 58 << 16 | '2' << 8 | '0' << 0)
 	#define SI2148_A20 ('A' << 24 | 48 << 16 | '2' << 8 | '0' << 0)
 	#define SI2157_A30 ('A' << 24 | 57 << 16 | '3' << 8 | '0' << 0)
@@ -153,6 +154,9 @@  static int si2157_init(struct dvb_frontend *fe)
 	case SI2141_A10:
 		fw_name = SI2141_A10_FIRMWARE;
 		break;
+	case SI2177_A30:
+		fw_name = SI2157_A30_FIRMWARE;
+		break;
 	case SI2157_A30:
 	case SI2147_A30:
 	case SI2146_A10:
@@ -529,6 +533,7 @@  static const struct i2c_device_id si2157_id_table[] = {
 	{"si2157", SI2157_CHIPTYPE_SI2157},
 	{"si2146", SI2157_CHIPTYPE_SI2146},
 	{"si2141", SI2157_CHIPTYPE_SI2141},
+	{"si2177", SI2157_CHIPTYPE_SI2177},
 	{}
 };
 MODULE_DEVICE_TABLE(i2c, si2157_id_table);
@@ -550,3 +555,4 @@  MODULE_AUTHOR("Antti Palosaari <crope@iki.fi>");
 MODULE_LICENSE("GPL");
 MODULE_FIRMWARE(SI2158_A20_FIRMWARE);
 MODULE_FIRMWARE(SI2141_A10_FIRMWARE);
+MODULE_FIRMWARE(SI2157_A30_FIRMWARE);
diff --git a/drivers/media/tuners/si2157_priv.h b/drivers/media/tuners/si2157_priv.h
index 50f8630..67caee5 100644
--- a/drivers/media/tuners/si2157_priv.h
+++ b/drivers/media/tuners/si2157_priv.h
@@ -50,6 +50,7 @@  struct si2157_dev {
 #define SI2157_CHIPTYPE_SI2157 0
 #define SI2157_CHIPTYPE_SI2146 1
 #define SI2157_CHIPTYPE_SI2141 2
+#define SI2157_CHIPTYPE_SI2177 3
 
 /* firmware command struct */
 #define SI2157_ARGLEN      30
@@ -61,5 +62,5 @@  struct si2157_cmd {
 
 #define SI2158_A20_FIRMWARE "dvb-tuner-si2158-a20-01.fw"
 #define SI2141_A10_FIRMWARE "dvb-tuner-si2141-a10-01.fw"
-
+#define SI2157_A30_FIRMWARE "dvb-tuner-si2157-a30-05.fw"
 #endif