Commit c837c93a authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb

* git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb:
  V4L/DVB (7751): ir-kbd-i2c: Save a temporary memory allocation in ir_probe
  V4L/DVB (7750): au0828/ cleanups and fixes
  V4L/DVB (7748): tuner-core: some adjustments at tuner logs, if debug enabled
  V4L/DVB (7746): pvrusb2: make signed one-bit bitfields unsigned
  V4L/DVB (7744): pvrusb2-dvb: add atsc/qam support for Hauppauge pvrusb2 model 751xx
  V4L/DVB (7742): cx88: Add support for the DViCO FusionHDTV_7_GOLD digital modes
  V4L/DVB (7741): s5h1411: Adding support for this ATSC/QAM demodulator
  V4L/DVB (7740): tuner-xc2028.c dubious !x & y
  V4L/DVB (7739): mt312.h: dubious one-bit signed bitfield
  V4L/DVB (7735): Fix compilation for au0828
  V4L/DVB (7734): em28xx: copy and paste error in em28xx_init_isoc
  V4L/DVB (7733): blackbird_find_mailbox negative return ignored in blackbird_initialize_codec()
  V4L/DVB (7732): vivi: fix a warning
parents d485cb9a 37c45df7
......@@ -307,6 +307,14 @@ config DVB_AU8522
An ATSC 8VSB and QAM64/256 tuner module. Say Y when you want
to support this frontend.
config DVB_S5H1411
tristate "Samsung S5H1411 based"
depends on DVB_CORE && I2C
default m if DVB_FE_CUSTOMISE
help
An ATSC 8VSB and QAM64/256 tuner module. Say Y when you want
to support this frontend.
comment "Tuners/PLL support"
depends on DVB_CORE
......
......@@ -55,3 +55,4 @@ obj-$(CONFIG_DVB_TUNER_XC5000) += xc5000.o
obj-$(CONFIG_DVB_TUNER_ITD1000) += itd1000.o
obj-$(CONFIG_DVB_AU8522) += au8522.o
obj-$(CONFIG_DVB_TDA10048) += tda10048.o
obj-$(CONFIG_DVB_S5H1411) += s5h1411.o
......@@ -33,7 +33,7 @@ struct mt312_config {
u8 demod_address;
/* inverted voltage setting */
int voltage_inverted:1;
unsigned int voltage_inverted:1;
};
#if defined(CONFIG_DVB_MT312) || (defined(CONFIG_DVB_MT312_MODULE) && defined(MODULE))
......
This diff is collapsed.
/*
Samsung S5H1411 VSB/QAM demodulator driver
Copyright (C) 2008 Steven Toth <stoth@hauppauge.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; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef __S5H1411_H__
#define __S5H1411_H__
#include <linux/dvb/frontend.h>
#define S5H1411_I2C_TOP_ADDR (0x32 >> 1)
#define S5H1411_I2C_QAM_ADDR (0x34 >> 1)
struct s5h1411_config {
/* serial/parallel output */
#define S5H1411_PARALLEL_OUTPUT 0
#define S5H1411_SERIAL_OUTPUT 1
u8 output_mode;
/* GPIO Setting */
#define S5H1411_GPIO_OFF 0
#define S5H1411_GPIO_ON 1
u8 gpio;
/* MPEG signal timing */
#define S5H1411_MPEGTIMING_CONTINOUS_INVERTING_CLOCK 0
#define S5H1411_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK 1
#define S5H1411_MPEGTIMING_NONCONTINOUS_INVERTING_CLOCK 2
#define S5H1411_MPEGTIMING_NONCONTINOUS_NONINVERTING_CLOCK 3
u16 mpeg_timing;
/* IF Freq for QAM and VSB in KHz */
#define S5H1411_IF_2500 2500
#define S5H1411_IF_3500 3500
#define S5H1411_IF_4000 4000
#define S5H1411_IF_5380 5380
#define S5H1411_IF_44000 44000
#define S5H1411_VSB_IF_DEFAULT S5H1411_IF_44000
#define S5H1411_QAM_IF_DEFAULT S5H1411_IF_44000
u16 qam_if;
u16 vsb_if;
/* Spectral Inversion */
#define S5H1411_INVERSION_OFF 0
#define S5H1411_INVERSION_ON 1
u8 inversion;
/* Return lock status based on tuner lock, or demod lock */
#define S5H1411_TUNERLOCKING 0
#define S5H1411_DEMODLOCKING 1
u8 status_mode;
};
#if defined(CONFIG_DVB_S5H1411) || \
(defined(CONFIG_DVB_S5H1411_MODULE) && defined(MODULE))
extern struct dvb_frontend *s5h1411_attach(const struct s5h1411_config *config,
struct i2c_adapter *i2c);
#else
static inline struct dvb_frontend *s5h1411_attach(
const struct s5h1411_config *config,
struct i2c_adapter *i2c)
{
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
return NULL;
}
#endif /* CONFIG_DVB_S5H1411 */
#endif /* __S5H1411_H__ */
/*
* Local variables:
* c-basic-offset: 8
*/
config VIDEO_AU0828
tristate "Auvitek AU0828 support"
depends on VIDEO_DEV && I2C && INPUT
depends on VIDEO_DEV && I2C && INPUT && DVB_CORE
select I2C_ALGOBIT
select DVB_AU8522 if !DVB_FE_CUSTOMIZE
select DVB_TUNER_XC5000 if !DVB_FE_CUSTOMIZE
......
......@@ -36,7 +36,6 @@ struct au0828_board au0828_boards[] = {
.name = "DViCO FusionHDTV USB",
},
};
const unsigned int au0828_bcount = ARRAY_SIZE(au0828_boards);
/* Tuner callback function for au0828 boards. Currently only needed
* for HVR1500Q, which has an xc5000 tuner.
......
......@@ -32,18 +32,10 @@
* 4 = I2C related
* 8 = Bridge related
*/
unsigned int debug;
module_param(debug, int, 0644);
int au0828_debug;
module_param_named(debug, au0828_debug, int, 0644);
MODULE_PARM_DESC(debug, "enable debug messages");
unsigned int usb_debug;
module_param(usb_debug, int, 0644);
MODULE_PARM_DESC(usb_debug, "enable usb debug messages");
unsigned int bridge_debug;
module_param(bridge_debug, int, 0644);
MODULE_PARM_DESC(bridge_debug, "enable bridge debug messages");
#define _AU0828_BULKPIPE 0x03
#define _BULKPIPESIZE 0xffff
......@@ -229,24 +221,18 @@ static int __init au0828_init(void)
{
int ret;
if (debug)
if (au0828_debug & 1)
printk(KERN_INFO "%s() Debugging is enabled\n", __func__);
if (usb_debug) {
if (au0828_debug & 2)
printk(KERN_INFO "%s() USB Debugging is enabled\n", __func__);
debug |= 2;
}
if (i2c_debug) {
if (au0828_debug & 4)
printk(KERN_INFO "%s() I2C Debugging is enabled\n", __func__);
debug |= 4;
}
if (bridge_debug) {
if (au0828_debug & 8)
printk(KERN_INFO "%s() Bridge Debugging is enabled\n",
__func__);
debug |= 8;
}
printk(KERN_INFO "au0828 driver loaded\n");
......
......@@ -204,7 +204,7 @@ static int au0828_dvb_stop_feed(struct dvb_demux_feed *feed)
return ret;
}
int dvb_register(struct au0828_dev *dev)
static int dvb_register(struct au0828_dev *dev)
{
struct au0828_dvb *dvb = &dev->dvb;
int result;
......
......@@ -29,11 +29,7 @@
#include <media/v4l2-common.h>
unsigned int i2c_debug;
module_param(i2c_debug, int, 0444);
MODULE_PARM_DESC(i2c_debug, "enable debug messages [i2c]");
unsigned int i2c_scan;
static int i2c_scan;
module_param(i2c_scan, int, 0444);
MODULE_PARM_DESC(i2c_scan, "scan i2c bus at insmod time");
......
......@@ -96,15 +96,12 @@ struct au0828_buff {
/* au0828-core.c */
extern u32 au0828_read(struct au0828_dev *dev, u16 reg);
extern u32 au0828_write(struct au0828_dev *dev, u16 reg, u32 val);
extern unsigned int debug;
extern unsigned int usb_debug;
extern unsigned int bridge_debug;
extern int au0828_debug;
/* ----------------------------------------------------------- */
/* au0828-cards.c */
extern struct au0828_board au0828_boards[];
extern struct usb_device_id au0828_usb_id_table[];
extern const unsigned int au0828_bcount;
extern void au0828_gpio_setup(struct au0828_dev *dev);
extern int au0828_tuner_callback(void *priv, int command, int arg);
extern void au0828_card_setup(struct au0828_dev *dev);
......@@ -115,7 +112,6 @@ extern int au0828_i2c_register(struct au0828_dev *dev);
extern int au0828_i2c_unregister(struct au0828_dev *dev);
extern void au0828_call_i2c_clients(struct au0828_dev *dev,
unsigned int cmd, void *arg);
extern unsigned int i2c_debug;
/* ----------------------------------------------------------- */
/* au0828-dvb.c */
......@@ -123,6 +119,6 @@ extern int au0828_dvb_register(struct au0828_dev *dev);
extern void au0828_dvb_unregister(struct au0828_dev *dev);
#define dprintk(level, fmt, arg...)\
do { if (debug & level)\
do { if (au0828_debug & level)\
printk(KERN_DEBUG DRIVER_NAME "/0: " fmt, ## arg);\
} while (0)
......@@ -58,6 +58,7 @@ config VIDEO_CX88_DVB
select DVB_CX24123 if !DVB_FE_CUSTOMISE
select DVB_ISL6421 if !DVB_FE_CUSTOMISE
select TUNER_SIMPLE if !DVB_FE_CUSTOMISE
select DVB_S5H1411 if !DVB_FE_CUSTOMISE
---help---
This adds support for DVB/ATSC cards based on the
Conexant 2388x chip.
......
......@@ -546,10 +546,12 @@ static int blackbird_initialize_codec(struct cx8802_dev *dev)
if (retval < 0)
return retval;
dev->mailbox = blackbird_find_mailbox(dev);
if (dev->mailbox < 0)
retval = blackbird_find_mailbox(dev);
if (retval < 0)
return -1;
dev->mailbox = retval;
retval = blackbird_api_cmd(dev, CX2341X_ENC_PING_FW, 0, 0); /* ping */
if (retval < 0) {
dprintk(0, "ERROR: Firmware ping failed!\n");
......
......@@ -1591,6 +1591,7 @@ static const struct cx88_board cx88_boards[] = {
.vmux = 2,
.gpio0 = 0x16d9,
}},
.mpeg = CX88_MPEG_DVB,
},
[CX88_BOARD_PROLINK_PV_8000GT] = {
.name = "Prolink Pixelview MPEG 8000GT",
......
......@@ -47,6 +47,7 @@
#include "isl6421.h"
#include "tuner-simple.h"
#include "tda9887.h"
#include "s5h1411.h"
MODULE_DESCRIPTION("driver for cx2388x based DVB cards");
MODULE_AUTHOR("Chris Pascoe <c.pascoe@itee.uq.edu.au>");
......@@ -463,6 +464,22 @@ static struct zl10353_config cx88_geniatech_x8000_mt = {
.no_tuner = 1,
};
static struct s5h1411_config dvico_fusionhdtv7_config = {
.output_mode = S5H1411_SERIAL_OUTPUT,
.gpio = S5H1411_GPIO_ON,
.mpeg_timing = S5H1411_MPEGTIMING_CONTINOUS_NONINVERTING_CLOCK,
.qam_if = S5H1411_IF_44000,
.vsb_if = S5H1411_IF_44000,
.inversion = S5H1411_INVERSION_OFF,
.status_mode = S5H1411_DEMODLOCKING
};
static struct xc5000_config dvico_fusionhdtv7_tuner_config = {
.i2c_address = 0xc2 >> 1,
.if_khz = 5380,
.tuner_callback = cx88_tuner_callback,
};
static int attach_xc3028(u8 addr, struct cx8802_dev *dev)
{
struct dvb_frontend *fe;
......@@ -844,6 +861,21 @@ static int dvb_register(struct cx8802_dev *dev)
if (attach_xc3028(0x61, dev) < 0)
return -EINVAL;
break;
case CX88_BOARD_DVICO_FUSIONHDTV_7_GOLD:
dev->dvb.frontend = dvb_attach(s5h1411_attach,
&dvico_fusionhdtv7_config,
&dev->core->i2c_adap);
if (dev->dvb.frontend != NULL) {
/* tuner_config.video_dev must point to
* i2c_adap.algo_data
*/
dvico_fusionhdtv7_tuner_config.priv =
dev->core->i2c_adap.algo_data;
dvb_attach(xc5000_attach, dev->dvb.frontend,
&dev->core->i2c_adap,
&dvico_fusionhdtv7_tuner_config);
}
break;
default:
printk(KERN_ERR "%s/2: The frontend of your DVB/ATSC card isn't supported yet\n",
dev->core->name);
......
......@@ -650,7 +650,7 @@ int em28xx_init_isoc(struct em28xx *dev, int max_packets,
dev->isoc_ctl.transfer_buffer = kzalloc(sizeof(void *)*num_bufs,
GFP_KERNEL);
if (!dev->isoc_ctl.urb) {
if (!dev->isoc_ctl.transfer_buffer) {
em28xx_errdev("cannot allocate memory for usbtransfer\n");
kfree(dev->isoc_ctl.urb);
return -ENOMEM;
......
......@@ -509,8 +509,11 @@ static int ir_probe(struct i2c_adapter *adap)
static const int probe_cx88[] = { 0x18, 0x6b, 0x71, -1 };
static const int probe_cx23885[] = { 0x6b, -1 };
const int *probe;
struct i2c_client *c;
unsigned char buf;
struct i2c_msg msg = {
.flags = I2C_M_RD,
.len = 0,
.buf = NULL,
};
int i, rc;
switch (adap->id) {
......@@ -536,23 +539,17 @@ static int ir_probe(struct i2c_adapter *adap)
return 0;
}
c = kzalloc(sizeof(*c), GFP_KERNEL);
if (!c)
return -ENOMEM;
c->adapter = adap;
for (i = 0; -1 != probe[i]; i++) {
c->addr = probe[i];
rc = i2c_master_recv(c, &buf, 0);
msg.addr = probe[i];
rc = i2c_transfer(adap, &msg, 1);
dprintk(1,"probe 0x%02x @ %s: %s\n",
probe[i], adap->name,
(0 == rc) ? "yes" : "no");
if (0 == rc) {
(1 == rc) ? "yes" : "no");
if (1 == rc) {
ir_attach(adap, probe[i], 0, 0);
break;
}
}
kfree(c);
return 0;
}
......
......@@ -64,6 +64,7 @@ config VIDEO_PVRUSB2_DVB
depends on VIDEO_PVRUSB2 && DVB_CORE && EXPERIMENTAL
select DVB_LGDT330X if !DVB_FE_CUSTOMISE
select DVB_S5H1409 if !DVB_FE_CUSTOMISE
select DVB_S5H1411 if !DVB_FE_CUSTOMISE
select DVB_TDA10048 if !DVB_FE_CUSTOMIZE
select DVB_TDA18271 if !DVB_FE_CUSTOMIZE
select TUNER_SIMPLE if !DVB_FE_CUSTOMISE
......
......@@ -36,6 +36,7 @@ pvr2_device_desc structures.
#include "pvrusb2-hdw-internal.h"
#include "lgdt330x.h"
#include "s5h1409.h"
#include "s5h1411.h"
#include "tda10048.h"
#include "tda18271.h"
#include "tda8290.h"
......@@ -368,6 +369,15 @@ static struct s5h1409_config pvr2_s5h1409_config = {
.status_mode = S5H1409_DEMODLOCKING,
};
static struct s5h1411_config pvr2_s5h1411_config = {
.output_mode = S5H1411_PARALLEL_OUTPUT,
.gpio = S5H1411_GPIO_OFF,
.vsb_if = S5H1411_IF_44000,
.qam_if = S5H1411_IF_4000,
.inversion = S5H1411_INVERSION_ON,
.status_mode = S5H1411_DEMODLOCKING,
};
static struct tda18271_std_map hauppauge_tda18271_std_map = {
.atsc_6 = { .if_freq = 5380, .agc_mode = 3, .std = 3,
.if_lvl = 6, .rfagc_top = 0x37, },
......@@ -390,6 +400,16 @@ static int pvr2_s5h1409_attach(struct pvr2_dvb_adapter *adap)
return -EIO;
}
static int pvr2_s5h1411_attach(struct pvr2_dvb_adapter *adap)
{
adap->fe = dvb_attach(s5h1411_attach, &pvr2_s5h1411_config,
&adap->channel.hdw->i2c_adap);
if (adap->fe)
return 0;
return -EIO;
}
static int pvr2_tda18271_8295_attach(struct pvr2_dvb_adapter *adap)
{
dvb_attach(tda829x_attach, adap->fe,
......@@ -406,6 +426,11 @@ struct pvr2_dvb_props pvr2_750xx_dvb_props = {
.frontend_attach = pvr2_s5h1409_attach,
.tuner_attach = pvr2_tda18271_8295_attach,
};
struct pvr2_dvb_props pvr2_751xx_dvb_props = {
.frontend_attach = pvr2_s5h1411_attach,
.tuner_attach = pvr2_tda18271_8295_attach,
};
#endif
static const char *pvr2_client_75xxx[] = {
......@@ -454,6 +479,9 @@ static const struct pvr2_device_desc pvr2_device_751xx = {
.digital_control_scheme = PVR2_DIGITAL_SCHEME_HAUPPAUGE,
.default_std_mask = V4L2_STD_NTSC_M,
.led_scheme = PVR2_LED_SCHEME_HAUPPAUGE,
#ifdef CONFIG_VIDEO_PVRUSB2_DVB
.dvb_props = &pvr2_751xx_dvb_props,
#endif
};
......
......@@ -104,28 +104,28 @@ struct pvr2_device_desc {
unsigned char digital_control_scheme;
/* If set, we don't bother trying to load cx23416 firmware. */
int flag_skip_cx23416_firmware:1;
unsigned int flag_skip_cx23416_firmware:1;
/* If set, the encoder must be healthy in order for digital mode to
work (otherwise we assume that digital streaming will work even
if we fail to locate firmware for the encoder). If the device
doesn't support digital streaming then this flag has no
effect. */
int flag_digital_requires_cx23416:1;
unsigned int flag_digital_requires_cx23416:1;
/* Device has a hauppauge eeprom which we can interrogate. */
int flag_has_hauppauge_rom:1;
unsigned int flag_has_hauppauge_rom:1;
/* Device does not require a powerup command to be issued. */
int flag_no_powerup:1;
unsigned int flag_no_powerup:1;
/* Device has a cx25840 - this enables special additional logic to
handle it. */
int flag_has_cx25840:1;
unsigned int flag_has_cx25840:1;
/* Device has a wm8775 - this enables special additional logic to
ensure that it is found. */
int flag_has_wm8775:1;
unsigned int flag_has_wm8775:1;
/* Device has IR hardware that can be faked into looking like a
normal Hauppauge i2c IR receiver. This is currently very
......@@ -135,15 +135,15 @@ struct pvr2_device_desc {
to virtualize the presence of the non-existant IR receiver chip and
implement the virtual receiver in terms of appropriate FX2
commands. */
int flag_has_hauppauge_custom_ir:1;
unsigned int flag_has_hauppauge_custom_ir:1;
/* These bits define which kinds of sources the device can handle.
Note: Digital tuner presence is inferred by the
digital_control_scheme enumeration. */
int flag_has_fmradio:1; /* Has FM radio receiver */
int flag_has_analogtuner:1; /* Has analog tuner */
int flag_has_composite:1; /* Has composite input */
int flag_has_svideo:1; /* Has s-video input */
unsigned int flag_has_fmradio:1; /* Has FM radio receiver */
unsigned int flag_has_analogtuner:1; /* Has analog tuner */
unsigned int flag_has_composite:1; /* Has composite input */
unsigned int flag_has_svideo:1; /* Has s-video input */
};
extern struct usb_device_id pvr2_device_table[];
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment