* [PATCH] [media] si2157: Improve support Si2158-A20 tuner
@ 2016-08-04 7:54 Oleh Kravchenko
[not found] ` <CAAZRmGxM8U+PBfP4RWfnLDH0gdw+2oSuMAivzYBxRqSqTPM4FQ@mail.gmail.com>
2016-10-24 15:54 ` [PATCH] [media] si2157: Improve support Si2158-A20 tuner Mauro Carvalho Chehab
0 siblings, 2 replies; 6+ messages in thread
From: Oleh Kravchenko @ 2016-08-04 7:54 UTC (permalink / raw)
To: linux-media, crope; +Cc: Oleh Kravchenko
Signed-off-by: Oleh Kravchenko <oleg@kaa.org.ua>
---
drivers/media/tuners/si2157.c | 34 +++++++++++++++++++++++++++-------
drivers/media/tuners/si2157_priv.h | 1 +
2 files changed, 28 insertions(+), 7 deletions(-)
diff --git a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c
index 57b2508..d7035a5 100644
--- a/drivers/media/tuners/si2157.c
+++ b/drivers/media/tuners/si2157.c
@@ -103,12 +103,21 @@ static int si2157_init(struct dvb_frontend *fe)
goto warm;
/* power up */
- if (dev->chiptype == SI2157_CHIPTYPE_SI2146) {
- memcpy(cmd.args, "\xc0\x05\x01\x00\x00\x0b\x00\x00\x01", 9);
- cmd.wlen = 9;
- } else {
- memcpy(cmd.args, "\xc0\x00\x0c\x00\x00\x01\x01\x01\x01\x01\x01\x02\x00\x00\x01", 15);
- cmd.wlen = 15;
+ switch (dev->chiptype) {
+ case SI2157_CHIPTYPE_SI2146:
+ memcpy(cmd.args, "\xc0\x05\x01\x00\x00\x0b\x00\x00\x01", 9);
+ cmd.wlen = 9;
+ break;
+
+ case SI2157_CHIPTYPE_SI2158:
+ memcpy(cmd.args, "\xC0\x00\x00\x00\x00\x01\x01\x01\x01\x01\x01\x02\x00\x00\x01", 15);
+ cmd.wlen = 15;
+ break;
+
+ default:
+ memcpy(cmd.args, "\xc0\x00\x0c\x00\x00\x01\x01\x01\x01\x01\x01\x02\x00\x00\x01", 15);
+ cmd.wlen = 15;
+ break;
}
cmd.rlen = 1;
ret = si2157_cmd_execute(client, &cmd);
@@ -204,6 +213,16 @@ skip_fw_download:
if (ret)
goto err;
+ /* start tuner? */
+ if (SI2157_CHIPTYPE_SI2158 == dev->chiptype) {
+ memcpy(cmd.args, "\xC0\x00\x0C", 3);
+ cmd.wlen = 3;
+ cmd.rlen = 1;
+ ret = si2157_cmd_execute(client, &cmd);
+ if (ret)
+ goto err;
+ }
+
/* query firmware version */
memcpy(cmd.args, "\x11", 1);
cmd.wlen = 1;
@@ -506,8 +525,9 @@ static int si2157_remove(struct i2c_client *client)
}
static const struct i2c_device_id si2157_id_table[] = {
- {"si2157", SI2157_CHIPTYPE_SI2157},
{"si2146", SI2157_CHIPTYPE_SI2146},
+ {"si2157", SI2157_CHIPTYPE_SI2157},
+ {"si2158", SI2157_CHIPTYPE_SI2158},
{}
};
MODULE_DEVICE_TABLE(i2c, si2157_id_table);
diff --git a/drivers/media/tuners/si2157_priv.h b/drivers/media/tuners/si2157_priv.h
index d6b2c7b..677fa00 100644
--- a/drivers/media/tuners/si2157_priv.h
+++ b/drivers/media/tuners/si2157_priv.h
@@ -42,6 +42,7 @@ struct si2157_dev {
#define SI2157_CHIPTYPE_SI2157 0
#define SI2157_CHIPTYPE_SI2146 1
+#define SI2157_CHIPTYPE_SI2158 2
/* firmware command struct */
#define SI2157_ARGLEN 30
--
2.7.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] [media] si2157: Improve support Si2158-A20 tuner
[not found] ` <CAAZRmGxM8U+PBfP4RWfnLDH0gdw+2oSuMAivzYBxRqSqTPM4FQ@mail.gmail.com>
@ 2016-08-04 10:26 ` Oleh Kravchenko
[not found] ` <CAAZRmGykv5LOmBxKYNUgi07+Rt=OTN3_+Cdu7BUGT0KbY0LPiA@mail.gmail.com>
0 siblings, 1 reply; 6+ messages in thread
From: Oleh Kravchenko @ 2016-08-04 10:26 UTC (permalink / raw)
To: Olli Salonen; +Cc: linux-media, Antti Palosaari
Hi Olli,
Looks like I miss something, what parameter do you mean?
On 04.08.16 13:08, Olli Salonen wrote:
> Hi Oleh,
>
> Do you have any idea of what this parameter change does? I have a gut
> feeling that this is an option that's not Si2158-specific, but a
> parameter that's valid for the other tuners as well.
>
> Do you know what this parameter will actually do? If so, it would be
> better to add this as a configuration option for the Si2157. Your
> patch will now change the behaviour even for devices that you probably
> have not tested.
>
> Cheers,
> -olli
>
> On 4 August 2016 at 10:54, Oleh Kravchenko <oleg@kaa.org.ua
> <mailto:oleg@kaa.org.ua>> wrote:
>
> Signed-off-by: Oleh Kravchenko <oleg@kaa.org.ua
> <mailto:oleg@kaa.org.ua>>
> ---
> drivers/media/tuners/si2157.c | 34
> +++++++++++++++++++++++++++-------
> drivers/media/tuners/si2157_priv.h | 1 +
> 2 files changed, 28 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/media/tuners/si2157.c
> b/drivers/media/tuners/si2157.c
> index 57b2508..d7035a5 100644
> --- a/drivers/media/tuners/si2157.c
> +++ b/drivers/media/tuners/si2157.c
> @@ -103,12 +103,21 @@ static int si2157_init(struct dvb_frontend *fe)
> goto warm;
>
> /* power up */
> - if (dev->chiptype == SI2157_CHIPTYPE_SI2146) {
> - memcpy(cmd.args,
> "\xc0\x05\x01\x00\x00\x0b\x00\x00\x01", 9);
> - cmd.wlen = 9;
> - } else {
> - memcpy(cmd.args,
> "\xc0\x00\x0c\x00\x00\x01\x01\x01\x01\x01\x01\x02\x00\x00\x01", 15);
> - cmd.wlen = 15;
> + switch (dev->chiptype) {
> + case SI2157_CHIPTYPE_SI2146:
> + memcpy(cmd.args,
> "\xc0\x05\x01\x00\x00\x0b\x00\x00\x01", 9);
> + cmd.wlen = 9;
> + break;
> +
> + case SI2157_CHIPTYPE_SI2158:
> + memcpy(cmd.args,
> "\xC0\x00\x00\x00\x00\x01\x01\x01\x01\x01\x01\x02\x00\x00\x01", 15);
> + cmd.wlen = 15;
> + break;
> +
> + default:
> + memcpy(cmd.args,
> "\xc0\x00\x0c\x00\x00\x01\x01\x01\x01\x01\x01\x02\x00\x00\x01", 15);
> + cmd.wlen = 15;
> + break;
> }
> cmd.rlen = 1;
> ret = si2157_cmd_execute(client, &cmd);
> @@ -204,6 +213,16 @@ skip_fw_download:
> if (ret)
> goto err;
>
> + /* start tuner? */
> + if (SI2157_CHIPTYPE_SI2158 == dev->chiptype) {
> + memcpy(cmd.args, "\xC0\x00\x0C", 3);
> + cmd.wlen = 3;
> + cmd.rlen = 1;
> + ret = si2157_cmd_execute(client, &cmd);
> + if (ret)
> + goto err;
> + }
> +
> /* query firmware version */
> memcpy(cmd.args, "\x11", 1);
> cmd.wlen = 1;
> @@ -506,8 +525,9 @@ static int si2157_remove(struct i2c_client
> *client)
> }
>
> static const struct i2c_device_id si2157_id_table[] = {
> - {"si2157", SI2157_CHIPTYPE_SI2157},
> {"si2146", SI2157_CHIPTYPE_SI2146},
> + {"si2157", SI2157_CHIPTYPE_SI2157},
> + {"si2158", SI2157_CHIPTYPE_SI2158},
> {}
> };
> MODULE_DEVICE_TABLE(i2c, si2157_id_table);
> diff --git a/drivers/media/tuners/si2157_priv.h
> b/drivers/media/tuners/si2157_priv.h
> index d6b2c7b..677fa00 100644
> --- a/drivers/media/tuners/si2157_priv.h
> +++ b/drivers/media/tuners/si2157_priv.h
> @@ -42,6 +42,7 @@ struct si2157_dev {
>
> #define SI2157_CHIPTYPE_SI2157 0
> #define SI2157_CHIPTYPE_SI2146 1
> +#define SI2157_CHIPTYPE_SI2158 2
>
> /* firmware command struct */
> #define SI2157_ARGLEN 30
> --
> 2.7.3
>
> --
> To unsubscribe from this list: send the line "unsubscribe
> linux-media" in
> the body of a message to majordomo@vger.kernel.org
> <mailto:majordomo@vger.kernel.org>
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
--
Best regards,
Oleh Kravchenko
Senior Software Developer, CMS | skype: oleg_krava | Email: oleg@kaa.org.ua
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] [media] si2157: Improve support Si2158-A20 tuner
[not found] ` <CAAZRmGykv5LOmBxKYNUgi07+Rt=OTN3_+Cdu7BUGT0KbY0LPiA@mail.gmail.com>
@ 2016-08-04 12:03 ` Oleh Kravchenko
2016-08-04 14:11 ` Oleh Kravchenko
0 siblings, 1 reply; 6+ messages in thread
From: Oleh Kravchenko @ 2016-08-04 12:03 UTC (permalink / raw)
To: Olli Salonen; +Cc: linux-media, Antti Palosaari
I got this from tracing I2C bus of tuner.
Windows driver send this to tuner before set frequency, bandwidth, etc.:
wC0 | 15 | C0 00 00 00 00 01 01 01 01 01 01 02 00 00
01 | ...............
; I cut firmware from here, by the way Windows driver use firmware v2.1.8
wC0 | 2 | 01
01 |
..
; I don't known what is it, but with(out) it on Linux my tuner work fine!
; I think this is calibration data(?)
wC0 | 6 | 14 00 10 06 E8
03 | ......
wC0 | 6 | 14 00 11 06 00
00 | ......
wC0 | 6 | 14 00 23 06 9E
80 | ..#...
wC0 | 6 | 14 00 24 06 00
00 | ..$...
wC0 | 6 | 14 00 03 06 08
00 | ......
wC0 | 6 | 14 00 07 06 32
C8 | ....2.
wC0 | 6 | 14 00 01 06 01
00 | ......
wC0 | 6 | 14 00 13 06 00
03 | ......
wC0 | 6 | 14 00 0C 06 88
13 | ......
wC0 | 6 | 14 00 0D 06 94
64 | .....d
wC0 | 6 | 14 00 17 06 00
00 | ......
wC0 | 6 | 14 00 12 06 00
00 | ......
wC0 | 6 | 14 00 05 06 BA
00 | ......
wC0 | 6 | 14 00 04 06 00
02 | ......
wC0 | 6 | 14 00 16 06 00
00 | ......
wC0 | 6 | 14 00 02 04 08
00 | ......
wC0 | 6 | 14 00 01 04 00
00 | ......
wC0 | 6 | 14 00 11 07 00
00 | ......
wC0 | 6 | 14 00 08 07 00
00 | ......
wC0 | 6 | 14 00 02 07 01
00 | ......
wC0 | 6 | 14 00 05 07 32
C8 | ....2.
wC0 | 6 | 14 00 0C 07 01
00 | ......
wC0 | 6 | 14 00 01 07 01
00 | ......
wC0 | 6 | 14 00 0D 07 00
00 | ......
wC0 | 6 | 14 00 0E 07 00
00 | ......
wC0 | 6 | 14 00 10 07 00
00 | ......
wC0 | 6 | 14 00 0A 07 00
01 | ......
wC0 | 6 | 14 00 06 07 88
13 | ......
wC0 | 6 | 14 00 07 07 94
1B | ......
wC0 | 6 | 14 00 03 07 28
00 | ....(.
wC0 | 6 | 14 00 13 07 FF
FF | ......
wC0 | 6 | 14 00 0F 07 00
00 | ......
wC0 | 6 | 14 00 09 07 00
00 | ......
wC0 | 6 | 14 00 04 07 B0
00 |
......
wC0 | 6 | 14 00 12 07 10
00 |
......
wC0 | 6 | 14 00 04 05 00
80 |
......
wC0 | 6 | 14 00 01 05 01
00 |
......
wC0 | 6 | 14 00 05 05 00
07 |
......
wC0 | 6 | 14 00 06 05 01
00 |
......
wC0 | 6 | 14 00 07 05 7F
00 |
......
; without C0 00 0C tuner is not work
wC0 | 3 | C0 00
0C |
...
On 04.08.16 14:11, Olli Salonen wrote:
> Hi Oleh,
>
> It would seem to me that when you start the clocks here:
>
> > "\xC0\x00\x00\x00\x00\x01\x01\x01\x01\x01\x01\x02\x00\x00\x01", 15);
>
> You've removed 0c from third octet compared to the default behaviour.
> However, then later in the sequence you run:
>
> > + /* start tuner? */
> > + if (SI2157_CHIPTYPE_SI2158 == dev->chiptype) {
> > + memcpy(cmd.args, "\xC0\x00\x0C", 3);
>
> Ie. there you do change the parameter in the third octet to 0c. I'm
> wondering what's the reason and significance of that. Was there a
> problem that you solved with this approach? Why is this way better
> than the previous way? I'm trying to understand that.
>
> Cheers,
> -olli
>
>
>
> On 4 August 2016 at 13:26, Oleh Kravchenko <oleg@kaa.org.ua
> <mailto:oleg@kaa.org.ua>> wrote:
>
> Hi Olli,
>
> Looks like I miss something, what parameter do you mean?
>
> On 04.08.16 13:08, Olli Salonen wrote:
> > Hi Oleh,
> >
> > Do you have any idea of what this parameter change does? I have
> a gut
> > feeling that this is an option that's not Si2158-specific, but a
> > parameter that's valid for the other tuners as well.
> >
> > Do you know what this parameter will actually do? If so, it would be
> > better to add this as a configuration option for the Si2157. Your
> > patch will now change the behaviour even for devices that you
> probably
> > have not tested.
> >
> > Cheers,
> > -olli
> >
> > On 4 August 2016 at 10:54, Oleh Kravchenko <oleg@kaa.org.ua
> <mailto:oleg@kaa.org.ua>
> > <mailto:oleg@kaa.org.ua <mailto:oleg@kaa.org.ua>>> wrote:
> >
> > Signed-off-by: Oleh Kravchenko <oleg@kaa.org.ua
> <mailto:oleg@kaa.org.ua>
> > <mailto:oleg@kaa.org.ua <mailto:oleg@kaa.org.ua>>>
> > ---
> > drivers/media/tuners/si2157.c | 34
> > +++++++++++++++++++++++++++-------
> > drivers/media/tuners/si2157_priv.h | 1 +
> > 2 files changed, 28 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/media/tuners/si2157.c
> > b/drivers/media/tuners/si2157.c
> > index 57b2508..d7035a5 100644
> > --- a/drivers/media/tuners/si2157.c
> > +++ b/drivers/media/tuners/si2157.c
> > @@ -103,12 +103,21 @@ static int si2157_init(struct
> dvb_frontend *fe)
> > goto warm;
> >
> > /* power up */
> > - if (dev->chiptype == SI2157_CHIPTYPE_SI2146) {
> > - memcpy(cmd.args,
> > "\xc0\x05\x01\x00\x00\x0b\x00\x00\x01", 9);
> > - cmd.wlen = 9;
> > - } else {
> > - memcpy(cmd.args,
> >
> "\xc0\x00\x0c\x00\x00\x01\x01\x01\x01\x01\x01\x02\x00\x00\x01", 15);
> > - cmd.wlen = 15;
> > + switch (dev->chiptype) {
> > + case SI2157_CHIPTYPE_SI2146:
> > + memcpy(cmd.args,
> > "\xc0\x05\x01\x00\x00\x0b\x00\x00\x01", 9);
> > + cmd.wlen = 9;
> > + break;
> > +
> > + case SI2157_CHIPTYPE_SI2158:
> > + memcpy(cmd.args,
> >
> "\xC0\x00\x00\x00\x00\x01\x01\x01\x01\x01\x01\x02\x00\x00\x01", 15);
> > + cmd.wlen = 15;
> > + break;
> > +
> > + default:
> > + memcpy(cmd.args,
> >
> "\xc0\x00\x0c\x00\x00\x01\x01\x01\x01\x01\x01\x02\x00\x00\x01", 15);
> > + cmd.wlen = 15;
> > + break;
> > }
> > cmd.rlen = 1;
> > ret = si2157_cmd_execute(client, &cmd);
> > @@ -204,6 +213,16 @@ skip_fw_download:
> > if (ret)
> > goto err;
> >
> > + /* start tuner? */
> > + if (SI2157_CHIPTYPE_SI2158 == dev->chiptype) {
> > + memcpy(cmd.args, "\xC0\x00\x0C", 3);
> > + cmd.wlen = 3;
> > + cmd.rlen = 1;
> > + ret = si2157_cmd_execute(client, &cmd);
> > + if (ret)
> > + goto err;
> > + }
> > +
> > /* query firmware version */
> > memcpy(cmd.args, "\x11", 1);
> > cmd.wlen = 1;
> > @@ -506,8 +525,9 @@ static int si2157_remove(struct i2c_client
> > *client)
> > }
> >
> > static const struct i2c_device_id si2157_id_table[] = {
> > - {"si2157", SI2157_CHIPTYPE_SI2157},
> > {"si2146", SI2157_CHIPTYPE_SI2146},
> > + {"si2157", SI2157_CHIPTYPE_SI2157},
> > + {"si2158", SI2157_CHIPTYPE_SI2158},
> > {}
> > };
> > MODULE_DEVICE_TABLE(i2c, si2157_id_table);
> > diff --git a/drivers/media/tuners/si2157_priv.h
> > b/drivers/media/tuners/si2157_priv.h
> > index d6b2c7b..677fa00 100644
> > --- a/drivers/media/tuners/si2157_priv.h
> > +++ b/drivers/media/tuners/si2157_priv.h
> > @@ -42,6 +42,7 @@ struct si2157_dev {
> >
> > #define SI2157_CHIPTYPE_SI2157 0
> > #define SI2157_CHIPTYPE_SI2146 1
> > +#define SI2157_CHIPTYPE_SI2158 2
> >
> > /* firmware command struct */
> > #define SI2157_ARGLEN 30
> > --
> > 2.7.3
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe
> > linux-media" in
> > the body of a message to majordomo@vger.kernel.org
> <mailto:majordomo@vger.kernel.org>
> > <mailto:majordomo@vger.kernel.org
> <mailto:majordomo@vger.kernel.org>>
> > More majordomo info at
> http://vger.kernel.org/majordomo-info.html
> >
> >
>
> --
> Best regards,
> Oleh Kravchenko
>
> Senior Software Developer, CMS | skype: oleg_krava | Email:
> oleg@kaa.org.ua <mailto:oleg@kaa.org.ua>
>
>
>
--
Best regards,
Oleh Kravchenko
Senior Software Developer, CMS | skype: oleg_krava | Email: oleg@kaa.org.ua
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] [media] si2157: Improve support Si2158-A20 tuner
2016-08-04 12:03 ` Oleh Kravchenko
@ 2016-08-04 14:11 ` Oleh Kravchenko
2016-08-04 20:46 ` Evromedia USB Full Hybrid Full HD works!!! Oleh Kravchenko
0 siblings, 1 reply; 6+ messages in thread
From: Oleh Kravchenko @ 2016-08-04 14:11 UTC (permalink / raw)
To: Olli Salonen; +Cc: linux-media, Antti Palosaari
By the way, may be "C0 00 0C" enable RF receiver?
On 04.08.16 15:03, Oleh Kravchenko wrote:
> I got this from tracing I2C bus of tuner.
>
> Windows driver send this to tuner before set frequency, bandwidth, etc.:
> wC0 | 15 | C0 00 00 00 00 01 01 01 01 01 01 02 00 00 01 | ...............
>
> ; I cut firmware from here, by the way Windows driver use firmware v2.1.8
> wC0 | 2 | 01 01 | ..
>
> ; I don't known what is it, but with(out) it on Linux my tuner work fine!
> ; I think this is calibration data(?)
> wC0 | 6 | 14 00 10 06 E8 03 | ......
> wC0 | 6 | 14 00 11 06 00 00 | ......
> wC0 | 6 | 14 00 23 06 9E 80 | ..#...
> wC0 | 6 | 14 00 24 06 00 00 | ..$...
> wC0 | 6 | 14 00 03 06 08 00 | ......
> wC0 | 6 | 14 00 07 06 32 C8 | ....2.
> wC0 | 6 | 14 00 01 06 01 00 | ......
> wC0 | 6 | 14 00 13 06 00 03 | ......
> wC0 | 6 | 14 00 0C 06 88 13 | ......
> wC0 | 6 | 14 00 0D 06 94 64 | .....d
> wC0 | 6 | 14 00 17 06 00 00 | ......
> wC0 | 6 | 14 00 12 06 00 00 | ......
> wC0 | 6 | 14 00 05 06 BA 00 | ......
> wC0 | 6 | 14 00 04 06 00 02 | ......
> wC0 | 6 | 14 00 16 06 00 00 | ......
> wC0 | 6 | 14 00 02 04 08 00 | ......
> wC0 | 6 | 14 00 01 04 00 00 | ......
> wC0 | 6 | 14 00 11 07 00 00 | ......
> wC0 | 6 | 14 00 08 07 00 00 | ......
> wC0 | 6 | 14 00 02 07 01 00 | ......
> wC0 | 6 | 14 00 05 07 32 C8 | ....2.
> wC0 | 6 | 14 00 0C 07 01 00 | ......
> wC0 | 6 | 14 00 01 07 01 00 | ......
> wC0 | 6 | 14 00 0D 07 00 00 | ......
> wC0 | 6 | 14 00 0E 07 00 00 | ......
> wC0 | 6 | 14 00 10 07 00 00 | ......
> wC0 | 6 | 14 00 0A 07 00 01 | ......
> wC0 | 6 | 14 00 06 07 88 13 | ......
> wC0 | 6 | 14 00 07 07 94 1B | ......
> wC0 | 6 | 14 00 03 07 28 00 | ....(.
> wC0 | 6 | 14 00 13 07 FF FF | ......
> wC0 | 6 | 14 00 0F 07 00 00 | ......
> wC0 | 6 | 14 00 09 07 00 00 | ......
> wC0 | 6 | 14 00 04 07 B0 00 | ......
> wC0 | 6 | 14 00 12 07 10 00 | ......
> wC0 | 6 | 14 00 04 05 00 80 | ......
> wC0 | 6 | 14 00 01 05 01 00 | ......
> wC0 | 6 | 14 00 05 05 00 07 | ......
> wC0 | 6 | 14 00 06 05 01 00 | ......
> wC0 | 6 | 14 00 07 05 7F 00 | ......
>
> ; without C0 00 0C tuner is not work
> wC0 | 3 | C0 00 0C | ...
>
>
>
> On 04.08.16 14:11, Olli Salonen wrote:
>> Hi Oleh,
>>
>> It would seem to me that when you start the clocks here:
>>
>>> "\xC0\x00\x00\x00\x00\x01\x01\x01\x01\x01\x01\x02\x00\x00\x01", 15);
>> You've removed 0c from third octet compared to the default behaviour.
>> However, then later in the sequence you run:
>>
>>> + /* start tuner? */
>>> + if (SI2157_CHIPTYPE_SI2158 == dev->chiptype) {
>>> + memcpy(cmd.args, "\xC0\x00\x0C", 3);
>> Ie. there you do change the parameter in the third octet to 0c. I'm
>> wondering what's the reason and significance of that. Was there a
>> problem that you solved with this approach? Why is this way better
>> than the previous way? I'm trying to understand that.
>>
>> Cheers,
>> -olli
>>
>>
>>
>> On 4 August 2016 at 13:26, Oleh Kravchenko <oleg@kaa.org.ua
>> <mailto:oleg@kaa.org.ua>> wrote:
>>
>> Hi Olli,
>>
>> Looks like I miss something, what parameter do you mean?
>>
>> On 04.08.16 13:08, Olli Salonen wrote:
>> > Hi Oleh,
>> >
>> > Do you have any idea of what this parameter change does? I have
>> a gut
>> > feeling that this is an option that's not Si2158-specific, but a
>> > parameter that's valid for the other tuners as well.
>> >
>> > Do you know what this parameter will actually do? If so, it would be
>> > better to add this as a configuration option for the Si2157. Your
>> > patch will now change the behaviour even for devices that you
>> probably
>> > have not tested.
>> >
>> > Cheers,
>> > -olli
>> >
>> > On 4 August 2016 at 10:54, Oleh Kravchenko <oleg@kaa.org.ua
>> <mailto:oleg@kaa.org.ua>
>> > <mailto:oleg@kaa.org.ua <mailto:oleg@kaa.org.ua>>> wrote:
>> >
>> > Signed-off-by: Oleh Kravchenko <oleg@kaa.org.ua
>> <mailto:oleg@kaa.org.ua>
>> > <mailto:oleg@kaa.org.ua <mailto:oleg@kaa.org.ua>>>
>> > ---
>> > drivers/media/tuners/si2157.c | 34
>> > +++++++++++++++++++++++++++-------
>> > drivers/media/tuners/si2157_priv.h | 1 +
>> > 2 files changed, 28 insertions(+), 7 deletions(-)
>> >
>> > diff --git a/drivers/media/tuners/si2157.c
>> > b/drivers/media/tuners/si2157.c
>> > index 57b2508..d7035a5 100644
>> > --- a/drivers/media/tuners/si2157.c
>> > +++ b/drivers/media/tuners/si2157.c
>> > @@ -103,12 +103,21 @@ static int si2157_init(struct
>> dvb_frontend *fe)
>> > goto warm;
>> >
>> > /* power up */
>> > - if (dev->chiptype == SI2157_CHIPTYPE_SI2146) {
>> > - memcpy(cmd.args,
>> > "\xc0\x05\x01\x00\x00\x0b\x00\x00\x01", 9);
>> > - cmd.wlen = 9;
>> > - } else {
>> > - memcpy(cmd.args,
>> >
>> "\xc0\x00\x0c\x00\x00\x01\x01\x01\x01\x01\x01\x02\x00\x00\x01", 15);
>> > - cmd.wlen = 15;
>> > + switch (dev->chiptype) {
>> > + case SI2157_CHIPTYPE_SI2146:
>> > + memcpy(cmd.args,
>> > "\xc0\x05\x01\x00\x00\x0b\x00\x00\x01", 9);
>> > + cmd.wlen = 9;
>> > + break;
>> > +
>> > + case SI2157_CHIPTYPE_SI2158:
>> > + memcpy(cmd.args,
>> >
>> "\xC0\x00\x00\x00\x00\x01\x01\x01\x01\x01\x01\x02\x00\x00\x01", 15);
>> > + cmd.wlen = 15;
>> > + break;
>> > +
>> > + default:
>> > + memcpy(cmd.args,
>> >
>> "\xc0\x00\x0c\x00\x00\x01\x01\x01\x01\x01\x01\x02\x00\x00\x01", 15);
>> > + cmd.wlen = 15;
>> > + break;
>> > }
>> > cmd.rlen = 1;
>> > ret = si2157_cmd_execute(client, &cmd);
>> > @@ -204,6 +213,16 @@ skip_fw_download:
>> > if (ret)
>> > goto err;
>> >
>> > + /* start tuner? */
>> > + if (SI2157_CHIPTYPE_SI2158 == dev->chiptype) {
>> > + memcpy(cmd.args, "\xC0\x00\x0C", 3);
>> > + cmd.wlen = 3;
>> > + cmd.rlen = 1;
>> > + ret = si2157_cmd_execute(client, &cmd);
>> > + if (ret)
>> > + goto err;
>> > + }
>> > +
>> > /* query firmware version */
>> > memcpy(cmd.args, "\x11", 1);
>> > cmd.wlen = 1;
>> > @@ -506,8 +525,9 @@ static int si2157_remove(struct i2c_client
>> > *client)
>> > }
>> >
>> > static const struct i2c_device_id si2157_id_table[] = {
>> > - {"si2157", SI2157_CHIPTYPE_SI2157},
>> > {"si2146", SI2157_CHIPTYPE_SI2146},
>> > + {"si2157", SI2157_CHIPTYPE_SI2157},
>> > + {"si2158", SI2157_CHIPTYPE_SI2158},
>> > {}
>> > };
>> > MODULE_DEVICE_TABLE(i2c, si2157_id_table);
>> > diff --git a/drivers/media/tuners/si2157_priv.h
>> > b/drivers/media/tuners/si2157_priv.h
>> > index d6b2c7b..677fa00 100644
>> > --- a/drivers/media/tuners/si2157_priv.h
>> > +++ b/drivers/media/tuners/si2157_priv.h
>> > @@ -42,6 +42,7 @@ struct si2157_dev {
>> >
>> > #define SI2157_CHIPTYPE_SI2157 0
>> > #define SI2157_CHIPTYPE_SI2146 1
>> > +#define SI2157_CHIPTYPE_SI2158 2
>> >
>> > /* firmware command struct */
>> > #define SI2157_ARGLEN 30
>> > --
>> > 2.7.3
>> >
>> > --
>> > To unsubscribe from this list: send the line "unsubscribe
>> > linux-media" in
>> > the body of a message to majordomo@vger.kernel.org
>> <mailto:majordomo@vger.kernel.org>
>> > <mailto:majordomo@vger.kernel.org
>> <mailto:majordomo@vger.kernel.org>>
>> > More majordomo info at
>> http://vger.kernel.org/majordomo-info.html
>> >
>> >
>>
>> --
>> Best regards,
>> Oleh Kravchenko
>>
>> Senior Software Developer, CMS | skype: oleg_krava | Email:
>> oleg@kaa.org.ua <mailto:oleg@kaa.org.ua>
>>
>>
>>
--
Best regards,
Oleh Kravchenko
Senior Software Developer, CMS | skype: oleg_krava | Email: oleg@kaa.org.ua
^ permalink raw reply [flat|nested] 6+ messages in thread
* Evromedia USB Full Hybrid Full HD works!!!
2016-08-04 14:11 ` Oleh Kravchenko
@ 2016-08-04 20:46 ` Oleh Kravchenko
0 siblings, 0 replies; 6+ messages in thread
From: Oleh Kravchenko @ 2016-08-04 20:46 UTC (permalink / raw)
To: Antti Palosaari, Olli Salonen; +Cc: linux-media
Hello Antti, Olli!
I tried media-video/kaffeine and now I have all 32 channels which
translated in Kyiv, Ukraine!
https://owncloud.kaa.org.ua/index.php/s/SvyIiTry3u7zZqj
What I should do with `si2157_ops` structure?
si2147 and si2157 have 42-870 MHz frequency range, but si2158 have
42-1002 MHz frequency range!
Should I define second `dvb_tuner_ops` structure?
Also, Evromedia USB Full Hybrid Full HD require changes in
cx231xx_i2c_send_bytes(), like this:
--- a/drivers/media/usb/cx231xx/cx231xx-i2c.c
+++ b/drivers/media/usb/cx231xx/cx231xx-i2c.c
@@ -171,6 +171,43 @@ static int cx231xx_i2c_send_bytes(
bus->i2c_nostop = 0;
bus->i2c_reserve = 0;
+//} else if (is_tuner(dev, bus, msg, TUNER_SI2158)) {
+} else if (0x60 == msg->addr && msg->len > 4) {
+ size = msg->len;
+
+ /* special case for Evromedia USB Full Hybrid Full HD */
+ saddr_len = 1;
+
+ /* adjust the length to correct length */
+ size -= saddr_len;
+
+ buf_ptr = (u8 *) (msg->buf + 1);
+
+ do {
+ /* prepare xfer_data struct */
+ req_data.dev_addr = msg->addr;
+ req_data.direction = msg->flags;
+ req_data.saddr_len = saddr_len;
+ req_data.saddr_dat = msg->buf[0];
+ req_data.buf_size = size > 4 ? 4 : size;
+ req_data.p_buffer = (u8 *) (buf_ptr + loop * 4);
+
+ bus->i2c_nostop = (size > 4) ? 1 : 0;
+ bus->i2c_reserve = (loop == 0) ? 0 : 1;
+
+ /* usb send command */
+ status = dev->cx231xx_send_usb_command(bus, &req_data);
+ ++ loop;
+
+ if (size >= 4)
+ size -= 4;
+ else
+ size = 0;
+
+ } while (size > 0);
+
+ bus->i2c_nostop = 0;
+ bus->i2c_reserve = 0;
How I can implement this in right way? :) Any ideas?
PS:
\xc0\x00\x0c\x00\x00\x01\x01\x01\x01\x01\x01\x02\x00\x00\x01
also fine for si2158, I have signal!
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] [media] si2157: Improve support Si2158-A20 tuner
2016-08-04 7:54 [PATCH] [media] si2157: Improve support Si2158-A20 tuner Oleh Kravchenko
[not found] ` <CAAZRmGxM8U+PBfP4RWfnLDH0gdw+2oSuMAivzYBxRqSqTPM4FQ@mail.gmail.com>
@ 2016-10-24 15:54 ` Mauro Carvalho Chehab
1 sibling, 0 replies; 6+ messages in thread
From: Mauro Carvalho Chehab @ 2016-10-24 15:54 UTC (permalink / raw)
To: Oleh Kravchenko; +Cc: linux-media, crope, Olli Salonen
Em Thu, 4 Aug 2016 10:54:02 +0300
Oleh Kravchenko <oleg@kaa.org.ua> escreveu:
> Signed-off-by: Oleh Kravchenko <oleg@kaa.org.ua>
What's the status of this patch? Is it still valid? If so, please re-send
with a proper description. e. g. what is it improving? why? how?
Regards,
Mauro
> ---
> drivers/media/tuners/si2157.c | 34 +++++++++++++++++++++++++++-------
> drivers/media/tuners/si2157_priv.h | 1 +
> 2 files changed, 28 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/media/tuners/si2157.c b/drivers/media/tuners/si2157.c
> index 57b2508..d7035a5 100644
> --- a/drivers/media/tuners/si2157.c
> +++ b/drivers/media/tuners/si2157.c
> @@ -103,12 +103,21 @@ static int si2157_init(struct dvb_frontend *fe)
> goto warm;
>
> /* power up */
> - if (dev->chiptype == SI2157_CHIPTYPE_SI2146) {
> - memcpy(cmd.args, "\xc0\x05\x01\x00\x00\x0b\x00\x00\x01", 9);
> - cmd.wlen = 9;
> - } else {
> - memcpy(cmd.args, "\xc0\x00\x0c\x00\x00\x01\x01\x01\x01\x01\x01\x02\x00\x00\x01", 15);
> - cmd.wlen = 15;
> + switch (dev->chiptype) {
> + case SI2157_CHIPTYPE_SI2146:
> + memcpy(cmd.args, "\xc0\x05\x01\x00\x00\x0b\x00\x00\x01", 9);
> + cmd.wlen = 9;
> + break;
> +
> + case SI2157_CHIPTYPE_SI2158:
> + memcpy(cmd.args, "\xC0\x00\x00\x00\x00\x01\x01\x01\x01\x01\x01\x02\x00\x00\x01", 15);
> + cmd.wlen = 15;
> + break;
> +
> + default:
> + memcpy(cmd.args, "\xc0\x00\x0c\x00\x00\x01\x01\x01\x01\x01\x01\x02\x00\x00\x01", 15);
> + cmd.wlen = 15;
> + break;
> }
> cmd.rlen = 1;
> ret = si2157_cmd_execute(client, &cmd);
> @@ -204,6 +213,16 @@ skip_fw_download:
> if (ret)
> goto err;
>
> + /* start tuner? */
> + if (SI2157_CHIPTYPE_SI2158 == dev->chiptype) {
> + memcpy(cmd.args, "\xC0\x00\x0C", 3);
> + cmd.wlen = 3;
> + cmd.rlen = 1;
> + ret = si2157_cmd_execute(client, &cmd);
> + if (ret)
> + goto err;
> + }
> +
> /* query firmware version */
> memcpy(cmd.args, "\x11", 1);
> cmd.wlen = 1;
> @@ -506,8 +525,9 @@ static int si2157_remove(struct i2c_client *client)
> }
>
> static const struct i2c_device_id si2157_id_table[] = {
> - {"si2157", SI2157_CHIPTYPE_SI2157},
> {"si2146", SI2157_CHIPTYPE_SI2146},
> + {"si2157", SI2157_CHIPTYPE_SI2157},
> + {"si2158", SI2157_CHIPTYPE_SI2158},
> {}
> };
> MODULE_DEVICE_TABLE(i2c, si2157_id_table);
> diff --git a/drivers/media/tuners/si2157_priv.h b/drivers/media/tuners/si2157_priv.h
> index d6b2c7b..677fa00 100644
> --- a/drivers/media/tuners/si2157_priv.h
> +++ b/drivers/media/tuners/si2157_priv.h
> @@ -42,6 +42,7 @@ struct si2157_dev {
>
> #define SI2157_CHIPTYPE_SI2157 0
> #define SI2157_CHIPTYPE_SI2146 1
> +#define SI2157_CHIPTYPE_SI2158 2
>
> /* firmware command struct */
> #define SI2157_ARGLEN 30
Thanks,
Mauro
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-10-24 15:54 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-04 7:54 [PATCH] [media] si2157: Improve support Si2158-A20 tuner Oleh Kravchenko
[not found] ` <CAAZRmGxM8U+PBfP4RWfnLDH0gdw+2oSuMAivzYBxRqSqTPM4FQ@mail.gmail.com>
2016-08-04 10:26 ` Oleh Kravchenko
[not found] ` <CAAZRmGykv5LOmBxKYNUgi07+Rt=OTN3_+Cdu7BUGT0KbY0LPiA@mail.gmail.com>
2016-08-04 12:03 ` Oleh Kravchenko
2016-08-04 14:11 ` Oleh Kravchenko
2016-08-04 20:46 ` Evromedia USB Full Hybrid Full HD works!!! Oleh Kravchenko
2016-10-24 15:54 ` [PATCH] [media] si2157: Improve support Si2158-A20 tuner Mauro Carvalho Chehab
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).