mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 10:49:33 +00:00
[media] dvb: Add support for pctv452e
Signed-off-by: Igor M. Liplianin <liplianin@me.by> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
600836cc7b
commit
4e2c53fde6
10 changed files with 1359 additions and 0 deletions
|
@ -258,6 +258,19 @@ config DVB_USB_AF9005_REMOTE
|
|||
Say Y here to support the default remote control decoding for the
|
||||
Afatech AF9005 based receiver.
|
||||
|
||||
config DVB_USB_PCTV452E
|
||||
tristate "Pinnacle PCTV HDTV Pro USB device/TT Connect S2-3600"
|
||||
depends on DVB_USB
|
||||
select TTPCI_EEPROM
|
||||
select DVB_LNBP22 if !DVB_FE_CUSTOMISE
|
||||
select DVB_STB0899 if !DVB_FE_CUSTOMISE
|
||||
select DVB_STB6100 if !DVB_FE_CUSTOMISE
|
||||
help
|
||||
Support for external USB adapter designed by Pinnacle,
|
||||
shipped under the brand name 'PCTV HDTV Pro USB'.
|
||||
Also supports TT Connect S2-3600/3650 cards.
|
||||
Say Y if you own such a device and want to use it.
|
||||
|
||||
config DVB_USB_DW2102
|
||||
tristate "DvbWorld & TeVii DVB-S/S2 USB2.0 support"
|
||||
depends on DVB_USB
|
||||
|
|
|
@ -64,6 +64,9 @@ obj-$(CONFIG_DVB_USB_AF9005_REMOTE) += dvb-usb-af9005-remote.o
|
|||
dvb-usb-anysee-objs = anysee.o
|
||||
obj-$(CONFIG_DVB_USB_ANYSEE) += dvb-usb-anysee.o
|
||||
|
||||
dvb-usb-pctv452e-objs = pctv452e.o
|
||||
obj-$(CONFIG_DVB_USB_PCTV452E) += dvb-usb-pctv452e.o
|
||||
|
||||
dvb-usb-dw2102-objs = dw2102.o
|
||||
obj-$(CONFIG_DVB_USB_DW2102) += dvb-usb-dw2102.o
|
||||
|
||||
|
@ -104,4 +107,5 @@ obj-$(CONFIG_DVB_USB_MXL111SF) += mxl111sf-tuner.o
|
|||
ccflags-y += -Idrivers/media/dvb/dvb-core/ -Idrivers/media/dvb/frontends/
|
||||
# due to tuner-xc3028
|
||||
ccflags-y += -Idrivers/media/common/tuners
|
||||
EXTRA_CFLAGS += -Idrivers/media/dvb/ttpci
|
||||
|
||||
|
|
|
@ -241,6 +241,9 @@
|
|||
#define USB_PID_PCTV_200E 0x020e
|
||||
#define USB_PID_PCTV_400E 0x020f
|
||||
#define USB_PID_PCTV_450E 0x0222
|
||||
#define USB_PID_PCTV_452E 0x021f
|
||||
#define USB_PID_TECHNOTREND_CONNECT_S2_3600 0x3007
|
||||
#define USB_PID_TECHNOTREND_CONNECT_S2_3650_CI 0x300a
|
||||
#define USB_PID_NEBULA_DIGITV 0x0201
|
||||
#define USB_PID_DVICO_BLUEBIRD_LGDT 0xd820
|
||||
#define USB_PID_DVICO_BLUEBIRD_LG064F_COLD 0xd500
|
||||
|
|
1093
drivers/media/dvb/dvb-usb/pctv452e.c
Normal file
1093
drivers/media/dvb/dvb-usb/pctv452e.c
Normal file
File diff suppressed because it is too large
Load diff
|
@ -607,6 +607,16 @@ config DVB_LNBP21
|
|||
help
|
||||
An SEC control chips.
|
||||
|
||||
config DVB_LNBP22
|
||||
tristate "LNBP22 SEC controllers"
|
||||
depends on DVB_CORE && I2C
|
||||
default m if DVB_FE_CUSTOMISE
|
||||
help
|
||||
LNB power supply and control voltage
|
||||
regulator chip with step-up converter
|
||||
and I2C interface.
|
||||
Say Y when you want to support this chip.
|
||||
|
||||
config DVB_ISL6405
|
||||
tristate "ISL6405 SEC controller"
|
||||
depends on DVB_CORE && I2C
|
||||
|
|
|
@ -52,6 +52,7 @@ obj-$(CONFIG_DVB_LGDT330X) += lgdt330x.o
|
|||
obj-$(CONFIG_DVB_LGDT3305) += lgdt3305.o
|
||||
obj-$(CONFIG_DVB_CX24123) += cx24123.o
|
||||
obj-$(CONFIG_DVB_LNBP21) += lnbp21.o
|
||||
obj-$(CONFIG_DVB_LNBP22) += lnbp22.o
|
||||
obj-$(CONFIG_DVB_ISL6405) += isl6405.o
|
||||
obj-$(CONFIG_DVB_ISL6421) += isl6421.o
|
||||
obj-$(CONFIG_DVB_TDA10086) += tda10086.o
|
||||
|
|
148
drivers/media/dvb/frontends/lnbp22.c
Normal file
148
drivers/media/dvb/frontends/lnbp22.c
Normal file
|
@ -0,0 +1,148 @@
|
|||
/*
|
||||
* lnbp22.h - driver for lnb supply and control ic lnbp22
|
||||
*
|
||||
* Copyright (C) 2006 Dominik Kuhlen
|
||||
* Based on lnbp21 driver
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
* Or, point your browser to http://www.gnu.org/copyleft/gpl.html
|
||||
*
|
||||
*
|
||||
* the project's page is at http://www.linuxtv.org
|
||||
*/
|
||||
#include <linux/delay.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/moduleparam.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/slab.h>
|
||||
|
||||
#include "dvb_frontend.h"
|
||||
#include "lnbp22.h"
|
||||
|
||||
static int debug;
|
||||
module_param(debug, int, 0644);
|
||||
MODULE_PARM_DESC(debug, "Turn on/off debugging (default:off).");
|
||||
|
||||
|
||||
#define dprintk(lvl, arg...) if (debug >= (lvl)) printk(arg)
|
||||
|
||||
struct lnbp22 {
|
||||
u8 config[4];
|
||||
struct i2c_adapter *i2c;
|
||||
};
|
||||
|
||||
static int lnbp22_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage)
|
||||
{
|
||||
struct lnbp22 *lnbp22 = (struct lnbp22 *)fe->sec_priv;
|
||||
struct i2c_msg msg = {
|
||||
.addr = 0x08,
|
||||
.flags = 0,
|
||||
.buf = (char *)&lnbp22->config,
|
||||
.len = sizeof(lnbp22->config),
|
||||
};
|
||||
|
||||
dprintk(1, "%s: %d (18V=%d 13V=%d)\n", __func__, voltage,
|
||||
SEC_VOLTAGE_18, SEC_VOLTAGE_13);
|
||||
|
||||
lnbp22->config[3] = 0x60; /* Power down */
|
||||
switch (voltage) {
|
||||
case SEC_VOLTAGE_OFF:
|
||||
break;
|
||||
case SEC_VOLTAGE_13:
|
||||
lnbp22->config[3] |= LNBP22_EN;
|
||||
break;
|
||||
case SEC_VOLTAGE_18:
|
||||
lnbp22->config[3] |= (LNBP22_EN | LNBP22_VSEL);
|
||||
break;
|
||||
default:
|
||||
return -EINVAL;
|
||||
};
|
||||
|
||||
dprintk(1, "%s: 0x%02x)\n", __func__, lnbp22->config[3]);
|
||||
return (i2c_transfer(lnbp22->i2c, &msg, 1) == 1) ? 0 : -EIO;
|
||||
}
|
||||
|
||||
static int lnbp22_enable_high_lnb_voltage(struct dvb_frontend *fe, long arg)
|
||||
{
|
||||
struct lnbp22 *lnbp22 = (struct lnbp22 *) fe->sec_priv;
|
||||
struct i2c_msg msg = {
|
||||
.addr = 0x08,
|
||||
.flags = 0,
|
||||
.buf = (char *)&lnbp22->config,
|
||||
.len = sizeof(lnbp22->config),
|
||||
};
|
||||
|
||||
dprintk(1, "%s: %d\n", __func__, (int)arg);
|
||||
if (arg)
|
||||
lnbp22->config[3] |= LNBP22_LLC;
|
||||
else
|
||||
lnbp22->config[3] &= ~LNBP22_LLC;
|
||||
|
||||
return (i2c_transfer(lnbp22->i2c, &msg, 1) == 1) ? 0 : -EIO;
|
||||
}
|
||||
|
||||
static void lnbp22_release(struct dvb_frontend *fe)
|
||||
{
|
||||
dprintk(1, "%s\n", __func__);
|
||||
/* LNBP power off */
|
||||
lnbp22_set_voltage(fe, SEC_VOLTAGE_OFF);
|
||||
|
||||
/* free data */
|
||||
kfree(fe->sec_priv);
|
||||
fe->sec_priv = NULL;
|
||||
}
|
||||
|
||||
struct dvb_frontend *lnbp22_attach(struct dvb_frontend *fe,
|
||||
struct i2c_adapter *i2c)
|
||||
{
|
||||
struct lnbp22 *lnbp22 = kmalloc(sizeof(struct lnbp22), GFP_KERNEL);
|
||||
if (!lnbp22)
|
||||
return NULL;
|
||||
|
||||
/* default configuration */
|
||||
lnbp22->config[0] = 0x00; /* ? */
|
||||
lnbp22->config[1] = 0x28; /* ? */
|
||||
lnbp22->config[2] = 0x48; /* ? */
|
||||
lnbp22->config[3] = 0x60; /* Power down */
|
||||
lnbp22->i2c = i2c;
|
||||
fe->sec_priv = lnbp22;
|
||||
|
||||
/* detect if it is present or not */
|
||||
if (lnbp22_set_voltage(fe, SEC_VOLTAGE_OFF)) {
|
||||
dprintk(0, "%s LNBP22 not found\n", __func__);
|
||||
kfree(lnbp22);
|
||||
fe->sec_priv = NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* install release callback */
|
||||
fe->ops.release_sec = lnbp22_release;
|
||||
|
||||
/* override frontend ops */
|
||||
fe->ops.set_voltage = lnbp22_set_voltage;
|
||||
fe->ops.enable_high_lnb_voltage = lnbp22_enable_high_lnb_voltage;
|
||||
|
||||
return fe;
|
||||
}
|
||||
EXPORT_SYMBOL(lnbp22_attach);
|
||||
|
||||
MODULE_DESCRIPTION("Driver for lnb supply and control ic lnbp22");
|
||||
MODULE_AUTHOR("Dominik Kuhlen");
|
||||
MODULE_LICENSE("GPL");
|
57
drivers/media/dvb/frontends/lnbp22.h
Normal file
57
drivers/media/dvb/frontends/lnbp22.h
Normal file
|
@ -0,0 +1,57 @@
|
|||
/*
|
||||
* lnbp22.h - driver for lnb supply and control ic lnbp22
|
||||
*
|
||||
* Copyright (C) 2006 Dominik Kuhlen
|
||||
* Based on lnbp21.h
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation; either version 2
|
||||
* of the License, or (at your option) any later version.
|
||||
*
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
* Or, point your browser to http://www.gnu.org/copyleft/gpl.html
|
||||
*
|
||||
*
|
||||
* the project's page is at http://www.linuxtv.org
|
||||
*/
|
||||
|
||||
#ifndef _LNBP22_H
|
||||
#define _LNBP22_H
|
||||
|
||||
/* Enable */
|
||||
#define LNBP22_EN 0x10
|
||||
/* Voltage selection */
|
||||
#define LNBP22_VSEL 0x02
|
||||
/* Plus 1 Volt Bit */
|
||||
#define LNBP22_LLC 0x01
|
||||
|
||||
#include <linux/dvb/frontend.h>
|
||||
|
||||
#if defined(CONFIG_DVB_LNBP22) || \
|
||||
(defined(CONFIG_DVB_LNBP22_MODULE) && defined(MODULE))
|
||||
/*
|
||||
* override_set and override_clear control which system register bits (above)
|
||||
* to always set & clear
|
||||
*/
|
||||
extern struct dvb_frontend *lnbp22_attach(struct dvb_frontend *fe,
|
||||
struct i2c_adapter *i2c);
|
||||
#else
|
||||
static inline struct dvb_frontend *lnbp22_attach(struct dvb_frontend *fe,
|
||||
struct i2c_adapter *i2c)
|
||||
{
|
||||
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
|
||||
return NULL;
|
||||
}
|
||||
#endif /* CONFIG_DVB_LNBP22 */
|
||||
|
||||
#endif /* _LNBP22_H */
|
|
@ -85,6 +85,35 @@ static int getmac_tt(u8 * decodedMAC, u8 * encodedMAC)
|
|||
return 0;
|
||||
}
|
||||
|
||||
int ttpci_eeprom_decode_mac(u8 *decodedMAC, u8 *encodedMAC)
|
||||
{
|
||||
u8 xor[20] = { 0x72, 0x23, 0x68, 0x19, 0x5c, 0xa8, 0x71, 0x2c,
|
||||
0x54, 0xd3, 0x7b, 0xf1, 0x9E, 0x23, 0x16, 0xf6,
|
||||
0x1d, 0x36, 0x64, 0x78};
|
||||
u8 data[20];
|
||||
int i;
|
||||
|
||||
memcpy(data, encodedMAC, 20);
|
||||
|
||||
for (i = 0; i < 20; i++)
|
||||
data[i] ^= xor[i];
|
||||
for (i = 0; i < 10; i++)
|
||||
data[i] = ((data[2 * i + 1] << 8) | data[2 * i])
|
||||
>> ((data[2 * i + 1] >> 6) & 3);
|
||||
|
||||
if (check_mac_tt(data))
|
||||
return -ENODEV;
|
||||
|
||||
decodedMAC[0] = data[2];
|
||||
decodedMAC[1] = data[1];
|
||||
decodedMAC[2] = data[0];
|
||||
decodedMAC[3] = data[6];
|
||||
decodedMAC[4] = data[5];
|
||||
decodedMAC[5] = data[4];
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(ttpci_eeprom_decode_mac);
|
||||
|
||||
static int ttpci_eeprom_read_encodedMAC(struct i2c_adapter *adapter, u8 * encodedMAC)
|
||||
{
|
||||
int ret;
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include <linux/types.h>
|
||||
#include <linux/i2c.h>
|
||||
|
||||
extern int ttpci_eeprom_decode_mac(u8 *decodedMAC, u8 *encodedMAC);
|
||||
extern int ttpci_eeprom_parse_mac(struct i2c_adapter *adapter, u8 *propsed_mac);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Reference in a new issue