[linuxtv-commits] [hg:v4l-dvb] budget-ci: Add support for Technotrend budget C-1501 dvb-c card

2008-06-17 Thread Patch from Sigmund Augdal
The patch number 8049 was added via Oliver Endriss [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

From: Sigmund Augdal  [EMAIL PROTECTED]
budget-ci: Add support for Technotrend budget C-1501 dvb-c card


The following experimental patch adds support for the technotrend budget
C-1501 dvb-c card. The parameters used to configure the tda10023 demod
chip are largely determined experimentally, but works quite for me in my
initial tests.

Signed-off-by: Sigmund Augdal [EMAIL PROTECTED]
Signed-off-by: Oliver Endriss [EMAIL PROTECTED]


---

 linux/drivers/media/dvb/ttpci/budget-ci.c |   25 +-
 1 file changed, 24 insertions(+), 1 deletion(-)

diff -r 78442352b885 -r dd848702aabe linux/drivers/media/dvb/ttpci/budget-ci.c
--- a/linux/drivers/media/dvb/ttpci/budget-ci.c Sun Jun 15 10:33:42 2008 -0300
+++ b/linux/drivers/media/dvb/ttpci/budget-ci.c Sun Jun 15 19:25:46 2008 +0200
@@ -46,6 +46,8 @@
 #include lnbp21.h
 #include bsbe1.h
 #include bsru6.h
+#include tda1002x.h
+#include tda827x.h
 
 /*
  * Regarding DEBIADDR_IR:
@@ -1066,6 +1068,15 @@ static struct stv0297_config dvbc_philip
.stop_during_read = 1,
 };
 
+static struct tda10023_config tda10023_config = {
+   .demod_address = 0xc,
+   .invert = 0,
+   .xtal = 1600,
+   .pll_m = 11,
+   .pll_p = 3,
+   .pll_n = 1,
+   .deltaf = 0xa511,
+};
 
 
 
@@ -1136,7 +1147,17 @@ static void frontend_init(struct budget_
budget_ci-budget.dvb_frontend = NULL;
}
}
-
+   break;
+
+   case 0x101a: /* TT Budget-C-1501 (philips tda10023/philips tda8274A) */
+   budget_ci-budget.dvb_frontend = dvb_attach(tda10023_attach, 
tda10023_config, budget_ci-budget.i2c_adap, 0x48);
+   if (budget_ci-budget.dvb_frontend) {
+   if (dvb_attach(tda827x_attach, 
budget_ci-budget.dvb_frontend, 0x61, budget_ci-budget.i2c_adap, NULL) == 
NULL) {
+   printk(KERN_ERR %s: No tda827x found!\n, 
__func__);
+   
dvb_frontend_detach(budget_ci-budget.dvb_frontend);
+   budget_ci-budget.dvb_frontend = NULL;
+   }
+   }
break;
}
 
@@ -1226,6 +1247,7 @@ MAKE_BUDGET_INFO(ttbt2, TT-Budget/WinTV
 MAKE_BUDGET_INFO(ttbt2, TT-Budget/WinTV-NOVA-T PCI, BUDGET_TT);
 MAKE_BUDGET_INFO(ttbtci, TT-Budget-T-CI PCI, BUDGET_TT);
 MAKE_BUDGET_INFO(ttbcci, TT-Budget-C-CI PCI, BUDGET_TT);
+MAKE_BUDGET_INFO(ttc1501, TT-Budget C-1501 PCI, BUDGET_TT);
 
 static struct pci_device_id pci_tbl[] = {
MAKE_EXTENSION_PCI(ttbci, 0x13c2, 0x100c),
@@ -1234,6 +1256,7 @@ static struct pci_device_id pci_tbl[] = 
MAKE_EXTENSION_PCI(ttbt2, 0x13c2, 0x1011),
MAKE_EXTENSION_PCI(ttbtci, 0x13c2, 0x1012),
MAKE_EXTENSION_PCI(ttbs2, 0x13c2, 0x1017),
+   MAKE_EXTENSION_PCI(ttc1501, 0x13c2, 0x101a),
{
 .vendor = 0,
 }


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/dd848702aabe5977d9aa72d57c94ff3bd0493488

___
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits


[linuxtv-commits] [hg:v4l-dvb] ttpci/Kconfig: Technotrend budget C-1501 needs tda10023

2008-06-17 Thread Patch from Mauro Carvalho Chehab
The patch number 8051 was added via Mauro Carvalho Chehab [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

From: Mauro Carvalho Chehab  [EMAIL PROTECTED]
ttpci/Kconfig: Technotrend budget C-1501 needs tda10023


Auto-selects tda10023, for budget-ci, if !DVB_FE_CUSTOMISE. This is needed for
Technotrend budget C-1501 dvb board.

Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]


---

 linux/drivers/media/dvb/ttpci/Kconfig |1 +
 1 file changed, 1 insertion(+)

diff -r c7caf42ae671 -r 90a2e0b3b6f0 linux/drivers/media/dvb/ttpci/Kconfig
--- a/linux/drivers/media/dvb/ttpci/Kconfig Mon Jun 16 09:31:57 2008 -0300
+++ b/linux/drivers/media/dvb/ttpci/Kconfig Mon Jun 16 09:35:06 2008 -0300
@@ -106,6 +106,7 @@ config DVB_BUDGET_CI
select DVB_STV0299 if !DVB_FE_CUSTOMISE
select DVB_TDA1004X if !DVB_FE_CUSTOMISE
select DVB_LNBP21 if !DVB_FE_CUSTOMISE
+   select DVB_TDA10023 if !DVB_FE_CUSTOMISE
select VIDEO_IR
help
  Support for simple SAA7146 based DVB cards


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/90a2e0b3b6f0fc5753105c67f23c6a5d1162cae5

___
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits


[linuxtv-commits] [hg:v4l-dvb] Add register get/set debug ioctls to saa7134

2008-06-17 Thread Patch from Mauro Carvalho Chehab
The patch number 8050 was added via Mauro Carvalho Chehab [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

From: Mauro Carvalho Chehab  [EMAIL PROTECTED]
Add register get/set debug ioctls to saa7134


Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]


---

 linux/drivers/media/video/saa7134/saa7134-video.c |   30 ++
 1 file changed, 30 insertions(+)

diff -r dd848702aabe -r c7caf42ae671 
linux/drivers/media/video/saa7134/saa7134-video.c
--- a/linux/drivers/media/video/saa7134/saa7134-video.c Sun Jun 15 19:25:46 
2008 +0200
+++ b/linux/drivers/media/video/saa7134/saa7134-video.c Mon Jun 16 09:31:57 
2008 -0300
@@ -2214,6 +2214,32 @@ static int saa7134_g_parm(struct file *f
 {
return 0;
 }
+
+#ifdef CONFIG_VIDEO_ADV_DEBUG
+static int vidioc_g_register (struct file *file, void *priv,
+ struct v4l2_register *reg)
+{
+   struct saa7134_fh *fh = priv;
+   struct saa7134_dev *dev = fh-dev;
+
+   if (!v4l2_chip_match_host(reg-match_type, reg-match_chip))
+   return -EINVAL;
+   reg-val = saa_readb(reg-reg);
+   return 0;
+}
+
+static int vidioc_s_register (struct file *file, void *priv,
+   struct v4l2_register *reg)
+{
+   struct saa7134_fh *fh = priv;
+   struct saa7134_dev *dev = fh-dev;
+
+   if (!v4l2_chip_match_host(reg-match_type, reg-match_chip))
+   return -EINVAL;
+   saa_writeb(reg-reg0xff, reg-val);
+   return 0;
+}
+#endif
 
 static int radio_querycap(struct file *file, void *priv,
struct v4l2_capability *cap)
@@ -2402,6 +2428,10 @@ struct video_device saa7134_video_templa
.vidioc_g_parm  = saa7134_g_parm,
.vidioc_g_frequency = saa7134_g_frequency,
.vidioc_s_frequency = saa7134_s_frequency,
+#ifdef CONFIG_VIDEO_ADV_DEBUG
+   .vidioc_g_register  = vidioc_g_register,
+   .vidioc_s_register  = vidioc_s_register,
+#endif
.tvnorms= SAA7134_NORMS,
.current_norm   = V4L2_STD_PAL,
 };


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/c7caf42ae671655eacdaf6f56fe2d1ed573d4021

___
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits


[linuxtv-commits] [hg:v4l-dvb] Add a tool to debug bttv registers

2008-06-17 Thread Patch from Mauro Carvalho Chehab
The patch number 8052 was added via Mauro Carvalho Chehab [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

From: Mauro Carvalho Chehab  [EMAIL PROTECTED]
Add a tool to debug bttv registers




Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]


---

 .hgignore |4 
 v4l2-apps/util/Makefile   |   10 -
 v4l2-apps/util/bttv-dbg.c |  361 ++
 3 files changed, 372 insertions(+), 3 deletions(-)

diff -r 90a2e0b3b6f0 -r e13575ad52a0 .hgignore
--- a/.hgignore Mon Jun 16 09:35:06 2008 -0300
+++ b/.hgignore Mon Jun 16 10:01:11 2008 -0300
@@ -46,3 +46,7 @@ v4l2-apps/util/qv4l2/qv4l2$
 v4l2-apps/util/qv4l2/qv4l2$
 v4l2-apps/util/rds/rds-saa6588$
 v4l2-apps/util/v4l2-ctl$
+v4l2-apps/util/cx18-ctl$
+v4l2-apps/util/ivtv-ctl$
+v4l2-apps/util/bttv-dbg$
+
diff -r 90a2e0b3b6f0 -r e13575ad52a0 v4l2-apps/util/Makefile
--- a/v4l2-apps/util/Makefile   Mon Jun 16 09:35:06 2008 -0300
+++ b/v4l2-apps/util/Makefile   Mon Jun 16 10:01:11 2008 -0300
@@ -1,9 +1,13 @@
 # Makefile for linuxtv.org v4l2-apps/util
+
+ifeq ($(KERNEL_DIR),)
+   KERNEL_DIR = /usr
+endif
 
 CPPFLAGS += -I../../linux/include -D_GNU_SOURCE
 LDFLAGS += -lm
 
-binaries = v4l2-ctl v4l2-dbg ivtv-ctl cx18-ctl
+binaries = v4l2-ctl v4l2-dbg ivtv-ctl cx18-ctl bttv-dbg
 
 ifeq ($(prefix),)
 prefix = /usr
@@ -32,12 +36,12 @@ install:
 
 include ../Make.rules
 
-parse.h: /usr/include/linux/input.h
+parse.h: $(KERNEL_DIR)/include/linux/input.h
@echo generating parse.h
@echo -en struct parse_key {\n\tchar *name;\n\tunsigned int value;\n} 
 parse.h
@echo -en keynames[] = {\n parse.h
 
-   @more /usr/include/linux/input.h |perl -n \
+   @more $(KERNEL_DIR)/linux/input.h |perl -n \
-e 'if (m/^\#define\s+(KEY_[^\s]+)\s+(0x[\d\w]+|[\d]+)/) ' \
-e '{ printf \t{\%s\, %s},\n,$$1,$$2; }' \
-e 'if (m/^\#define\s+(BTN_[^\s]+)\s+(0x[\d\w]+|[\d]+)/) ' \
diff -r 90a2e0b3b6f0 -r e13575ad52a0 v4l2-apps/util/bttv-dbg.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +
+++ b/v4l2-apps/util/bttv-dbg.c Mon Jun 16 10:01:11 2008 -0300
@@ -0,0 +1,361 @@
+/*
+Copyright (C) 2008 Mauro Carvalho Chehab [EMAIL PROTECTED]
+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 version 2 of the License.
+
+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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include unistd.h
+#include stdlib.h
+#include stdio.h
+#include string.h
+#include getopt.h
+#include fcntl.h
+#include errno.h
+#include sys/ioctl.h
+#include sys/time.h
+#include linux/types.h
+#include linux/videodev2.h
+
+struct bt8xx_regs {
+   unsigned int reg;
+   char *name;
+   int size;
+};
+
+static struct bt8xx_regs bt8xx_regs_other[] = {
+   {0x000, BT848_DSTATUS, 1},
+   {0x054, BT848_TEST, 1},
+   {0x060, BT848_ADELAY, 1},
+   {0x064, BT848_BDELAY, 1},
+   {0x07C, BT848_SRESET, 1},
+   {0x100, BT848_INT_STAT, 1},
+   {0x110, BT848_I2C, 1},
+   {0x11C, BT848_GPIO_REG_INP, 1},
+   {0x120, BT848_RISC_COUNT, 1},
+
+   /* This is also defined at bt8xx_regs with other name */
+   {0x0fc, BT848_VBI_PACK_DEL_VBI_HDELAY, 1},
+};
+
+static struct bt8xx_regs bt8xx_regs[] = {
+   {0x004, BT848_IFORM, 1},
+   {0x008, BT848_TDEC, 1},
+   {0x00C, BT848_E_CROP, 1},
+   {0x08C, BT848_O_CROP, 1},
+   {0x010, BT848_E_VDELAY_LO, 1},
+   {0x090, BT848_O_VDELAY_LO, 1},
+   {0x014, BT848_E_VACTIVE_LO, 1},
+   {0x094, BT848_O_VACTIVE_LO, 1},
+   {0x018, BT848_E_HDELAY_LO, 1},
+   {0x098, BT848_O_HDELAY_LO, 1},
+   {0x01C, BT848_E_HACTIVE_LO, 1},
+   {0x09C, BT848_O_HACTIVE_LO, 1},
+   {0x020, BT848_E_HSCALE_HI, 1},
+   {0x0A0, BT848_O_HSCALE_HI, 1},
+   {0x024, BT848_E_HSCALE_LO, 1},
+   {0x0A4, BT848_O_HSCALE_LO, 1},
+   {0x028, BT848_BRIGHT, 1},
+   {0x02C, BT848_E_CONTROL, 1},
+   {0x0AC, BT848_O_CONTROL, 1},
+   {0x030, BT848_CONTRAST_LO, 1},
+   {0x034, BT848_SAT_U_LO, 1},
+   {0x038, BT848_SAT_V_LO, 1},
+   {0x03C, BT848_HUE, 1},
+   {0x040, BT848_E_SCLOOP, 1},
+   {0x0C0, BT848_O_SCLOOP, 1},
+   {0x048, 

[linuxtv-commits] [hg:v4l-dvb] Prepare v4l-board-dbg to other chip additions

2008-06-17 Thread Patch from Mauro Carvalho Chehab
The patch number 8054 was added via Mauro Carvalho Chehab [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

From: Mauro Carvalho Chehab  [EMAIL PROTECTED]
Prepare v4l-board-dbg to other chip additions




Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]


---

 v4l2-apps/util/bttv-dbg.h  |  131 -
 v4l2-apps/util/v4l-board-dbg.c |   96 +++-
 2 files changed, 127 insertions(+), 100 deletions(-)

diff -r 91630c6b45e9 -r b8004e41dff5 v4l2-apps/util/bttv-dbg.h
--- a/v4l2-apps/util/bttv-dbg.h Mon Jun 16 10:13:24 2008 -0300
+++ b/v4l2-apps/util/bttv-dbg.h Mon Jun 16 16:35:52 2008 -0300
@@ -18,77 +18,80 @@
 
 #define BTTV_IDENT bttv
 
+/* Register name prefix */
+#define BTTV_PREFIX BT848_
+
 static struct board_regs bt8xx_regs_other[] = {
-   {0x000, BT848_DSTATUS, 1},
-   {0x054, BT848_TEST, 1},
-   {0x060, BT848_ADELAY, 1},
-   {0x064, BT848_BDELAY, 1},
-   {0x07C, BT848_SRESET, 1},
-   {0x100, BT848_INT_STAT, 1},
-   {0x110, BT848_I2C, 1},
-   {0x11C, BT848_GPIO_REG_INP, 1},
-   {0x120, BT848_RISC_COUNT, 1},
+   {0x000, BTTV_PREFIX DSTATUS, 1},
+   {0x054, BTTV_PREFIX TEST, 1},
+   {0x060, BTTV_PREFIX ADELAY, 1},
+   {0x064, BTTV_PREFIX BDELAY, 1},
+   {0x07C, BTTV_PREFIX SRESET, 1},
+   {0x100, BTTV_PREFIX INT_STAT, 1},
+   {0x110, BTTV_PREFIX I2C, 1},
+   {0x11C, BTTV_PREFIX GPIO_REG_INP, 1},
+   {0x120, BTTV_PREFIX RISC_COUNT, 1},
 
/* This is also defined at bt8xx_regs with other name */
-   {0x0fc, BT848_VBI_PACK_DEL_VBI_HDELAY, 1},
+   {0x0fc, BTTV_PREFIX VBI_PACK_DEL_VBI_HDELAY, 1},
 };
 
 static struct board_regs bt8xx_regs[] = {
-   {0x004, BT848_IFORM, 1},
-   {0x008, BT848_TDEC, 1},
-   {0x00C, BT848_E_CROP, 1},
-   {0x08C, BT848_O_CROP, 1},
-   {0x010, BT848_E_VDELAY_LO, 1},
-   {0x090, BT848_O_VDELAY_LO, 1},
-   {0x014, BT848_E_VACTIVE_LO, 1},
-   {0x094, BT848_O_VACTIVE_LO, 1},
-   {0x018, BT848_E_HDELAY_LO, 1},
-   {0x098, BT848_O_HDELAY_LO, 1},
-   {0x01C, BT848_E_HACTIVE_LO, 1},
-   {0x09C, BT848_O_HACTIVE_LO, 1},
-   {0x020, BT848_E_HSCALE_HI, 1},
-   {0x0A0, BT848_O_HSCALE_HI, 1},
-   {0x024, BT848_E_HSCALE_LO, 1},
-   {0x0A4, BT848_O_HSCALE_LO, 1},
-   {0x028, BT848_BRIGHT, 1},
-   {0x02C, BT848_E_CONTROL, 1},
-   {0x0AC, BT848_O_CONTROL, 1},
-   {0x030, BT848_CONTRAST_LO, 1},
-   {0x034, BT848_SAT_U_LO, 1},
-   {0x038, BT848_SAT_V_LO, 1},
-   {0x03C, BT848_HUE, 1},
-   {0x040, BT848_E_SCLOOP, 1},
-   {0x0C0, BT848_O_SCLOOP, 1},
-   {0x048, BT848_OFORM, 1},
-   {0x04C, BT848_E_VSCALE_HI, 1},
-   {0x0CC, BT848_O_VSCALE_HI, 1},
-   {0x050, BT848_E_VSCALE_LO, 1},
-   {0x0D0, BT848_O_VSCALE_LO, 1},
-   {0x068, BT848_ADC, 1},
-   {0x044, BT848_WC_UP, 1},
-   {0x078, BT848_WC_DOWN, 1},
-   {0x06C, BT848_E_VTC, 1},
-   {0x080, BT848_TGCTRL, 1},
-   {0x0EC, BT848_O_VTC, 1},
-   {0x0D4, BT848_COLOR_FMT, 1},
-   {0x0B0, BT848_VTOTAL_LO, 1},
-   {0x0B4, BT848_VTOTAL_HI, 1},
-   {0x0D8, BT848_COLOR_CTL, 1},
-   {0x0DC, BT848_CAP_CTL, 1},
-   {0x0E0, BT848_VBI_PACK_SIZE, 1},
-   {0x0E4, BT848_VBI_PACK_DEL, 1},
-   {0x0E8, BT848_FCNTR, 1},
+   {0x004, BTTV_PREFIX IFORM, 1},
+   {0x008, BTTV_PREFIX TDEC, 1},
+   {0x00C, BTTV_PREFIX E_CROP, 1},
+   {0x08C, BTTV_PREFIX O_CROP, 1},
+   {0x010, BTTV_PREFIX E_VDELAY_LO, 1},
+   {0x090, BTTV_PREFIX O_VDELAY_LO, 1},
+   {0x014, BTTV_PREFIX E_VACTIVE_LO, 1},
+   {0x094, BTTV_PREFIX O_VACTIVE_LO, 1},
+   {0x018, BTTV_PREFIX E_HDELAY_LO, 1},
+   {0x098, BTTV_PREFIX O_HDELAY_LO, 1},
+   {0x01C, BTTV_PREFIX E_HACTIVE_LO, 1},
+   {0x09C, BTTV_PREFIX O_HACTIVE_LO, 1},
+   {0x020, BTTV_PREFIX E_HSCALE_HI, 1},
+   {0x0A0, BTTV_PREFIX O_HSCALE_HI, 1},
+   {0x024, BTTV_PREFIX E_HSCALE_LO, 1},
+   {0x0A4, BTTV_PREFIX O_HSCALE_LO, 1},
+   {0x028, BTTV_PREFIX BRIGHT, 1},
+   {0x02C, BTTV_PREFIX E_CONTROL, 1},
+   {0x0AC, BTTV_PREFIX O_CONTROL, 1},
+   {0x030, BTTV_PREFIX CONTRAST_LO, 1},
+   {0x034, BTTV_PREFIX SAT_U_LO, 1},
+   {0x038, BTTV_PREFIX SAT_V_LO, 1},
+   {0x03C, BTTV_PREFIX HUE, 1},
+   {0x040, BTTV_PREFIX E_SCLOOP, 1},
+   {0x0C0, BTTV_PREFIX O_SCLOOP, 1},
+   {0x048, BTTV_PREFIX OFORM, 1},
+   {0x04C, BTTV_PREFIX E_VSCALE_HI, 1},
+   {0x0CC, BTTV_PREFIX O_VSCALE_HI, 1},
+   {0x050, BTTV_PREFIX E_VSCALE_LO, 1},
+   {0x0D0, BTTV_PREFIX O_VSCALE_LO, 1},
+   {0x068, BTTV_PREFIX ADC, 1},
+   {0x044, 

[linuxtv-commits] [hg:v4l-dvb] rename bttv-dbg to v4l-board-dbg in order to make it more generic

2008-06-17 Thread Patch from Mauro Carvalho Chehab
The patch number 8053 was added via Mauro Carvalho Chehab [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

From: Mauro Carvalho Chehab  [EMAIL PROTECTED]
rename bttv-dbg to v4l-board-dbg in order to make it more generic




Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]


---

 .hgignore  |3 
 v4l2-apps/util/Makefile|2 
 v4l2-apps/util/bttv-dbg.c  |  361 -
 v4l2-apps/util/bttv-dbg.h  |   94 
 v4l2-apps/util/v4l-board-dbg.c |  281 +
 v4l2-apps/util/v4l-board-dbg.h |   21 +
 6 files changed, 398 insertions(+), 364 deletions(-)

diff -r e13575ad52a0 -r 91630c6b45e9 .hgignore
--- a/.hgignore Mon Jun 16 10:01:11 2008 -0300
+++ b/.hgignore Mon Jun 16 10:13:24 2008 -0300
@@ -48,5 +48,4 @@ v4l2-apps/util/v4l2-ctl$
 v4l2-apps/util/v4l2-ctl$
 v4l2-apps/util/cx18-ctl$
 v4l2-apps/util/ivtv-ctl$
-v4l2-apps/util/bttv-dbg$
-
+v4l2-apps/util/v4l-board-dbg$
diff -r e13575ad52a0 -r 91630c6b45e9 v4l2-apps/util/Makefile
--- a/v4l2-apps/util/Makefile   Mon Jun 16 10:01:11 2008 -0300
+++ b/v4l2-apps/util/Makefile   Mon Jun 16 10:13:24 2008 -0300
@@ -7,7 +7,7 @@ CPPFLAGS += -I../../linux/include -D_GNU
 CPPFLAGS += -I../../linux/include -D_GNU_SOURCE
 LDFLAGS += -lm
 
-binaries = v4l2-ctl v4l2-dbg ivtv-ctl cx18-ctl bttv-dbg
+binaries = v4l2-ctl v4l2-dbg ivtv-ctl cx18-ctl v4l-board-dbg
 
 ifeq ($(prefix),)
 prefix = /usr
diff -r e13575ad52a0 -r 91630c6b45e9 v4l2-apps/util/bttv-dbg.c
--- a/v4l2-apps/util/bttv-dbg.c Mon Jun 16 10:01:11 2008 -0300
+++ /dev/null   Thu Jan 01 00:00:00 1970 +
@@ -1,361 +0,0 @@
-/*
-Copyright (C) 2008 Mauro Carvalho Chehab [EMAIL PROTECTED]
-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 version 2 of the License.
-
-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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-
-#include unistd.h
-#include stdlib.h
-#include stdio.h
-#include string.h
-#include getopt.h
-#include fcntl.h
-#include errno.h
-#include sys/ioctl.h
-#include sys/time.h
-#include linux/types.h
-#include linux/videodev2.h
-
-struct bt8xx_regs {
-   unsigned int reg;
-   char *name;
-   int size;
-};
-
-static struct bt8xx_regs bt8xx_regs_other[] = {
-   {0x000, BT848_DSTATUS, 1},
-   {0x054, BT848_TEST, 1},
-   {0x060, BT848_ADELAY, 1},
-   {0x064, BT848_BDELAY, 1},
-   {0x07C, BT848_SRESET, 1},
-   {0x100, BT848_INT_STAT, 1},
-   {0x110, BT848_I2C, 1},
-   {0x11C, BT848_GPIO_REG_INP, 1},
-   {0x120, BT848_RISC_COUNT, 1},
-
-   /* This is also defined at bt8xx_regs with other name */
-   {0x0fc, BT848_VBI_PACK_DEL_VBI_HDELAY, 1},
-};
-
-static struct bt8xx_regs bt8xx_regs[] = {
-   {0x004, BT848_IFORM, 1},
-   {0x008, BT848_TDEC, 1},
-   {0x00C, BT848_E_CROP, 1},
-   {0x08C, BT848_O_CROP, 1},
-   {0x010, BT848_E_VDELAY_LO, 1},
-   {0x090, BT848_O_VDELAY_LO, 1},
-   {0x014, BT848_E_VACTIVE_LO, 1},
-   {0x094, BT848_O_VACTIVE_LO, 1},
-   {0x018, BT848_E_HDELAY_LO, 1},
-   {0x098, BT848_O_HDELAY_LO, 1},
-   {0x01C, BT848_E_HACTIVE_LO, 1},
-   {0x09C, BT848_O_HACTIVE_LO, 1},
-   {0x020, BT848_E_HSCALE_HI, 1},
-   {0x0A0, BT848_O_HSCALE_HI, 1},
-   {0x024, BT848_E_HSCALE_LO, 1},
-   {0x0A4, BT848_O_HSCALE_LO, 1},
-   {0x028, BT848_BRIGHT, 1},
-   {0x02C, BT848_E_CONTROL, 1},
-   {0x0AC, BT848_O_CONTROL, 1},
-   {0x030, BT848_CONTRAST_LO, 1},
-   {0x034, BT848_SAT_U_LO, 1},
-   {0x038, BT848_SAT_V_LO, 1},
-   {0x03C, BT848_HUE, 1},
-   {0x040, BT848_E_SCLOOP, 1},
-   {0x0C0, BT848_O_SCLOOP, 1},
-   {0x048, BT848_OFORM, 1},
-   {0x04C, BT848_E_VSCALE_HI, 1},
-   {0x0CC, BT848_O_VSCALE_HI, 1},
-   {0x050, BT848_E_VSCALE_LO, 1},
-   {0x0D0, BT848_O_VSCALE_LO, 1},
-   {0x068, BT848_ADC, 1},
-   {0x044, BT848_WC_UP, 1},
-   {0x078, BT848_WC_DOWN, 1},
-   {0x06C, BT848_E_VTC, 1},
-   {0x080, BT848_TGCTRL, 1},
-   {0x0EC, BT848_O_VTC, 1},
-   {0x0D4, BT848_COLOR_FMT, 1},
-   {0x0B0, BT848_VTOTAL_LO, 1},
-   {0x0B4, BT848_VTOTAL_HI, 1},
-   

[linuxtv-commits] [hg:v4l-dvb] v4l-board-dbg: Add support for saa7134 registers

2008-06-17 Thread Patch from Mauro Carvalho Chehab
The patch number 8055 was added via Mauro Carvalho Chehab [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

From: Mauro Carvalho Chehab  [EMAIL PROTECTED]
v4l-board-dbg: Add support for saa7134 registers


Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]


---

 v4l2-apps/util/Makefile|3 +++
 v4l2-apps/util/v4l-board-dbg.c |   31 ---
 v4l2-apps/util/v4l-board-dbg.h |3 +++
 3 files changed, 34 insertions(+), 3 deletions(-)

diff -r b8004e41dff5 -r a2cbb6ac15cd v4l2-apps/util/Makefile
--- a/v4l2-apps/util/Makefile   Mon Jun 16 16:35:52 2008 -0300
+++ b/v4l2-apps/util/Makefile   Mon Jun 16 17:41:25 2008 -0300
@@ -54,6 +54,7 @@ keytables:
./gen_keytables.pl ../../linux/drivers/media/common/ir-keymaps.c
 
 keytable: keytable.c parse.h keytables
+v4l-board-dbg: v4l-board-dbg.c bttv-dbg.h saa7134-dbg.h
 
 v4l2-driverids.cpp: ../../linux/include/linux/i2c-id.h
@echo struct driverid { const char *name; unsigned id; } driverids[] = 
{ $@
@@ -64,3 +65,5 @@ v4l2-chipids.cpp: ../../linux/include/me
@echo struct chipid { const char *name; unsigned id; } chipids[] = { 
$@
@grep V4L2_IDENT_ $^ | sed -e 
's/.*V4L2_IDENT_\([0-9A-Z_]*\)[^=]*=[^0-9]*\([0-9]*\).*/{ \1, \2 },/' | tr 
A-Z a-z $@
@echo { 0, 0 }}; $@
+
+
diff -r b8004e41dff5 -r a2cbb6ac15cd v4l2-apps/util/v4l-board-dbg.c
--- a/v4l2-apps/util/v4l-board-dbg.cMon Jun 16 16:35:52 2008 -0300
+++ b/v4l2-apps/util/v4l-board-dbg.cMon Jun 16 17:41:25 2008 -0300
@@ -27,11 +27,12 @@
 #include linux/videodev2.h
 
 #include bttv-dbg.h
+#include saa7134-dbg.h
 
 #define ARRAY_SIZE(arr) ((int)(sizeof(arr) / sizeof((arr)[0])))
 
 struct board_list {
-   char *queryname;
+   char *name;
int prefix; /* Register prefix size */
struct board_regs *regs;
int regs_size;
@@ -41,12 +42,20 @@ struct board_list {
 
 struct board_list boards[] = {
[0] = { /* From bttv-dbg.h */
-   .queryname = BTTV_IDENT,
+   .name  = BTTV_IDENT,
.prefix= sizeof (BTTV_PREFIX),
.regs  = bt8xx_regs,
.regs_size = ARRAY_SIZE(bt8xx_regs),
.alt_regs  = bt8xx_regs_other,
.alt_regs_size = ARRAY_SIZE(bt8xx_regs_other),
+   },
+   [1] = { /* From saa7134-dbg.h */
+   .name  = SAA7134_IDENT,
+   .prefix= sizeof (SAA7134_PREFIX),
+   .regs  = saa7134_regs,
+   .regs_size = ARRAY_SIZE(saa7134_regs),
+   .alt_regs  = NULL,
+   .alt_regs_size = 0,
},
 };
 
@@ -106,6 +115,7 @@ int main(int argc, char **argv)
int i;
int fd = -1;
struct v4l2_register reg;
+   struct v4l2_capability cap;
struct board_list *curr_bd;
int board = 0;
struct option long_options[] = {
@@ -118,6 +128,7 @@ int main(int argc, char **argv)
};
 
/* FIXME: need to check for 'board' */
+board=1;
curr_bd = boards[board];
 
/* command args */
@@ -168,6 +179,20 @@ int main(int argc, char **argv)
}
free(device);
 
+   if (ioctl(fd, VIDIOC_QUERYCAP, cap)  0) {
+   printf(Error while reading capabilities\n);
+   exit(2);
+   }
+
+   for (board = ARRAY_SIZE(boards)-1; board = 0; board--) {
+   if (!strcasecmp((char *)cap.driver, boards[board].name))
+   break;
+   }
+   if (board  0) {
+   printf(This software doesn't support %s yet\n, cap.driver);
+   exit(3);
+   }
+
reg.match_type = V4L2_CHIP_MATCH_HOST;
reg.match_chip = 0;
 
@@ -176,7 +201,7 @@ int main(int argc, char **argv)
char name[256];
reg.reg = curr_bd-regs[i].reg;
if (ioctl(fd, VIDIOC_DBG_G_REGISTER, reg)  0) {
-   printf(Error while reading\n);
+   printf(Error while reading. Maybe you're not 
root?\n);
continue;
}
sprintf(name, %s:, curr_bd-regs[i].name);
diff -r b8004e41dff5 -r a2cbb6ac15cd v4l2-apps/util/v4l-board-dbg.h
--- a/v4l2-apps/util/v4l-board-dbg.hMon Jun 16 16:35:52 2008 -0300
+++ b/v4l2-apps/util/v4l-board-dbg.hMon Jun 16 17:41:25 2008 -0300
@@ -14,8 +14,11 @@
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
+#ifndef _V4L_BOARD_DBG
+#define 

[linuxtv-commits] [hg:v4l-dvb] v4l-board-dbg: Some cleanups

2008-06-17 Thread Patch from Mauro Carvalho Chehab
The patch number 8056 was added via Mauro Carvalho Chehab [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

From: Mauro Carvalho Chehab  [EMAIL PROTECTED]
v4l-board-dbg: Some cleanups




Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]


---

 v4l2-apps/util/v4l-board-dbg.c |   12 
 1 file changed, 4 insertions(+), 8 deletions(-)

diff -r a2cbb6ac15cd -r ef88a701e2a1 v4l2-apps/util/v4l-board-dbg.c
--- a/v4l2-apps/util/v4l-board-dbg.cMon Jun 16 17:41:25 2008 -0300
+++ b/v4l2-apps/util/v4l-board-dbg.cMon Jun 16 17:53:05 2008 -0300
@@ -43,7 +43,7 @@ struct board_list boards[] = {
 struct board_list boards[] = {
[0] = { /* From bttv-dbg.h */
.name  = BTTV_IDENT,
-   .prefix= sizeof (BTTV_PREFIX),
+   .prefix= sizeof(BTTV_PREFIX) - 1,
.regs  = bt8xx_regs,
.regs_size = ARRAY_SIZE(bt8xx_regs),
.alt_regs  = bt8xx_regs_other,
@@ -51,7 +51,7 @@ struct board_list boards[] = {
},
[1] = { /* From saa7134-dbg.h */
.name  = SAA7134_IDENT,
-   .prefix= sizeof (SAA7134_PREFIX),
+   .prefix= sizeof(SAA7134_PREFIX) - 1,
.regs  = saa7134_regs,
.regs_size = ARRAY_SIZE(saa7134_regs),
.alt_regs  = NULL,
@@ -127,10 +127,6 @@ int main(int argc, char **argv)
{0, 0, 0, 0}
};
 
-   /* FIXME: need to check for 'board' */
-board=1;
-   curr_bd = boards[board];
-
/* command args */
if (argc == 1) {
usage();
@@ -193,6 +189,8 @@ board=1;
exit(3);
}
 
+   curr_bd = boards[board];
+
reg.match_type = V4L2_CHIP_MATCH_HOST;
reg.match_chip = 0;
 
@@ -238,7 +236,6 @@ board=1;
return -1;
}
 
-
for (i = curr_bd-regs_size - 1; i =0 ; i--) {
if (!strcasecmp(reg_name, curr_bd-regs[i].name)) {
bd_reg = curr_bd-regs[i];
@@ -281,7 +278,6 @@ board=1;
}
}
 
-
if (i  0) {
printf(Register not found\n);
return -1;


---

Patch is available at: 
http://linuxtv.org/hg/v4l-dvb/rev/ef88a701e2a1d3e7ec576201f702d05c08986bb3

___
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits


[linuxtv-commits] [hg:v4l-dvb] v4l-board-dbg: Add registers for em28xx

2008-06-17 Thread Patch from Mauro Carvalho Chehab
The patch number 8058 was added via Mauro Carvalho Chehab [EMAIL PROTECTED]
to http://linuxtv.org/hg/v4l-dvb master development tree.

Kernel patches in this development tree may be modified to be backward
compatible with older kernels. Compatibility modifications will be
removed before inclusion into the mainstream Kernel

If anyone has any objections, please let us know by sending a message to:
[EMAIL PROTECTED]

--

From: Mauro Carvalho Chehab  [EMAIL PROTECTED]
v4l-board-dbg: Add registers for em28xx


Signed-off-by: Mauro Carvalho Chehab [EMAIL PROTECTED]


---

 v4l2-apps/util/Makefile|3 -
 v4l2-apps/util/em28xx-dbg.h|   84 +
 v4l2-apps/util/v4l-board-dbg.c |9 +++
 3 files changed, 95 insertions(+), 1 deletion(-)

diff -r 29f4d60b0b87 -r 50be11af3fdb v4l2-apps/util/Makefile
--- a/v4l2-apps/util/Makefile   Mon Jun 16 18:03:41 2008 -0300
+++ b/v4l2-apps/util/Makefile   Mon Jun 16 18:04:06 2008 -0300
@@ -54,7 +54,8 @@ keytables:
./gen_keytables.pl ../../linux/drivers/media/common/ir-keymaps.c
 
 keytable: keytable.c parse.h keytables
-v4l-board-dbg: v4l-board-dbg.c bttv-dbg.h saa7134-dbg.h
+
+v4l-board-dbg: v4l-board-dbg.c bttv-dbg.h saa7134-dbg.h em28xx-dbg.h
 
 v4l2-driverids.cpp: ../../linux/include/linux/i2c-id.h
@echo struct driverid { const char *name; unsigned id; } driverids[] = 
{ $@
diff -r 29f4d60b0b87 -r 50be11af3fdb v4l2-apps/util/em28xx-dbg.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +
+++ b/v4l2-apps/util/em28xx-dbg.h   Mon Jun 16 18:04:06 2008 -0300
@@ -0,0 +1,84 @@
+/*
+Copyright (C) 2008 Mauro Carvalho Chehab [EMAIL PROTECTED]
+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 version 2 of the License.
+
+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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+
+#include v4l-board-dbg.h
+
+#define EM28XX_IDENT em28xx
+
+/* Register name prefix */
+#define EM2800_PREFIX EM2800_
+#define EM2880_PREFIX EM2880_
+#define EM28XX_PREFIX EM28XX_
+
+static struct board_regs em28xx_regs[] = {
+   {0x08, EM2800_PREFIX AUDIOSRC, 1},
+   {0x04, EM2880_PREFIX GPO, 1},
+   {0x08, EM28XX_PREFIX GPIO, 1},
+
+   {0x06, EM28XX_PREFIX I2C_CLK, 1},
+   {0x0a, EM28XX_PREFIX CHIPID, 1},
+   {0x0c, EM28XX_PREFIX USBSUSP, 1},
+
+   {0x0e, EM28XX_PREFIX AUDIOSRC, 1},
+   {0x0f, EM28XX_PREFIX XCLK, 1},
+
+   {0x10, EM28XX_PREFIX VINMODE, 1},
+   {0x11, EM28XX_PREFIX VINCTRL, 1},
+   {0x12, EM28XX_PREFIX VINENABLE, 1},
+
+   {0x14, EM28XX_PREFIX GAMMA, 1},
+   {0x15, EM28XX_PREFIX RGAIN, 1},
+   {0x16, EM28XX_PREFIX GGAIN, 1},
+   {0x17, EM28XX_PREFIX BGAIN, 1},
+   {0x18, EM28XX_PREFIX ROFFSET, 1},
+   {0x19, EM28XX_PREFIX GOFFSET, 1},
+   {0x1a, EM28XX_PREFIX BOFFSET, 1},
+
+   {0x1b, EM28XX_PREFIX OFLOW, 1},
+   {0x1c, EM28XX_PREFIX HSTART, 1},
+   {0x1d, EM28XX_PREFIX VSTART, 1},
+   {0x1e, EM28XX_PREFIX CWIDTH, 1},
+   {0x1f, EM28XX_PREFIX CHEIGHT, 1},
+
+   {0x20, EM28XX_PREFIX YGAIN, 1},
+   {0x21, EM28XX_PREFIX YOFFSET, 1},
+   {0x22, EM28XX_PREFIX UVGAIN, 1},
+   {0x23, EM28XX_PREFIX UOFFSET, 1},
+   {0x24, EM28XX_PREFIX VOFFSET, 1},
+   {0x25, EM28XX_PREFIX SHARPNESS, 1},
+
+   {0x26, EM28XX_PREFIX COMPR, 1},
+   {0x27, EM28XX_PREFIX OUTFMT, 1},
+
+   {0x28, EM28XX_PREFIX XMIN, 1},
+   {0x29, EM28XX_PREFIX XMAX, 1},
+   {0x2a, EM28XX_PREFIX YMIN, 1},
+   {0x2b, EM28XX_PREFIX YMAX, 1},
+
+   {0x30, EM28XX_PREFIX HSCALELOW, 1},
+   {0x31, EM28XX_PREFIX HSCALEHIGH, 1},
+   {0x32, EM28XX_PREFIX VSCALELOW, 1},
+   {0x33, EM28XX_PREFIX VSCALEHIGH, 1},
+
+   {0x40, EM28XX_PREFIX AC97LSB, 1},
+   {0x41, EM28XX_PREFIX AC97MSB, 1},
+   {0x42, EM28XX_PREFIX AC97ADDR, 1},
+   {0x43, EM28XX_PREFIX AC97BUSY, 1},
+
+   {0x02, EM28XX_PREFIX MASTER_AC97, 1},
+   {0x10, EM28XX_PREFIX LINE_IN_AC97, 1},
+   {0x14, EM28XX_PREFIX VIDEO_AC97, 1},
+};
\ No newline at end of file
diff -r 29f4d60b0b87 -r 50be11af3fdb v4l2-apps/util/v4l-board-dbg.c
--- a/v4l2-apps/util/v4l-board-dbg.cMon Jun 16 18:03:41 2008 -0300
+++ b/v4l2-apps/util/v4l-board-dbg.cMon Jun 16 18:04:06 2008 -0300
@@ -28,6 +28,7 @@
 
 #include bttv-dbg.h
 #include saa7134-dbg.h
+#include em28xx-dbg.h
 
 #define ARRAY_SIZE(arr) ((int)(sizeof(arr) / sizeof((arr)[0])))
 
@@ -57,6 +58,14 @@ struct board_list boards[] = {
.alt_regs