Comment 5 for bug 125384

Revision history for this message
hexion (hexium) wrote :

After reading posts in the mailing list of Lirc, and the bug you filed in launchpad, I started thinking about how to solve this problem.

Well, I got it Now I'm running Lirc with 2.6.22 kernel using lirc_gpio module.

I simply added the functions droped in the source code, recompiled some modules, installed them and recompile Lirc.

Of course this is a temporal fix till Lirc devs adapt the code to the new API, but it's unlike that that's done before Gutsy is frozen, so this patch should do the trick.

Note: The files are not patches, they are the source files edited by me. This is the code I added:

drivers/media/video/bt8xx/bttv.h:
// lirc_gpio support starts

extern wait_queue_head_t* bttv_get_gpio_queue(unsigned int card);
extern int bttv_get_cardinfo(unsigned int card, int *type,
                 unsigned int *cardid);

// lirc_gpio support ends

drivers/media/video/bt8xx/bttv-if.c:

// lirc_gpio support starts
EXPORT_SYMBOL(bttv_get_gpio_queue);
EXPORT_SYMBOL(bttv_get_cardinfo);

int bttv_get_cardinfo(unsigned int card, int *type, unsigned *cardid)
{
    printk("The bttv_* interface is obsolete and will go away,\n"
           "please use the new, sysfs based interface instead.\n");
    if (card >= bttv_num) {
        return -1;
    }
    *type = bttvs[card].c.type;
    *cardid = bttvs[card].cardid;
    return 0;
}

wait_queue_head_t* bttv_get_gpio_queue(unsigned int card)
{
    struct bttv *btv;

    if (card >= bttv_num) {
        return NULL;
    }

    btv = &bttvs[card];
    if (bttvs[card].shutdown) {
        return NULL;
    }
    return &btv->gpioq;
}

// lirc_gpio support ends