mirror of
https://github.com/DigitalDevices/dddvb.git
synced 2023-10-10 13:37:43 +02:00
move common functions of ddbridge and octonet to core
This commit is contained in:
parent
49d4bd0da8
commit
6814a8fa23
@ -26,6 +26,20 @@
|
|||||||
|
|
||||||
DEFINE_MUTEX(redirect_lock);
|
DEFINE_MUTEX(redirect_lock);
|
||||||
|
|
||||||
|
static struct workqueue_struct *ddb_wq;
|
||||||
|
|
||||||
|
static int adapter_alloc;
|
||||||
|
module_param(adapter_alloc, int, 0444);
|
||||||
|
MODULE_PARM_DESC(adapter_alloc,
|
||||||
|
"0-one adapter per io, 1-one per tab with io, 2-one per tab, 3-one for all");
|
||||||
|
|
||||||
|
#ifdef CONFIG_PCI_MSI
|
||||||
|
static int msi = 1;
|
||||||
|
module_param(msi, int, 0444);
|
||||||
|
MODULE_PARM_DESC(msi,
|
||||||
|
" Control MSI interrupts: 0-disable, 1-enable (default)");
|
||||||
|
#endif
|
||||||
|
|
||||||
static int ci_bitrate = 70000;
|
static int ci_bitrate = 70000;
|
||||||
module_param(ci_bitrate, int, 0444);
|
module_param(ci_bitrate, int, 0444);
|
||||||
MODULE_PARM_DESC(ci_bitrate, " Bitrate in KHz for output to CI.");
|
MODULE_PARM_DESC(ci_bitrate, " Bitrate in KHz for output to CI.");
|
||||||
@ -5480,3 +5494,11 @@ static void ddb_reset_ios(struct ddb *dev)
|
|||||||
rm->output->base + i * rm->output->size);
|
rm->output->base + i * rm->output->size);
|
||||||
usleep_range(5000, 6000);
|
usleep_range(5000, 6000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void ddb_unmap(struct ddb *dev)
|
||||||
|
{
|
||||||
|
if (dev->regs)
|
||||||
|
iounmap(dev->regs);
|
||||||
|
vfree(dev);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -29,34 +29,12 @@
|
|||||||
|
|
||||||
#include "ddbridge.h"
|
#include "ddbridge.h"
|
||||||
#include "ddbridge-regs.h"
|
#include "ddbridge-regs.h"
|
||||||
|
|
||||||
static struct workqueue_struct *ddb_wq;
|
|
||||||
|
|
||||||
static int adapter_alloc;
|
|
||||||
module_param(adapter_alloc, int, 0444);
|
|
||||||
MODULE_PARM_DESC(adapter_alloc,
|
|
||||||
"0-one adapter per io, 1-one per tab with io, 2-one per tab, 3-one for all");
|
|
||||||
|
|
||||||
#ifdef CONFIG_PCI_MSI
|
|
||||||
static int msi = 1;
|
|
||||||
module_param(msi, int, 0444);
|
|
||||||
MODULE_PARM_DESC(msi,
|
|
||||||
" Control MSI interrupts: 0-disable, 1-enable (default)");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "ddbridge-core.c"
|
#include "ddbridge-core.c"
|
||||||
|
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
|
|
||||||
static void ddb_unmap(struct ddb *dev)
|
|
||||||
{
|
|
||||||
if (dev->regs)
|
|
||||||
iounmap(dev->regs);
|
|
||||||
vfree(dev);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void __devexit ddb_irq_disable(struct ddb *dev)
|
static void __devexit ddb_irq_disable(struct ddb *dev)
|
||||||
{
|
{
|
||||||
if (dev->link[0].info->regmap->irq_version == 2) {
|
if (dev->link[0].info->regmap->irq_version == 2) {
|
||||||
|
@ -125,7 +125,7 @@ static int __exit octonet_remove(struct platform_device *pdev)
|
|||||||
|
|
||||||
free_irq(platform_get_irq(dev->pfdev, 0), dev);
|
free_irq(platform_get_irq(dev->pfdev, 0), dev);
|
||||||
ddb_ports_release(dev);
|
ddb_ports_release(dev);
|
||||||
octonet_unmap(dev);
|
ddb_unmap(dev);
|
||||||
platform_set_drvdata(pdev, 0);
|
platform_set_drvdata(pdev, 0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -203,7 +203,7 @@ fail:
|
|||||||
dev_err(dev->dev, "fail\n");
|
dev_err(dev->dev, "fail\n");
|
||||||
ddbwritel(dev, 0, ETHER_CONTROL);
|
ddbwritel(dev, 0, ETHER_CONTROL);
|
||||||
ddbwritel(dev, 0, INTERRUPT_ENABLE);
|
ddbwritel(dev, 0, INTERRUPT_ENABLE);
|
||||||
octonet_unmap(dev);
|
ddb_unmap(dev);
|
||||||
platform_set_drvdata(pdev, 0);
|
platform_set_drvdata(pdev, 0);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user