Re: [media 7/8] PCIE bridge driver for PT3 & PX-Q3PE

2016-04-01 Thread kbuild test robot
Hi Буди,

[auto build test ERROR on linuxtv-media/master]
[also build test ERROR on v4.6-rc1 next-20160401]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improving the system]

url:
https://github.com/0day-ci/linux/commits/info-are-ma/DVB-driver-for-Earthsoft-PT3-PLEX-PX-Q3PE-ISDB-S-T-PCIE-cards-PX-BCUD-ISDB-S-USB-dongle/20160401-034740
base:   git://linuxtv.org/media_tree.git master
config: i386-allmodconfig (attached as .config)
reproduce:
# save the attached .config to linux build tree
make ARCH=i386 

All errors (new ones prefixed by >>):

   drivers/media/pci/ptx/pt3_pci.c: In function 'pt3_dma_run':
>> drivers/media/pci/ptx/pt3_pci.c:225:3: error: implicit declaration of 
>> function 'writeq' [-Werror=implicit-function-declaration]
  writeq(p->desc_info->adr, base + PT3_DMA_DESC);
  ^
   cc1: some warnings being treated as errors
--
   drivers/media/pci/ptx/pxq3pe_pci.c: In function 'pxq3pe_remove':
>> drivers/media/pci/ptx/pxq3pe_pci.c:484:3: error: implicit declaration of 
>> function 'vfree' [-Werror=implicit-function-declaration]
  vfree(p->sBuf);
  ^
   drivers/media/pci/ptx/pxq3pe_pci.c: In function 'pxq3pe_probe':
>> drivers/media/pci/ptx/pxq3pe_pci.c:536:14: error: implicit declaration of 
>> function 'vzalloc' [-Werror=implicit-function-declaration]
  p->sBuf  = vzalloc(p->sBufSize);
 ^
   drivers/media/pci/ptx/pxq3pe_pci.c:536:12: warning: assignment makes pointer 
from integer without a cast [-Wint-conversion]
  p->sBuf  = vzalloc(p->sBufSize);
   ^
   cc1: some warnings being treated as errors

vim +/writeq +225 drivers/media/pci/ptx/pt3_pci.c

   219  
   220  if (ON) {
   221  for (i = 0; i < p->ts_blk_cnt; i++) /* 17 */
   222  *p->ts_info[i].dat  = PTX_TS_NOT_SYNC;
   223  p->ts_blk_idx = 0;
   224  writel(2, base + PT3_DMA_CTL);  /* stop 
DMA */
 > 225  writeq(p->desc_info->adr, base + PT3_DMA_DESC);
   226  writel(1, base + PT3_DMA_CTL);  /* 
start DMA */
   227  } else {
   228  writel(2, base + PT3_DMA_CTL);  /* stop 
DMA */

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: Binary data


Re: [media 7/8] PCIE bridge driver for PT3 & PX-Q3PE

2016-03-31 Thread kbuild test robot
Hi Буди,

[auto build test WARNING on linuxtv-media/master]
[also build test WARNING on v4.6-rc1 next-20160331]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improving the system]

url:
https://github.com/0day-ci/linux/commits/info-are-ma/DVB-driver-for-Earthsoft-PT3-PLEX-PX-Q3PE-ISDB-S-T-PCIE-cards-PX-BCUD-ISDB-S-USB-dongle/20160401-034740
base:   git://linuxtv.org/media_tree.git master
config: i386-allmodconfig (attached as .config)
reproduce:
# save the attached .config to linux build tree
make ARCH=i386 

All warnings (new ones prefixed by >>):

   drivers/media/pci/ptx/pxq3pe_pci.c: In function 'pxq3pe_remove':
   drivers/media/pci/ptx/pxq3pe_pci.c:484:3: error: implicit declaration of 
function 'vfree' [-Werror=implicit-function-declaration]
  vfree(p->sBuf);
  ^
   drivers/media/pci/ptx/pxq3pe_pci.c: In function 'pxq3pe_probe':
   drivers/media/pci/ptx/pxq3pe_pci.c:536:14: error: implicit declaration of 
function 'vzalloc' [-Werror=implicit-function-declaration]
  p->sBuf  = vzalloc(p->sBufSize);
 ^
>> drivers/media/pci/ptx/pxq3pe_pci.c:536:12: warning: assignment makes pointer 
>> from integer without a cast [-Wint-conversion]
  p->sBuf  = vzalloc(p->sBufSize);
   ^
   cc1: some warnings being treated as errors

vim +536 drivers/media/pci/ptx/pxq3pe_pci.c

   478  if (c->dma.dat)
   479  pci_free_consistent(card->pdev, c->dma.sz, c->dma.dat, 
c->dma.adr);
   480  for (i = 0; i < card->adapn; i++) {
   481  struct ptx_adap *adap   = >adap[i];
   482  struct pxq3pe_adap  *p  = adap->priv;
   483  
 > 484  vfree(p->sBuf);
   485  }
   486  if (c->bar)
   487  pci_iounmap(pdev, c->bar);
   488  ptx_unregister_adap(card);
   489  }
   490  
   491  static const struct i2c_algorithm pxq3pe_algo = {
   492  .functionality  = ptx_i2c_func,
   493  .master_xfer= pxq3pe_xfr,
   494  };
   495  
   496  static int pxq3pe_probe(struct pci_dev *pdev, const struct 
pci_device_id *pci_id)
   497  {
   498  struct ptx_subdev_info  pxq3pe_subdev_info[] = {
   499  {SYS_ISDBT, 0x20, TC90522_MODNAME, 0x10, NM131_MODNAME},
   500  {SYS_ISDBS, 0x22, TC90522_MODNAME, 0x11, 
TDA2014X_MODNAME},
   501  {SYS_ISDBT, 0x24, TC90522_MODNAME, 0x12, NM131_MODNAME},
   502  {SYS_ISDBS, 0x26, TC90522_MODNAME, 0x13, 
TDA2014X_MODNAME},
   503  {SYS_ISDBT, 0x28, TC90522_MODNAME, 0x14, NM131_MODNAME},
   504  {SYS_ISDBS, 0x2A, TC90522_MODNAME, 0x15, 
TDA2014X_MODNAME},
   505  {SYS_ISDBT, 0x2C, TC90522_MODNAME, 0x16, NM131_MODNAME},
   506  {SYS_ISDBS, 0x2E, TC90522_MODNAME, 0x17, 
TDA2014X_MODNAME},
   507  };
   508  struct ptx_card *card   = ptx_alloc(pdev, 
KBUILD_MODNAME, ARRAY_SIZE(pxq3pe_subdev_info),
   509  sizeof(struct 
pxq3pe_card), sizeof(struct pxq3pe_adap), pxq3pe_lnb);
   510  struct pxq3pe_card  *c;
   511  u8  regctl  = 0xA0,
   512  i;
   513  u16 cfg;
   514  int err = !card || pci_read_config_word(pdev, 
PCI_COMMAND, );
   515  
   516  if (err)
   517  return ptx_abort(pdev, pxq3pe_remove, err, "Memory/PCI 
error, card=%p", card);
   518  c   = card->priv;
   519  if (!(cfg & PCI_COMMAND_MASTER)) {
   520  pci_set_master(pdev);
   521  pci_read_config_word(pdev, PCI_COMMAND, );
   522  if (!(cfg & PCI_COMMAND_MASTER))
   523  return ptx_abort(pdev, pxq3pe_remove, -EIO, 
"Bus Mastering is disabled");
   524  }
   525  c->bar  = pci_iomap(pdev, 0, 0);
   526  if (!c->bar)
   527  return ptx_abort(pdev, pxq3pe_remove, -EIO, "I/O map 
failed");
   528  if (ptx_i2c_add_adapter(card, _algo))
   529  return ptx_abort(pdev, pxq3pe_remove, -EIO, "Cannot add 
I2C");
   530  
   531  for (i = 0; i < card->adapn; i++) {
   532  struct ptx_adap *adap   = >adap[i];
   533  struct pxq3pe_adap  *p  = adap->priv;
   534  
   535  p->sBufSize = PTX_TS_SIZE * 100 << 9;
 > 536  p->sBuf = vzalloc(p->sBufSize);
   537  if (!p->sBuf)
   538  return ptx_abort(pdev, pxq3pe_remove, -ENOMEM, 
"No memory for stream buffer");
   539  }

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: Binary data


Re: [media 7/8] PCIE bridge driver for PT3 & PX-Q3PE

2016-03-31 Thread kbuild test robot
Hi Буди,

[auto build test ERROR on linuxtv-media/master]
[also build test ERROR on v4.6-rc1 next-20160331]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improving the system]

url:
https://github.com/0day-ci/linux/commits/info-are-ma/DVB-driver-for-Earthsoft-PT3-PLEX-PX-Q3PE-ISDB-S-T-PCIE-cards-PX-BCUD-ISDB-S-USB-dongle/20160401-034740
base:   git://linuxtv.org/media_tree.git master
config: i386-allyesconfig (attached as .config)
reproduce:
# save the attached .config to linux build tree
make ARCH=i386 

All errors (new ones prefixed by >>):

>> drivers/media/pci/ptx/ptx_common.c:187:536: error: 'KBUILD_MODNAME' 
>> undeclared here (not in a function)
>> drivers/media/pci/ptx/ptx_common.c:187:551: error: expected ',' or ';' 
>> before string constant

vim +/KBUILD_MODNAME +187 drivers/media/pci/ptx/ptx_common.c

   181  pci_release_regions(card->pdev);
   182  pci_set_drvdata(card->pdev, NULL);
   183  pci_disable_device(card->pdev);
   184  kfree(card);
   185  }
   186  
 > 187  DVB_DEFINE_MOD_OPT_ADAPTER_NR(adap_no);
   188  int ptx_register_adap(struct ptx_card *card, const struct 
ptx_subdev_info *info,
   189  int (*thread)(void *), int (*dma)(struct 
ptx_adap *, bool))
   190  {

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: Binary data


[media 7/8] PCIE bridge driver for PT3 & PX-Q3PE

2016-03-31 Thread info
From: Буди Романто, AreMa Inc 

PCIE bridge driver for PT3 & PX-Q3PE
Please read cover letter for details.

Signed-off-by: Буди Романто, AreMa Inc 
---
 drivers/media/pci/Kconfig  |   2 +-
 drivers/media/pci/Makefile |   2 +-
 drivers/media/pci/ptx/Kconfig  |  21 ++
 drivers/media/pci/ptx/Makefile |   8 +
 drivers/media/pci/ptx/pt3_pci.c| 425 +++
 drivers/media/pci/ptx/ptx_common.c | 252 
 drivers/media/pci/ptx/ptx_common.h |  74 +
 drivers/media/pci/ptx/pxq3pe_pci.c | 585 +
 8 files changed, 1367 insertions(+), 2 deletions(-)
 create mode 100644 drivers/media/pci/ptx/Kconfig
 create mode 100644 drivers/media/pci/ptx/Makefile
 create mode 100644 drivers/media/pci/ptx/pt3_pci.c
 create mode 100644 drivers/media/pci/ptx/ptx_common.c
 create mode 100644 drivers/media/pci/ptx/ptx_common.h
 create mode 100644 drivers/media/pci/ptx/pxq3pe_pci.c

diff --git a/drivers/media/pci/Kconfig b/drivers/media/pci/Kconfig
index 48a611b..9d63ad6 100644
--- a/drivers/media/pci/Kconfig
+++ b/drivers/media/pci/Kconfig
@@ -44,7 +44,7 @@ source "drivers/media/pci/b2c2/Kconfig"
 source "drivers/media/pci/pluto2/Kconfig"
 source "drivers/media/pci/dm1105/Kconfig"
 source "drivers/media/pci/pt1/Kconfig"
-source "drivers/media/pci/pt3/Kconfig"
+source "drivers/media/pci/ptx/Kconfig"
 source "drivers/media/pci/mantis/Kconfig"
 source "drivers/media/pci/ngene/Kconfig"
 source "drivers/media/pci/ddbridge/Kconfig"
diff --git a/drivers/media/pci/Makefile b/drivers/media/pci/Makefile
index 5f8aacb..984e37c 100644
--- a/drivers/media/pci/Makefile
+++ b/drivers/media/pci/Makefile
@@ -7,7 +7,7 @@ obj-y+= ttpci/  \
pluto2/ \
dm1105/ \
pt1/\
-   pt3/\
+   ptx/\
mantis/ \
ngene/  \
ddbridge/   \
diff --git a/drivers/media/pci/ptx/Kconfig b/drivers/media/pci/ptx/Kconfig
new file mode 100644
index 000..792acfe
--- /dev/null
+++ b/drivers/media/pci/ptx/Kconfig
@@ -0,0 +1,21 @@
+config DVB_PT3
+   tristate "Earthsoft PT3 cards"
+   depends on DVB_CORE && PCI && I2C
+   select DVB_TC90522 if MEDIA_SUBDRV_AUTOSELECT
+   select MEDIA_TUNER_QM1D1C0042 if MEDIA_SUBDRV_AUTOSELECT
+   select MEDIA_TUNER_MXL301RF if MEDIA_SUBDRV_AUTOSELECT
+   help
+ Support for Earthsoft PT3 ISDB-S/T PCIe cards.
+
+ Say Y or M if you own such a device and want to use it.
+
+config DVB_PXQ3PE
+   tristate "PLEX PX-Q3PE cards"
+   depends on DVB_CORE && PCI && I2C
+   select DVB_TC90522 if MEDIA_SUBDRV_AUTOSELECT
+   select MEDIA_TUNER_QM1D1C0042 if MEDIA_SUBDRV_AUTOSELECT
+   select MEDIA_TUNER_MXL301RF if MEDIA_SUBDRV_AUTOSELECT
+   help
+ Support for PLEX PX-Q3PE ISDB-S/T PCIe cards.
+
+ Say Y or M if you own such a device and want to use it.
diff --git a/drivers/media/pci/ptx/Makefile b/drivers/media/pci/ptx/Makefile
new file mode 100644
index 000..b10ad8a
--- /dev/null
+++ b/drivers/media/pci/ptx/Makefile
@@ -0,0 +1,8 @@
+pt3-objs   := pt3_pci.o ptx_common.o
+pxq3pe-objs:= pxq3pe_pci.o ptx_common.o
+
+obj-$(CONFIG_DVB_PT3)  += pt3.o
+obj-$(CONFIG_DVB_PXQ3PE)   += pxq3pe.o
+
+ccflags-y += -Idrivers/media/dvb-core -Idrivers/media/dvb-frontends 
-Idrivers/media/tuners
+
diff --git a/drivers/media/pci/ptx/pt3_pci.c b/drivers/media/pci/ptx/pt3_pci.c
new file mode 100644
index 000..07431da
--- /dev/null
+++ b/drivers/media/pci/ptx/pt3_pci.c
@@ -0,0 +1,425 @@
+/*
+   DVB driver for Earthsoft PT3 ISDB-S/T PCIE bridge Altera Cyclone IV 
FPGA EP4CGX15BF14C8N
+
+   Copyright (C) Budi Rachmanto, AreMa Inc. 
+
+   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.
+*/
+
+#include "tc90522.h"
+#include "qm1d1c004x.h"
+#include "mxl301rf.h"
+#include "ptx_common.h"
+
+MODULE_AUTHOR("Budi Rachmanto, AreMa Inc. ");
+MODULE_DESCRIPTION("Earthsoft PT3 DVB Driver");
+MODULE_LICENSE("GPL");
+
+static struct pci_device_id pt3_id[] = {
+   {PCI_DEVICE(0x1172, 0x4c15)},
+   {},
+};
+MODULE_DEVICE_TABLE(pci, pt3_id);
+
+enum ePT3 {
+   PT3_REG_VERSION = 0x00, /*  R   Version */
+   PT3_REG_BUS = 0x04, /*  R   Bus */
+   PT3_REG_SYS_W   = 0x08, /*  W   System  */
+   PT3_REG_SYS_R   = 0x0c, /*  R   System  */
+   PT3_REG_I2C_W   = 0x10, /*  W   I2C */
+   PT3_REG_I2C_R   = 0x14, /*  R   I2C */
+   PT3_REG_RAM_W   = 0x18, /*  W   RAM