All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tim Farrington <timf@iinet.net.au>
To: linux-dvb@linuxtv.org, John.Chajecki@leicester.gov.uk
Subject: [linux-dvb] Saa7134 with Avermedia M1155 hybrid card on Ubuntu 8.04
Date: Fri, 15 Aug 2008 00:00:29 +0800	[thread overview]
Message-ID: <48A4569D.6090608@iinet.net.au> (raw)

[-- Attachment #1: Type: text/plain, Size: 4652 bytes --]

Hi John,

I will try and help.

Try this and see if you get anywhere.

First, you need to install these:

sudo apt-get install build-essential mercurial

Next, you need to download v4l-dvb from Linuxtv.org into your home 
directory:

hg clone http://linuxtv.org/hg/v4l-dvb

Next, in Ubuntu 8.04, you will have to remove conflicting modules:
(beware this may affect things such as a webcam)

cd /lib/modules/`uname -r`/ubuntu
sudo rm -rf media
cd

Next, modify the source code in ~/v4l-dvb

In ~/v4l-dvb/linux/drivers/media/video/saa7134/saa7134-cards.c

Find this section:

    [SAA7134_BOARD_AVERMEDIA_M115] = {
        .name           = "Avermedia M115",
        .audio_clock    = 0x187de7,
        .tuner_type     = TUNER_XC2028,
        .radio_type     = UNSET,
        .tuner_addr    = ADDR_UNSET,
        .radio_addr    = ADDR_UNSET,
/*add this line*/.mpeg           = SAA7134_MPEG_DVB,
        .inputs         = {{
            .name = name_tv,
            .vmux = 1,
            .amux = TV,
            .tv   = 1,
        }, {
            .name = name_comp1,
            .vmux = 3,
            .amux = LINE1,
        }, {
            .name = name_svideo,
            .vmux = 8,
            .amux = LINE2,
        } },
    },

Find this section:

static int saa7134_xc2028_callback(struct saa7134_dev *dev,
                   int command, int arg)
{
    switch (command) {
    case XC2028_TUNER_RESET:
        saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x00008000, 0x00000000);
        saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x00008000, 0x00008000);
        switch (dev->board) {
        case SAA7134_BOARD_AVERMEDIA_CARDBUS_506:
        case SAA7134_BOARD_AVERMEDIA_M103:
            saa7134_set_gpio(dev, 23, 0);
            msleep(10);
            saa7134_set_gpio(dev, 23, 1);
        break;
        case SAA7134_BOARD_AVERMEDIA_A16D:
/*add this line*/case SAA7134_BOARD_AVERMEDIA_M115:
            saa7134_set_gpio(dev, 21, 0);
            msleep(10);
            saa7134_set_gpio(dev, 21, 1);
        break;
        }
    return 0;
    }
    return -EINVAL;
}

Find this section:

int saa7134_board_init1(struct saa7134_dev *dev)
...
    case SAA7134_BOARD_AVERMEDIA_CARDBUS:
/*    case SAA7134_BOARD_AVERMEDIA_M115: */ /*comment this line out*/
#if 1
        /* power-down tuner chip */
        saa_andorl(SAA7134_GPIO_GPMODE0 >> 2,   0xffffffff, 0);
        saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0xffffffff, 0);
#endif
        msleep(10);
        /* power-up tuner chip */
        saa_andorl(SAA7134_GPIO_GPMODE0 >> 2,   0xffffffff, 0xffffffff);
        saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0xffffffff, 0xffffffff);
        msleep(10);
        break;

Find this section:

    case SAA7134_BOARD_AVERMEDIA_A16D:
        saa7134_set_gpio(dev, 21, 0);
        msleep(10);
        saa7134_set_gpio(dev, 21, 1);
        msleep(1);
        dev->has_remote = SAA7134_REMOTE_GPIO;
        break;

Create a new case entry below it:

    case SAA7134_BOARD_AVERMEDIA_M115:
        saa7134_set_gpio(dev, 21, 0);
        msleep(10);
        saa7134_set_gpio(dev, 21, 1);
        break;

Find this section:

        switch (dev->board) {
        case SAA7134_BOARD_AVERMEDIA_A16D:
        case SAA7134_BOARD_AVERMEDIA_CARDBUS_506:
        case SAA7134_BOARD_AVERMEDIA_M103:
/*add this line*/case SAA7134_BOARD_AVERMEDIA_M115:
            ctl.demod = XC3028_FE_ZARLINK456;
            break;


In ~/v4l-dvb/linux/drivers/media/video/saa7134/saa7134-dvb.c

Find this section:

    case SAA7134_BOARD_AVERMEDIA_CARDBUS_506:
        dprintk("AverMedia E506R dvb setup\n");
        saa7134_set_gpio(dev, 25, 0);
        msleep(10);
        saa7134_set_gpio(dev, 25, 1);
        dev->dvb.frontend = dvb_attach(mt352_attach,
                        &avermedia_xc3028_mt352_dev,
                        &dev->i2c_adap);
        attach_xc3028 = 1;
        break;

Create a new case entry below it:

    case SAA7134_BOARD_AVERMEDIA_M115:
        saa7134_set_gpio(dev, 25, 0);
        msleep(10);
        saa7134_set_gpio(dev, 25, 1);
        dev->dvb.frontend = dvb_attach(mt352_attach,
                        &avermedia_xc3028_mt352_dev,
                        &dev->i2c_adap);
        attach_xc3028 = 1;
        break;

Save these files.
Next, use make to build the modules:

cd
cd v4l-dvb
make
sudo make install

Next, you need to extract and install the firmware:

In ~/v4l-dvb/linux/Documentation/video4linux/extract_xc3028.pl

you will find instructions on how to use this file to obtain the firmware.

Then, copy the firmware to /lib:

sudo cp xc3028-v27.fw /lib/firmware/`uname -r`

reboot

check dmesg.

See if that gets anywhere.

Regards,
Timf

[-- Attachment #2: m115.txt --]
[-- Type: text/plain, Size: 3918 bytes --]


First, you need to install these:

sudo apt-get install build-essential mercurial

Next, you need to download v4l-dvb from Linuxtv.org into your home directory:

hg clone http://linuxtv.org/hg/v4l-dvb

Next, in Ubuntu 8.04, you will have to remove conflicting modules:
(beware this may affect things such as a webcam)

cd /lib/modules/`uname -r`/ubuntu
sudo rm -rf media
cd

Next, modify the source code in ~/v4l-dvb

In ~/v4l-dvb/linux/drivers/media/video/saa7134/saa7134-cards.c

Find this section:

	[SAA7134_BOARD_AVERMEDIA_M115] = {
		.name           = "Avermedia M115",
		.audio_clock    = 0x187de7,
		.tuner_type     = TUNER_XC2028,
		.radio_type     = UNSET,
		.tuner_addr	= ADDR_UNSET,
		.radio_addr	= ADDR_UNSET,
/*add this line*/.mpeg           = SAA7134_MPEG_DVB,
		.inputs         = {{
			.name = name_tv,
			.vmux = 1,
			.amux = TV,
			.tv   = 1,
		}, {
			.name = name_comp1,
			.vmux = 3,
			.amux = LINE1,
		}, {
			.name = name_svideo,
			.vmux = 8,
			.amux = LINE2,
		} },
	},

Find this section:

static int saa7134_xc2028_callback(struct saa7134_dev *dev,
				   int command, int arg)
{
	switch (command) {
	case XC2028_TUNER_RESET:
		saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x00008000, 0x00000000);
		saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x00008000, 0x00008000);
		switch (dev->board) {
		case SAA7134_BOARD_AVERMEDIA_CARDBUS_506:
		case SAA7134_BOARD_AVERMEDIA_M103:
			saa7134_set_gpio(dev, 23, 0);
			msleep(10);
			saa7134_set_gpio(dev, 23, 1);
		break;
		case SAA7134_BOARD_AVERMEDIA_A16D:
/*add this line*/case SAA7134_BOARD_AVERMEDIA_M115:
			saa7134_set_gpio(dev, 21, 0);
			msleep(10);
			saa7134_set_gpio(dev, 21, 1);
		break;
		}
	return 0;
	}
	return -EINVAL;
}

Find this section:

int saa7134_board_init1(struct saa7134_dev *dev)
...
	case SAA7134_BOARD_AVERMEDIA_CARDBUS:
/*	case SAA7134_BOARD_AVERMEDIA_M115: */ /*comment this line out*/
#if 1
		/* power-down tuner chip */
		saa_andorl(SAA7134_GPIO_GPMODE0 >> 2,   0xffffffff, 0);
		saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0xffffffff, 0);
#endif
		msleep(10);
		/* power-up tuner chip */
		saa_andorl(SAA7134_GPIO_GPMODE0 >> 2,   0xffffffff, 0xffffffff);
		saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0xffffffff, 0xffffffff);
		msleep(10);
		break;

Find this section:

	case SAA7134_BOARD_AVERMEDIA_A16D:
		saa7134_set_gpio(dev, 21, 0);
		msleep(10);
		saa7134_set_gpio(dev, 21, 1);
		msleep(1);
		dev->has_remote = SAA7134_REMOTE_GPIO;
		break;

Create a new case entry below it:

	case SAA7134_BOARD_AVERMEDIA_M115:
		saa7134_set_gpio(dev, 21, 0);
		msleep(10);
		saa7134_set_gpio(dev, 21, 1);
		break;

Find this section:

		switch (dev->board) {
		case SAA7134_BOARD_AVERMEDIA_A16D:
		case SAA7134_BOARD_AVERMEDIA_CARDBUS_506:
		case SAA7134_BOARD_AVERMEDIA_M103:
/*add this line*/case SAA7134_BOARD_AVERMEDIA_M115:
			ctl.demod = XC3028_FE_ZARLINK456;
			break;


In ~/v4l-dvb/linux/drivers/media/video/saa7134/saa7134-dvb.c

Find this section:

	case SAA7134_BOARD_AVERMEDIA_CARDBUS_506:
		dprintk("AverMedia E506R dvb setup\n");
		saa7134_set_gpio(dev, 25, 0);
		msleep(10);
		saa7134_set_gpio(dev, 25, 1);
		dev->dvb.frontend = dvb_attach(mt352_attach,
						&avermedia_xc3028_mt352_dev,
						&dev->i2c_adap);
		attach_xc3028 = 1;
		break;

Create a new case entry below it:

	case SAA7134_BOARD_AVERMEDIA_M115:
		saa7134_set_gpio(dev, 25, 0);
		msleep(10);
		saa7134_set_gpio(dev, 25, 1);
		dev->dvb.frontend = dvb_attach(mt352_attach,
						&avermedia_xc3028_mt352_dev,
						&dev->i2c_adap);
		attach_xc3028 = 1;
		break;

Save these files.
Next, use make to build the modules:

cd
cd v4l-dvb
make
sudo make install

Next, you need to extract and install the firmware:

In ~/v4l-dvb/linux/Documentation/video4linux/extract_xc3028.pl

you will find instructions on how to use this file to obtain the firmware.

Then, copy the firmware to /lib:

sudo cp xc3028-v27.fw /lib/firmware/`uname -r`

reboot

check dmesg.


[-- Attachment #3: Type: text/plain, Size: 150 bytes --]

_______________________________________________
linux-dvb mailing list
linux-dvb@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb

             reply	other threads:[~2008-08-14 16:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-14 16:00 Tim Farrington [this message]
2008-08-14 23:10 ` [linux-dvb] Saa7134 with Avermedia M1155 hybrid card on Ubuntu 8.04 hermann pitton
  -- strict thread matches above, loose matches on Subject: below --
2008-08-12 14:08 John Chajecki
2008-08-12 20:39 ` hermann pitton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48A4569D.6090608@iinet.net.au \
    --to=timf@iinet.net.au \
    --cc=John.Chajecki@leicester.gov.uk \
    --cc=linux-dvb@linuxtv.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.