SPENDE

2018-11-10 Thread info
Sehr geehrter Herr/Frau,
Wir freuen uns, Ihnen mitzuteilen, dass Sie ausgewählt wurden, um die Summe zu 
erhalten €2,000,000.00 Euro aus Mitteln der Mavis Wanczyk Hilfe.  Mein Name ist 
Mavis Wanczyk der Gewinner des 758,7 Millionen US-Dollar in der Power Ball 
Lotterie Jackpot als der größte Preis aus einem einzigen Lottoschein in USA.  
Meine Wohltätigkeitsstiftung hat dich ausgewählt, als unsere glücklichen 
Empfänger erhalten die Summe von € 2,000,000.00 EURO. Nehmen Sie dieses Angebot 
an und kontaktieren Sie mich für Weitere Details.


Hello

2018-11-06 Thread Million Consulting Info
Limes Asset Ltd is a Registered UK company currently delivering business 
financing and financing.
We are currently funding start-up, Growth stage companies and Individual 
funding.

Do you need to pay for our services?

Website: limesassetltd.co.uk
Email:  i...@limesassetltd.co.uk

John Pratt
Limes Asset LTD
Company Reg No: 06784897


Re: Reply Urgent

2017-06-19 Thread INFO

Hello,

How are you doing? I have been sent to inform you that, We have an  
inheritance of a deceased client with your surname. Contact Mr Andrew  
Bailey Reply Email To: myinf...@gmail.com with your "Full Names" for  
more info.  Thanks for your understanding.


Reply ASAP thank you.

Melissa.
--
Correo Corporativo Hospital Universitario del Valle E.S.E
***

"Estamos re-dimensionandonos para crecer!"

**




[media 0/5] DVB driver for Earthsoft PT3, PLEX PX-Q3PE ISDB-S/T PCIE cards & PX-BCUD ISDB-S USB dongle

2016-04-05 Thread info
28xx/em28xx-dvb.c   |  81 ++-
 drivers/media/usb/em28xx/em28xx.h   |   1 +
 36 files changed, 2816 insertions(+), 3156 deletions(-)
 delete mode 100644 drivers/media/pci/pt3/Kconfig
 delete mode 100644 drivers/media/pci/pt3/Makefile
 delete mode 100644 drivers/media/pci/pt3/pt3.c
 delete mode 100644 drivers/media/pci/pt3/pt3.h
 delete mode 100644 drivers/media/pci/pt3/pt3_dma.c
 delete mode 100644 drivers/media/pci/pt3/pt3_i2c.c
 create mode 100644 drivers/media/pci/ptx/Kconfig
 create mode 100644 drivers/media/pci/ptx/Makefile
 create mode 100644 drivers/media/pci/ptx/pt3.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.c
 create mode 100644 drivers/media/tuners/nm131.c
 create mode 100644 drivers/media/tuners/nm131.h
 delete mode 100644 drivers/media/tuners/qm1d1c0042.c
 delete mode 100644 drivers/media/tuners/qm1d1c0042.h
 create mode 100644 drivers/media/tuners/qm1d1c004x.c
 create mode 100644 drivers/media/tuners/qm1d1c004x.h
 create mode 100644 drivers/media/tuners/tda2014x.c
 create mode 100644 drivers/media/tuners/tda2014x.h

-- 
2.7.4

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


[media 1/5] Raise adapter number limit

2016-04-05 Thread info
From: Буди Романто, AreMa Inc <knightri...@are.ma>

The current limit is too low for latest cards with 8+ tuners on a single slot.
IMHO, the most appropriate minimum default is 16.

Signed-off-by: Буди Романто, AreMa Inc <knightri...@are.ma>
---
 drivers/media/dvb-core/Kconfig  | 4 ++--
 drivers/media/dvb-core/dvbdev.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/media/dvb-core/Kconfig b/drivers/media/dvb-core/Kconfig
index fa7a249..91732a9 100644
--- a/drivers/media/dvb-core/Kconfig
+++ b/drivers/media/dvb-core/Kconfig
@@ -5,7 +5,7 @@
 config DVB_MAX_ADAPTERS
int "maximum number of DVB/ATSC adapters"
depends on DVB_CORE
-   default 8
+   default 16
range 1 255
help
  Maximum number of DVB/ATSC adapters. Increasing this number
@@ -13,7 +13,7 @@ config DVB_MAX_ADAPTERS
  if a much lower number of DVB/ATSC adapters is present.
  Only values in the range 4-32 are tested.
 
- If you are unsure about this, use the default value 8
+ If you are unsure about this, use the default value 16
 
 config DVB_DYNAMIC_MINORS
bool "Dynamic DVB minor allocation"
diff --git a/drivers/media/dvb-core/dvbdev.h b/drivers/media/dvb-core/dvbdev.h
index 4aff7bd..ae4e0a2 100644
--- a/drivers/media/dvb-core/dvbdev.h
+++ b/drivers/media/dvb-core/dvbdev.h
@@ -34,7 +34,7 @@
 #if defined(CONFIG_DVB_MAX_ADAPTERS) && CONFIG_DVB_MAX_ADAPTERS > 0
   #define DVB_MAX_ADAPTERS CONFIG_DVB_MAX_ADAPTERS
 #else
-  #define DVB_MAX_ADAPTERS 8
+  #define DVB_MAX_ADAPTERS 16
 #endif
 
 #define DVB_UNSET (-1)
-- 
2.7.4

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


[media 4/5] Tuners for Earthsoft PT3, PLEX PX-Q3PE ISDB-S/T PCIE cards & PX-BCUD ISDB-S USB dongle

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

tda2014x.c  TDA20142PX-Q3PE
qm1d1c004x.cQM1D1C0042, QM1D1C0045, QM1D1C0045_2PX-BCUD, PT3
nm131.c NM131, NM130, NM120 PX-Q3PE
mxl301rf.c  MxL301RFPT3

Signed-off-by: Буди Романто, AreMa Inc 
---
 drivers/media/tuners/Kconfig  |  21 ++-
 drivers/media/tuners/Makefile |   4 +-
 drivers/media/tuners/mxl301rf.c   | 230 
 drivers/media/tuners/mxl301rf.h   |  23 +++
 drivers/media/tuners/nm131.c  | 252 +++
 drivers/media/tuners/nm131.h  |  13 ++
 drivers/media/tuners/qm1d1c004x.c | 247 ++
 drivers/media/tuners/qm1d1c004x.h |  23 +++
 drivers/media/tuners/tda2014x.c   | 358 ++
 drivers/media/tuners/tda2014x.h   |  13 ++
 10 files changed, 1180 insertions(+), 4 deletions(-)
 create mode 100644 drivers/media/tuners/mxl301rf.c
 create mode 100644 drivers/media/tuners/mxl301rf.h
 create mode 100644 drivers/media/tuners/nm131.c
 create mode 100644 drivers/media/tuners/nm131.h
 create mode 100644 drivers/media/tuners/qm1d1c004x.c
 create mode 100644 drivers/media/tuners/qm1d1c004x.h
 create mode 100644 drivers/media/tuners/tda2014x.c
 create mode 100644 drivers/media/tuners/tda2014x.h

diff --git a/drivers/media/tuners/Kconfig b/drivers/media/tuners/Kconfig
index 05998f0..a7f044b 100644
--- a/drivers/media/tuners/Kconfig
+++ b/drivers/media/tuners/Kconfig
@@ -271,10 +271,25 @@ config MEDIA_TUNER_MXL301RF
help
  MaxLinear MxL301RF OFDM tuner driver.
 
-config MEDIA_TUNER_QM1D1C0042
-   tristate "Sharp QM1D1C0042 tuner"
+config MEDIA_TUNER_QM1D1C004X
+   tristate "Sharp QM1D1C004x tuner"
depends on MEDIA_SUPPORT && I2C
default m if !MEDIA_SUBDRV_AUTOSELECT
help
- Sharp QM1D1C0042 trellis coded 8PSK tuner driver.
+ Sharp trellis coded 8PSK tuner driver.
+ Supported chips: QM1D1C0042, QM1D1C0045
+
+config MEDIA_TUNER_NM131
+   tristate "Newport Media tuners NM131, NM130 and NM120"
+   depends on MEDIA_SUPPORT && I2C
+   default m if !MEDIA_SUBDRV_AUTOSELECT
+   help
+ Newport Media NM131, NM130 and NM120 tuner driver.
+
+config MEDIA_TUNER_TDA2014X
+   tristate "NXP Semiconductors TDA2014x tuner"
+   depends on MEDIA_SUPPORT && I2C
+   default m if !MEDIA_SUBDRV_AUTOSELECT
+   help
+ NXP Semiconductor TDA2014x tuner driver.
 endmenu
diff --git a/drivers/media/tuners/Makefile b/drivers/media/tuners/Makefile
index 06a9ab6..6a2b52a 100644
--- a/drivers/media/tuners/Makefile
+++ b/drivers/media/tuners/Makefile
@@ -39,8 +39,10 @@ obj-$(CONFIG_MEDIA_TUNER_FC0013) += fc0013.o
 obj-$(CONFIG_MEDIA_TUNER_IT913X) += it913x.o
 obj-$(CONFIG_MEDIA_TUNER_R820T) += r820t.o
 obj-$(CONFIG_MEDIA_TUNER_MXL301RF) += mxl301rf.o
-obj-$(CONFIG_MEDIA_TUNER_QM1D1C0042) += qm1d1c0042.o
+obj-$(CONFIG_MEDIA_TUNER_QM1D1C004X) += qm1d1c004x.o
 obj-$(CONFIG_MEDIA_TUNER_M88RS6000T) += m88rs6000t.o
+obj-$(CONFIG_MEDIA_TUNER_NM131) += nm131.o
+obj-$(CONFIG_MEDIA_TUNER_TDA2014X) += tda2014x.o
 
 ccflags-y += -I$(srctree)/drivers/media/dvb-core
 ccflags-y += -I$(srctree)/drivers/media/dvb-frontends
diff --git a/drivers/media/tuners/mxl301rf.c b/drivers/media/tuners/mxl301rf.c
new file mode 100644
index 000..6d5f4f0
--- /dev/null
+++ b/drivers/media/tuners/mxl301rf.c
@@ -0,0 +1,230 @@
+/*
+   Sharp VA4M6JC2103 - Earthsoft PT3 ISDB-T tuner MaxLinear CMOS Hybrid TV 
MxL301RF
+
+   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 "dvb_frontend.h"
+#include "mxl301rf.h"
+
+int mxl301rf_w(struct dvb_frontend *fe, u8 slvadr, const u8 *dat, int len)
+{
+   struct i2c_client   *d  = fe->demodulator_priv;
+   u8  *buf= kzalloc(len + 1, GFP_KERNEL);
+   int ret;
+   struct i2c_msg  msg[] = {
+   {.addr = d->addr,   .flags = 0, .buf = buf, .len = 
len + 1,},
+   };
+
+   if (!buf)
+   return -ENOMEM;
+   buf[0]  = slvadr;
+   memcpy(buf + 1, dat, len);
+   ret = i2c_transfer(d->adapter, msg, 1);
+   kfree(buf);
+   return  ret == 1 ? 0 : -EIO;
+}
+
+int mxl301rf_w_tuner(struct dvb_frontend *fe, const u8 *dat, int len)
+{
+   u8  *buf= kzalloc(len + 1, GFP_KERNEL);
+   int ret;
+
+   if (!buf)
+   return -ENOMEM;
+   buf[0]  = ((struct i2c_client *)fe->tuner_priv)->addr << 1;
+   memcpy(buf + 1, dat, len);
+   ret = mxl301rf_w(fe, 0xFE, buf, len + 1);
+   

[media 2/5] drop backstabbing drivers

2016-04-05 Thread info
From: Буди Романто, AreMa Inc <knightri...@are.ma>

Obsoleted & superseded, please read cover letter for details.

Signed-off-by: Буди Романто, AreMa Inc <knightri...@are.ma>
---
 drivers/media/dvb-frontends/tc90522.c | 840 
 drivers/media/dvb-frontends/tc90522.h |  42 --
 drivers/media/pci/pt3/Kconfig |  10 -
 drivers/media/pci/pt3/Makefile|   8 -
 drivers/media/pci/pt3/pt3.c   | 874 --
 drivers/media/pci/pt3/pt3.h   | 186 
 drivers/media/pci/pt3/pt3_dma.c   | 225 -
 drivers/media/pci/pt3/pt3_i2c.c   | 240 --
 drivers/media/tuners/mxl301rf.c   | 349 --
 drivers/media/tuners/mxl301rf.h   |  26 -
 drivers/media/tuners/qm1d1c0042.c | 448 -
 drivers/media/tuners/qm1d1c0042.h |  37 --
 12 files changed, 3285 deletions(-)
 delete mode 100644 drivers/media/dvb-frontends/tc90522.c
 delete mode 100644 drivers/media/dvb-frontends/tc90522.h
 delete mode 100644 drivers/media/pci/pt3/Kconfig
 delete mode 100644 drivers/media/pci/pt3/Makefile
 delete mode 100644 drivers/media/pci/pt3/pt3.c
 delete mode 100644 drivers/media/pci/pt3/pt3.h
 delete mode 100644 drivers/media/pci/pt3/pt3_dma.c
 delete mode 100644 drivers/media/pci/pt3/pt3_i2c.c
 delete mode 100644 drivers/media/tuners/mxl301rf.c
 delete mode 100644 drivers/media/tuners/mxl301rf.h
 delete mode 100644 drivers/media/tuners/qm1d1c0042.c
 delete mode 100644 drivers/media/tuners/qm1d1c0042.h

diff --git a/drivers/media/dvb-frontends/tc90522.c 
b/drivers/media/dvb-frontends/tc90522.c
deleted file mode 100644
index 31cd325..000
--- a/drivers/media/dvb-frontends/tc90522.c
+++ /dev/null
@@ -1,840 +0,0 @@
-/*
- * Toshiba TC90522 Demodulator
- *
- * Copyright (C) 2014 Akihiro Tsukada <tsk...@gmail.com>
- *
- * 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.
- *
- *
- * 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.
- */
-
-/*
- * NOTICE:
- * This driver is incomplete and lacks init/config of the chips,
- * as the necessary info is not disclosed.
- * It assumes that users of this driver (such as a PCI bridge of
- * DTV receiver cards) properly init and configure the chip
- * via I2C *before* calling this driver's init() function.
- *
- * Currently, PT3 driver is the only one that uses this driver,
- * and contains init/config code in its firmware.
- * Thus some part of the code might be dependent on PT3 specific config.
- */
-
-#include 
-#include 
-#include 
-#include "dvb_math.h"
-#include "tc90522.h"
-
-#define TC90522_I2C_THRU_REG 0xfe
-
-#define TC90522_MODULE_IDX(addr) (((u8)(addr) & 0x02U) >> 1)
-
-struct tc90522_state {
-   struct tc90522_config cfg;
-   struct dvb_frontend fe;
-   struct i2c_client *i2c_client;
-   struct i2c_adapter tuner_i2c;
-
-   bool lna;
-};
-
-struct reg_val {
-   u8 reg;
-   u8 val;
-};
-
-static int
-reg_write(struct tc90522_state *state, const struct reg_val *regs, int num)
-{
-   int i, ret;
-   struct i2c_msg msg;
-
-   ret = 0;
-   msg.addr = state->i2c_client->addr;
-   msg.flags = 0;
-   msg.len = 2;
-   for (i = 0; i < num; i++) {
-   msg.buf = (u8 *)[i];
-   ret = i2c_transfer(state->i2c_client->adapter, , 1);
-   if (ret == 0)
-   ret = -EIO;
-   if (ret < 0)
-   return ret;
-   }
-   return 0;
-}
-
-static int reg_read(struct tc90522_state *state, u8 reg, u8 *val, u8 len)
-{
-   struct i2c_msg msgs[2] = {
-   {
-   .addr = state->i2c_client->addr,
-   .flags = 0,
-   .buf = ,
-   .len = 1,
-   },
-   {
-   .addr = state->i2c_client->addr,
-   .flags = I2C_M_RD,
-   .buf = val,
-   .len = len,
-   },
-   };
-   int ret;
-
-   ret = i2c_transfer(state->i2c_client->adapter, msgs, ARRAY_SIZE(msgs));
-   if (ret == ARRAY_SIZE(msgs))
-   ret = 0;
-   else if (ret >= 0)
-   ret = -EIO;
-   return ret;
-}
-
-static struct tc90522_state *cfg_to_state(struct tc90522_config *c)
-{
-   return container_of(c, struct tc90522_state, cfg);
-}
-
-
-static int tc90522s_set_tsid(struct dvb_frontend *fe)
-{
-   struct reg_val set_tsid[] = {
-   { 0x8f, 00 },
-   { 0x90, 00 }
-   };
-
-   set_t

[media 3/5] Demodulator for Earthsoft PT3, PLEX PX-Q3PE ISDB-S/T PCIE cards & PX-BCUD ISDB-S USB dongle

2016-04-05 Thread info
  return 1049480 + 38360 * fno;   /* BS   
*/
+   else if (fno < 24)
+   return 1613000 + 4 * (fno - 12);/* CS110 right  
*/
+   return 1593000 + 4 * (fno - 24);/* CS110 left   
*/
+   }
+
+   void s_kHz(u32 *f)
+   {
+   *f =*f > 300 ? fno2kHz(14)  :   /* max kHz, CNN 
*/
+   *f >= 1049480 ? *f  :   /* min real kHz 
*/
+   *f > 48 ? fno2kHz(4):   /* BS11 etc.
*/
+   fno2kHz(*f - 1);
+   }
+
+   u32 fno2Hz(u32 fno)
+   {
+   return  (fno > 112 ? 557 : 93 + 6 * fno + (fno < 12 ? 0 : fno < 
17 ? 2 : fno < 63 ? 0 : 2)) * 100 + 142857;
+   }
+
+   void t_Hz(u32 *f)
+   {
+   *f =*f >= 9000  ? *f:   /* 
real_freq Hz */
+   *f > 255? fno2Hz(77):   /* NHK  
*/
+   *f > 127? fno2Hz(*f - 128)  :   /* 
freqno (IO#) */
+   *f > 63 ? (*f -= 64,/* CATV 
*/
+   *f > 22 ? fno2Hz(*f - 1):   /* 
C23-C62  */
+   *f > 12 ? fno2Hz(*f - 10)   :   /* 
C13-C22  */
+   fno2Hz(77)) :
+   *f > 62 ? fno2Hz(77):
+   *f > 12 ? fno2Hz(*f + 50)   :   /* 
13-62*/
+   *f > 3  ? fno2Hz(*f +  9)   :   /*  
4-12*/
+   *f  ? fno2Hz(*f -  1)   :   /*  1-3 
*/
+   fno2Hz(77);
+   }
+   struct i2c_client   *d  = fe->demodulator_priv;
+   enum fe_status  *festat = i2c_get_clientdata(d);
+   u16 set_id  = fe->dtv_property_cache.stream_id,
+   i   = 999;
+   u8  data[16];
+
+   if (!retune)/* once is enough */
+   return 0;
+   *festat = 0;
+   if (fe->dtv_property_cache.delivery_system == SYS_ISDBT)
+   goto ISDBT;
+
+   s_kHz(>dtv_property_cache.frequency);
+   if (fe->ops.tuner_ops.set_params(fe))
+   return -EIO;
+   while (i--) {
+   if  ((tc90522_r(d, 0xC3, data, 1), !(data[0] & 0x10))   
&&  /* locked   */
+   (tc90522_r(d, 0xCE, data, 2), *(u16 *)data != 0)
&&  /* valid TSID   */
+   tc90522_r(d, 0xC3, data, 1) 
&&
+   tc90522_r(d, 0xCE, data, 16))
+   break;
+   msleep_interruptible(5);
+   }
+   if (!i)
+   goto ERR;
+   for (i = 0; i < 8; i++) {
+   u16 tsid = tc90522_n2int(data + i*2, 2);
+
+   if ((tsid == set_id || set_id == i) &&
+   tc90522_w(d, 0x8F, tsid >> 8)   &&
+   tc90522_w(d, 0x90, tsid & 0xFF) &&
+   tc90522_r(d, 0xE6, data, 2) &&
+   tc90522_n2int(data, 2) == tsid)
+   goto LOCK;
+   }
+   goto ERR;
+ISDBT:
+   t_Hz(>dtv_property_cache.frequency);
+   if (fe->ops.tuner_ops.set_params(fe))
+   return -EIO;
+   while (i--) {
+   boolretryov,
+   lock0,
+   lock1;
+   if (!tc90522_r(d, 0x80, data, 1) || !tc90522_r(d, 0xB0, data + 
1, 1))
+   break;
+   retryov = data[0] & 0b1000 ? true : false;
+   lock0   = data[0] & 0b1000 ? false : true;
+   lock1   = data[1] & 0b1000 ? true : false;
+   if (lock0 && lock1) {
+LOCK:
+   *festat = FE_HAS_SIGNAL | FE_HAS_CARRIER | FE_HAS_LOCK;
+   *stat = *festat;
+   return 0;
+   }
+   if (retryov)
+   break;
+   msleep_interruptible(1);
+   }
+ERR:
+   *stat = *festat;
+   return -ETIMEDOUT;
+}
+
+static struct dvb_frontend_ops tc90522_ops = {
+   .info = {
+   .name = TC90522_MODNAME,
+   .caps = FE_CAN_INVERSION_AUTO | FE_CAN_FEC_AUTO | 
FE_CAN_QAM_AUTO | FE_CAN_MULTISTREAM |
+   FE_CAN_TRANSMISSION_MODE_AUTO | 
FE_CAN_GUARD_INTERVAL_AUTO | FE_CAN_HIERARCHY_AUTO,
+   .frequency_min  = 1,/* actual limit settings are 
set by .tune */
+   .frequency_max  = 77000,
+   },
+   

[media 5/5] Bridge driver for PT3, PX-Q3PE & PX-BCUD

2016-04-05 Thread info
rty_cache.delivery_system == SYS_ISDBS ? 's' : 't');
+   return IS_ERR(adap->kthread) ? PTR_ERR(adap->kthread) : 
adap->card->dma(adap, true);
+}
+
+struct ptx_card *ptx_alloc(struct pci_dev *pdev, u8 *name, u8 adapn, u32 
sz_card_priv, u32 sz_adap_priv,
+   void (*lnb)(struct ptx_card *, bool))
+{
+   u8 i;
+   struct ptx_card *card = kzalloc(sizeof(struct ptx_card) + sz_card_priv 
+ adapn *
+   (sizeof(struct ptx_adap) + 
sz_adap_priv), GFP_KERNEL);
+   if (!card)
+   return NULL;
+   card->priv  = sz_card_priv ? [1] : NULL;
+   card->adap  = (struct ptx_adap *)((u8 *)[1] + sz_card_priv);
+   card->pdev  = pdev;
+   card->adapn = adapn;
+   card->name  = name;
+   card->lnbON = true;
+   card->lnb   = lnb;
+   for (i = 0; i < card->adapn; i++) {
+   struct ptx_adap *p = >adap[i];
+
+   p->card = card;
+   p->priv = sz_adap_priv ? (u8 *)>adap[card->adapn] + i * 
sz_adap_priv : NULL;
+   }
+   if (pci_enable_device(pdev) ||
+   pci_set_dma_mask(pdev, DMA_BIT_MASK(32))||
+   pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)) ||
+   pci_request_regions(pdev, name)) {
+   kfree(card);
+   return NULL;
+   }
+   pci_set_drvdata(pdev, card);
+   return card;
+}
+
+int ptx_i2c_add_adapter(struct ptx_card *card, const struct i2c_algorithm 
*algo)
+{
+   struct i2c_adapter *i2c = >i2c;
+
+   i2c->algo   = algo;
+   i2c->dev.parent = >pdev->dev;
+   strcpy(i2c->name, card->name);
+   i2c_set_adapdata(i2c, card);
+   mutex_init(>lock);
+   return  i2c_add_adapter(i2c);
+}
+
+void ptx_unregister_subdev(struct i2c_client *c)
+{
+   if (!c)
+   return;
+   if (c->dev.driver)
+   module_put(c->dev.driver->owner);
+   i2c_unregister_device(c);
+}
+
+struct i2c_client *ptx_register_subdev(struct i2c_adapter *i2c, struct 
dvb_frontend *fe, u16 adr, char *name)
+{
+   struct i2c_client   *c;
+   struct i2c_board_info   info = {
+   .platform_data  = fe,
+   .addr   = adr,
+   };
+
+   strlcpy(info.type, name, I2C_NAME_SIZE);
+   request_module("%s", info.type);
+   c = i2c_new_device(i2c, );
+   if (!c)
+   return NULL;
+   if (c->dev.driver && try_module_get(c->dev.driver->owner))
+   return c;
+   ptx_unregister_subdev(c);
+   return NULL;
+}
+
+void ptx_unregister_fe(struct dvb_frontend *fe)
+{
+   if (!fe)
+   return;
+   if (fe->frontend_priv)
+   dvb_unregister_frontend(fe);
+   ptx_unregister_subdev(fe->tuner_priv);
+   ptx_unregister_subdev(fe->demodulator_priv);
+   kfree(fe);
+}
+
+struct dvb_frontend *ptx_register_fe(struct i2c_adapter *i2c, struct 
dvb_adapter *dvb, const struct ptx_subdev_info *info)
+{
+   struct dvb_frontend *fe = kzalloc(sizeof(struct dvb_frontend), 
GFP_KERNEL);
+
+   if (!fe)
+   return  NULL;
+   fe->demodulator_priv= ptx_register_subdev(i2c, fe, 
info->demod_addr, info->demod_name);
+   fe->tuner_priv  = ptx_register_subdev(i2c, fe, 
info->tuner_addr, info->tuner_name);
+   if (info->type)
+   fe->ops.delsys[0] = info->type;
+   if (!fe->demodulator_priv || !fe->tuner_priv || (dvb && 
dvb_register_frontend(dvb, fe))) {
+   ptx_unregister_fe(fe);
+   return  NULL;
+   }
+   return fe;
+}
+
+void ptx_unregister_adap(struct ptx_card *card)
+{
+   int i   = card->adapn - 1;
+   struct ptx_adap *adap   = card->adap + i;
+
+   for (; i >= 0; i--, adap--) {
+   ptx_unregister_fe(adap->fe);
+   if (adap->demux.dmx.close)
+   adap->demux.dmx.close(>demux.dmx);
+   if (adap->dmxdev.filter)
+   dvb_dmxdev_release(>dmxdev);
+   if (adap->demux.cnt_storage)
+   dvb_dmx_release(>demux);
+   if (adap->dvb.name)
+   dvb_unregister_adapter(>dvb);
+   }
+   i2c_del_adapter(>i2c);
+   pci_release_regions(card->pdev);
+   pci_set_drvdata(card->pdev, NULL);
+   pci_disable_device(card->pdev);
+   kfree(card);
+}
+
+int ptx_register_adap(struct ptx_card *card, const struct ptx_subdev_info 
*info,
+   int (*thread)(void *), int (*dma)(struct ptx_adap *, 
bool))
+{
+   struct ptx_adap *adap;
+   short   adap_no[DVB_MAX_ADAPTERS] = {};
+   u8  i;
+   int  

[media 4/6] Tuners for Earthsoft PT3, PLEX PX-Q3PE ISDB-S/T PCIE cards & PX-BCUD ISDB-S USB dongle

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

tda2014x.c  TDA20142PX-Q3PE
qm1d1c004x.cQM1D1C0042, QM1D1C0045, QM1D1C0045_2PX-BCUD, PT3
nm131.c NM131, NM130, NM120 PX-Q3PE
mxl301rf.c  MxL301RFPT3

Signed-off-by: Буди Романто, AreMa Inc 
---
 drivers/media/tuners/Kconfig  |  21 ++-
 drivers/media/tuners/Makefile |   4 +-
 drivers/media/tuners/mxl301rf.c   | 220 +++
 drivers/media/tuners/mxl301rf.h   |  23 +++
 drivers/media/tuners/nm131.c  | 248 ++
 drivers/media/tuners/nm131.h  |  13 ++
 drivers/media/tuners/qm1d1c004x.c | 242 ++
 drivers/media/tuners/qm1d1c004x.h |  23 +++
 drivers/media/tuners/tda2014x.c   | 358 ++
 drivers/media/tuners/tda2014x.h   |  13 ++
 10 files changed, 1161 insertions(+), 4 deletions(-)
 create mode 100644 drivers/media/tuners/mxl301rf.c
 create mode 100644 drivers/media/tuners/mxl301rf.h
 create mode 100644 drivers/media/tuners/nm131.c
 create mode 100644 drivers/media/tuners/nm131.h
 create mode 100644 drivers/media/tuners/qm1d1c004x.c
 create mode 100644 drivers/media/tuners/qm1d1c004x.h
 create mode 100644 drivers/media/tuners/tda2014x.c
 create mode 100644 drivers/media/tuners/tda2014x.h

diff --git a/drivers/media/tuners/Kconfig b/drivers/media/tuners/Kconfig
index 05998f0..a7f044b 100644
--- a/drivers/media/tuners/Kconfig
+++ b/drivers/media/tuners/Kconfig
@@ -271,10 +271,25 @@ config MEDIA_TUNER_MXL301RF
help
  MaxLinear MxL301RF OFDM tuner driver.
 
-config MEDIA_TUNER_QM1D1C0042
-   tristate "Sharp QM1D1C0042 tuner"
+config MEDIA_TUNER_QM1D1C004X
+   tristate "Sharp QM1D1C004x tuner"
depends on MEDIA_SUPPORT && I2C
default m if !MEDIA_SUBDRV_AUTOSELECT
help
- Sharp QM1D1C0042 trellis coded 8PSK tuner driver.
+ Sharp trellis coded 8PSK tuner driver.
+ Supported chips: QM1D1C0042, QM1D1C0045
+
+config MEDIA_TUNER_NM131
+   tristate "Newport Media tuners NM131, NM130 and NM120"
+   depends on MEDIA_SUPPORT && I2C
+   default m if !MEDIA_SUBDRV_AUTOSELECT
+   help
+ Newport Media NM131, NM130 and NM120 tuner driver.
+
+config MEDIA_TUNER_TDA2014X
+   tristate "NXP Semiconductors TDA2014x tuner"
+   depends on MEDIA_SUPPORT && I2C
+   default m if !MEDIA_SUBDRV_AUTOSELECT
+   help
+ NXP Semiconductor TDA2014x tuner driver.
 endmenu
diff --git a/drivers/media/tuners/Makefile b/drivers/media/tuners/Makefile
index 06a9ab6..6a2b52a 100644
--- a/drivers/media/tuners/Makefile
+++ b/drivers/media/tuners/Makefile
@@ -39,8 +39,10 @@ obj-$(CONFIG_MEDIA_TUNER_FC0013) += fc0013.o
 obj-$(CONFIG_MEDIA_TUNER_IT913X) += it913x.o
 obj-$(CONFIG_MEDIA_TUNER_R820T) += r820t.o
 obj-$(CONFIG_MEDIA_TUNER_MXL301RF) += mxl301rf.o
-obj-$(CONFIG_MEDIA_TUNER_QM1D1C0042) += qm1d1c0042.o
+obj-$(CONFIG_MEDIA_TUNER_QM1D1C004X) += qm1d1c004x.o
 obj-$(CONFIG_MEDIA_TUNER_M88RS6000T) += m88rs6000t.o
+obj-$(CONFIG_MEDIA_TUNER_NM131) += nm131.o
+obj-$(CONFIG_MEDIA_TUNER_TDA2014X) += tda2014x.o
 
 ccflags-y += -I$(srctree)/drivers/media/dvb-core
 ccflags-y += -I$(srctree)/drivers/media/dvb-frontends
diff --git a/drivers/media/tuners/mxl301rf.c b/drivers/media/tuners/mxl301rf.c
new file mode 100644
index 000..916b06f
--- /dev/null
+++ b/drivers/media/tuners/mxl301rf.c
@@ -0,0 +1,220 @@
+/*
+   Sharp VA4M6JC2103 - Earthsoft PT3 ISDB-T tuner MaxLinear CMOS Hybrid TV 
MxL301RF
+
+   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 "dvb_frontend.h"
+#include "mxl301rf.h"
+
+int mxl301rf_w(struct dvb_frontend *fe, u8 slvadr, const u8 *dat, int len)
+{
+   struct i2c_client   *d  = fe->demodulator_priv;
+   u8  buf[len + 1];
+   struct i2c_msg  msg[] = {
+   {.addr = d->addr,   .flags = 0, .buf = buf, .len = 
len + 1,},
+   };
+
+   buf[0] = slvadr;
+   memcpy(buf + 1, dat, len);
+   return i2c_transfer(d->adapter, msg, 1) == 1 ? 0 : -EIO;
+}
+
+int mxl301rf_w_tuner(struct dvb_frontend *fe, const u8 *dat, int len)
+{
+   u8 buf[len + 1];
+
+   buf[0] = ((struct i2c_client *)fe->tuner_priv)->addr << 1;
+   memcpy(buf + 1, dat, len);
+   return mxl301rf_w(fe, 0xFE, buf, len + 1);
+}
+
+u8 mxl301rf_r(struct dvb_frontend *fe, u8 regadr)
+{
+   struct i2c_client   *d  = fe->demodulator_priv,
+   *t  = fe->tuner_priv;
+   u8  wbuf[]  = {0xFB, regadr},
+   rbuf[]  = {0xFE, (t->addr << 1) | 1, 0};
+  

[media 0/6] DVB driver for Earthsoft PT3, PLEX PX-Q3PE ISDB-S/T PCIE cards & PX-BCUD ISDB-S USB dongle

2016-04-04 Thread info
/em28xx-cards.c |  27 +
 drivers/media/usb/em28xx/em28xx-dvb.c   |  81 ++-
 drivers/media/usb/em28xx/em28xx.h   |   1 +
 36 files changed, 2794 insertions(+), 3156 deletions(-)
 delete mode 100644 drivers/media/pci/pt3/Kconfig
 delete mode 100644 drivers/media/pci/pt3/Makefile
 delete mode 100644 drivers/media/pci/pt3/pt3.c
 delete mode 100644 drivers/media/pci/pt3/pt3.h
 delete mode 100644 drivers/media/pci/pt3/pt3_dma.c
 delete mode 100644 drivers/media/pci/pt3/pt3_i2c.c
 create mode 100644 drivers/media/pci/ptx/Kconfig
 create mode 100644 drivers/media/pci/ptx/Makefile
 create mode 100644 drivers/media/pci/ptx/pt3.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.c
 create mode 100644 drivers/media/tuners/nm131.c
 create mode 100644 drivers/media/tuners/nm131.h
 delete mode 100644 drivers/media/tuners/qm1d1c0042.c
 delete mode 100644 drivers/media/tuners/qm1d1c0042.h
 create mode 100644 drivers/media/tuners/qm1d1c004x.c
 create mode 100644 drivers/media/tuners/qm1d1c004x.h
 create mode 100644 drivers/media/tuners/tda2014x.c
 create mode 100644 drivers/media/tuners/tda2014x.h

-- 
2.7.4

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


[media 1/6] Raise adapter number limit

2016-04-04 Thread info
From: Буди Романто, AreMa Inc <knightri...@are.ma>

The current limit is too low for latest cards with 8+ tuners on a single slot.
IMHO, the most appropriate minimum default is 16.

Signed-off-by: Буди Романто, AreMa Inc <knightri...@are.ma>
---
 drivers/media/dvb-core/Kconfig  | 4 ++--
 drivers/media/dvb-core/dvbdev.h | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/media/dvb-core/Kconfig b/drivers/media/dvb-core/Kconfig
index fa7a249..91732a9 100644
--- a/drivers/media/dvb-core/Kconfig
+++ b/drivers/media/dvb-core/Kconfig
@@ -5,7 +5,7 @@
 config DVB_MAX_ADAPTERS
int "maximum number of DVB/ATSC adapters"
depends on DVB_CORE
-   default 8
+   default 16
range 1 255
help
  Maximum number of DVB/ATSC adapters. Increasing this number
@@ -13,7 +13,7 @@ config DVB_MAX_ADAPTERS
  if a much lower number of DVB/ATSC adapters is present.
  Only values in the range 4-32 are tested.
 
- If you are unsure about this, use the default value 8
+ If you are unsure about this, use the default value 16
 
 config DVB_DYNAMIC_MINORS
bool "Dynamic DVB minor allocation"
diff --git a/drivers/media/dvb-core/dvbdev.h b/drivers/media/dvb-core/dvbdev.h
index 4aff7bd..ae4e0a2 100644
--- a/drivers/media/dvb-core/dvbdev.h
+++ b/drivers/media/dvb-core/dvbdev.h
@@ -34,7 +34,7 @@
 #if defined(CONFIG_DVB_MAX_ADAPTERS) && CONFIG_DVB_MAX_ADAPTERS > 0
   #define DVB_MAX_ADAPTERS CONFIG_DVB_MAX_ADAPTERS
 #else
-  #define DVB_MAX_ADAPTERS 8
+  #define DVB_MAX_ADAPTERS 16
 #endif
 
 #define DVB_UNSET (-1)
-- 
2.7.4

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


[media 2/6] drop backstabbing drivers

2016-04-04 Thread info
From: Буди Романто, AreMa Inc <knightri...@are.ma>

Obsoleted & superseded, please read cover letter for details.

Signed-off-by: Буди Романто, AreMa Inc <knightri...@are.ma>
---
 drivers/media/dvb-frontends/tc90522.c | 840 
 drivers/media/dvb-frontends/tc90522.h |  42 --
 drivers/media/pci/pt3/Kconfig |  10 -
 drivers/media/pci/pt3/Makefile|   8 -
 drivers/media/pci/pt3/pt3.c   | 874 --
 drivers/media/pci/pt3/pt3.h   | 186 
 drivers/media/pci/pt3/pt3_dma.c   | 225 -
 drivers/media/pci/pt3/pt3_i2c.c   | 240 --
 drivers/media/tuners/mxl301rf.c   | 349 --
 drivers/media/tuners/mxl301rf.h   |  26 -
 drivers/media/tuners/qm1d1c0042.c | 448 -
 drivers/media/tuners/qm1d1c0042.h |  37 --
 12 files changed, 3285 deletions(-)
 delete mode 100644 drivers/media/dvb-frontends/tc90522.c
 delete mode 100644 drivers/media/dvb-frontends/tc90522.h
 delete mode 100644 drivers/media/pci/pt3/Kconfig
 delete mode 100644 drivers/media/pci/pt3/Makefile
 delete mode 100644 drivers/media/pci/pt3/pt3.c
 delete mode 100644 drivers/media/pci/pt3/pt3.h
 delete mode 100644 drivers/media/pci/pt3/pt3_dma.c
 delete mode 100644 drivers/media/pci/pt3/pt3_i2c.c
 delete mode 100644 drivers/media/tuners/mxl301rf.c
 delete mode 100644 drivers/media/tuners/mxl301rf.h
 delete mode 100644 drivers/media/tuners/qm1d1c0042.c
 delete mode 100644 drivers/media/tuners/qm1d1c0042.h

diff --git a/drivers/media/dvb-frontends/tc90522.c 
b/drivers/media/dvb-frontends/tc90522.c
deleted file mode 100644
index 31cd325..000
--- a/drivers/media/dvb-frontends/tc90522.c
+++ /dev/null
@@ -1,840 +0,0 @@
-/*
- * Toshiba TC90522 Demodulator
- *
- * Copyright (C) 2014 Akihiro Tsukada <tsk...@gmail.com>
- *
- * 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.
- *
- *
- * 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.
- */
-
-/*
- * NOTICE:
- * This driver is incomplete and lacks init/config of the chips,
- * as the necessary info is not disclosed.
- * It assumes that users of this driver (such as a PCI bridge of
- * DTV receiver cards) properly init and configure the chip
- * via I2C *before* calling this driver's init() function.
- *
- * Currently, PT3 driver is the only one that uses this driver,
- * and contains init/config code in its firmware.
- * Thus some part of the code might be dependent on PT3 specific config.
- */
-
-#include 
-#include 
-#include 
-#include "dvb_math.h"
-#include "tc90522.h"
-
-#define TC90522_I2C_THRU_REG 0xfe
-
-#define TC90522_MODULE_IDX(addr) (((u8)(addr) & 0x02U) >> 1)
-
-struct tc90522_state {
-   struct tc90522_config cfg;
-   struct dvb_frontend fe;
-   struct i2c_client *i2c_client;
-   struct i2c_adapter tuner_i2c;
-
-   bool lna;
-};
-
-struct reg_val {
-   u8 reg;
-   u8 val;
-};
-
-static int
-reg_write(struct tc90522_state *state, const struct reg_val *regs, int num)
-{
-   int i, ret;
-   struct i2c_msg msg;
-
-   ret = 0;
-   msg.addr = state->i2c_client->addr;
-   msg.flags = 0;
-   msg.len = 2;
-   for (i = 0; i < num; i++) {
-   msg.buf = (u8 *)[i];
-   ret = i2c_transfer(state->i2c_client->adapter, , 1);
-   if (ret == 0)
-   ret = -EIO;
-   if (ret < 0)
-   return ret;
-   }
-   return 0;
-}
-
-static int reg_read(struct tc90522_state *state, u8 reg, u8 *val, u8 len)
-{
-   struct i2c_msg msgs[2] = {
-   {
-   .addr = state->i2c_client->addr,
-   .flags = 0,
-   .buf = ,
-   .len = 1,
-   },
-   {
-   .addr = state->i2c_client->addr,
-   .flags = I2C_M_RD,
-   .buf = val,
-   .len = len,
-   },
-   };
-   int ret;
-
-   ret = i2c_transfer(state->i2c_client->adapter, msgs, ARRAY_SIZE(msgs));
-   if (ret == ARRAY_SIZE(msgs))
-   ret = 0;
-   else if (ret >= 0)
-   ret = -EIO;
-   return ret;
-}
-
-static struct tc90522_state *cfg_to_state(struct tc90522_config *c)
-{
-   return container_of(c, struct tc90522_state, cfg);
-}
-
-
-static int tc90522s_set_tsid(struct dvb_frontend *fe)
-{
-   struct reg_val set_tsid[] = {
-   { 0x8f, 00 },
-   { 0x90, 00 }
-   };
-
-   set_t

[media 5/6] PCIE bridge driver for PT3 & PX-Q3PE

2016-04-04 Thread info
p[i];
+
+   p->card = card;
+   p->priv = sz_adap_priv ? (u8 *)>adap[card->adapn] + i * 
sz_adap_priv : NULL;
+   }
+   if (pci_enable_device(pdev) ||
+   pci_set_dma_mask(pdev, DMA_BIT_MASK(32))||
+   pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)) ||
+   pci_request_regions(pdev, name)) {
+   kfree(card);
+   return NULL;
+   }
+   pci_set_drvdata(pdev, card);
+   return card;
+}
+
+int ptx_i2c_add_adapter(struct ptx_card *card, const struct i2c_algorithm 
*algo)
+{
+   struct i2c_adapter *i2c = >i2c;
+
+   i2c->algo   = algo;
+   i2c->dev.parent = >pdev->dev;
+   strcpy(i2c->name, card->name);
+   i2c_set_adapdata(i2c, card);
+   mutex_init(>lock);
+   return  i2c_add_adapter(i2c);
+}
+
+void ptx_unregister_subdev(struct i2c_client *c)
+{
+   if (!c)
+   return;
+   if (c->dev.driver)
+   module_put(c->dev.driver->owner);
+   i2c_unregister_device(c);
+}
+
+struct i2c_client *ptx_register_subdev(struct i2c_adapter *i2c, struct 
dvb_frontend *fe, u16 adr, char *name)
+{
+   struct i2c_client   *c;
+   struct i2c_board_info   info = {
+   .platform_data  = fe,
+   .addr   = adr,
+   };
+
+   strlcpy(info.type, name, I2C_NAME_SIZE);
+   request_module("%s", info.type);
+   c = i2c_new_device(i2c, );
+   if (!c)
+   return NULL;
+   if (c->dev.driver && try_module_get(c->dev.driver->owner))
+   return c;
+   ptx_unregister_subdev(c);
+   return NULL;
+}
+
+void ptx_unregister_fe(struct dvb_frontend *fe)
+{
+   if (!fe)
+   return;
+   if (fe->frontend_priv)
+   dvb_unregister_frontend(fe);
+   ptx_unregister_subdev(fe->tuner_priv);
+   ptx_unregister_subdev(fe->demodulator_priv);
+   kfree(fe);
+}
+
+struct dvb_frontend *ptx_register_fe(struct i2c_adapter *i2c, struct 
dvb_adapter *dvb, const struct ptx_subdev_info *info)
+{
+   struct dvb_frontend *fe = kzalloc(sizeof(struct dvb_frontend), 
GFP_KERNEL);
+
+   if (!fe)
+   return  NULL;
+   fe->demodulator_priv= ptx_register_subdev(i2c, fe, 
info->demod_addr, info->demod_name);
+   fe->tuner_priv  = ptx_register_subdev(i2c, fe, 
info->tuner_addr, info->tuner_name);
+   if (info->type)
+   fe->ops.delsys[0] = info->type;
+   if (!fe->demodulator_priv || !fe->tuner_priv || (dvb && 
dvb_register_frontend(dvb, fe))) {
+   ptx_unregister_fe(fe);
+   return  NULL;
+   }
+   return fe;
+}
+
+void ptx_unregister_adap(struct ptx_card *card)
+{
+   int i   = card->adapn - 1;
+   struct ptx_adap *adap   = card->adap + i;
+
+   for (; i >= 0; i--, adap--) {
+   ptx_unregister_fe(adap->fe);
+   if (adap->demux.dmx.close)
+   adap->demux.dmx.close(>demux.dmx);
+   if (adap->dmxdev.filter)
+   dvb_dmxdev_release(>dmxdev);
+   if (adap->demux.cnt_storage)
+   dvb_dmx_release(>demux);
+   if (adap->dvb.name)
+   dvb_unregister_adapter(>dvb);
+   }
+   i2c_del_adapter(>i2c);
+   pci_release_regions(card->pdev);
+   pci_set_drvdata(card->pdev, NULL);
+   pci_disable_device(card->pdev);
+   kfree(card);
+}
+
+int ptx_register_adap(struct ptx_card *card, const struct ptx_subdev_info 
*info,
+   int (*thread)(void *), int (*dma)(struct ptx_adap *, 
bool))
+{
+   struct ptx_adap *adap;
+   short   adap_no[DVB_MAX_ADAPTERS] = {};
+   u8  i;
+   int err;
+
+   card->thread= thread;
+   card->dma   = dma;
+   for (i = 0, adap = card->adap; i < card->adapn; i++, adap++) {
+   struct dvb_adapter  *dvb= >dvb;
+   struct dvb_demux*demux  = >demux;
+   struct dmxdev   *dmxdev = >dmxdev;
+
+   if (dvb_register_adapter(dvb, card->name, THIS_MODULE, 
>pdev->dev, adap_no) < 0)
+   return -ENFILE;
+   demux->dmx.capabilities = DMX_TS_FILTERING | 
DMX_SECTION_FILTERING;
+   demux->feednum  = 1;
+   demux->filternum= 1;
+   demux->start_feed   = ptx_start_feed;
+   demux->stop_feed= ptx_stop_feed;
+   if (dvb_dmx_init(demux) < 0)
+   return -ENOMEM;
+   dmxdev->filternum   = 1;
+   dmxdev->demux   = >dmx;
+

[media 3/6] Demodulator for Earthsoft PT3, PLEX PX-Q3PE ISDB-S/T PCIE cards & PX-BCUD ISDB-S USB dongle

2016-04-04 Thread info
  return 1049480 + 38360 * fno;   /* BS   
*/
+   else if (fno < 24)
+   return 1613000 + 4 * (fno - 12);/* CS110 right  
*/
+   return 1593000 + 4 * (fno - 24);/* CS110 left   
*/
+   }
+
+   void s_kHz(u32 *f)
+   {
+   *f =*f > 300 ? fno2kHz(14)  :   /* max kHz, CNN 
*/
+   *f >= 1049480 ? *f  :   /* min real kHz 
*/
+   *f > 48 ? fno2kHz(4):   /* BS11 etc.
*/
+   fno2kHz(*f - 1);
+   }
+
+   u32 fno2Hz(u32 fno)
+   {
+   return  (fno > 112 ? 557 : 93 + 6 * fno + (fno < 12 ? 0 : fno < 
17 ? 2 : fno < 63 ? 0 : 2)) * 100 + 142857;
+   }
+
+   void t_Hz(u32 *f)
+   {
+   *f =*f >= 9000  ? *f:   /* 
real_freq Hz */
+   *f > 255? fno2Hz(77):   /* NHK  
*/
+   *f > 127? fno2Hz(*f - 128)  :   /* 
freqno (IO#) */
+   *f > 63 ? (*f -= 64,/* CATV 
*/
+   *f > 22 ? fno2Hz(*f - 1):   /* 
C23-C62  */
+   *f > 12 ? fno2Hz(*f - 10)   :   /* 
C13-C22  */
+   fno2Hz(77)) :
+   *f > 62 ? fno2Hz(77):
+   *f > 12 ? fno2Hz(*f + 50)   :   /* 
13-62*/
+   *f > 3  ? fno2Hz(*f +  9)   :   /*  
4-12*/
+   *f  ? fno2Hz(*f -  1)   :   /*  1-3 
*/
+   fno2Hz(77);
+   }
+   struct i2c_client   *d  = fe->demodulator_priv;
+   enum fe_status  *festat = i2c_get_clientdata(d);
+   u16 set_id  = fe->dtv_property_cache.stream_id,
+   i   = 999;
+   u8  data[16];
+
+   if (!retune)/* once is enough */
+   return 0;
+   *festat = 0;
+   if (fe->dtv_property_cache.delivery_system == SYS_ISDBT)
+   goto ISDBT;
+
+   s_kHz(>dtv_property_cache.frequency);
+   if (fe->ops.tuner_ops.set_params(fe))
+   return -EIO;
+   while (i--) {
+   if  ((tc90522_r(d, 0xC3, data, 1), !(data[0] & 0x10))   
&&  /* locked   */
+   (tc90522_r(d, 0xCE, data, 2), *(u16 *)data != 0)
&&  /* valid TSID   */
+   tc90522_r(d, 0xC3, data, 1) 
&&
+   tc90522_r(d, 0xCE, data, 16))
+   break;
+   msleep_interruptible(5);
+   }
+   if (!i)
+   goto ERR;
+   for (i = 0; i < 8; i++) {
+   u16 tsid = tc90522_n2int(data + i*2, 2);
+
+   if ((tsid == set_id || set_id == i) &&
+   tc90522_w(d, 0x8F, tsid >> 8)   &&
+   tc90522_w(d, 0x90, tsid & 0xFF) &&
+   tc90522_r(d, 0xE6, data, 2) &&
+   tc90522_n2int(data, 2) == tsid)
+   goto LOCK;
+   }
+   goto ERR;
+ISDBT:
+   t_Hz(>dtv_property_cache.frequency);
+   if (fe->ops.tuner_ops.set_params(fe))
+   return -EIO;
+   while (i--) {
+   boolretryov,
+   lock0,
+   lock1;
+   if (!tc90522_r(d, 0x80, data, 1) || !tc90522_r(d, 0xB0, data + 
1, 1))
+   break;
+   retryov = data[0] & 0b1000 ? true : false;
+   lock0   = data[0] & 0b1000 ? false : true;
+   lock1   = data[1] & 0b1000 ? true : false;
+   if (lock0 && lock1) {
+LOCK:
+   *festat = FE_HAS_SIGNAL | FE_HAS_CARRIER | FE_HAS_LOCK;
+   *stat = *festat;
+   return 0;
+   }
+   if (retryov)
+   break;
+   msleep_interruptible(1);
+   }
+ERR:
+   *stat = *festat;
+   return -ETIMEDOUT;
+}
+
+static struct dvb_frontend_ops tc90522_ops = {
+   .info = {
+   .name = TC90522_MODNAME,
+   .caps = FE_CAN_INVERSION_AUTO | FE_CAN_FEC_AUTO | 
FE_CAN_QAM_AUTO | FE_CAN_MULTISTREAM |
+   FE_CAN_TRANSMISSION_MODE_AUTO | 
FE_CAN_GUARD_INTERVAL_AUTO | FE_CAN_HIERARCHY_AUTO,
+   .frequency_min  = 1,/* actual limit settings are 
set by .tune */
+   .frequency_max  = 77000,
+   },
+   

[media 6/6] Bridge driver for PLEX PX-BCUD ISDB-S USB dongle

2016-04-04 Thread info
   97
+#define EM28178_BOARD_PLEX_PX_BCUD98
 
 /* Limits minimum and default number of buffers */
 #define EM28XX_MIN_BUF 4
-- 
2.7.4

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


[media 5/8] MaxLinear MxL301RF ISDB-T tuner

2016-03-31 Thread info
ytes to store RF  */
+   0x13, 0x01  /* start tune   */
+   };
+   const u8 idac[] = {
+   0x0d, 0x00,
+   0x0c, 0x67,
+   0x6f, 0x89,
+   0x70, 0x0c,
+   0x6f, 0x8a,
+   0x70, 0x0e,
+   0x6f, 0x8b,
+   0x70, 0x10+12,
+   };
+   u8  dat[20];
+   int err = mxl301rf_set_agc(fe, MXL301RF_AGC_MANUAL);
+   u32 freq= fe->dtv_property_cache.frequency,
+   kHz = 1000,
+   MHz = 100,
+   dig_rf  = freq / MHz,
+   tmp = freq % MHz,
+   i,
+   fdiv= 100;
+   unsigned long timeout;
+
+   if (err)
+   return err;
+   for (i = 0; i < 6; i++) {
+   dig_rf <<= 1;
+   fdiv /= 2;
+   if (tmp > fdiv) {
+   tmp -= fdiv;
+   dig_rf++;
+   }
+   }
+   if (tmp > 7812)
+   dig_rf++;
+   rf_dat[2 * 7 + 1]   = (u8)(dig_rf);
+   rf_dat[2 * 8 + 1]   = (u8)(dig_rf >> 8);
+   for (i = 0; i < ARRAY_SIZE(shf_dvbt_tab); i++) {
+   if ((freq >= (shf_dvbt_tab[i].freq - shf_dvbt_tab[i].freq_th) * 
kHz) &&
+   (freq <= (shf_dvbt_tab[i].freq + 
shf_dvbt_tab[i].freq_th) * kHz)) {
+   rf_dat[2 * 5 + 1] = shf_dvbt_tab[i].shf_val;
+   rf_dat[2 * 6 + 1] = 0xa0 | shf_dvbt_tab[i].shf_dir;
+   break;
+   }
+   }
+   memcpy(dat, rf_dat, sizeof(rf_dat));
+
+   mxl301rf_w_tuner(fe, dat, 14);
+   msleep_interruptible(1);
+   mxl301rf_w_tuner(fe, dat + 14, 6);
+   msleep_interruptible(1);
+   dat[0] = 0x1a;
+   dat[1] = 0x0d;
+   mxl301rf_w_tuner(fe, dat, 2);
+   mxl301rf_w_tuner(fe, idac, sizeof(idac));
+   timeout = jiffies + msecs_to_jiffies(100);
+   while (time_before(jiffies, timeout)) {
+   if ((mxl301rf_r(fe, 0x16) & 0x0c) == 0x0c && (mxl301rf_r(fe, 
0x16) & 0x03) == 0x03)
+   return mxl301rf_set_agc(fe, MXL301RF_AGC_AUTO);
+   msleep_interruptible(1);
+   }
+   return -ETIMEDOUT;
+}
+
+int mxl301rf_wakeup(struct dvb_frontend *fe)
+{
+   u8  buf = (1 << 7) | (0 << 4),
+   dat[2]  = {0x01, 0x01};
+   int err = mxl301rf_w(fe, 0x03, , 1);
+
+   if (err)
+   return err;
+   mxl301rf_w_tuner(fe, dat, sizeof(dat));
+   return 0;
+}
+
+int mxl301rf_probe(struct i2c_client *t, const struct i2c_device_id *id)
+{
+   struct dvb_frontend *fe = t->dev.platform_data;
+   u8  d[] = {0x10, 0x01};
+
+   fe->ops.tuner_ops.set_params= mxl301rf_tune;
+   fe->ops.tuner_ops.sleep = mxl301rf_sleep;
+   fe->ops.tuner_ops.init  = mxl301rf_wakeup;
+   return  mxl301rf_w(fe, 0x1c, d, 1)  ||
+   mxl301rf_w(fe, 0x1d, d+1, 1);
+}
+
+static struct i2c_device_id mxl301rf_id[] = {
+   {MXL301RF_MODNAME, 0},
+   {},
+};
+MODULE_DEVICE_TABLE(i2c, mxl301rf_id);
+
+static struct i2c_driver mxl301rf_driver = {
+   .driver.name= mxl301rf_id->name,
+   .probe  = mxl301rf_probe,
+   .id_table   = mxl301rf_id,
+};
+module_i2c_driver(mxl301rf_driver);
+
+MODULE_AUTHOR("Budi Rachmanto, AreMa Inc. <knightrider(@)are.ma>");
+MODULE_DESCRIPTION("Earthsoft PT3 MxL301RF MaxLinear CMOS Hybrid TV ISDB-T 
tuner driver");
+MODULE_LICENSE("GPL");
+
diff --git a/drivers/media/tuners/mxl301rf.h b/drivers/media/tuners/mxl301rf.h
new file mode 100644
index 000..32a31b0
--- /dev/null
+++ b/drivers/media/tuners/mxl301rf.h
@@ -0,0 +1,23 @@
+/*
+ * Sharp VA4M6JC2103 - Earthsoft PT3 ISDB-T tuner MaxLinear CMOS Hybrid TV 
MxL301RF
+ *
+ * Copyright (C) 2014 Budi Rachmanto, AreMa Inc. <i...@are.ma>
+ *
+ * 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.
+ */
+
+#ifndef MXL301RF_H
+#define MXL301RF_H
+
+#define MXL301RF_MODNAME "mxl301rf"
+
+#endif
+
-- 
2.7.4

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


[media 3/8] drop backstabbing drivers

2016-03-31 Thread info
From: Буди Романто, AreMa Inc <knightri...@are.ma>

Obsoleted & superseded, please read cover letter for details.

Signed-off-by: Буди Романто, AreMa Inc <knightri...@are.ma>
---
 drivers/media/dvb-frontends/tc90522.c | 840 
 drivers/media/dvb-frontends/tc90522.h |  42 --
 drivers/media/pci/pt3/Kconfig |  10 -
 drivers/media/pci/pt3/Makefile|   8 -
 drivers/media/pci/pt3/pt3.c   | 874 --
 drivers/media/pci/pt3/pt3.h   | 186 
 drivers/media/pci/pt3/pt3_dma.c   | 225 -
 drivers/media/pci/pt3/pt3_i2c.c   | 240 --
 drivers/media/tuners/mxl301rf.c   | 349 --
 drivers/media/tuners/mxl301rf.h   |  26 -
 drivers/media/tuners/qm1d1c0042.c | 448 -
 drivers/media/tuners/qm1d1c0042.h |  37 --
 12 files changed, 3285 deletions(-)
 delete mode 100644 drivers/media/dvb-frontends/tc90522.c
 delete mode 100644 drivers/media/dvb-frontends/tc90522.h
 delete mode 100644 drivers/media/pci/pt3/Kconfig
 delete mode 100644 drivers/media/pci/pt3/Makefile
 delete mode 100644 drivers/media/pci/pt3/pt3.c
 delete mode 100644 drivers/media/pci/pt3/pt3.h
 delete mode 100644 drivers/media/pci/pt3/pt3_dma.c
 delete mode 100644 drivers/media/pci/pt3/pt3_i2c.c
 delete mode 100644 drivers/media/tuners/mxl301rf.c
 delete mode 100644 drivers/media/tuners/mxl301rf.h
 delete mode 100644 drivers/media/tuners/qm1d1c0042.c
 delete mode 100644 drivers/media/tuners/qm1d1c0042.h

diff --git a/drivers/media/dvb-frontends/tc90522.c 
b/drivers/media/dvb-frontends/tc90522.c
deleted file mode 100644
index 31cd325..000
--- a/drivers/media/dvb-frontends/tc90522.c
+++ /dev/null
@@ -1,840 +0,0 @@
-/*
- * Toshiba TC90522 Demodulator
- *
- * Copyright (C) 2014 Akihiro Tsukada <tsk...@gmail.com>
- *
- * 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.
- *
- *
- * 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.
- */
-
-/*
- * NOTICE:
- * This driver is incomplete and lacks init/config of the chips,
- * as the necessary info is not disclosed.
- * It assumes that users of this driver (such as a PCI bridge of
- * DTV receiver cards) properly init and configure the chip
- * via I2C *before* calling this driver's init() function.
- *
- * Currently, PT3 driver is the only one that uses this driver,
- * and contains init/config code in its firmware.
- * Thus some part of the code might be dependent on PT3 specific config.
- */
-
-#include 
-#include 
-#include 
-#include "dvb_math.h"
-#include "tc90522.h"
-
-#define TC90522_I2C_THRU_REG 0xfe
-
-#define TC90522_MODULE_IDX(addr) (((u8)(addr) & 0x02U) >> 1)
-
-struct tc90522_state {
-   struct tc90522_config cfg;
-   struct dvb_frontend fe;
-   struct i2c_client *i2c_client;
-   struct i2c_adapter tuner_i2c;
-
-   bool lna;
-};
-
-struct reg_val {
-   u8 reg;
-   u8 val;
-};
-
-static int
-reg_write(struct tc90522_state *state, const struct reg_val *regs, int num)
-{
-   int i, ret;
-   struct i2c_msg msg;
-
-   ret = 0;
-   msg.addr = state->i2c_client->addr;
-   msg.flags = 0;
-   msg.len = 2;
-   for (i = 0; i < num; i++) {
-   msg.buf = (u8 *)[i];
-   ret = i2c_transfer(state->i2c_client->adapter, , 1);
-   if (ret == 0)
-   ret = -EIO;
-   if (ret < 0)
-   return ret;
-   }
-   return 0;
-}
-
-static int reg_read(struct tc90522_state *state, u8 reg, u8 *val, u8 len)
-{
-   struct i2c_msg msgs[2] = {
-   {
-   .addr = state->i2c_client->addr,
-   .flags = 0,
-   .buf = ,
-   .len = 1,
-   },
-   {
-   .addr = state->i2c_client->addr,
-   .flags = I2C_M_RD,
-   .buf = val,
-   .len = len,
-   },
-   };
-   int ret;
-
-   ret = i2c_transfer(state->i2c_client->adapter, msgs, ARRAY_SIZE(msgs));
-   if (ret == ARRAY_SIZE(msgs))
-   ret = 0;
-   else if (ret >= 0)
-   ret = -EIO;
-   return ret;
-}
-
-static struct tc90522_state *cfg_to_state(struct tc90522_config *c)
-{
-   return container_of(c, struct tc90522_state, cfg);
-}
-
-
-static int tc90522s_set_tsid(struct dvb_frontend *fe)
-{
-   struct reg_val set_tsid[] = {
-   { 0x8f, 00 },
-   { 0x90, 00 }
-   };
-
-   set_t

[media 2/8] NXP tda2014x & Newport Media nm120/130/131 tuner (PXQ3PE)

2016-03-31 Thread info
   /* ProgramVcoPor */
+   tda2014x_r8(fe, 0xF, 0, 8, )
&&
+   (val = (val & 0x1F) | 0x80, tda2014x_w16(fe, 0xF, 0, 8, 0, 0, 
6, val))  &&
+   tda2014x_r8(fe, 0x13, 0, 8, )   
&&
+   (val = (val & 0xFFCF) | 0x20, tda2014x_w16(fe, 0x13, 0, 8, 
0, 0, 6, val))   &&
+   tda2014x_r8(fe, 0x12, 0, 8, )   
&&
+   (val |= 0xC0, tda2014x_w16(fe, 0x12, 0, 8, 0, 0, 6, val))   
&&
+   tda2014x_w16(fe, 0x10, 5, 1, 0, 1, 6, 1)
&&
+   tda2014x_w16(fe, 0x10, 5, 1, 0, 1, 6, 1)
&&
+   tda2014x_w16(fe, 0xF, 5, 1, 0, 1, 6, 1) 
&&
+   tda2014x_r8(fe, 0x11, 4, 1, )   
&&
+   (val || tda2014x_r8(fe, 0x11, 4, 1, ))  
&&
+   (val || tda2014x_r8(fe, 0x11, 4, 1, ))  
&&
+   val 
&&
+   tda2014x_r8(fe, 0x10, 0, 4, )   
&&
+   tda2014x_w16(fe, 0xF, 0, 4, 0, 1, 6, val)   
&&
+   tda2014x_w16(fe, 0xF, 6, 1, 0, 1, 6, 1)     
&&
+   tda2014x_w16(fe, 0xF, 5, 1, 0, 1, 6, 0) 
&&
+   tda2014x_r8(fe, 0x12, 0, 8, )   
&&
+   (val &= 0x7F, tda2014x_w16(fe, 0x12, 0, 8, 0, 0, 6, val))   
&&
+   tda2014x_w16(fe, 0xD, 5, 2, 0, 1, 6, 1) 
&&
+
+   /* EnableLoopThrough */
+   tda2014x_r8(fe, 6, 0, 8, )  
&&
+   tda2014x_w16(fe, 6, 0, 8, 0, 0, 6, (val & 0xF7) | 8)) * -EIO
||
+
+   tda2014x_tune(fe);
+}
+
+static struct i2c_device_id tda2014x_id[] = {
+   {TDA2014X_MODNAME, 0},
+   {},
+};
+MODULE_DEVICE_TABLE(i2c, tda2014x_id);
+
+static struct i2c_driver tda2014x_driver = {
+   .driver.name= tda2014x_id->name,
+   .probe  = tda2014x_probe,
+   .id_table   = tda2014x_id,
+};
+module_i2c_driver(tda2014x_driver);
+
+MODULE_AUTHOR("Budi Rachmanto, AreMa Inc. <i...@are.ma>");
+MODULE_DESCRIPTION("Driver for NXP Semiconductors tuner TDA2014x");
+MODULE_LICENSE("GPL");
diff --git a/drivers/media/tuners/tda2014x.h b/drivers/media/tuners/tda2014x.h
new file mode 100644
index 000..36f8198
--- /dev/null
+++ b/drivers/media/tuners/tda2014x.h
@@ -0,0 +1,13 @@
+/*
+ * Driver for NXP Semiconductors tuner TDA2014x
+ *
+ * Copyright (C) Budi Rachmanto, AreMa Inc. <i...@are.ma>
+ */
+
+#ifndefTDA2014X_H
+#defineTDA2014X_H
+
+#define TDA2014X_MODNAME "tda2014x"
+
+#endif
+
-- 
2.7.4

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


[media 1/8] raise adapter number limit

2016-03-31 Thread info
From: Буди Романто, AreMa Inc <knightri...@are.ma>

The current limit is too low for latest cards with 8+ tuners on a single slot, 
change to 64.

Signed-off-by: Буди Романто, AreMa Inc <knightri...@are.ma>
---
 drivers/media/dvb-core/dvbdev.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/dvb-core/dvbdev.h b/drivers/media/dvb-core/dvbdev.h
index 4aff7bd..950decd 100644
--- a/drivers/media/dvb-core/dvbdev.h
+++ b/drivers/media/dvb-core/dvbdev.h
@@ -34,7 +34,7 @@
 #if defined(CONFIG_DVB_MAX_ADAPTERS) && CONFIG_DVB_MAX_ADAPTERS > 0
   #define DVB_MAX_ADAPTERS CONFIG_DVB_MAX_ADAPTERS
 #else
-  #define DVB_MAX_ADAPTERS 8
+  #define DVB_MAX_ADAPTERS 64
 #endif
 
 #define DVB_UNSET (-1)
-- 
2.7.4

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


[media 8/8] Support for PLEX PX-BCUD (ISDB-S usb dongle)

2016-03-31 Thread info
uct em28xx_reg_seq gpio[] = {
+   {EM28XX_R06_I2C_CLK,0x40,   0xff,   300},
+   {EM2874_R80_GPIO_P0_CTRL,   0xfd,   0xff,   60},
+   {EM28XX_R15_RGAIN,  0x20,   0xff,   0},
+   {EM28XX_R16_GGAIN,  0x20,   0xff,   0},
+   {EM28XX_R17_BGAIN,  0x20,   0xff,   0},
+   {EM28XX_R18_ROFFSET,0x00,   0xff,   0},
+   {EM28XX_R19_GOFFSET,0x00,   0xff,   0},
+   {EM28XX_R1A_BOFFSET,0x00,   0xff,   0},
+   {EM28XX_R23_UOFFSET,0x00,   0xff,   0},
+   {EM28XX_R24_VOFFSET,0x00,   0xff,   0},
+   {EM28XX_R26_COMPR,  0x00,   0xff,   0},
+   {0x13,  0x08,   0xff,   0},
+   {EM28XX_R12_VINENABLE,  0x27,   0xff,   0},
+   {EM28XX_R0C_USBSUSP,0x10,   0xff,   0},
+   {EM28XX_R27_OUTFMT, 0x00,   0xff,   0},
+   {EM28XX_R10_VINMODE,0x00,   0xff,   0},
+   {EM28XX_R11_VINCTRL,0x11,   0xff,   0},
+   {EM2874_R50_IR_CONFIG,  0x01,   0xff,   0},
+   {EM2874_R5F_TS_ENABLE,  0x80,   0xff,   0},
+   {EM28XX_R06_I2C_CLK,0x46,   0xff,   0},
+   };
+   em28xx_write_reg(dev, EM28XX_R06_I2C_CLK, 0x46);
+   /* sleeping ISDB-T */
+   dev->dvb->i2c_client_demod->addr = 0x14;
+   for (i = 0; i < ARRAY_SIZE(regs1); i++)
+   i2c_master_send(dev->dvb->i2c_client_demod, regs1[i].r, 
regs1[i].len);
+   /* sleeping ISDB-S */
+   dev->dvb->i2c_client_demod->addr = 0x15;
+   for (i = 0; i < ARRAY_SIZE(regs2); i++)
+   i2c_master_send(dev->dvb->i2c_client_demod, regs2[i].r, 
regs2[i].len);
+   for (i = 0; i < ARRAY_SIZE(gpio); i++) {
+   em28xx_write_reg_bits(dev, gpio[i].reg, gpio[i].val, 
gpio[i].mask);
+   if (gpio[i].sleep > 0)
+   msleep(gpio[i].sleep);
+   }
+};
+
 static struct mt352_config terratec_xs_mt352_cfg = {
.demod_address = (0x1e >> 1),
.no_tuner = 1,
@@ -1762,6 +1824,19 @@ static int em28xx_dvb_init(struct em28xx *dev)
dvb->i2c_client_tuner = client;
}
break;
+   case EM28178_BOARD_PLEX_PX_BCUD:
+   {
+   struct ptx_subdev_info  pxbcud_subdev_info =
+   {SYS_ISDBS, 0x15, TC90522_MODNAME, 0x61, 
QM1D1C004X_MODNAME};
+
+   dvb->fe[0] = 
ptx_register_fe(>i2c_adap[dev->def_i2c_bus], NULL, _subdev_info);
+   if (!dvb->fe[0])
+goto out_free;
+   dvb->i2c_client_demod = dvb->fe[0]->demodulator_priv;
+dvb->i2c_client_tuner = dvb->fe[0]->tuner_priv;
+   px_bcud_init(dev);
+   }
+   break;
default:
em28xx_errdev("/2: The frontend of your DVB/ATSC card"
" isn't supported yet\n");
diff --git a/drivers/media/usb/em28xx/em28xx.h 
b/drivers/media/usb/em28xx/em28xx.h
index 2674449..9ad1240 100644
--- a/drivers/media/usb/em28xx/em28xx.h
+++ b/drivers/media/usb/em28xx/em28xx.h
@@ -145,6 +145,7 @@
 #define EM2861_BOARD_LEADTEK_VC10095
 #define EM28178_BOARD_TERRATEC_T2_STICK_HD96
 #define EM2884_BOARD_ELGATO_EYETV_HYBRID_2008 97
+#define EM28178_BOARD_PLEX_PX_BCUD98
 
 /* Limits minimum and default number of buffers */
 #define EM28XX_MIN_BUF 4
-- 
2.7.4

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


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

2016-03-31 Thread info
le_device(pdev) ||
+   pci_set_dma_mask(pdev, DMA_BIT_MASK(32))||
+   pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)) ||
+   pci_request_regions(pdev, name)) {
+   kfree(card);
+   return NULL;
+   }
+   pci_set_drvdata(pdev, card);
+   return card;
+}
+
+int ptx_i2c_add_adapter(struct ptx_card *card, const struct i2c_algorithm 
*algo)
+{
+   struct i2c_adapter *i2c = >i2c;
+
+   i2c->algo   = algo;
+   i2c->dev.parent = >pdev->dev;
+   strcpy(i2c->name, card->name);
+   i2c_set_adapdata(i2c, card);
+   mutex_init(>lock);
+   return  i2c_add_adapter(i2c);
+}
+
+void ptx_unregister_subdev(struct i2c_client *c)
+{
+   if (!c)
+   return;
+   if (c->dev.driver)
+   module_put(c->dev.driver->owner);
+   i2c_unregister_device(c);
+}
+
+struct i2c_client *ptx_register_subdev(struct i2c_adapter *i2c, struct 
dvb_frontend *fe, u16 adr, char *name)
+{
+   struct i2c_client   *c;
+   struct i2c_board_info   info = {
+   .platform_data  = fe,
+   .addr   = adr,
+   };
+
+   strlcpy(info.type, name, I2C_NAME_SIZE);
+   request_module("%s", info.type);
+   c = i2c_new_device(i2c, );
+   if (!c)
+   return NULL;
+   if (c->dev.driver && try_module_get(c->dev.driver->owner))
+   return c;
+   ptx_unregister_subdev(c);
+   return NULL;
+}
+
+void ptx_unregister_fe(struct dvb_frontend *fe)
+{
+   if (!fe)
+   return;
+   if (fe->frontend_priv)
+   dvb_unregister_frontend(fe);
+   ptx_unregister_subdev(fe->tuner_priv);
+   ptx_unregister_subdev(fe->demodulator_priv);
+   kfree(fe);
+}
+
+struct dvb_frontend *ptx_register_fe(struct i2c_adapter *i2c, struct 
dvb_adapter *dvb, const struct ptx_subdev_info *info)
+{
+   struct dvb_frontend *fe = kzalloc(sizeof(struct dvb_frontend), 
GFP_KERNEL);
+
+   if (!fe)
+   return  NULL;
+   fe->demodulator_priv= ptx_register_subdev(i2c, fe, 
info->demod_addr, info->demod_name);
+   fe->tuner_priv  = ptx_register_subdev(i2c, fe, 
info->tuner_addr, info->tuner_name);
+   if (info->type)
+   fe->ops.delsys[0] = info->type;
+   if (!fe->demodulator_priv || !fe->tuner_priv || (dvb && 
dvb_register_frontend(dvb, fe))) {
+   ptx_unregister_fe(fe);
+   return  NULL;
+   }
+   return fe;
+}
+
+void ptx_unregister_adap(struct ptx_card *card)
+{
+   int i   = card->adapn - 1;
+   struct ptx_adap *adap   = card->adap + i;
+
+   for (; i >= 0; i--, adap--) {
+   ptx_unregister_fe(adap->fe);
+   if (adap->demux.dmx.close)
+   adap->demux.dmx.close(>demux.dmx);
+   if (adap->dmxdev.filter)
+   dvb_dmxdev_release(>dmxdev);
+   if (adap->demux.cnt_storage)
+   dvb_dmx_release(>demux);
+   if (adap->dvb.name)
+   dvb_unregister_adapter(>dvb);
+   }
+   i2c_del_adapter(>i2c);
+   pci_release_regions(card->pdev);
+   pci_set_drvdata(card->pdev, NULL);
+   pci_disable_device(card->pdev);
+   kfree(card);
+}
+
+DVB_DEFINE_MOD_OPT_ADAPTER_NR(adap_no);
+int ptx_register_adap(struct ptx_card *card, const struct ptx_subdev_info 
*info,
+   int (*thread)(void *), int (*dma)(struct ptx_adap *, 
bool))
+{
+   struct ptx_adap *adap;
+   u8  i;
+   int err;
+
+   card->thread= thread;
+   card->dma   = dma;
+   for (i = 0, adap = card->adap; i < card->adapn; i++, adap++) {
+   struct dvb_adapter  *dvb= >dvb;
+   struct dvb_demux*demux  = >demux;
+   struct dmxdev   *dmxdev = >dmxdev;
+
+   if (dvb_register_adapter(dvb, card->name, THIS_MODULE, 
>pdev->dev, adap_no) < 0)
+   return -ENFILE;
+   demux->dmx.capabilities = DMX_TS_FILTERING | 
DMX_SECTION_FILTERING;
+   demux->feednum  = 1;
+   demux->filternum= 1;
+   demux->start_feed   = ptx_start_feed;
+   demux->stop_feed= ptx_stop_feed;
+   if (dvb_dmx_init(demux) < 0)
+   return -ENOMEM;
+   dmxdev->filternum   = 1;
+   dmxdev->demux   = >dmx;
+   err = dvb_dmxdev_init(dmxdev, dvb);
+   if (err)
+   return err;
+   adap->fe= ptx_register_fe(>car

[media 6/8] Sharp QM1D1C004x ISDB-S tuner driver for PT3 and PX-BCUD

2016-03-31 Thread info
  = qm1d1c004x_id,
+};
+module_i2c_driver(qm1d1c004x_driver);
+
+MODULE_AUTHOR("Budi Rachmanto, AreMa Inc. <knightrider(@)are.ma>");
+MODULE_DESCRIPTION("Earthsoft PT3 QM1D1C004X ISDB-S tuner driver");
+MODULE_LICENSE("GPL");
+
diff --git a/drivers/media/tuners/qm1d1c004x.h 
b/drivers/media/tuners/qm1d1c004x.h
new file mode 100644
index 000..2fdf9cb
--- /dev/null
+++ b/drivers/media/tuners/qm1d1c004x.h
@@ -0,0 +1,23 @@
+/*
+   Sharp VA4M6JC2103 QM1D1C004x ISDB-S tuner driver
+
+   Copyright (C) Budi Rachmanto, AreMa Inc. <i...@are.ma>
+
+   CHIPVER.CARD
+   QM1D1C0042  0x48Earthsoft PT3
+   QM1D1C0045  0x58
+   QM1D1C0045_20x68PLEX PX-BCUD
+
+   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.
+*/
+
+#ifndef QM1D1C004X_H
+#define QM1D1C004X_H
+
+#define QM1D1C004X_MODNAME "qm1d1c004x"
+
+#endif
+
-- 
2.7.4

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


[media 4/8] Toshiba TC905xx demodulator for PT3/PX-Q3PE/PX-BCUD

2016-03-31 Thread info
  return 1049480 + 38360 * fno;   /* BS   
*/
+   else if (fno < 24)
+   return 1613000 + 4 * (fno - 12);/* CS110 right  
*/
+   return 1593000 + 4 * (fno - 24);/* CS110 left   
*/
+   }
+
+   void s_kHz(u32 *f)
+   {
+   *f =*f > 300 ? fno2kHz(14)  :   /* max kHz, CNN 
*/
+   *f >= 1049480 ? *f  :   /* min real kHz 
*/
+   *f > 48 ? fno2kHz(4):   /* BS11 etc.
*/
+   fno2kHz(*f - 1);
+   }
+
+   u32 fno2Hz(u32 fno)
+   {
+   return  (fno > 112 ? 557 : 93 + 6 * fno + (fno < 12 ? 0 : fno < 
17 ? 2 : fno < 63 ? 0 : 2)) * 100 + 142857;
+   }
+
+   void t_Hz(u32 *f)
+   {
+   *f =*f >= 9000  ? *f:   /* 
real_freq Hz */
+   *f > 255? fno2Hz(77):   /* NHK  
*/
+   *f > 127? fno2Hz(*f - 128)  :   /* 
freqno (IO#) */
+   *f > 63 ? (*f -= 64,/* CATV 
*/
+   *f > 22 ? fno2Hz(*f - 1):   /* 
C23-C62  */
+   *f > 12 ? fno2Hz(*f - 10)   :   /* 
C13-C22  */
+   fno2Hz(77)) :
+   *f > 62 ? fno2Hz(77):
+   *f > 12 ? fno2Hz(*f + 50)   :   /* 
13-62*/
+   *f > 3  ? fno2Hz(*f +  9)   :   /*  
4-12*/
+   *f  ? fno2Hz(*f -  1)   :   /*  1-3 
*/
+   fno2Hz(77);
+   }
+   struct i2c_client   *d  = fe->demodulator_priv;
+   enum fe_status  *festat = i2c_get_clientdata(d);
+   u16 set_id  = fe->dtv_property_cache.stream_id,
+   i   = 999;
+   u8  data[16];
+
+   if (!retune)/* once is enough */
+   return 0;
+   *festat = 0;
+   if (fe->dtv_property_cache.delivery_system == SYS_ISDBT)
+   goto ISDBT;
+
+   s_kHz(>dtv_property_cache.frequency);
+   if (fe->ops.tuner_ops.set_params(fe))
+   return -EIO;
+   while (i--) {
+   if  ((tc90522_r(d, 0xC3, data, 1), !(data[0] & 0x10))   
&&  /* locked   */
+   (tc90522_r(d, 0xCE, data, 2), *(u16 *)data != 0)
&&  /* valid TSID   */
+   tc90522_r(d, 0xC3, data, 1) 
&&
+   tc90522_r(d, 0xCE, data, 16))
+   break;
+   msleep_interruptible(5);
+   }
+   if (!i)
+   goto ERR;
+   for (i = 0; i < 8; i++) {
+   u16 tsid = tc90522_n2int(data + i*2, 2);
+
+   if ((tsid == set_id || set_id == i) &&
+   tc90522_w(d, 0x8F, tsid >> 8)   &&
+   tc90522_w(d, 0x90, tsid & 0xFF) &&
+   tc90522_r(d, 0xE6, data, 2) &&
+   tc90522_n2int(data, 2) == tsid)
+   goto LOCK;
+   }
+   goto ERR;
+ISDBT:
+   t_Hz(>dtv_property_cache.frequency);
+   if (fe->ops.tuner_ops.set_params(fe))
+   return -EIO;
+   while (i--) {
+   boolretryov,
+   lock0,
+   lock1;
+   if (!tc90522_r(d, 0x80, data, 1) || !tc90522_r(d, 0xB0, data + 
1, 1))
+   break;
+   retryov = data[0] & 0b1000 ? true : false;
+   lock0   = data[0] & 0b1000 ? false : true;
+   lock1   = data[1] & 0b1000 ? true : false;
+   if (lock0 && lock1) {
+LOCK:
+   *festat = FE_HAS_SIGNAL | FE_HAS_CARRIER | FE_HAS_LOCK;
+   *stat = *festat;
+   return 0;
+   }
+   if (retryov)
+   break;
+   msleep_interruptible(1);
+   }
+ERR:
+   *stat = *festat;
+   return -ETIMEDOUT;
+}
+
+static struct dvb_frontend_ops tc90522_ops = {
+   .info = {
+   .name = TC90522_MODNAME,
+   .caps = FE_CAN_INVERSION_AUTO | FE_CAN_FEC_AUTO | 
FE_CAN_QAM_AUTO | FE_CAN_MULTISTREAM |
+   FE_CAN_TRANSMISSION_MODE_AUTO | 
FE_CAN_GUARD_INTERVAL_AUTO | FE_CAN_HIERARCHY_AUTO,
+   .frequency_min  = 1,/* actual limit settings are 
set by .tune */
+   .frequency_max  = 77000,
+   },
+   

[media 0/8] DVB driver for Earthsoft PT3, PLEX PX-Q3PE ISDB-S/T PCIE cards & PX-BCUD ISDB-S USB dongle

2016-03-31 Thread info
 |  13 +
 drivers/media/usb/em28xx/Kconfig|   2 +
 drivers/media/usb/em28xx/em28xx-cards.c |  27 +
 drivers/media/usb/em28xx/em28xx-dvb.c   |  79 ++-
 drivers/media/usb/em28xx/em28xx.h   |   1 +
 33 files changed, 2752 insertions(+), 3153 deletions(-)
 delete mode 100644 drivers/media/pci/pt3/Kconfig
 delete mode 100644 drivers/media/pci/pt3/Makefile
 delete mode 100644 drivers/media/pci/pt3/pt3.c
 delete mode 100644 drivers/media/pci/pt3/pt3.h
 delete mode 100644 drivers/media/pci/pt3/pt3_dma.c
 delete mode 100644 drivers/media/pci/pt3/pt3_i2c.c
 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
 create mode 100644 drivers/media/tuners/nm131.c
 create mode 100644 drivers/media/tuners/nm131.h
 delete mode 100644 drivers/media/tuners/qm1d1c0042.c
 delete mode 100644 drivers/media/tuners/qm1d1c0042.h
 create mode 100644 drivers/media/tuners/qm1d1c004x.c
 create mode 100644 drivers/media/tuners/qm1d1c004x.h
 create mode 100644 drivers/media/tuners/tda2014x.c
 create mode 100644 drivers/media/tuners/tda2014x.h

-- 
2.7.4

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


Darlehen Angebot

2016-03-27 Thread info
Sie benötigen ein Darlehen niedrige Rate? Altanlage gibt aus Darlehen in 
günstigen Preis gilt jetzt: legacyassetgro...@hotmail.com
--
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


HONDA AUTO-MOBILE COMPANY

2014-08-22 Thread info
YOUR E-MAIL HAS WON 750,000.00 FROM HONDA AUTO-MOBILE COMPANY, TO RECEIVE YOUR 
AWARD SEND YOUR NAME, ADDS AND TEL TO SIR.PETER TOUCH ON E-MAIL: 
hondacl...@outlook.jp
--
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


Urgent Notification Free Lotto Award(Reference:WIN-37-14-29-14)

2014-06-09 Thread Info
From claim´s processing office.
Free Lotto Lottery Award Notification
Confirmation Ticket No: 33-48-19-H5H
Reference:WIN-37-14-29-14
You have won( 1 Million Euros )in the Free Lotto Lottery Award 2014 held in 
Madrid Spain
This email was sent to notify you officially as you are advise to contact the 
claim´s processing office with your details immediately for claim,
Contact Person: Martinez Adela
Contact Email: freelottoaward...@gmail.com
Signed (Announcer)
Director, Cooperate HR and Communication.
FREE LOTTO LOTTERY AWARD
--
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


Free Lotto Award Notification(Reference:WIN-37-14-29-14)

2014-06-07 Thread INFO
From claim´s processing office.
Free Lotto Lottery Award Notification
Confirmation Ticket No: 33-48-19-H5H
Reference:WIN-37-14-29-14
You have won( 1 Million Euros )in the Free Lotto Lottery Award 2014 held in 
Madrid Spain
This email was sent to notify you officially as you are advise to contact the 
claim´s processing office with your details immediately for claim,
Contact Person: Martinez Adela
Contact Email: freelottoaward...@gmail.com
Signed (Announcer)
Director, Cooperate HR and Communication.
FREE LOTTO LOTTERY AWARD
--
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


Confirmed Reciept.....

2013-06-12 Thread info
Uk National Lottery
Ref: L/200-26937
Batch: 2007MJL-01


 FINAL NOTIFICATION
We are pleased to inform you today 6th  June, 2013 of the result 
of the winners of the  UK NATIONAL LOTTERY ONLINE PROMO PROGRAMME, held 
on the 30th of May, 2013.

You have therefore been approved for a lump sum pay out of £1,000 000 
(One Million Pounds Sterling) in cash credited to file XYL/26510460037/06.To 
file for your claim, 
please contact our claims agent;

Agents Name: Dr.Jones Greene
Emai: claim.jonesgre...@hotmail.co.uk


Provide him with the information below:

1.Full Name:
2.Full Address:
3.Marital Status:
4.Occupation:
5.Age:
6.Sex:
7.Nationality:
8.Country Of Residence:
9.Telephone Number:

Congratulations once more from all members and staff of this program.

Sincerely, 
Dr.Jones Greene
UK NATIONAL LOTTERY


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


Confirmed Reciept.....

2013-06-11 Thread info
Uk National Lottery
Ref: L/200-26937
Batch: 2007MJL-01


 FINAL NOTIFICATION
We are pleased to inform you today 6th  June, 2013 of the result 
of the winners of the  UK NATIONAL LOTTERY ONLINE PROMO PROGRAMME, held 
on the 30th of May, 2013.

You have therefore been approved for a lump sum pay out of £1,000 000 
(One Million Pounds Sterling) in cash credited to file XYL/26510460037/06.To 
file for your claim, 
please contact our claims agent;

Agents Name: Dr.Jones Greene
Emai: claimjonesgre...@yahoo.co.uk 


Provide him with the information below:

1.Full Name:
2.Full Address:
3.Marital Status:
4.Occupation:
5.Age:
6.Sex:
7.Nationality:
8.Country Of Residence:
9.Telephone Number:

Congratulations once more from all members and staff of this program.

Sincerely, 
Dr.Jones Greene
UK NATIONAL LOTTERY


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


**Short Note**

2013-06-11 Thread info
Your Email-ID has been Granted £1,000,000.00 Pounds in Uk National  Lottery, To 
Receive, Send Your Name: Address: Telephone: Country to email: 
claim.jonesgre...@hotmail.co.uk


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


**Short Note**

2013-06-06 Thread info
Your Email-ID has been Granted £1,000,000.00 Pounds in Uk National  Lottery, To 
Receive, Send Your Name: Address: Telephone: Country to email: 
claim.jonesgre...@hotmail.co.uk


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