summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2008-06-15 08:28:11 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-06-15 08:28:11 -0300
commit5948bab2516e721360e6db06be74da5fe69dfe3f (patch)
tree06695ed2a2adf2ee5146db5f3de112b2123d0508
parent063f30078fd2e192ff79f2c269f41cbc27539218 (diff)
parente192b6f88d8065aacfce581bee2f3a231156e8be (diff)
downloadmediapointer-dvb-s2-5948bab2516e721360e6db06be74da5fe69dfe3f.tar.gz
mediapointer-dvb-s2-5948bab2516e721360e6db06be74da5fe69dfe3f.tar.bz2
merge: http://linuxtv.org/hg/~mkrufky/tda18271
From: Mauro Carvalho Chehab <mchehab@infradead.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r--linux/drivers/media/dvb/dvb-usb/Kconfig1
-rw-r--r--linux/drivers/media/dvb/dvb-usb/anysee.c22
-rw-r--r--linux/drivers/media/dvb/dvb-usb/anysee.h4
-rw-r--r--linux/drivers/media/dvb/frontends/tda10023.c6
-rw-r--r--linux/drivers/media/dvb/frontends/tda1002x.h10
-rw-r--r--linux/drivers/media/dvb/frontends/tda1004x.c29
-rw-r--r--linux/drivers/media/video/cx88/cx88-alsa.c6
-rw-r--r--linux/drivers/media/video/em28xx/em28xx-audio.c6
-rw-r--r--linux/drivers/media/video/saa7134/saa7134-alsa.c8
-rw-r--r--linux/drivers/media/video/saa7134/saa7134-cards.c3
-rw-r--r--linux/drivers/media/video/saa7134/saa7134-dvb.c3
11 files changed, 76 insertions, 22 deletions
diff --git a/linux/drivers/media/dvb/dvb-usb/Kconfig b/linux/drivers/media/dvb/dvb-usb/Kconfig
index 3f7b9b632..cae574fa7 100644
--- a/linux/drivers/media/dvb/dvb-usb/Kconfig
+++ b/linux/drivers/media/dvb/dvb-usb/Kconfig
@@ -244,6 +244,7 @@ config DVB_USB_AF9005_REMOTE
config DVB_USB_ANYSEE
tristate "Anysee DVB-T/C USB2.0 support"
depends on DVB_USB
+ select DVB_PLL if !DVB_FE_CUSTOMISE
select DVB_MT352 if !DVB_FE_CUSTOMISE
select DVB_ZL10353 if !DVB_FE_CUSTOMISE
select DVB_TDA10023 if !DVB_FE_CUSTOMISE
diff --git a/linux/drivers/media/dvb/dvb-usb/anysee.c b/linux/drivers/media/dvb/dvb-usb/anysee.c
index 89675dbf7..224919559 100644
--- a/linux/drivers/media/dvb/dvb-usb/anysee.c
+++ b/linux/drivers/media/dvb/dvb-usb/anysee.c
@@ -23,8 +23,8 @@
* Card reader in Anysee is nothing more than ISO 7816 card reader.
* There is no hardware CAM in any Anysee device sold.
* In my understanding it should be implemented by making own module
- * for ISO 7816 card reader, like dvb_ca_en50221 is implented. This
- * module registers serial interface that can be used to comminicate
+ * for ISO 7816 card reader, like dvb_ca_en50221 is implemented. This
+ * module registers serial interface that can be used to communicate
* with any ISO 7816 smart card.
*
* Any help according to implement serial smart card reader support
@@ -227,7 +227,8 @@ static struct tda10023_config anysee_tda10023_config = {
.pll_m = 11,
.pll_p = 3,
.pll_n = 1,
- .deltaf = 0xfed6,
+ .output_mode = TDA10023_OUTPUT_MODE_PARALLEL_C,
+ .deltaf = 0xfeeb,
};
static struct mt352_config anysee_mt352_config = {
@@ -272,8 +273,8 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap)
1. E30 MT352 02 0.2.1
2. E30 ZL10353 02 0.2.1
3. E30 Plus ZL10353 06 0.1.0
- 4. E30C Plus TDA10023 0a 0.1.0
- E30C Plus TDA10023 0f 0.1.2 (not working)
+ 4. E30C Plus TDA10023 0a 0.1.0 rev 0.2
+ 4. E30C Plus TDA10023 0f 0.1.2 rev 0.4
*/
/* Zarlink MT352 DVB-T demod inside of Samsung DNOS404ZH102A NIM */
@@ -305,13 +306,10 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap)
return 0;
}
- /* known not working (E30C Plus v0.1.2) */
- if (hw_info[0] == 0x0f) {
- info("this version of Anysee is not supported yet");
- /* return IO port D to init value for safe */
- ret = anysee_write_reg(adap->dev, 0xb0, io_d);
- return -ENODEV;
- }
+ /* IO port E - E30C rev 0.4 board requires this */
+ ret = anysee_write_reg(adap->dev, 0xb1, 0xa7);
+ if (ret)
+ return ret;
/* Philips TDA10023 DVB-C demod */
adap->fe = dvb_attach(tda10023_attach, &anysee_tda10023_config,
diff --git a/linux/drivers/media/dvb/dvb-usb/anysee.h b/linux/drivers/media/dvb/dvb-usb/anysee.h
index 48da3949e..7ca01ff6e 100644
--- a/linux/drivers/media/dvb/dvb-usb/anysee.h
+++ b/linux/drivers/media/dvb/dvb-usb/anysee.h
@@ -23,8 +23,8 @@
* Card reader in Anysee is nothing more than ISO 7816 card reader.
* There is no hardware CAM in any Anysee device sold.
* In my understanding it should be implemented by making own module
- * for ISO 7816 card reader, like dvb_ca_en50221 is implented. This
- * module registers serial interface that can be used to comminicate
+ * for ISO 7816 card reader, like dvb_ca_en50221 is implemented. This
+ * module registers serial interface that can be used to communicate
* with any ISO 7816 smart card.
*
* Any help according to implement serial smart card reader support
diff --git a/linux/drivers/media/dvb/frontends/tda10023.c b/linux/drivers/media/dvb/frontends/tda10023.c
index 82d6cb5b8..ec9d772c4 100644
--- a/linux/drivers/media/dvb/frontends/tda10023.c
+++ b/linux/drivers/media/dvb/frontends/tda10023.c
@@ -269,7 +269,8 @@ static int tda10023_init (struct dvb_frontend *fe)
/* 084 */ 0x02, 0xff, 0x93, /* AGCCONF1 IFS=1 KAGCIF=2 KAGCTUN=3 */
/* 087 */ 0x2d, 0xff, 0xf6, /* SWEEP SWPOS=1 SWDYN=7 SWSTEP=1 SWLEN=2 */
/* 090 */ 0x04, 0x10, 0x00, /* SWRAMP=1 */
-/* 093 */ 0x12, 0xff, 0xa1, /* INTP1 POCLKP=1 FEL=1 MFS=0 */
+/* 093 */ 0x12, 0xff, TDA10023_OUTPUT_MODE_PARALLEL_B, /*
+ INTP1 POCLKP=1 FEL=1 MFS=0 */
/* 096 */ 0x2b, 0x01, 0xa1, /* INTS1 */
/* 099 */ 0x20, 0xff, 0x04, /* INTP2 SWAPP=? MSBFIRSTP=? INTPSEL=? */
/* 102 */ 0x2c, 0xff, 0x0d, /* INTP/S TRIP=0 TRIS=0 */
@@ -289,6 +290,9 @@ static int tda10023_init (struct dvb_frontend *fe)
tda10023_inittab[83] = (state->config->deltaf >> 8);
}
+ if (state->config->output_mode)
+ tda10023_inittab[95] = state->config->output_mode;
+
tda10023_writetab(state, tda10023_inittab);
return 0;
diff --git a/linux/drivers/media/dvb/frontends/tda1002x.h b/linux/drivers/media/dvb/frontends/tda1002x.h
index 4522b7ef5..afc0a32ea 100644
--- a/linux/drivers/media/dvb/frontends/tda1002x.h
+++ b/linux/drivers/media/dvb/frontends/tda1002x.h
@@ -32,6 +32,13 @@ struct tda1002x_config {
u8 invert;
};
+enum tda10023_output_mode {
+ TDA10023_OUTPUT_MODE_PARALLEL_A = 0xe0,
+ TDA10023_OUTPUT_MODE_PARALLEL_B = 0xa1,
+ TDA10023_OUTPUT_MODE_PARALLEL_C = 0xa0,
+ TDA10023_OUTPUT_MODE_SERIAL, /* TODO: not implemented */
+};
+
struct tda10023_config {
/* the demodulator's i2c address */
u8 demod_address;
@@ -43,6 +50,9 @@ struct tda10023_config {
u8 pll_p; /* defaults: 4 */
u8 pll_n; /* defaults: 1 */
+ /* MPEG2 TS output mode */
+ u8 output_mode;
+
/* input freq offset + baseband conversion type */
u16 deltaf;
};
diff --git a/linux/drivers/media/dvb/frontends/tda1004x.c b/linux/drivers/media/dvb/frontends/tda1004x.c
index 499738463..a0d638653 100644
--- a/linux/drivers/media/dvb/frontends/tda1004x.c
+++ b/linux/drivers/media/dvb/frontends/tda1004x.c
@@ -1248,11 +1248,14 @@ struct dvb_frontend* tda10045_attach(const struct tda1004x_config* config,
struct i2c_adapter* i2c)
{
struct tda1004x_state *state;
+ int id;
/* allocate memory for the internal state */
state = kmalloc(sizeof(struct tda1004x_state), GFP_KERNEL);
- if (!state)
+ if (!state) {
+ printk(KERN_ERR "Can't alocate memory for tda10045 state\n");
return NULL;
+ }
/* setup the state */
state->config = config;
@@ -1260,7 +1263,15 @@ struct dvb_frontend* tda10045_attach(const struct tda1004x_config* config,
state->demod_type = TDA1004X_DEMOD_TDA10045;
/* check if the demod is there */
- if (tda1004x_read_byte(state, TDA1004X_CHIPID) != 0x25) {
+ id = tda1004x_read_byte(state, TDA1004X_CHIPID);
+ if (id < 0) {
+ printk(KERN_ERR "tda10045: chip is not answering. Giving up.\n");
+ kfree(state);
+ return NULL;
+ }
+
+ if (id != 0x25) {
+ printk(KERN_ERR "Invalid tda1004x ID = 0x%02x. Can't proceed\n", id);
kfree(state);
return NULL;
}
@@ -1307,11 +1318,14 @@ struct dvb_frontend* tda10046_attach(const struct tda1004x_config* config,
struct i2c_adapter* i2c)
{
struct tda1004x_state *state;
+ int id;
/* allocate memory for the internal state */
state = kmalloc(sizeof(struct tda1004x_state), GFP_KERNEL);
- if (!state)
+ if (!state) {
+ printk(KERN_ERR "Can't alocate memory for tda10046 state\n");
return NULL;
+ }
/* setup the state */
state->config = config;
@@ -1319,7 +1333,14 @@ struct dvb_frontend* tda10046_attach(const struct tda1004x_config* config,
state->demod_type = TDA1004X_DEMOD_TDA10046;
/* check if the demod is there */
- if (tda1004x_read_byte(state, TDA1004X_CHIPID) != 0x46) {
+ id = tda1004x_read_byte(state, TDA1004X_CHIPID);
+ if (id < 0) {
+ printk(KERN_ERR "tda10046: chip is not answering. Giving up.\n");
+ kfree(state);
+ return NULL;
+ }
+ if (id != 0x46) {
+ printk(KERN_ERR "Invalid tda1004x ID = 0x%02x. Can't proceed\n", id);
kfree(state);
return NULL;
}
diff --git a/linux/drivers/media/video/cx88/cx88-alsa.c b/linux/drivers/media/video/cx88/cx88-alsa.c
index 9e87bcb98..a8e985b6f 100644
--- a/linux/drivers/media/video/cx88/cx88-alsa.c
+++ b/linux/drivers/media/video/cx88/cx88-alsa.c
@@ -385,6 +385,12 @@ static int snd_cx88_pcm_open(struct snd_pcm_substream *substream)
struct snd_pcm_runtime *runtime = substream->runtime;
int err;
+ if (!chip) {
+ printk(KERN_ERR "BUG: cx88 can't find device struct."
+ " Can't proceed with open\n");
+ return -ENODEV;
+ }
+
err = snd_pcm_hw_constraint_pow2(runtime, 0, SNDRV_PCM_HW_PARAM_PERIODS);
if (err < 0)
goto _error;
diff --git a/linux/drivers/media/video/em28xx/em28xx-audio.c b/linux/drivers/media/video/em28xx/em28xx-audio.c
index 076a49dc0..904973305 100644
--- a/linux/drivers/media/video/em28xx/em28xx-audio.c
+++ b/linux/drivers/media/video/em28xx/em28xx-audio.c
@@ -299,6 +299,12 @@ static int snd_em28xx_capture_open(struct snd_pcm_substream *substream)
dprintk("opening device and trying to acquire exclusive lock\n");
+ if (!dev) {
+ printk(KERN_ERR "BUG: em28xx can't find device struct."
+ " Can't proceed with open\n");
+ return -ENODEV;
+ }
+
/* Sets volume, mute, etc */
dev->mute = 0;
diff --git a/linux/drivers/media/video/saa7134/saa7134-alsa.c b/linux/drivers/media/video/saa7134/saa7134-alsa.c
index 58670f9ea..900be78e3 100644
--- a/linux/drivers/media/video/saa7134/saa7134-alsa.c
+++ b/linux/drivers/media/video/saa7134/saa7134-alsa.c
@@ -628,9 +628,15 @@ static int snd_card_saa7134_capture_open(struct snd_pcm_substream * substream)
struct snd_pcm_runtime *runtime = substream->runtime;
snd_card_saa7134_pcm_t *pcm;
snd_card_saa7134_t *saa7134 = snd_pcm_substream_chip(substream);
- struct saa7134_dev *dev = saa7134->dev;
+ struct saa7134_dev *dev;
int amux, err;
+ if (!saa7134) {
+ printk(KERN_ERR "BUG: saa7134 can't find device struct."
+ " Can't proceed with open\n");
+ return -ENODEV;
+ }
+ dev = saa7134->dev;
mutex_lock(&dev->dmasound.lock);
dev->dmasound.read_count = 0;
diff --git a/linux/drivers/media/video/saa7134/saa7134-cards.c b/linux/drivers/media/video/saa7134/saa7134-cards.c
index 0757f573e..1e888e9e0 100644
--- a/linux/drivers/media/video/saa7134/saa7134-cards.c
+++ b/linux/drivers/media/video/saa7134/saa7134-cards.c
@@ -5803,7 +5803,8 @@ int saa7134_board_init1(struct saa7134_dev *dev)
saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0x80040100, 0x80040100);
saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x80040100, 0x00040100);
printk("%s: %s: hybrid analog/dvb card\n"
- "%s: Sorry, only the analog inputs are supported for now.\n",
+ "%s: Sorry, only analog s-video and composite input "
+ "are supported for now.\n",
dev->name, card(dev).name, dev->name);
break;
}
diff --git a/linux/drivers/media/video/saa7134/saa7134-dvb.c b/linux/drivers/media/video/saa7134/saa7134-dvb.c
index a5a2d5905..5bf61d4e3 100644
--- a/linux/drivers/media/video/saa7134/saa7134-dvb.c
+++ b/linux/drivers/media/video/saa7134/saa7134-dvb.c
@@ -1094,7 +1094,8 @@ static int dvb_init(struct saa7134_dev *dev)
ads_tech_duo_config.tuner_address);
goto dettach_frontend;
}
- }
+ } else
+ wprintk("failed to attach tda10046\n");
break;
case SAA7134_BOARD_TEVION_DVBT_220RF:
if (configure_tda827x_fe(dev, &tevion_dvbt220rf_config,