Re: [PATCH] Add support for TechniSat Skystar S2

2015-04-20 Thread Johannes Stezenbach
(add Mauro)

On Sun, Apr 19, 2015 at 11:19:43PM +0200, Patrick Boettcher wrote:
 On Fri, 17 Apr 2015 11:06:30 +0200
 Patrick Boettcher patrick.boettc...@posteo.de wrote:
  http://git.linuxtv.org/cgit.cgi/pb/media_tree.git/ cx24120-v2
 
 Jannis pointed out, that my repository on linuxtv.org was not
 fetchable...
 
 I put one onto github, this should work:
 
 https://github.com/pboettch/linux.git cx24120-v2
 
 It is the same commits as I was pushing to the linuxtv.org .

Patrick, can you point out why your repository is
not fetchable?  Any error messages?

Johannes
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] Add support for TechniSat Skystar S2

2015-04-20 Thread Patrick Boettcher
Hi Johannes,

On Mon, 20 Apr 2015 10:20:47 +0200 Johannes Stezenbach j...@linuxtv.org
wrote:

 (add Mauro)
 
 On Sun, Apr 19, 2015 at 11:19:43PM +0200, Patrick Boettcher wrote:
  On Fri, 17 Apr 2015 11:06:30 +0200
  Patrick Boettcher patrick.boettc...@posteo.de wrote:
   http://git.linuxtv.org/cgit.cgi/pb/media_tree.git/ cx24120-v2
  
  Jannis pointed out, that my repository on linuxtv.org was not
  fetchable...
  
  I put one onto github, this should work:
  
  https://github.com/pboettch/linux.git cx24120-v2
  
  It is the same commits as I was pushing to the linuxtv.org .
 
 Patrick, can you point out why your repository is
 not fetchable?  Any error messages?

In the meantime I recreated it from scratch (using git-menu I did
delete - clone).

Before it was giving error like this:

remote: error: Could not read 28df73703e738d8ae7a958350f74b08b2e9fe9ed
remote: fatal: Failed to traverse parents of commit
6b9d03db027c532e509ad9064dd767f621b6e69a

This seems to me a problem of a git push not uploading all the missing
commits between my local repo's commit-base and the remote one.

My repo was very old (2010). I assume none has ever cloned from it and
the media_tree has itself been push forced several times.

--
Patrick.
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] Add support for TechniSat Skystar S2

2015-04-20 Thread Patrick Boettcher
Hi Jemma,

On Fri, 17 Apr 2015 12:47:50 +0100 Jemma Denson jden...@gmail.com
wrote:

  To prepare an integration into 4.2 (or at least 4.3) I suggest
  using my media_tree on linuxtv.org .
 
  http://git.linuxtv.org/cgit.cgi/pb/media_tree.git/ cx24120-v2
 
  I added a checkpatch-patch on top of it. If you can, please base any
  future work of yours on this tree until is has been integrated.
 Will do! If I can work out the SNR scale I have got plans to have
 this work in the new way of doing this. Did you ever manage to obtain
 a datasheet for this demod? I have tried contacting NXP but haven't 
 received anything back.

What can I say: it works. I'm just using it as a DVB-S2 receiver for my
vdr-installation and I can successfully zap and vdr is doing its
background/epg scanning.

I consider it OK for inclusion. Any fixes, if any, can be later on.

regards,
--
Patrick.


--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] Add support for TechniSat Skystar S2

2015-04-19 Thread Patrick Boettcher
Hi,

On Fri, 17 Apr 2015 11:06:30 +0200
Patrick Boettcher patrick.boettc...@posteo.de wrote:
 http://git.linuxtv.org/cgit.cgi/pb/media_tree.git/ cx24120-v2

Jannis pointed out, that my repository on linuxtv.org was not
fetchable...

I put one onto github, this should work:

https://github.com/pboettch/linux.git cx24120-v2

It is the same commits as I was pushing to the linuxtv.org .

regards,
--
Patrick.
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] Add support for TechniSat Skystar S2

2015-04-17 Thread Patrick Boettcher
Hi Jemma,

Thanks for taking this one. I had this on my list for years.

On Mon, 13 Apr 2015 07:32:15 +0100 Jemma Denson jden...@gmail.com
wrote:

 Oh, I was doing this the wrong way then. I did have some preamble to
 this but it seems to have been stripped.
 
 Anyway, this patch adds support for the Technisat Skystar S2 - this
 has been tried before but the cx24120 driver was a bit out of shape
 and it didn't got any further:
 https://patchwork.linuxtv.org/patch/10575/
 
 It is an old card, but currently being sold off for next to nothing,
 so it's proving quite popular of late.
 Noticing it's quite similar to the cx24116 and cx24117 I've rewritten
 the driver in a similar way. There were a few registers and commands
 from those drivers missing from this one I've tested out and found
 they do something so they've been added in to speed up tuning and to
 make get_frontend return something useful.

If time allows it I will try to install and test your driver this
weekend or, at the latest, next weekend.

 I've only got access to 28.2E, but everything I've tried seems to work
 OK, on both the v3 and v5 APIs. Assuming I've read the APIs and some
 of the modern drivers OK it should be doing things in the reasonably
 modern way, but if anything else needs doing let me know.

I have my Skystar S2 pointed to 19.2E.

To prepare an integration into 4.2 (or at least 4.3) I suggest using my
media_tree on linuxtv.org .

http://git.linuxtv.org/cgit.cgi/pb/media_tree.git/ cx24120-v2

I added a checkpatch-patch on top of it. If you can, please base any
future work of yours on this tree until is has been integrated.

Please also tell me, whether you are OK with the comment I added around
your commit or not.

Thanks,
--
Patrick.
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] Add support for TechniSat Skystar S2

2015-04-17 Thread Jemma Denson

On 17/04/15 10:06, Patrick Boettcher wrote:

I have my Skystar S2 pointed to 19.2E.
That would be great if you could test on that, 28.2E can be a bit 
conservative. The parts that I consider need testing are FEC and Pilot 
on DVBS2 - I didn't have that much variety in FEC values, and as far as 
I could tell everything is Pilot=ON on 28.2.


If it's not obvious from the code and comments, the values used for 
tuning are in the modfec_table, and the pattern *seems* to match with 
the modfec_lookup_table - for DVBS2, anyway. With DVBS the values for 
setting and getting are different, and not just a straight +=0x2d 
unfortunately.
I did have a plan to merge these two tables together, and it would need 
a seperate u8 val for setting and getting due to DVBS being odd.


Pilot was admittedly a bit of guesswork - it seems to be able to do the 
same thing as the cx24117 driver, in that ON is |= 0x40 and AUTO is 
|=0x80. To work out the fec values needed I had some code that looped 
through from 0x01 to 0xff and found that, for example, 8PSK 2/3 worked 
on 0x4d, 0x8d and 0xcd and failed to tune on 0x0d which made me realise 
that the top two bits were infact pilot.
It really does need testing with a S2 transponder which needs pilot off 
- to check firstly that the tuning mask is correct, and also that 
get_fec is doing the right thing with retrieving the value. I'm not 100% 
sure that bit 8 signifies pilot in that register, but it seems to fit in 
that that clock ratios needed are different which would be due to the 
data rate being slightly lower when pilot is in use.



To prepare an integration into 4.2 (or at least 4.3) I suggest using my
media_tree on linuxtv.org .

http://git.linuxtv.org/cgit.cgi/pb/media_tree.git/ cx24120-v2

I added a checkpatch-patch on top of it. If you can, please base any
future work of yours on this tree until is has been integrated.
Will do! If I can work out the SNR scale I have got plans to have this 
work in the new way of doing this. Did you ever manage to obtain a 
datasheet for this demod? I have tried contacting NXP but haven't 
received anything back.



Please also tell me, whether you are OK with the comment I added around
your commit or not.

Yes, that's OK.

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH] Add support for TechniSat Skystar S2

2015-04-13 Thread Jemma Denson

Oh, I was doing this the wrong way then. I did have some preamble to
this but it seems to have been stripped.

Anyway, this patch adds support for the Technisat Skystar S2 - this
has been tried before but the cx24120 driver was a bit out of shape
and it didn't got any further:
https://patchwork.linuxtv.org/patch/10575/

It is an old card, but currently being sold off for next to nothing,
so it's proving quite popular of late.
Noticing it's quite similar to the cx24116 and cx24117 I've rewritten
the driver in a similar way. There were a few registers and commands
from those drivers missing from this one I've tested out and found
they do something so they've been added in to speed up tuning and to
make get_frontend return something useful.

I've only got access to 28.2E, but everything I've tried seems to work
OK, on both the v3 and v5 APIs. Assuming I've read the APIs and some
of the modern drivers OK it should be doing things in the reasonably
modern way, but if anything else needs doing let me know.
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] Add support for TechniSat Skystar S2

2015-04-12 Thread Jemma Denson
Signed-off-by: Jemma Denson jden...@gmail.com
---
 drivers/media/common/b2c2/Kconfig|1 +
 drivers/media/common/b2c2/flexcop-fe-tuner.c |   51 +-
 drivers/media/common/b2c2/flexcop-misc.c |1 +
 drivers/media/common/b2c2/flexcop-reg.h  |1 +
 drivers/media/dvb-frontends/Kconfig  |7 +
 drivers/media/dvb-frontends/Makefile |1 +
 drivers/media/dvb-frontends/cx24120.c| 1577 ++
 drivers/media/dvb-frontends/cx24120.h|   56 +
 8 files changed, 1688 insertions(+), 7 deletions(-)
 create mode 100644 drivers/media/dvb-frontends/cx24120.c
 create mode 100644 drivers/media/dvb-frontends/cx24120.h

diff --git a/drivers/media/common/b2c2/Kconfig 
b/drivers/media/common/b2c2/Kconfig
index a8c6cdf..e593638 100644
--- a/drivers/media/common/b2c2/Kconfig
+++ b/drivers/media/common/b2c2/Kconfig
@@ -14,6 +14,7 @@ config DVB_B2C2_FLEXCOP
select DVB_S5H1420 if MEDIA_SUBDRV_AUTOSELECT
select DVB_TUNER_ITD1000 if MEDIA_SUBDRV_AUTOSELECT
select DVB_ISL6421 if MEDIA_SUBDRV_AUTOSELECT
+   select DVB_CX24120 if MEDIA_SUBDRV_AUTOSELECT
select DVB_CX24123 if MEDIA_SUBDRV_AUTOSELECT
select MEDIA_TUNER_SIMPLE if MEDIA_SUBDRV_AUTOSELECT
select DVB_TUNER_CX24113 if MEDIA_SUBDRV_AUTOSELECT
diff --git a/drivers/media/common/b2c2/flexcop-fe-tuner.c 
b/drivers/media/common/b2c2/flexcop-fe-tuner.c
index 7e14e90..66f6910 100644
--- a/drivers/media/common/b2c2/flexcop-fe-tuner.c
+++ b/drivers/media/common/b2c2/flexcop-fe-tuner.c
@@ -12,6 +12,7 @@
 #include cx24113.h
 #include cx24123.h
 #include isl6421.h
+#include cx24120.h
 #include mt352.h
 #include bcm3510.h
 #include nxt200x.h
@@ -26,6 +27,16 @@
 #define FE_SUPPORTED(fe) (defined(CONFIG_DVB_##fe) || \
(defined(CONFIG_DVB_##fe##_MODULE)  defined(MODULE)))
 
+#if FE_SUPPORTED(BCM3510) || FE_SUPPORTED(CX24120)
+static int flexcop_fe_request_firmware(struct dvb_frontend *fe,
+   const struct firmware **fw, char *name)
+{
+   struct flexcop_device *fc = fe-dvb-priv;
+
+   return request_firmware(fw, name, fc-dev);
+}
+#endif
+
 /* lnb control */
 #if FE_SUPPORTED(MT312) || FE_SUPPORTED(STV0299)
 static int flexcop_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t 
voltage)
@@ -445,13 +456,6 @@ static int airstar_dvbt_attach(struct flexcop_device *fc,
 
 /* AirStar ATSC 1st generation */
 #if FE_SUPPORTED(BCM3510)
-static int flexcop_fe_request_firmware(struct dvb_frontend *fe,
-   const struct firmware **fw, char* name)
-{
-   struct flexcop_device *fc = fe-dvb-priv;
-   return request_firmware(fw, name, fc-dev);
-}
-
 static struct bcm3510_config air2pc_atsc_first_gen_config = {
.demod_address= 0x0f,
.request_firmware = flexcop_fe_request_firmware,
@@ -619,6 +623,38 @@ fail:
 #define cablestar2_attach NULL
 #endif
 
+/* SkyStar S2 PCI DVB-S/S2 card based on Conexant cx24120/cx24118 */
+#if FE_SUPPORTED(CX24120)  FE_SUPPORTED(ISL6421)
+static const struct cx24120_config skystar2_rev3_3_cx24120_config = {
+   .i2c_addr = 0x55,
+   .xtal_khz = 10111,
+   .initial_mpeg_config = { 0xa1, 0x76, 0x07 },
+   .request_firmware = flexcop_fe_request_firmware,
+};
+
+static int skystarS2_rev33_attach(struct flexcop_device *fc,
+   struct i2c_adapter *i2c)
+{
+   fc-fe = dvb_attach(cx24120_attach,
+   skystar2_rev3_3_cx24120_config, i2c);
+   if (fc-fe == NULL)
+   return 0;
+
+   fc-dev_type = FC_SKYS2_REV33;
+   fc-fc_i2c_adap[2].no_base_addr = 1;
+   if ((dvb_attach(isl6421_attach, fc-fe,
+   fc-fc_i2c_adap[2].i2c_adap, 0x08, 0, 0, false) == NULL)) {
+   err(ISL6421 could NOT be attached!);
+   return 0;
+   }
+   info(ISL6421 successfully attached.);
+
+   return 1;
+}
+#else
+#define skystarS2_rev33_attach NULL
+#endif
+
 static struct {
flexcop_device_type_t type;
int (*attach)(struct flexcop_device *, struct i2c_adapter *);
@@ -632,6 +668,7 @@ static struct {
{ FC_AIR_ATSC1, airstar_atsc1_attach },
{ FC_CABLE, cablestar2_attach },
{ FC_SKY_REV23, skystar2_rev23_attach },
+   { FC_SKYS2_REV33, skystarS2_rev33_attach },
 };
 
 /* try to figure out the frontend */
diff --git a/drivers/media/common/b2c2/flexcop-misc.c 
b/drivers/media/common/b2c2/flexcop-misc.c
index f06f3a9..b8eff23 100644
--- a/drivers/media/common/b2c2/flexcop-misc.c
+++ b/drivers/media/common/b2c2/flexcop-misc.c
@@ -56,6 +56,7 @@ static const char *flexcop_device_names[] = {
[FC_SKY_REV26]  = Sky2PC/SkyStar 2 DVB-S rev 2.6,
[FC_SKY_REV27]  = Sky2PC/SkyStar 2 DVB-S rev 2.7a/u,
[FC_SKY_REV28]  = Sky2PC/SkyStar 2 DVB-S rev 2.8,
+   [FC_SKYS2_REV33] = Sky2PC/SkyStar S2 DVB-S/S2 rev 3.3,
 };
 
 static const char *flexcop_bus_names[] = {
diff --git a/drivers/media/common/b2c2/flexcop-reg.h 
b/drivers/media/common/b2c2/flexcop-reg.h
index dc4528d..835c54d 100644

Re: [PATCH] Add support for TechniSat SkyStar S2 / CX24120-13Z frontend

2012-04-11 Thread Mauro Carvalho Chehab
Hi Jannis,

Em 04-04-2012 04:11, Jannis escreveu:
 Hi all,
 
 some (longer) time ago, I posted to this list concerning the
 CX24120-frontend
 (http://www.spinics.net/lists/linux-media/msg33717.html). By now I
 modified the patch to work with linux-3.4-r1 (after the DVB-interface
 changes):
 
 [2.434181] b2c2-flexcop: B2C2 FlexcopII/II(b)/III digital TV
 receiver chip loaded successfully
 [2.434240] flexcop-pci: will use the HW PID filter.
 [2.434242] flexcop-pci: card revision 2
 [2.438105] DVB: registering new adapter (FlexCop Digital TV device)
 [2.440018] b2c2-flexcop: MAC address = 00:08:c9:e0:87:57
 [2.440024] CX24120: cx24120_attach: - Conexant cx24120/cx24118 -
 DVBS/S2 Satellite demod/tuner
 [2.440025] CX24120: cx24120_attach: - Driver version: 'SVT - 0.0.4a
03.04.2012'
 [2.440149] CX24120: cx24120_attach: - Demod CX24120 rev. 0x07 detected.
 [2.440150] CX24120: cx24120_attach: - Conexant cx24120/cx24118 -
 DVBS/S2 Satellite demod/tuner ATTACHED.
 [2.440440] b2c2-flexcop: ISL6421 successfully attached.
 [2.440440] b2c2-flexcop: found 'Conexant CX24120/CX24118' .
 [2.440442] DVB: registering adapter 0 frontend 0 (Conexant
 CX24120/CX24118)...
 [2.440648] b2c2-flexcop: initialization of 'Sky2PC/SkyStar S2
 DVB-S/S2 rev 3.3' at the 'PCI' bus controlled by a 'FlexCopIIb' complete
 
 As stated in the original message, the patch is not written by me, the
 author is Sergey Tyurin, I just modified it so it keeps working with
 current kernels. Since I don't know an appropiate location for
 publishing this, I thought this is best sent upstream.

If the patch was made by Sergey, you should add, at the beginning of the
body of the email, a like like:

From: Sergey Tyurin his@email


and add your comments like:

[jannis-li...@kripserver.net: patch ported to the current DVB kernel ABI]

You should also add your Signed-off-by:. It is also highly recommended
that you would get Sergey's Signed-off-by on it.

Please see LinuxTV developer wiki pages, in order to check the proper ways
to submit the patch upstream.

In particular, please check the patch using scripts/checkpatch.pl. This
tool checks the patch CodingStyle. It also checks a few trivial mistakes.

It currently doesn't like this code very much:

ERROR: Missing Signed-off-by: line(s)

total: 515 errors, 394 warnings, 1522 lines checked

NOTE: whitespace errors detected, you may wish to use scripts/cleanpatch or
  scripts/cleanfile

As you're not the author of the original driver, the better procedure is
to submit Sergey's driver as-is (but without the Kconfig/Makefile changes,
in order to avoid it to break compilation), then a patch fixing it to the
current ABI from you, and patch/patch series from you fixing the CodingStyle 
issues.

Btw, scripts/Lindent in general solves most of those issues (although it
is not a perfect tool).

 This patch was tested with some channels (SDTV, HDTV and audio only
 (radio)) from Astra-19.2E in Europe.
 
 If you have any comments abouth things that stop the patch from going
 upstream, please feel free to tell me and I'll see if I can change them.

I just did a quick look on it, as it is harder to analyze a code with a
different CodingStyle.

There are too many EXPORT_SYMBOL() there, several of them for static functions.
That's wrong. Only non-static functions used by other modules should use
EXPORT_SYMBOL. Probably, the only function that requires it is cx24120_attach().

Anyway, I'll do a deeper review after you fix the pointed issues.
 
 Best regards,
   Jannis Achstetter

Regards,
Mauro
--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html