Re: Re: [PATCH 1/6] m88ds3103, montage dvb-s/s2 demodulator driver

2012-04-27 Thread nibble.max
2012-04-28 10:57:19 nibble@gmail.com
Antti, Mauro,

i believe we're all on the same page here and i just want to summarize
based on all the discussion so far and if we all agree:

1) ds3000 and ts2020 code split, there are already several strong
arguments about it and most of all that it turned out there is
reference design with 3rd party tuner that works both with ds3000 and
stv090x demodulators. i will take care of this task


Montage demodulator has worked with Sharp 6306 CAN tuner for several years.
I suggest to put the dvb-s/s2 initialize constant data of ds3000 to the 
seperate files.
As i patch ds3103, it has also dvb-s/s2 initialize datas. 
It will make ds3000 file too long and ugly to review.
As i do in the try patch placing them into ds3000_priv.h.

2) the result of 1) would be that the following DVB-S2 tuner and
demodulator drivers will be able to work in any combination of each
other (assuming there is such hardware design available): stb0899*,
stv090x*, ds3000, stv6110x*, stb6100* and ts2020. that's good, because
it starts to put order, because those are significant part of the
DVB-S2 drivers in the kernel

3) not only, because of 2), but in general it's not clear why there is
stv6110.* driver, which is for the exact same silicone as stv6110x*,
as well stv0900*, which is for the same family of chips as stv090x*. i
can help a little here to the degree that i can make all bridge
drivers depend on stv6110x* and stv090x* except the driver for one
card made by NetUP - there i can just do it in theory, but i can't
test and probably break support for it

4) after 1), 2) and if 3) is resolved the only DVB-S2 drivers that
will continue to be married to one particular tuner (CX24118A) that
will left are cx24116 and tda10071, which for the time being will be
left that way until basically there is someone that volunteers to make
separate CX24118A driver based on the LG, SHARP and Comtech datasheets
that are available in the public domain, for which i gave details in a
previous email, and which in my opinion contain sufficient information
that task to be made

5) ds3103 and ts2022 support, done in form of a patch respectively to
ds3000 driver and ts2020 driver or if ts2022 happens to be very
different than ts2020 then ts2022 support be made as separate driver,
i guess Max will take this


FYI,We have approval from Montage to let us use its reference code under GPLv2 
lincense.

But to their surprise, they review ds3000.c and find the tuner and demod config 
part almost same as their reference code.
They have not agree anybody to public their code under GPLv2 before.
They doubt that ds3000.c public is breaking their NDA without their permission.

6) if it's necessary bug fixes, improvements, etc to the shared code
between ds3000 and ds3103, but only after review, discussion and
argumentation why those changes are actually needed


On Fri, Apr 27, 2012 at 11:42 PM, Antti Palosaari cr...@iki.fi wrote:
 On 27.04.2012 23:21, Konstantin Dimitrov wrote:

 On Fri, Apr 27, 2012 at 10:55 PM, Antti Palosaaricr...@iki.fi  wrote:

 On 27.04.2012 22:01, Konstantin Dimitrov wrote:


 Mauro, your reasoning makes sense to me. so, let's split them and at
 least settle this part of the discussion - i will do as far as my
 spare time allows, as well make sure there are no some problems
 introduced after the split.

 also, in one email i've just sent in answer to Antti there is enough
 argument why such split, i.e. tuner-pass-through-mode is subject to
 discussion about CX24116 and TDA10071 drivers too. currently, majority
 of DVB-S2 demodulator drivers in the kernel are married to particular
 tuners and there is no split.



 I read the mail and as it was long study, I comment only that
 CX24116+CX24118A and TDA10071+CX24118A demod+tuner combos versus Montage
 demod+tuner combos. As you may see, CX24116 and TDA10071 are so much
 different than both needs own driver. But as you said those are married
 always as a demod+tuner.

 So if I use your logic, what happens if CX24118A tuner is not driven by
 CX24116 or TDA10071 firmware? ==  it happens we have two drivers,
 CX24116
 and TDA10071 *both* having similar CX24118A tuner driver code inside!
 Same
 tuner driver code inside two demods drivers. Could you now understand why
 we
 want it split?
 The reason which saves us having CX24118A tuner driver is that it is
 inside
 both CX24116 and TDA10071 firmware.

 There is mainly two different controlling situation. Most commonly driver
 controls chip but in some cases it is firmware which is controlling. And
 I
 don't see it very important trying always to by-pass firmware control and
 use driver for that.


 i got that point, but what happens if tomorrow their is CX24116 or
 TDA10071 design with tuner different than CX14118A? in fact the LG
 datasheet i pointed out to you clearly states that for example there
 is actually such design - case when CX24116 is used with CX24128 tuner
 instead CX24118A in which case the only way is 

Re: Re: Re: [PATCH 1/6] m88ds3103, montage dvb-s/s2 demodulator driver

2012-04-26 Thread nibble.max
2012-04-26 20:59:28 nibble@gmail.com
2012-04-24 09:50:33 nibble@gmail.com
Em 23-04-2012 19:51, Konstantin Dimitrov escreveu:
 Antti, i already commented about ds3103 drivers months ago:
 
 also, why Montage tuner code should be spitted from the demodulator
 code? is there any evidence that any Montage tuner (ts2020 or ts2022)
 can work with 3rd party demodulator different than ds3000 or ds3103?

This has nothing to do with Montage devices, but with the way we write
those drivers in Kernel.

There are _several_ examples where the driver for a single silicon were
turned into more than one driver. The biggest examples are the SoC chips,
that are transformed into a large series of drivers.

Another example is the cx88 driver: due to technical reasons, it was splitted 
into 4 drivers, one for each different PCI ID exported by it. 

The cx2341x driver is also an interesting example: while it used to be for a
separate chip, the cx2341x functions are now part of IP blocks on newer 
Conexant chipsets. Those single chips require two drivers to work (cx2341x
and the associated media PCI bridge driver).

Looking into tuners, there are the tda18271 family of devices, with are
supported by several drivers: tda827x, tda8290 and tda18271-fe, depending
on how the actual device is mounted. Eventually, the actual tuner may
also have a tda9887 inside it.

So, there's nothing wrong on splitting it on separate drivers. In a matter of
fact, we strongly prefer to have tuners separate from demods. Having them
together can only be justified technically, if there are really strong reasons
why they should be at the same driver.

I probably missed this at my review for ds3000 (that's why it ended by being
merged), but, on the review I did on it (accidentally due to m88ds3103 
patchset
review), it is clear that the tuner has actually a different I2C address 
(0x60)
than the demod, and it is indeed a separate device. Sorry for slipping into 
it.

Anyway, now that this is noticed, tuner and demod drivers should be split,
especially since there are some patches floating around to add support for 
ds3103.

As I said before, the right thing to do is:

  1) split ds3000 from ts2020 at the existing driver;
  2) add support for the newer chips (ds3103/ts2022) to the ds3000 and 
 ds3103
 drivers.
  3) test if the patches adding support for the newer chips didn't break 
 the
 support for existing hardware.

My proposal is that tasks (1) and (3) should be handled by you. As Max wants 
to
add support for some devices based on ds3103/ts2022, IMO, he can do the 
patches
for (2) in a way that they would be acceptable by you, as the driver 
maintainer
for ds3000/ts2020, testing with their devices.

Regards,
Mauro

Montage M88ds3103 is not only working with its own tuners. 
It works with silicon tuner including AV2011, AV2026 and CAN tuner including 
sharp6306, sharp7803 and sharp7903 etc.
How to add these supports in the single file? It is really headache. 
So I think that spliting the tuner and demod file is only right way.

First I read the source code of DS3000 and show respects to ds3000 work in 
linux.
But find that it can not read back the tuner register correctly, and not set 
the right tuner bandwidth filter,etc.
I fix all those bugs and also update ds3000 firmware to the latest one.
The big one is that I start to add m88ds3103 demodulator and m88ts2022 tuner 
support. It is not just the work as simple as adding some constant. there are 
much difference as you can see much switch and if to apply the especial code 
for new tuner and demodulator.

But Konstantin tell me that I have no right to put the copyright in the file, 
even say many bad words to my works.
As I know that Konstantin works for the competitor company, I donot care the 
fight of his company and dvbsky.
Dvbsky develops its hardware by their own, and write windows driver. some of 
their technical guys have more than ten years in PC tuner design experience 
from old analog one based on bt878 chip. ohh, this story is out of this topic, 
sorry.

As many requirements to run into linux, I become the candidate to do it. 
It is public and open project, everybody can contribute to it. Is it right?
I think it is unfair and is abnormal for open source project. 
even start to read the GNU document carefully to check if the original author 
deny your work in the wrong way, what can i do?
So I decide to rewrite the code from scratch, and find almost ds3000 code copy 
from the reference code except the driver framework. 
It is obvious that the code is old one, montage update its ds3000 code after 
Konstantin' works. So I update to the new one.
I have no hardware of Konstantin's works and patch the original ds3000 because 
more complex works.
That is why I decide to write the new m88ds3103 file and put copyright of 
Montage and Konstantin as well to show repects to both.

BR,
Max

Hello,
I finish the following works.
1)split the montage dvb-s2 frontend into 

Re: Re: [PATCH 1/6] m88ds3103, montage dvb-s/s2 demodulator driver

2012-04-23 Thread nibble.max
2012-04-24 09:50:33 nibble@gmail.com
Em 23-04-2012 19:51, Konstantin Dimitrov escreveu:
 Antti, i already commented about ds3103 drivers months ago:
 
 also, why Montage tuner code should be spitted from the demodulator
 code? is there any evidence that any Montage tuner (ts2020 or ts2022)
 can work with 3rd party demodulator different than ds3000 or ds3103?

This has nothing to do with Montage devices, but with the way we write
those drivers in Kernel.

There are _several_ examples where the driver for a single silicon were
turned into more than one driver. The biggest examples are the SoC chips,
that are transformed into a large series of drivers.

Another example is the cx88 driver: due to technical reasons, it was splitted 
into 4 drivers, one for each different PCI ID exported by it. 

The cx2341x driver is also an interesting example: while it used to be for a
separate chip, the cx2341x functions are now part of IP blocks on newer 
Conexant chipsets. Those single chips require two drivers to work (cx2341x
and the associated media PCI bridge driver).

Looking into tuners, there are the tda18271 family of devices, with are
supported by several drivers: tda827x, tda8290 and tda18271-fe, depending
on how the actual device is mounted. Eventually, the actual tuner may
also have a tda9887 inside it.

So, there's nothing wrong on splitting it on separate drivers. In a matter of
fact, we strongly prefer to have tuners separate from demods. Having them
together can only be justified technically, if there are really strong reasons
why they should be at the same driver.

I probably missed this at my review for ds3000 (that's why it ended by being
merged), but, on the review I did on it (accidentally due to m88ds3103 patchset
review), it is clear that the tuner has actually a different I2C address (0x60)
than the demod, and it is indeed a separate device. Sorry for slipping into it.

Anyway, now that this is noticed, tuner and demod drivers should be split,
especially since there are some patches floating around to add support for 
ds3103.

As I said before, the right thing to do is:

   1) split ds3000 from ts2020 at the existing driver;
   2) add support for the newer chips (ds3103/ts2022) to the ds3000 and 
 ds3103
  drivers.
   3) test if the patches adding support for the newer chips didn't break 
 the
  support for existing hardware.

My proposal is that tasks (1) and (3) should be handled by you. As Max wants to
add support for some devices based on ds3103/ts2022, IMO, he can do the patches
for (2) in a way that they would be acceptable by you, as the driver maintainer
for ds3000/ts2020, testing with their devices.

Regards,
Mauro

Montage M88ds3103 is not only working with its own tuners. 
It works with silicon tuner including AV2011, AV2026 and CAN tuner including 
sharp6306, sharp7803 and sharp7903 etc.
How to add these supports in the single file? It is really headache. 
So I think that spliting the tuner and demod file is only right way.

First I read the source code of DS3000 and show respects to ds3000 work in 
linux.
But find that it can not read back the tuner register correctly, and not set 
the right tuner bandwidth filter,etc.
I fix all those bugs and also update ds3000 firmware to the latest one.
The big one is that I start to add m88ds3103 demodulator and m88ts2022 tuner 
support. It is not just the work as simple as adding some constant. there are 
much difference as you can see much switch and if to apply the especial code 
for new tuner and demodulator.

But Konstantin tell me that I have no right to put the copyright in the file, 
even say many bad words to my works.
As I know that Konstantin works for the competitor company, I donot care the 
fight of his company and dvbsky.
Dvbsky develops its hardware by their own, and write windows driver. some of 
their technical guys have more than ten years in PC tuner design experience 
from old analog one based on bt878 chip. ohh, this story is out of this topic, 
sorry.

As many requirements to run into linux, I become the candidate to do it. 
It is public and open project, everybody can contribute to it. Is it right?
I think it is unfair and is abnormal for open source project. 
even start to read the GNU document carefully to check if the original author 
deny your work in the wrong way, what can i do?
So I decide to rewrite the code from scratch, and find almost ds3000 code copy 
from the reference code except the driver framework. 
It is obvious that the code is old one, montage update its ds3000 code after 
Konstantin' works. So I update to the new one.
I have no hardware of Konstantin's works and patch the original ds3000 because 
more complex works.
That is why I decide to write the new m88ds3103 file and put copyright of 
Montage and Konstantin as well to show repects to both.

BR,
Max

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to 

Re: Re: [PATCH 1/6] m88ds3103, montage dvb-s/s2 demodulator driver

2012-04-20 Thread nibble.max
2012-04-20 15:56:27 nibble@gmail.com
At first time, I check it exist so try to patch it.
But with new m88ds3103 features to add and ts2022 tuner include, find it is 
hard to do simply patch.
It is better to create a new driver for maintain.
Hi Max,

Em 15-04-2012 12:53, nibble.max escreveu:
 Montage m88ds3103 demodulator and ts2022 tuner driver.

It was pointed to me that this device were already discussed on:

   http://www.mail-archive.com/linux-media@vger.kernel.org/msg43109.html

If m88ds3103 demod is similar enough to ds3000, it should just add the needed
bits at the existing driver, and not creating a new driver. 

Thanks,
Mauro

 
 Signed-off-by: Max nibble nibble@gmail.com
 ---
  drivers/media/dvb/frontends/Kconfig |7 +
  drivers/media/dvb/frontends/Makefile|2 +
  drivers/media/dvb/frontends/m88ds3103.c | 1851 
 +++
  drivers/media/dvb/frontends/m88ds3103.h |   53 +
  4 files changed, 1913 insertions(+)
  create mode 100644 drivers/media/dvb/frontends/m88ds3103.c
  create mode 100644 drivers/media/dvb/frontends/m88ds3103.h
 
 diff --git a/drivers/media/dvb/frontends/Kconfig 
 b/drivers/media/dvb/frontends/Kconfig
 index e11adb6..d2bb312 100644
 --- a/drivers/media/dvb/frontends/Kconfig
 +++ b/drivers/media/dvb/frontends/Kconfig
 @@ -214,6 +214,13 @@ config DVB_CX24116
  help
A DVB-S/S2 tuner module. Say Y when you want to support this frontend.
  
 +config DVB_M88DS3103
 +tristate Montage DS3103 based
 +depends on DVB_CORE  I2C
 +default m if DVB_FE_CUSTOMISE
 +help
 +  A DVB-S/S2 tuner module. Say Y when you want to support this frontend.
 +  
  config DVB_SI21XX
  tristate Silicon Labs SI21XX based
  depends on DVB_CORE  I2C
 diff --git a/drivers/media/dvb/frontends/Makefile 
 b/drivers/media/dvb/frontends/Makefile
 index 6ca7557..84ddf41 100644
 --- a/drivers/media/dvb/frontends/Makefile
 +++ b/drivers/media/dvb/frontends/Makefile
 @@ -98,5 +98,7 @@ obj-$(CONFIG_DVB_A8293) += a8293.o
  obj-$(CONFIG_DVB_TDA10071) += tda10071.o
  obj-$(CONFIG_DVB_RTL2830) += rtl2830.o
  obj-$(CONFIG_DVB_M88RS2000) += m88rs2000.o
 +obj-$(CONFIG_DVB_M88DS3103) += m88ds3103.o
  obj-$(CONFIG_DVB_AF9033) += af9033.o
  
 +
 diff --git a/drivers/media/dvb/frontends/m88ds3103.c 
 b/drivers/media/dvb/frontends/m88ds3103.c
 new file mode 100644
 index 000..a186ba0
 --- /dev/null
 +++ b/drivers/media/dvb/frontends/m88ds3103.c
 @@ -0,0 +1,1851 @@
 +/*
 +Montage Technology M88DS3103/M88TS2022 - DVBS/S2 Satellite demod/tuner 
 driver
 +
 +Copyright (C) 2011 Max nibblenibble@gmail.com
 +Copyright (C) 2010 Montage Technologywww.montage-tech.com
 +Copyright (C) 2009 Konstantin Dimitrov.
 +
 +This program is free software; you can redistribute it and/or modify
 +it under the terms of the GNU General Public License as published by
 +the Free Software Foundation; either version 2 of the License, or
 +(at your option) any later version.
 +
 +This program is distributed in the hope that it will be useful,
 +but WITHOUT ANY WARRANTY; without even the implied warranty of
 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 +GNU General Public License for more details.
 +
 +You should have received a copy of the GNU General Public License
 +along with this program; if not, write to the Free Software
 +Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 + */
 +
 +#include linux/slab.h
 +#include linux/kernel.h
 +#include linux/module.h
 +#include linux/moduleparam.h
 +#include linux/init.h
 +#include linux/firmware.h
 +
 +#include dvb_frontend.h
 +#include m88ds3103.h
 +
 +static int debug;
 +module_param(debug, int, 0644);
 +MODULE_PARM_DESC(debug, Activates frontend debugging (default:0));
 +
 +#define dprintk(args...) \
 +do { \
 +if (debug) \
 +printk(KERN_INFO m88ds3103:  args); \
 +} while (0)
 +
 +#define FW_DOWN_SIZE 32
 +#define FW_DOWN_LOOP (8192/FW_DOWN_SIZE)
 +#define DS3103_DEFAULT_FIRMWARE dvb-fe-ds3103.fw
 +#define DS3000_DEFAULT_FIRMWARE dvb-fe-ds300x.fw
 +#define MT_FE_MCLK_KHZ 96000 /* in kHz */
 +#define MT_FE_CRYSTAL_KHZ   27000 /* in kHz */
 +#define FREQ_OFFSET_AT_SMALL_SYM_RATE_KHz 3000
 +#define DS3000_ID   0x3000
 +#define DS3103_ID   0x3103
 +#define TS2020_ID   0x2020
 +#define TS2022_ID   0x2022
 +#define UNKNOW_ID   0x
 +
 +/* For M88DS3103 demod dvbs mode.*/
 +static u8 ds3103_dvbs_init_tab[] = {
 +0x23, 0x07,
 +0x08, 0x03,
 +0x0c, 0x02,
 +0x21, 0x54,
 +0x25, 0x82,
 +0x27, 0x31,
 +0x30, 0x08,
 +0x31, 0x40,
 +0x32, 0x32,
 +0x33, 0x35,
 +0x35, 0xff,
 +0x3a, 0x00,
 +0x37, 0x10,
 +0x38, 0x10,
 +0x39, 0x02,
 +0x42, 0x60,
 +0x4a, 0x80,
 +0x4b, 0x04,
 +0x4d, 0x91,
 +0x5d, 0xc8,
 +0x50, 0x36,
 +0x51, 0x36,
 +0x52, 0x36,
 +0x53, 0x36,
 +0x63, 0x0f,
 +0x64, 0x30,
 +0x65, 0x40,
 +0x68, 

Re: Re: [PATCH 1/6] m88ds3103, montage dvb-s/s2 demodulator driver

2012-04-20 Thread nibble.max
2012-04-20 15:48:53 nibble@gmail.com
Mauro, thank you.

Hi Max,

Em 15-04-2012 12:53, nibble.max escreveu:
 Montage m88ds3103 demodulator and ts2022 tuner driver.
 
 Signed-off-by: Max nibble nibble@gmail.com

Please always test any patch you send upstream with ./scripts/checkpatch.pl.

It analyses the code and checks if it is following the Linux Coding Style
(Documentation/CodingStyle).

From what I've seen, there are several small CodingStyle issues on this patch.

There's also another problem here: this driver is mixing an I2C tuner driver
with the demod one. Please split. If the tuner is simple enough, you an add
it to:
   drivers/media/common/tuners/tuner-simple.c
or at:
   drivers/media/dvb/frontends/dvb-pll.c

But please don't mix tuners with demods. Mixing it causes code duplication and
more time lost when debugging it (as two different version of the same driver
can have different bugs).
I check the tuner-simple.c and dvb-pll.c is not fit for m88ts202x tuner.
Should we create a new tuner file like stv6110x?

I'll analyze it deeper after you fix those two issues.

Thanks,
Mauro


 ---
  drivers/media/dvb/frontends/Kconfig |7 +
  drivers/media/dvb/frontends/Makefile|2 +
  drivers/media/dvb/frontends/m88ds3103.c | 1851 
 +++
  drivers/media/dvb/frontends/m88ds3103.h |   53 +
  4 files changed, 1913 insertions(+)
  create mode 100644 drivers/media/dvb/frontends/m88ds3103.c
  create mode 100644 drivers/media/dvb/frontends/m88ds3103.h
 
 diff --git a/drivers/media/dvb/frontends/Kconfig 
 b/drivers/media/dvb/frontends/Kconfig
 index e11adb6..d2bb312 100644
 --- a/drivers/media/dvb/frontends/Kconfig
 +++ b/drivers/media/dvb/frontends/Kconfig
 @@ -214,6 +214,13 @@ config DVB_CX24116
  help
A DVB-S/S2 tuner module. Say Y when you want to support this frontend.
  
 +config DVB_M88DS3103
 +tristate Montage DS3103 based
 +depends on DVB_CORE  I2C
 +default m if DVB_FE_CUSTOMISE
 +help
 +  A DVB-S/S2 tuner module. Say Y when you want to support this frontend.
 +  
  config DVB_SI21XX
  tristate Silicon Labs SI21XX based
  depends on DVB_CORE  I2C
 diff --git a/drivers/media/dvb/frontends/Makefile 
 b/drivers/media/dvb/frontends/Makefile
 index 6ca7557..84ddf41 100644
 --- a/drivers/media/dvb/frontends/Makefile
 +++ b/drivers/media/dvb/frontends/Makefile
 @@ -98,5 +98,7 @@ obj-$(CONFIG_DVB_A8293) += a8293.o
  obj-$(CONFIG_DVB_TDA10071) += tda10071.o
  obj-$(CONFIG_DVB_RTL2830) += rtl2830.o
  obj-$(CONFIG_DVB_M88RS2000) += m88rs2000.o
 +obj-$(CONFIG_DVB_M88DS3103) += m88ds3103.o
  obj-$(CONFIG_DVB_AF9033) += af9033.o
  
 +
 diff --git a/drivers/media/dvb/frontends/m88ds3103.c 
 b/drivers/media/dvb/frontends/m88ds3103.c
 new file mode 100644
 index 000..a186ba0
 --- /dev/null
 +++ b/drivers/media/dvb/frontends/m88ds3103.c
 @@ -0,0 +1,1851 @@
 +/*
 +Montage Technology M88DS3103/M88TS2022 - DVBS/S2 Satellite demod/tuner 
 driver
 +
 +Copyright (C) 2011 Max nibblenibble@gmail.com
 +Copyright (C) 2010 Montage Technologywww.montage-tech.com
 +Copyright (C) 2009 Konstantin Dimitrov.
 +
 +This program is free software; you can redistribute it and/or modify
 +it under the terms of the GNU General Public License as published by
 +the Free Software Foundation; either version 2 of the License, or
 +(at your option) any later version.
 +
 +This program is distributed in the hope that it will be useful,
 +but WITHOUT ANY WARRANTY; without even the implied warranty of
 +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 +GNU General Public License for more details.
 +
 +You should have received a copy of the GNU General Public License
 +along with this program; if not, write to the Free Software
 +Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 + */
 +
 +#include linux/slab.h
 +#include linux/kernel.h
 +#include linux/module.h
 +#include linux/moduleparam.h
 +#include linux/init.h
 +#include linux/firmware.h
 +
 +#include dvb_frontend.h
 +#include m88ds3103.h
 +
 +static int debug;
 +module_param(debug, int, 0644);
 +MODULE_PARM_DESC(debug, Activates frontend debugging (default:0));
 +
 +#define dprintk(args...) \
 +do { \
 +if (debug) \
 +printk(KERN_INFO m88ds3103:  args); \
 +} while (0)
 +
 +#define FW_DOWN_SIZE 32
 +#define FW_DOWN_LOOP (8192/FW_DOWN_SIZE)
 +#define DS3103_DEFAULT_FIRMWARE dvb-fe-ds3103.fw
 +#define DS3000_DEFAULT_FIRMWARE dvb-fe-ds300x.fw
 +#define MT_FE_MCLK_KHZ 96000 /* in kHz */
 +#define MT_FE_CRYSTAL_KHZ   27000 /* in kHz */
 +#define FREQ_OFFSET_AT_SMALL_SYM_RATE_KHz 3000
 +#define DS3000_ID   0x3000
 +#define DS3103_ID   0x3103
 +#define TS2020_ID   0x2020
 +#define TS2022_ID   0x2022
 +#define UNKNOW_ID   0x
 +
 +/* For M88DS3103 demod dvbs mode.*/
 +static u8 ds3103_dvbs_init_tab[] = {
 +0x23, 0x07,
 +0x08, 0x03,
 +0x0c, 0x02,
 +0x21, 0x54,
 +   

Re: Re: [PATCH 1/6] m88ds3103, montage dvb-s/s2 demodulator driver

2012-04-20 Thread nibble.max
2012-04-21 10:38:02 nibble@gmail.com
Em 20-04-2012 06:47, Antti Palosaari escreveu:
 On 20.04.2012 11:01, nibble.max wrote:
 2012-04-20 15:56:27 nibble@gmail.com
 At first time, I check it exist so try to patch it.
 But with new m88ds3103 features to add and ts2022 tuner include, find it is 
 hard to do simply patch.
 It is better to create a new driver for maintain.
 Hi Max,

 Em 15-04-2012 12:53, nibble.max escreveu:
 Montage m88ds3103 demodulator and ts2022 tuner driver.

 It was pointed to me that this device were already discussed on:

http://www.mail-archive.com/linux-media@vger.kernel.org/msg43109.html

 If m88ds3103 demod is similar enough to ds3000, it should just add the 
 needed
 bits at the existing driver, and not creating a new driver.

 Thanks,
 Mauro
 
 The main problem of these all existing and upcoming Montage DVB-S/S2 drivers 
 are those are not split originally correct as a tuner and demod and now it 
 causes problems.
 
 I really suspect it should be:
 * single demod driver that supports both DS3000 and DS3103
 * single tuner driver that supports both TS2020 and TS2022
 
 And now what we have is 2 drivers that contains both tuner and demod. And a 
 lot of same code. :-(
 
 But it is almost impossible to split it correctly at that phase if you don't 
 have both hardware combinations, DS3000/TS2020 and DS3103/TS2022. I think it 
 is best to leave old DS3000 as it is and make new driver for DS3103 *and* 
 TS2022. Maybe after that someone could add DS3000 support to new DS3103 
 driver and TS2020 support to new TS2022 driver. After that it is possible to 
 remove old DS3000 driver.
 
 And we should really consider make simple rule not to accept any driver 
 which is not split as logical parts: USB/PCI-interface + demodulator + tuner.

Mixing tuner and demod is not good. Yet, dropping the current ds3000 doesn't
seem to be the best approach.

IMO, Konstantin/Montage should split the ds3000 driver on two drivers, putting
the ts2020 bits on a separate driver.

Then, Max should write a patch for ds3000 in order to add support for ds3103 on
it, and a patch for ts2020 driver, in order to add support for ts2022 on it.

Of course, Konstantin should check if Max changes don't break support for the
DS3000/TS2020 configuration.

Regards,
Mauro
Actually, I have the following hardware combinations.
1)DS3000 and TS2020 2)DS3103 and TS2020 3)DS3103 and TS2022
Should I sumbit the driver for DS3103 and TS2022 in the split files?
Or I must wait for Konstantin's work. How long should I wait for?

BR,
Max.

--
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