Re: Fwd: [PATCH] V4L/DVB: New NXP tda18218 tuner

2010-06-17 Thread Bee Hock Goh
Can someone share what is the process to get a patch into the mainstream codes?

It been quite a while already and its still been review. Seem like a
waste if this patch disappear again just like the previous time when
it was submitted long ago.

On Sun, May 30, 2010 at 8:22 AM, Bee Hock Goh beeh...@gmail.com wrote:
 Hi Lauris,

 thanks for the reply. I am just a user. :)

 As you are the original driver developer, it would great if you could
 endorsed/ack the patch sent by Nikola.

 thanks,
  Hock.

 On Sun, May 30, 2010 at 12:07 AM, Lauris Ding ld...@gmx.de wrote:
 On 29.05.2010 11:39, Bee Hock Goh wrote:

 Dear Lauris,

 Are you still active? Nikola have submitted a patch for af9015/tda18218.

 Could you maybe spend some time to help and endorsed it?

 thanks,
  Hock.


 -- Forwarded message --
 From: Antti Palosaaricr...@iki.fi
 Date: Sat, May 29, 2010 at 2:25 AM
 Subject: Re: [PATCH] V4L/DVB: New NXP tda18218 tuner
 To: Nikola Pajkovskynpajk...@redhat.com
 Cc: linux-media@vger.kernel.org


 Terve,

 On 05/20/2010 12:52 PM, Nikola Pajkovsky wrote:


 Signed-off-by: Nikola Pajkovskynpajk...@redhat.com
 ---
  drivers/media/common/tuners/Kconfig         |    7 +
  drivers/media/common/tuners/Makefile        |    1 +
  drivers/media/common/tuners/tda18218.c      |  432
 +++
  drivers/media/common/tuners/tda18218.h      |   44 +++
  drivers/media/common/tuners/tda18218_priv.h |   36 +++
  drivers/media/dvb/dvb-usb/af9015.c          |   13 +-
  drivers/media/dvb/frontends/af9013.c        |   15 +
  drivers/media/dvb/frontends/af9013_priv.h   |    5 +-
  8 files changed, 548 insertions(+), 5 deletions(-)
  create mode 100644 drivers/media/common/tuners/tda18218.c
  create mode 100644 drivers/media/common/tuners/tda18218.h
  create mode 100644 drivers/media/common/tuners/tda18218_priv.h


 tda18218_write_reg() could use tda18218_write_regs()

 tda18218_set_params() correct frequency limits. No need to check both
 upper and lower limit.

 printk(KERN_INFO We've got a lock!);
 it does not sounds good idea to print INFO when lock

 while(i  10) {
 use for loop insted. Two rows less code.

 tda18218_init()
 why return -EREMOTEIO; ?

 tda18218_attach()
 printk(KERN_WARNING Device is not a TDA18218!\n);
 we should fail without noise since many times tuner attach is used for
 probe correct tuner

 A lot of error checkings are missing when reg write / read

 checkpatch returns a lot of warnings and for errors too almost every
 file changed

 Is that checked TDA18218 uses same demod settings as TDA18271?

 And the biggest problem is that driver author Lauris haven't replied
 any mails...

 regards
 Antti


 --
 http://palosaari.fi/
 --
 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



 Hi,

 well, I've stopped doing anything on it after I finally got it working, as
 it was enough for me having it just working, more or less regardless of what
 the code looked like.

 I very much appreciate your work on it, but I'm quite unexperienced in
 kernel programming; I'll try to help whenever I can from now on, though.

 Regards, Lauris


--
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: Fwd: [PATCH] V4L/DVB: New NXP tda18218 tuner

2010-05-29 Thread Bee Hock Goh
Hi Lauris,

thanks for the reply. I am just a user. :)

As you are the original driver developer, it would great if you could
endorsed/ack the patch sent by Nikola.

thanks,
 Hock.

On Sun, May 30, 2010 at 12:07 AM, Lauris Ding ld...@gmx.de wrote:
 On 29.05.2010 11:39, Bee Hock Goh wrote:

 Dear Lauris,

 Are you still active? Nikola have submitted a patch for af9015/tda18218.

 Could you maybe spend some time to help and endorsed it?

 thanks,
  Hock.


 -- Forwarded message --
 From: Antti Palosaaricr...@iki.fi
 Date: Sat, May 29, 2010 at 2:25 AM
 Subject: Re: [PATCH] V4L/DVB: New NXP tda18218 tuner
 To: Nikola Pajkovskynpajk...@redhat.com
 Cc: linux-media@vger.kernel.org


 Terve,

 On 05/20/2010 12:52 PM, Nikola Pajkovsky wrote:


 Signed-off-by: Nikola Pajkovskynpajk...@redhat.com
 ---
  drivers/media/common/tuners/Kconfig         |    7 +
  drivers/media/common/tuners/Makefile        |    1 +
  drivers/media/common/tuners/tda18218.c      |  432
 +++
  drivers/media/common/tuners/tda18218.h      |   44 +++
  drivers/media/common/tuners/tda18218_priv.h |   36 +++
  drivers/media/dvb/dvb-usb/af9015.c          |   13 +-
  drivers/media/dvb/frontends/af9013.c        |   15 +
  drivers/media/dvb/frontends/af9013_priv.h   |    5 +-
  8 files changed, 548 insertions(+), 5 deletions(-)
  create mode 100644 drivers/media/common/tuners/tda18218.c
  create mode 100644 drivers/media/common/tuners/tda18218.h
  create mode 100644 drivers/media/common/tuners/tda18218_priv.h


 tda18218_write_reg() could use tda18218_write_regs()

 tda18218_set_params() correct frequency limits. No need to check both
 upper and lower limit.

 printk(KERN_INFO We've got a lock!);
 it does not sounds good idea to print INFO when lock

 while(i  10) {
 use for loop insted. Two rows less code.

 tda18218_init()
 why return -EREMOTEIO; ?

 tda18218_attach()
 printk(KERN_WARNING Device is not a TDA18218!\n);
 we should fail without noise since many times tuner attach is used for
 probe correct tuner

 A lot of error checkings are missing when reg write / read

 checkpatch returns a lot of warnings and for errors too almost every
 file changed

 Is that checked TDA18218 uses same demod settings as TDA18271?

 And the biggest problem is that driver author Lauris haven't replied
 any mails...

 regards
 Antti


 --
 http://palosaari.fi/
 --
 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



 Hi,

 well, I've stopped doing anything on it after I finally got it working, as
 it was enough for me having it just working, more or less regardless of what
 the code looked like.

 I very much appreciate your work on it, but I'm quite unexperienced in
 kernel programming; I'll try to help whenever I can from now on, though.

 Regards, Lauris

--
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] V4L/DVB: New NXP tda18218 tuner

2010-05-28 Thread Antti Palosaari

Terve,

On 05/20/2010 12:52 PM, Nikola Pajkovsky wrote:

Signed-off-by: Nikola Pajkovskynpajk...@redhat.com
---
  drivers/media/common/tuners/Kconfig |7 +
  drivers/media/common/tuners/Makefile|1 +
  drivers/media/common/tuners/tda18218.c  |  432 +++
  drivers/media/common/tuners/tda18218.h  |   44 +++
  drivers/media/common/tuners/tda18218_priv.h |   36 +++
  drivers/media/dvb/dvb-usb/af9015.c  |   13 +-
  drivers/media/dvb/frontends/af9013.c|   15 +
  drivers/media/dvb/frontends/af9013_priv.h   |5 +-
  8 files changed, 548 insertions(+), 5 deletions(-)
  create mode 100644 drivers/media/common/tuners/tda18218.c
  create mode 100644 drivers/media/common/tuners/tda18218.h
  create mode 100644 drivers/media/common/tuners/tda18218_priv.h


tda18218_write_reg() could use tda18218_write_regs()

tda18218_set_params() correct frequency limits. No need to check both 
upper and lower limit.


printk(KERN_INFO We've got a lock!);
it does not sounds good idea to print INFO when lock

while(i  10) {
use for loop insted. Two rows less code.

tda18218_init()
why return -EREMOTEIO; ?

tda18218_attach()
printk(KERN_WARNING Device is not a TDA18218!\n);
we should fail without noise since many times tuner attach is used for 
probe correct tuner


A lot of error checkings are missing when reg write / read

checkpatch returns a lot of warnings and for errors too almost every 
file changed


Is that checked TDA18218 uses same demod settings as TDA18271?

And the biggest problem is that driver author Lauris haven't replied any 
mails...


regards
Antti


--
http://palosaari.fi/
--
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] V4L/DVB: New NXP tda18218 tuner

2010-05-20 Thread Nikola Pajkovsky
Signed-off-by: Nikola Pajkovsky npajk...@redhat.com
---
 drivers/media/common/tuners/Kconfig |7 +
 drivers/media/common/tuners/Makefile|1 +
 drivers/media/common/tuners/tda18218.c  |  432 +++
 drivers/media/common/tuners/tda18218.h  |   44 +++
 drivers/media/common/tuners/tda18218_priv.h |   36 +++
 drivers/media/dvb/dvb-usb/af9015.c  |   13 +-
 drivers/media/dvb/frontends/af9013.c|   15 +
 drivers/media/dvb/frontends/af9013_priv.h   |5 +-
 8 files changed, 548 insertions(+), 5 deletions(-)
 create mode 100644 drivers/media/common/tuners/tda18218.c
 create mode 100644 drivers/media/common/tuners/tda18218.h
 create mode 100644 drivers/media/common/tuners/tda18218_priv.h

diff --git a/drivers/media/common/tuners/Kconfig 
b/drivers/media/common/tuners/Kconfig
index 409a426..b00c63c 100644
--- a/drivers/media/common/tuners/Kconfig
+++ b/drivers/media/common/tuners/Kconfig
@@ -179,4 +179,11 @@ config MEDIA_TUNER_MAX2165
help
  A driver for the silicon tuner MAX2165 from Maxim.
 
+config MEDIA_TUNER_TDA18218
+   tristate NXP TDA18218 silicon tuner
+   depends on VIDEO_MEDIA  I2C
+   default m if MEDIA_TUNER_CUSTOMISE
+   help
+ A driver for the silicon tuner TDA18218 from NXP.
+
 endif # MEDIA_TUNER_CUSTOMISE
diff --git a/drivers/media/common/tuners/Makefile 
b/drivers/media/common/tuners/Makefile
index a543852..96da03d 100644
--- a/drivers/media/common/tuners/Makefile
+++ b/drivers/media/common/tuners/Makefile
@@ -24,6 +24,7 @@ obj-$(CONFIG_MEDIA_TUNER_MXL5005S) += mxl5005s.o
 obj-$(CONFIG_MEDIA_TUNER_MXL5007T) += mxl5007t.o
 obj-$(CONFIG_MEDIA_TUNER_MC44S803) += mc44s803.o
 obj-$(CONFIG_MEDIA_TUNER_MAX2165) += max2165.o
+obj-$(CONFIG_MEDIA_TUNER_TDA18218) += tda18218.o
 
 EXTRA_CFLAGS += -Idrivers/media/dvb/dvb-core
 EXTRA_CFLAGS += -Idrivers/media/dvb/frontends
diff --git a/drivers/media/common/tuners/tda18218.c 
b/drivers/media/common/tuners/tda18218.c
new file mode 100644
index 000..1860b18
--- /dev/null
+++ b/drivers/media/common/tuners/tda18218.c
@@ -0,0 +1,432 @@
+/*
+ *  Driver for NXP TDA18218 silicon tuner
+ *
+ *  Copyright (C) 2010 Lauris Ding ld...@gmx.de
+ *  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 tda18218.h
+#include tda18218_priv.h
+
+static int tda18218_write_reg(struct dvb_frontend *fe, u8 reg, u8 val)
+{
+   struct tda18218_priv *priv = fe-tuner_priv;
+   u8 buf[2] = { reg, val };
+   struct i2c_msg msg = { .addr = priv-cfg-i2c_address, .flags = 0,
+  .buf = buf, .len = 2 };
+   int ret;
+
+   if (fe-ops.i2c_gate_ctrl)
+   fe-ops.i2c_gate_ctrl(fe, 1);
+   /* write register */
+   ret = i2c_transfer(priv-i2c, msg, 1);
+   if (fe-ops.i2c_gate_ctrl)
+   fe-ops.i2c_gate_ctrl(fe, 0);
+
+   if (ret != 1)
+   printk(KERN_WARNING I2C write failed ret: %d reg: %02x\n, 
ret, reg);
+
+   return (ret == 1 ? 0 : ret);
+}
+
+static int tda18218_write_regs(struct dvb_frontend *fe, u8 reg,
+   u8 *val, u8 len)
+{
+   struct tda18218_priv *priv = fe-tuner_priv;
+   u8 buf[1+len];
+   struct i2c_msg msg = {
+   .addr = priv-cfg-i2c_address,
+   .flags = 0,
+   .len = sizeof(buf),
+   .buf = buf };
+
+   int ret;
+
+   buf[0] = reg;
+   memcpy(buf[1], val, len);
+
+   if (fe-ops.i2c_gate_ctrl)
+   fe-ops.i2c_gate_ctrl(fe, 1);
+   ret = i2c_transfer(priv-i2c, msg, 1);
+   if (fe-ops.i2c_gate_ctrl)
+   fe-ops.i2c_gate_ctrl(fe, 1);
+
+   if (ret != 1)
+   printk(KERN_WARNING I2C write failed ret: %d reg: %02x len: 
%d\n, ret, reg, len);
+
+   return (ret == 1 ? 0 : ret);
+}
+
+static int tda18218_read_regs(struct dvb_frontend *fe)
+{
+   struct tda18218_priv *priv = fe-tuner_priv;
+   u8 *regs = priv-tda18218_regs;
+   u8 buf = 0x00;
+   int ret;
+   struct i2c_msg msg[] = {
+   { .addr = 0xc0, .flags = 0,
+ .buf = buf, .len = 1 },
+   { .addr = 0xc0, .flags = I2C_M_RD,
+ .buf = regs, .len = 59 }
+   };
+
+   if (fe-ops.i2c_gate_ctrl)
+   fe-ops.i2c_gate_ctrl(fe, 1);
+
+   /* read all