提交 fb20871a 编写于 作者: L Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging-2.6: (342 commits)
  Staging: comedi: fix build errors
  Staging: udlfb: update to version 0.2.3
  Staging: udlfb: fix some sparse warnings.
  Staging: udlfb: clean up checkpatch warnings in udlfb.c
  Staging: udlfb: clean up checkpatch warnings in udlfb.h
  Staging: udlfb: add udlfb driver to build
  Staging: add udlfb driver
  Staging: pata_rdc: remove pointless comments
  Staging: pata_rdc: remove DRIVER macros
  Staging: pata_rdc: remove dbgprintf macro
  Staging: pata_rdc: remove broken flag
  Staging: pata_rdc: fix build warnings
  Staging: pata_rdc: use PCI_DEVICE
  Staging: pata_rdc: remove function prototypes
  Staging: pata_rdc: coding style fixes
  Staging: pata_rdc: convert code to work in 2.6.29
  Staging: pata_rdc: add driver to the build system
  Staging: add pata_rdc driver
  Staging: remove obsolete serqt_usb driver
  Staging: serqt_usb2 add the driver to the build
  ...
...@@ -5479,6 +5479,7 @@ STAGING SUBSYSTEM ...@@ -5479,6 +5479,7 @@ STAGING SUBSYSTEM
P: Greg Kroah-Hartman P: Greg Kroah-Hartman
M: gregkh@suse.de M: gregkh@suse.de
T: quilt kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/ T: quilt kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/
L: devel@driverdev.osuosl.org
S: Maintained S: Maintained
F: drivers/staging/ F: drivers/staging/
......
...@@ -85,6 +85,8 @@ source "drivers/staging/altpciechdma/Kconfig" ...@@ -85,6 +85,8 @@ source "drivers/staging/altpciechdma/Kconfig"
source "drivers/staging/rtl8187se/Kconfig" source "drivers/staging/rtl8187se/Kconfig"
source "drivers/staging/rtl8192su/Kconfig"
source "drivers/staging/rspiusb/Kconfig" source "drivers/staging/rspiusb/Kconfig"
source "drivers/staging/mimio/Kconfig" source "drivers/staging/mimio/Kconfig"
...@@ -113,11 +115,19 @@ source "drivers/staging/heci/Kconfig" ...@@ -113,11 +115,19 @@ source "drivers/staging/heci/Kconfig"
source "drivers/staging/line6/Kconfig" source "drivers/staging/line6/Kconfig"
source "drivers/staging/serqt_usb/Kconfig"
source "drivers/gpu/drm/radeon/Kconfig" source "drivers/gpu/drm/radeon/Kconfig"
source "drivers/staging/octeon/Kconfig" source "drivers/staging/octeon/Kconfig"
source "drivers/staging/serqt_usb2/Kconfig"
source "drivers/staging/vt6655/Kconfig"
source "drivers/staging/cpc-usb/Kconfig"
source "drivers/staging/pata_rdc/Kconfig"
source "drivers/staging/udlfb/Kconfig"
endif # !STAGING_EXCLUDE_BUILD endif # !STAGING_EXCLUDE_BUILD
endif # STAGING endif # STAGING
...@@ -25,6 +25,7 @@ obj-$(CONFIG_ASUS_OLED) += asus_oled/ ...@@ -25,6 +25,7 @@ obj-$(CONFIG_ASUS_OLED) += asus_oled/
obj-$(CONFIG_PANEL) += panel/ obj-$(CONFIG_PANEL) += panel/
obj-$(CONFIG_ALTERA_PCIE_CHDMA) += altpciechdma/ obj-$(CONFIG_ALTERA_PCIE_CHDMA) += altpciechdma/
obj-$(CONFIG_RTL8187SE) += rtl8187se/ obj-$(CONFIG_RTL8187SE) += rtl8187se/
obj-$(CONFIG_RTL8192SU) += rtl8192su/
obj-$(CONFIG_USB_RSPI) += rspiusb/ obj-$(CONFIG_USB_RSPI) += rspiusb/
obj-$(CONFIG_INPUT_MIMIO) += mimio/ obj-$(CONFIG_INPUT_MIMIO) += mimio/
obj-$(CONFIG_TRANZPORT) += frontier/ obj-$(CONFIG_TRANZPORT) += frontier/
...@@ -39,5 +40,9 @@ obj-$(CONFIG_IDE_PHISON) += phison/ ...@@ -39,5 +40,9 @@ obj-$(CONFIG_IDE_PHISON) += phison/
obj-$(CONFIG_PLAN9AUTH) += p9auth/ obj-$(CONFIG_PLAN9AUTH) += p9auth/
obj-$(CONFIG_HECI) += heci/ obj-$(CONFIG_HECI) += heci/
obj-$(CONFIG_LINE6_USB) += line6/ obj-$(CONFIG_LINE6_USB) += line6/
obj-$(CONFIG_USB_SERIAL_QUATECH_ESU100) += serqt_usb/ obj-$(CONFIG_USB_SERIAL_QUATECH2) += serqt_usb2/
obj-$(CONFIG_OCTEON_ETHERNET) += octeon/ obj-$(CONFIG_OCTEON_ETHERNET) += octeon/
obj-$(CONFIG_VT6655) += vt6655/
obj-$(CONFIG_USB_CPC) += cpc-usb/
obj-$(CONFIG_RDC_17F3101X) += pata_rdc/
obj-$(CONFIG_FB_UDL) += udlfb/
...@@ -312,7 +312,6 @@ static inline void dump_ieee80211_hdr(struct ieee80211_hdr *hdr, char *tag) ...@@ -312,7 +312,6 @@ static inline void dump_ieee80211_hdr(struct ieee80211_hdr *hdr, char *tag)
{ {
u16 fctl; u16 fctl;
int hdrlen; int hdrlen;
DECLARE_MAC_BUF(mac);
fctl = le16_to_cpu(hdr->frame_control); fctl = le16_to_cpu(hdr->frame_control);
switch (fctl & IEEE80211_FCTL_FTYPE) { switch (fctl & IEEE80211_FCTL_FTYPE) {
...@@ -375,13 +374,13 @@ static inline void dump_ieee80211_hdr(struct ieee80211_hdr *hdr, char *tag) ...@@ -375,13 +374,13 @@ static inline void dump_ieee80211_hdr(struct ieee80211_hdr *hdr, char *tag)
printk("FC=0x%04x DUR=0x%04x", printk("FC=0x%04x DUR=0x%04x",
fctl, le16_to_cpu(hdr->duration_id)); fctl, le16_to_cpu(hdr->duration_id));
if (hdrlen >= 10) if (hdrlen >= 10)
printk(" A1=%s", print_mac(mac, hdr->addr1)); printk(" A1=%pM", hdr->addr1);
if (hdrlen >= 16) if (hdrlen >= 16)
printk(" A2=%s", print_mac(mac, hdr->addr2)); printk(" A2=%pM", hdr->addr2);
if (hdrlen >= 24) if (hdrlen >= 24)
printk(" A3=%s", print_mac(mac, hdr->addr3)); printk(" A3=%pM", hdr->addr3);
if (hdrlen >= 30) if (hdrlen >= 30)
printk(" A4=%s", print_mac(mac, hdr->addr4)); printk(" A4=%pM", hdr->addr4);
printk("\n"); printk("\n");
} }
......
...@@ -58,15 +58,17 @@ static inline void agnx_interrupt_ack(struct agnx_priv *priv, u32 *reason) ...@@ -58,15 +58,17 @@ static inline void agnx_interrupt_ack(struct agnx_priv *priv, u32 *reason)
*reason |= AGNX_STAT_TXM; *reason |= AGNX_STAT_TXM;
} }
} }
/* if (*reason & AGNX_STAT_X) { #if 0
if (*reason & AGNX_STAT_X) {
reg = ioread32(ctl + AGNX_INT_STAT); reg = ioread32(ctl + AGNX_INT_STAT);
iowrite32(reg, ctl + AGNX_INT_STAT); iowrite32(reg, ctl + AGNX_INT_STAT);
/* FIXME reinit interrupt mask *\/ /* FIXME reinit interrupt mask */
reg = 0xc390bf9 & ~IRQ_TX_BEACON; reg = 0xc390bf9 & ~IRQ_TX_BEACON;
reg &= ~IRQ_TX_DISABLE; reg &= ~IRQ_TX_DISABLE;
iowrite32(reg, ctl + AGNX_INT_MASK); iowrite32(reg, ctl + AGNX_INT_MASK);
iowrite32(0x800, ctl + AGNX_CIR_BLKCTL); iowrite32(0x800, ctl + AGNX_CIR_BLKCTL);
} */ }
#endif
} /* agnx_interrupt_ack */ } /* agnx_interrupt_ack */
static irqreturn_t agnx_interrupt_handler(int irq, void *dev_id) static irqreturn_t agnx_interrupt_handler(int irq, void *dev_id)
...@@ -150,8 +152,7 @@ static int agnx_get_mac_address(struct agnx_priv *priv) ...@@ -150,8 +152,7 @@ static int agnx_get_mac_address(struct agnx_priv *priv)
*((u32 *)(priv->mac_addr + 2)) = cpu_to_le32(reg); *((u32 *)(priv->mac_addr + 2)) = cpu_to_le32(reg);
if (!is_valid_ether_addr(priv->mac_addr)) { if (!is_valid_ether_addr(priv->mac_addr)) {
DECLARE_MAC_BUF(mbuf); printk(KERN_WARNING PFX "read mac %pM\n", priv->mac_addr);
printk(KERN_WARNING PFX "read mac %s\n", print_mac(mbuf, priv->mac_addr));
printk(KERN_WARNING PFX "Invalid hwaddr! Using random hwaddr\n"); printk(KERN_WARNING PFX "Invalid hwaddr! Using random hwaddr\n");
random_ether_addr(priv->mac_addr); random_ether_addr(priv->mac_addr);
} }
...@@ -220,7 +221,7 @@ static void agnx_periodic_work_handler(struct work_struct *work) ...@@ -220,7 +221,7 @@ static void agnx_periodic_work_handler(struct work_struct *work)
/* TODO Recalibrate*/ /* TODO Recalibrate*/
/* calibrate_oscillator(priv); */ /* calibrate_oscillator(priv); */
/* antenna_calibrate(priv); */ /* antenna_calibrate(priv); */
/* agnx_send_packet(priv, 997); / /* agnx_send_packet(priv, 997); */
/* FIXME */ /* FIXME */
/* if (debug == 3) */ /* if (debug == 3) */
/* delay = msecs_to_jiffies(AGNX_PERIODIC_DELAY); */ /* delay = msecs_to_jiffies(AGNX_PERIODIC_DELAY); */
...@@ -455,47 +456,35 @@ static int __devinit agnx_pci_probe(struct pci_dev *pdev, ...@@ -455,47 +456,35 @@ static int __devinit agnx_pci_probe(struct pci_dev *pdev,
{ {
struct ieee80211_hw *dev; struct ieee80211_hw *dev;
struct agnx_priv *priv; struct agnx_priv *priv;
u32 mem_addr0, mem_len0;
u32 mem_addr1, mem_len1;
int err; int err;
DECLARE_MAC_BUF(mac);
err = pci_enable_device(pdev); err = pci_enable_device(pdev);
if (err) { if (err) {
printk(KERN_ERR PFX "Can't enable new PCI device\n"); dev_err(&pdev->dev, "can't enable pci device\n");
return err; return err;
} }
/* get pci resource */
mem_addr0 = pci_resource_start(pdev, 0);
mem_len0 = pci_resource_len(pdev, 0);
mem_addr1 = pci_resource_start(pdev, 1);
mem_len1 = pci_resource_len(pdev, 1);
printk(KERN_DEBUG PFX "Memaddr0 is %x, length is %x\n", mem_addr0, mem_len0);
printk(KERN_DEBUG PFX "Memaddr1 is %x, length is %x\n", mem_addr1, mem_len1);
err = pci_request_regions(pdev, "agnx-pci"); err = pci_request_regions(pdev, "agnx-pci");
if (err) { if (err) {
printk(KERN_ERR PFX "Can't obtain PCI resource\n"); dev_err(&pdev->dev, "can't reserve PCI resources\n");
return err; return err;
} }
if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32)) || if (pci_set_dma_mask(pdev, DMA_BIT_MASK(32)) ||
pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32))) { pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32))) {
printk(KERN_ERR PFX "No suitable DMA available\n"); dev_err(&pdev->dev, "no suitable DMA available\n");
err = -EIO;
goto err_free_reg; goto err_free_reg;
} }
pci_set_master(pdev); pci_set_master(pdev);
printk(KERN_DEBUG PFX "pdev->irq is %d\n", pdev->irq);
dev = ieee80211_alloc_hw(sizeof(*priv), &agnx_ops); dev = ieee80211_alloc_hw(sizeof(*priv), &agnx_ops);
if (!dev) { if (!dev) {
printk(KERN_ERR PFX "ieee80211 alloc failed\n"); dev_err(&pdev->dev, "ieee80211 alloc failed\n");
err = -ENOMEM; err = -ENOMEM;
goto err_free_reg; goto err_free_reg;
} }
/* init priv */
priv = dev->priv; priv = dev->priv;
memset(priv, 0, sizeof(*priv)); memset(priv, 0, sizeof(*priv));
priv->mode = NL80211_IFTYPE_MONITOR; priv->mode = NL80211_IFTYPE_MONITOR;
...@@ -504,17 +493,17 @@ static int __devinit agnx_pci_probe(struct pci_dev *pdev, ...@@ -504,17 +493,17 @@ static int __devinit agnx_pci_probe(struct pci_dev *pdev,
spin_lock_init(&priv->lock); spin_lock_init(&priv->lock);
priv->init_status = AGNX_UNINIT; priv->init_status = AGNX_UNINIT;
/* Map mem #1 and #2 */ priv->ctl = pci_iomap(pdev, 0, 0);
priv->ctl = pci_iomap(pdev, 0, mem_len0); /* dev_dbg(&pdev->dev, "MEM1 mapped address is 0x%p\n", priv->ctl); */
/* printk(KERN_DEBUG PFX"MEM1 mapped address is 0x%p\n", priv->ctl); */
if (!priv->ctl) { if (!priv->ctl) {
printk(KERN_ERR PFX "Can't map device memory\n"); dev_err(&pdev->dev, "can't map device memory\n");
err = -ENOMEM;
goto err_free_dev; goto err_free_dev;
} }
priv->data = pci_iomap(pdev, 1, mem_len1); priv->data = pci_iomap(pdev, 1, 0);
printk(KERN_DEBUG PFX "MEM2 mapped address is 0x%p\n", priv->data);
if (!priv->data) { if (!priv->data) {
printk(KERN_ERR PFX "Can't map device memory\n"); dev_err(&pdev->dev, "can't map device memory\n");
err = -ENOMEM;
goto err_iounmap2; goto err_iounmap2;
} }
...@@ -555,15 +544,15 @@ static int __devinit agnx_pci_probe(struct pci_dev *pdev, ...@@ -555,15 +544,15 @@ static int __devinit agnx_pci_probe(struct pci_dev *pdev,
err = ieee80211_register_hw(dev); err = ieee80211_register_hw(dev);
if (err) { if (err) {
printk(KERN_ERR PFX "Can't register hardware\n"); dev_err(&pdev->dev, "can't register hardware\n");
goto err_iounmap; goto err_iounmap;
} }
agnx_hw_reset(priv); agnx_hw_reset(priv);
dev_info(&pdev->dev, "%s: hwaddr %pM, Rev 0x%02x\n",
printk(PFX "%s: hwaddr %s, Rev 0x%02x\n", wiphy_name(dev->wiphy), wiphy_name(dev->wiphy),
print_mac(mac, dev->wiphy->perm_addr), priv->revid); dev->wiphy->perm_addr, priv->revid);
return 0; return 0;
err_iounmap: err_iounmap:
......
...@@ -118,7 +118,7 @@ static void mac_address_set(struct agnx_priv *priv) ...@@ -118,7 +118,7 @@ static void mac_address_set(struct agnx_priv *priv)
iowrite32(reg, ctl + AGNX_RXM_MACLO); iowrite32(reg, ctl + AGNX_RXM_MACLO);
} }
static void receiver_bssid_set(struct agnx_priv *priv, u8 *bssid) static void receiver_bssid_set(struct agnx_priv *priv, const u8 *bssid)
{ {
void __iomem *ctl = priv->ctl; void __iomem *ctl = priv->ctl;
u32 reg; u32 reg;
...@@ -954,7 +954,7 @@ int agnx_set_ssid(struct agnx_priv *priv, u8 *ssid, size_t ssid_len) ...@@ -954,7 +954,7 @@ int agnx_set_ssid(struct agnx_priv *priv, u8 *ssid, size_t ssid_len)
return 0; return 0;
} }
void agnx_set_bssid(struct agnx_priv *priv, u8 *bssid) void agnx_set_bssid(struct agnx_priv *priv, const u8 *bssid)
{ {
receiver_bssid_set(priv, bssid); receiver_bssid_set(priv, bssid);
} }
...@@ -401,7 +401,7 @@ u8 read_from_eeprom(struct agnx_priv *priv, u16 address); ...@@ -401,7 +401,7 @@ u8 read_from_eeprom(struct agnx_priv *priv, u16 address);
void agnx_hw_init(struct agnx_priv *priv); void agnx_hw_init(struct agnx_priv *priv);
int agnx_hw_reset(struct agnx_priv *priv); int agnx_hw_reset(struct agnx_priv *priv);
int agnx_set_ssid(struct agnx_priv *priv, u8 *ssid, size_t ssid_len); int agnx_set_ssid(struct agnx_priv *priv, u8 *ssid, size_t ssid_len);
void agnx_set_bssid(struct agnx_priv *priv, u8 *bssid); void agnx_set_bssid(struct agnx_priv *priv, const u8 *bssid);
void enable_power_saving(struct agnx_priv *priv); void enable_power_saving(struct agnx_priv *priv);
void disable_power_saving(struct agnx_priv *priv); void disable_power_saving(struct agnx_priv *priv);
void calibrate_antenna_period(unsigned long data); void calibrate_antenna_period(unsigned long data);
......
...@@ -22,7 +22,7 @@ void hash_read(struct agnx_priv *priv, u32 reghi, u32 reglo, u8 sta_id) ...@@ -22,7 +22,7 @@ void hash_read(struct agnx_priv *priv, u32 reghi, u32 reglo, u8 sta_id)
printk(PFX "RX hash cmd are : %.8x%.8x\n", reghi, reglo); printk(PFX "RX hash cmd are : %.8x%.8x\n", reghi, reglo);
} }
void hash_write(struct agnx_priv *priv, u8 *mac_addr, u8 sta_id) void hash_write(struct agnx_priv *priv, const u8 *mac_addr, u8 sta_id)
{ {
void __iomem *ctl = priv->ctl; void __iomem *ctl = priv->ctl;
u32 reghi, reglo; u32 reghi, reglo;
......
...@@ -201,7 +201,7 @@ struct agnx_beacon_hdr { ...@@ -201,7 +201,7 @@ struct agnx_beacon_hdr {
/* 802.11(abg) beacon */ /* 802.11(abg) beacon */
} __attribute__((__packed__)); } __attribute__((__packed__));
void hash_write(struct agnx_priv *priv, u8 *mac_addr, u8 sta_id); void hash_write(struct agnx_priv *priv, const u8 *mac_addr, u8 sta_id);
void hash_dump(struct agnx_priv *priv, u8 sta_id); void hash_dump(struct agnx_priv *priv, u8 sta_id);
void hash_read(struct agnx_priv *priv, u32 reghi, u32 reglo, u8 sta_id); void hash_read(struct agnx_priv *priv, u32 reghi, u32 reglo, u8 sta_id);
void hash_delete(struct agnx_priv *priv, u32 reghi, u32 reglo, u8 sta_id); void hash_delete(struct agnx_priv *priv, u32 reghi, u32 reglo, u8 sta_id);
......
...@@ -399,6 +399,7 @@ static inline void ape_chdma_desc_set(struct ape_chdma_desc *desc, dma_addr_t ad ...@@ -399,6 +399,7 @@ static inline void ape_chdma_desc_set(struct ape_chdma_desc *desc, dma_addr_t ad
desc->rc_addr_l = cpu_to_le32(pci_dma_l(addr)); desc->rc_addr_l = cpu_to_le32(pci_dma_l(addr));
} }
#if ALTPCIECHDMA_CDEV
/* /*
* ape_sg_to_chdma_table() - Create a device descriptor table from a scatterlist. * ape_sg_to_chdma_table() - Create a device descriptor table from a scatterlist.
* *
...@@ -456,6 +457,7 @@ static int ape_sg_to_chdma_table(struct scatterlist *sgl, int nents, int first, ...@@ -456,6 +457,7 @@ static int ape_sg_to_chdma_table(struct scatterlist *sgl, int nents, int first,
j++; j++;
return j; return j;
} }
#endif
/* compare buffers */ /* compare buffers */
static inline int compare(u32 *p, u32 *q, int len) static inline int compare(u32 *p, u32 *q, int len)
...@@ -540,8 +542,8 @@ static int __devinit dma_test(struct ape_dev *ape, struct pci_dev *dev) ...@@ -540,8 +542,8 @@ static int __devinit dma_test(struct ape_dev *ape, struct pci_dev *dev)
printk(KERN_DEBUG "Could not allocate coherent DMA buffer.\n"); printk(KERN_DEBUG "Could not allocate coherent DMA buffer.\n");
goto fail; goto fail;
} }
printk(KERN_DEBUG "Allocated cache-coherent DMA buffer (virtual address = 0x%016llx, bus address = 0x%016llx).\n", printk(KERN_DEBUG "Allocated cache-coherent DMA buffer (virtual address = %p, bus address = 0x%016llx).\n",
(u64)buffer_virt, (u64)buffer_bus); buffer_virt, (u64)buffer_bus);
/* fill first half of buffer with its virtual address as data */ /* fill first half of buffer with its virtual address as data */
for (i = 0; i < 4 * PAGE_SIZE; i += 4) for (i = 0; i < 4 * PAGE_SIZE; i += 4)
...@@ -783,7 +785,7 @@ static int __devinit probe(struct pci_dev *dev, const struct pci_device_id *id) ...@@ -783,7 +785,7 @@ static int __devinit probe(struct pci_dev *dev, const struct pci_device_id *id)
goto err_ape; goto err_ape;
} }
ape->pci_dev = dev; ape->pci_dev = dev;
dev->dev.driver_data = (void *)ape; dev_set_drvdata(&dev->dev, ape);
printk(KERN_DEBUG "probe() ape = 0x%p\n", ape); printk(KERN_DEBUG "probe() ape = 0x%p\n", ape);
printk(KERN_DEBUG "sizeof(struct ape_chdma_table) = %d.\n", printk(KERN_DEBUG "sizeof(struct ape_chdma_table) = %d.\n",
...@@ -801,8 +803,8 @@ static int __devinit probe(struct pci_dev *dev, const struct pci_device_id *id) ...@@ -801,8 +803,8 @@ static int __devinit probe(struct pci_dev *dev, const struct pci_device_id *id)
goto err_table; goto err_table;
} }
printk(KERN_DEBUG "table_virt = 0x%16llx, table_bus = 0x%16llx.\n", printk(KERN_DEBUG "table_virt = %p, table_bus = 0x%16llx.\n",
(u64)ape->table_virt, (u64)ape->table_bus); ape->table_virt, (u64)ape->table_bus);
/* enable device */ /* enable device */
rc = pci_enable_device(dev); rc = pci_enable_device(dev);
...@@ -913,9 +915,11 @@ static int __devinit probe(struct pci_dev *dev, const struct pci_device_id *id) ...@@ -913,9 +915,11 @@ static int __devinit probe(struct pci_dev *dev, const struct pci_device_id *id)
rc = 0; rc = 0;
printk(KERN_DEBUG "probe() successful.\n"); printk(KERN_DEBUG "probe() successful.\n");
goto end; goto end;
#if ALTPCIECHDMA_CDEV
err_cdev: err_cdev:
/* unmap the BARs */ /* unmap the BARs */
unmap_bars(ape, dev); unmap_bars(ape, dev);
#endif
err_map: err_map:
/* free allocated irq */ /* free allocated irq */
if (ape->irq_line >= 0) if (ape->irq_line >= 0)
...@@ -930,7 +934,7 @@ static int __devinit probe(struct pci_dev *dev, const struct pci_device_id *id) ...@@ -930,7 +934,7 @@ static int __devinit probe(struct pci_dev *dev, const struct pci_device_id *id)
pci_release_regions(dev); pci_release_regions(dev);
err_mask: err_mask:
err_regions: err_regions:
err_rev: /*err_rev:*/
/* clean up everything before device enable() */ /* clean up everything before device enable() */
err_enable: err_enable:
if (ape->table_virt) if (ape->table_virt)
...@@ -946,19 +950,11 @@ static int __devinit probe(struct pci_dev *dev, const struct pci_device_id *id) ...@@ -946,19 +950,11 @@ static int __devinit probe(struct pci_dev *dev, const struct pci_device_id *id)
static void __devexit remove(struct pci_dev *dev) static void __devexit remove(struct pci_dev *dev)
{ {
struct ape_dev *ape; struct ape_dev *ape = dev_get_drvdata(&dev->dev);
printk(KERN_DEBUG "remove(0x%p)\n", dev); printk(KERN_DEBUG "remove(0x%p)\n", dev);
if ((dev == 0) || (dev->dev.driver_data == 0)) { printk(KERN_DEBUG "remove(dev = 0x%p) where ape = 0x%p\n", dev, ape);
printk(KERN_DEBUG "remove(dev = 0x%p) dev->dev.driver_data = 0x%p\n",
dev, (dev? dev->dev.driver_data: NULL));
return;
}
ape = (struct ape_dev *)dev->dev.driver_data;
printk(KERN_DEBUG "remove(dev = 0x%p) where dev->dev.driver_data = 0x%p\n", dev, ape);
if (ape->pci_dev != dev) {
printk(KERN_DEBUG "dev->dev.driver_data->pci_dev (0x%08lx) != dev (0x%08lx)\n",
(unsigned long)ape->pci_dev, (unsigned long)dev);
}
/* remove character device */ /* remove character device */
#if ALTPCIECHDMA_CDEV #if ALTPCIECHDMA_CDEV
sg_exit(ape); sg_exit(ape);
...@@ -1151,7 +1147,7 @@ static struct pci_driver pci_driver = { ...@@ -1151,7 +1147,7 @@ static struct pci_driver pci_driver = {
.name = DRV_NAME, .name = DRV_NAME,
.id_table = ids, .id_table = ids,
.probe = probe, .probe = probe,
.remove = remove, .remove = __devexit_p(remove),
/* resume, suspend are optional */ /* resume, suspend are optional */
}; };
......
...@@ -6,6 +6,8 @@ config ANDROID ...@@ -6,6 +6,8 @@ config ANDROID
---help--- ---help---
Enable support for various drivers needed on the Android platform Enable support for various drivers needed on the Android platform
if ANDROID
config ANDROID_BINDER_IPC config ANDROID_BINDER_IPC
bool "Android Binder IPC Driver" bool "Android Binder IPC Driver"
default n default n
...@@ -73,9 +75,13 @@ config ANDROID_RAM_CONSOLE_EARLY_SIZE ...@@ -73,9 +75,13 @@ config ANDROID_RAM_CONSOLE_EARLY_SIZE
default 0 default 0
depends on ANDROID_RAM_CONSOLE_EARLY_INIT depends on ANDROID_RAM_CONSOLE_EARLY_INIT
config ANDROID_TIMED_OUTPUT
bool "Timed output class driver"
default y
config ANDROID_TIMED_GPIO config ANDROID_TIMED_GPIO
tristate "Android timed gpio driver" tristate "Android timed gpio driver"
depends on GENERIC_GPIO depends on GENERIC_GPIO && ANDROID_TIMED_OUTPUT
default n default n
config ANDROID_LOW_MEMORY_KILLER config ANDROID_LOW_MEMORY_KILLER
...@@ -84,4 +90,6 @@ config ANDROID_LOW_MEMORY_KILLER ...@@ -84,4 +90,6 @@ config ANDROID_LOW_MEMORY_KILLER
---help--- ---help---
Register processes to be killed when memory is low Register processes to be killed when memory is low
endif # if ANDROID
endmenu endmenu
obj-$(CONFIG_ANDROID_BINDER_IPC) += binder.o obj-$(CONFIG_ANDROID_BINDER_IPC) += binder.o
obj-$(CONFIG_ANDROID_LOGGER) += logger.o obj-$(CONFIG_ANDROID_LOGGER) += logger.o
obj-$(CONFIG_ANDROID_RAM_CONSOLE) += ram_console.o obj-$(CONFIG_ANDROID_RAM_CONSOLE) += ram_console.o
obj-$(CONFIG_ANDROID_TIMED_OUTPUT) += timed_output.o
obj-$(CONFIG_ANDROID_TIMED_GPIO) += timed_gpio.o obj-$(CONFIG_ANDROID_TIMED_GPIO) += timed_gpio.o
obj-$(CONFIG_ANDROID_LOW_MEMORY_KILLER) += lowmemorykiller.o obj-$(CONFIG_ANDROID_LOW_MEMORY_KILLER) += lowmemorykiller.o
此差异已折叠。
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
* mutex 'mutex'. * mutex 'mutex'.
*/ */
struct logger_log { struct logger_log {
unsigned char * buffer; /* the ring buffer itself */ unsigned char *buffer;/* the ring buffer itself */
struct miscdevice misc; /* misc device representing the log */ struct miscdevice misc; /* misc device representing the log */
wait_queue_head_t wq; /* wait queue for readers */ wait_queue_head_t wq; /* wait queue for readers */
struct list_head readers; /* this log's readers */ struct list_head readers; /* this log's readers */
...@@ -52,7 +52,7 @@ struct logger_log { ...@@ -52,7 +52,7 @@ struct logger_log {
* reference counting. The structure is protected by log->mutex. * reference counting. The structure is protected by log->mutex.
*/ */
struct logger_reader { struct logger_reader {
struct logger_log * log; /* associated log */ struct logger_log *log; /* associated log */
struct list_head list; /* entry in logger_log's list */ struct list_head list; /* entry in logger_log's list */
size_t r_off; /* current read head offset */ size_t r_off; /* current read head offset */
}; };
...@@ -74,7 +74,7 @@ struct logger_reader { ...@@ -74,7 +74,7 @@ struct logger_reader {
* file->logger_log. Thus what file->private_data points at depends on whether * file->logger_log. Thus what file->private_data points at depends on whether
* or not the file was opened for reading. This function hides that dirtiness. * or not the file was opened for reading. This function hides that dirtiness.
*/ */
static inline struct logger_log * file_get_log(struct file *file) static inline struct logger_log *file_get_log(struct file *file)
{ {
if (file->f_mode & FMODE_READ) { if (file->f_mode & FMODE_READ) {
struct logger_reader *reader = file->private_data; struct logger_reader *reader = file->private_data;
...@@ -379,7 +379,7 @@ ssize_t logger_aio_write(struct kiocb *iocb, const struct iovec *iov, ...@@ -379,7 +379,7 @@ ssize_t logger_aio_write(struct kiocb *iocb, const struct iovec *iov,
return ret; return ret;
} }
static struct logger_log * get_log_from_minor(int); static struct logger_log *get_log_from_minor(int);
/* /*
* logger_open - the log's open() file operation * logger_open - the log's open() file operation
...@@ -519,7 +519,7 @@ static long logger_ioctl(struct file *file, unsigned int cmd, unsigned long arg) ...@@ -519,7 +519,7 @@ static long logger_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
return ret; return ret;
} }
static struct file_operations logger_fops = { static const struct file_operations logger_fops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.read = logger_read, .read = logger_read,
.aio_write = logger_aio_write, .aio_write = logger_aio_write,
...@@ -557,7 +557,7 @@ DEFINE_LOGGER_DEVICE(log_main, LOGGER_LOG_MAIN, 64*1024) ...@@ -557,7 +557,7 @@ DEFINE_LOGGER_DEVICE(log_main, LOGGER_LOG_MAIN, 64*1024)
DEFINE_LOGGER_DEVICE(log_events, LOGGER_LOG_EVENTS, 256*1024) DEFINE_LOGGER_DEVICE(log_events, LOGGER_LOG_EVENTS, 256*1024)
DEFINE_LOGGER_DEVICE(log_radio, LOGGER_LOG_RADIO, 64*1024) DEFINE_LOGGER_DEVICE(log_radio, LOGGER_LOG_RADIO, 64*1024)
static struct logger_log * get_log_from_minor(int minor) static struct logger_log *get_log_from_minor(int minor)
{ {
if (log_main.misc.minor == minor) if (log_main.misc.minor == minor)
return &log_main; return &log_main;
......
...@@ -34,18 +34,24 @@ static int lowmem_adj[6] = { ...@@ -34,18 +34,24 @@ static int lowmem_adj[6] = {
}; };
static int lowmem_adj_size = 4; static int lowmem_adj_size = 4;
static size_t lowmem_minfree[6] = { static size_t lowmem_minfree[6] = {
3*512, // 6MB 3 * 512, /* 6MB */
2*1024, // 8MB 2 * 1024, /* 8MB */
4*1024, // 16MB 4 * 1024, /* 16MB */
16*1024, // 64MB 16 * 1024, /* 64MB */
}; };
static int lowmem_minfree_size = 4; static int lowmem_minfree_size = 4;
#define lowmem_print(level, x...) do { if(lowmem_debug_level >= (level)) printk(x); } while(0) #define lowmem_print(level, x...) \
do { \
if (lowmem_debug_level >= (level)) \
printk(x); \
} while (0)
module_param_named(cost, lowmem_shrinker.seeks, int, S_IRUGO | S_IWUSR); module_param_named(cost, lowmem_shrinker.seeks, int, S_IRUGO | S_IWUSR);
module_param_array_named(adj, lowmem_adj, int, &lowmem_adj_size, S_IRUGO | S_IWUSR); module_param_array_named(adj, lowmem_adj, int, &lowmem_adj_size,
module_param_array_named(minfree, lowmem_minfree, uint, &lowmem_minfree_size, S_IRUGO | S_IWUSR); S_IRUGO | S_IWUSR);
module_param_array_named(minfree, lowmem_minfree, uint, &lowmem_minfree_size,
S_IRUGO | S_IWUSR);
module_param_named(debug_level, lowmem_debug_level, uint, S_IRUGO | S_IWUSR); module_param_named(debug_level, lowmem_debug_level, uint, S_IRUGO | S_IWUSR);
static int lowmem_shrink(int nr_to_scan, gfp_t gfp_mask) static int lowmem_shrink(int nr_to_scan, gfp_t gfp_mask)
...@@ -57,46 +63,77 @@ static int lowmem_shrink(int nr_to_scan, gfp_t gfp_mask) ...@@ -57,46 +63,77 @@ static int lowmem_shrink(int nr_to_scan, gfp_t gfp_mask)
int i; int i;
int min_adj = OOM_ADJUST_MAX + 1; int min_adj = OOM_ADJUST_MAX + 1;
int selected_tasksize = 0; int selected_tasksize = 0;
int selected_oom_adj;
int array_size = ARRAY_SIZE(lowmem_adj); int array_size = ARRAY_SIZE(lowmem_adj);
int other_free = global_page_state(NR_FREE_PAGES) + global_page_state(NR_FILE_PAGES); int other_free = global_page_state(NR_FREE_PAGES);
if(lowmem_adj_size < array_size) int other_file = global_page_state(NR_FILE_PAGES);
if (lowmem_adj_size < array_size)
array_size = lowmem_adj_size; array_size = lowmem_adj_size;
if(lowmem_minfree_size < array_size) if (lowmem_minfree_size < array_size)
array_size = lowmem_minfree_size; array_size = lowmem_minfree_size;
for(i = 0; i < array_size; i++) { for (i = 0; i < array_size; i++) {
if(other_free < lowmem_minfree[i]) { if (other_free < lowmem_minfree[i] &&
other_file < lowmem_minfree[i]) {
min_adj = lowmem_adj[i]; min_adj = lowmem_adj[i];
break; break;
} }
} }
if(nr_to_scan > 0) if (nr_to_scan > 0)
lowmem_print(3, "lowmem_shrink %d, %x, ofree %d, ma %d\n", nr_to_scan, gfp_mask, other_free, min_adj); lowmem_print(3, "lowmem_shrink %d, %x, ofree %d %d, ma %d\n",
nr_to_scan, gfp_mask, other_free, other_file,
min_adj);
rem = global_page_state(NR_ACTIVE_ANON) +
global_page_state(NR_ACTIVE_FILE) +
global_page_state(NR_INACTIVE_ANON) +
global_page_state(NR_INACTIVE_FILE);
if (nr_to_scan <= 0 || min_adj == OOM_ADJUST_MAX + 1) {
lowmem_print(5, "lowmem_shrink %d, %x, return %d\n",
nr_to_scan, gfp_mask, rem);
return rem;
}
selected_oom_adj = min_adj;
read_lock(&tasklist_lock); read_lock(&tasklist_lock);
for_each_process(p) { for_each_process(p) {
if(p->oomkilladj >= 0 && p->mm) { int oom_adj;
tasksize = get_mm_rss(p->mm);
if(nr_to_scan > 0 && tasksize > 0 && p->oomkilladj >= min_adj) { task_lock(p);
if(selected == NULL || if (!p->mm) {
p->oomkilladj > selected->oomkilladj || task_unlock(p);
(p->oomkilladj == selected->oomkilladj && continue;
tasksize > selected_tasksize)) { }
selected = p; oom_adj = p->oomkilladj;
selected_tasksize = tasksize; if (oom_adj < min_adj) {
lowmem_print(2, "select %d (%s), adj %d, size %d, to kill\n", task_unlock(p);
p->pid, p->comm, p->oomkilladj, tasksize); continue;
} }
} tasksize = get_mm_rss(p->mm);
rem += tasksize; task_unlock(p);
if (tasksize <= 0)
continue;
if (selected) {
if (oom_adj < selected_oom_adj)
continue;
if (oom_adj == selected_oom_adj &&
tasksize <= selected_tasksize)
continue;
} }
selected = p;
selected_tasksize = tasksize;
selected_oom_adj = oom_adj;
lowmem_print(2, "select %d (%s), adj %d, size %d, to kill\n",
p->pid, p->comm, oom_adj, tasksize);
} }
if(selected != NULL) { if (selected) {
lowmem_print(1, "send sigkill to %d (%s), adj %d, size %d\n", lowmem_print(1, "send sigkill to %d (%s), adj %d, size %d\n",
selected->pid, selected->comm, selected->pid, selected->comm,
selected->oomkilladj, selected_tasksize); selected_oom_adj, selected_tasksize);
force_sig(SIGKILL, selected); force_sig(SIGKILL, selected);
rem -= selected_tasksize; rem -= selected_tasksize;
} }
lowmem_print(4, "lowmem_shrink %d, %x, return %d\n", nr_to_scan, gfp_mask, rem); lowmem_print(4, "lowmem_shrink %d, %x, return %d\n",
nr_to_scan, gfp_mask, rem);
read_unlock(&tasklist_lock); read_unlock(&tasklist_lock);
return rem; return rem;
} }
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <linux/string.h> #include <linux/string.h>
#include <linux/uaccess.h> #include <linux/uaccess.h>
#include <asm/io.h> #include <linux/io.h>
#ifdef CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION #ifdef CONFIG_ANDROID_RAM_CONSOLE_ERROR_CORRECTION
#include <linux/rslib.h> #include <linux/rslib.h>
...@@ -225,8 +225,9 @@ static int __init ram_console_init(struct ram_console_buffer *buffer, ...@@ -225,8 +225,9 @@ static int __init ram_console_init(struct ram_console_buffer *buffer,
buffer_size - sizeof(struct ram_console_buffer); buffer_size - sizeof(struct ram_console_buffer);
if (ram_console_buffer_size > buffer_size) { if (ram_console_buffer_size > buffer_size) {
pr_err("ram_console: buffer %p, invalid size %zu, datasize %zu\n", pr_err("ram_console: buffer %p, invalid size %zu, "
buffer, buffer_size, ram_console_buffer_size); "datasize %zu\n", buffer, buffer_size,
ram_console_buffer_size);
return 0; return 0;
} }
...@@ -365,7 +366,7 @@ static ssize_t ram_console_read_old(struct file *file, char __user *buf, ...@@ -365,7 +366,7 @@ static ssize_t ram_console_read_old(struct file *file, char __user *buf,
return count; return count;
} }
static struct file_operations ram_console_file_ops = { static const struct file_operations ram_console_file_ops = {
.owner = THIS_MODULE, .owner = THIS_MODULE,
.read = ram_console_read_old, .read = ram_console_read_old,
}; };
......
...@@ -20,13 +20,12 @@ ...@@ -20,13 +20,12 @@
#include <linux/err.h> #include <linux/err.h>
#include <linux/gpio.h> #include <linux/gpio.h>
#include "timed_output.h"
#include "timed_gpio.h" #include "timed_gpio.h"
static struct class *timed_gpio_class;
struct timed_gpio_data { struct timed_gpio_data {
struct device *dev; struct timed_output_dev dev;
struct hrtimer timer; struct hrtimer timer;
spinlock_t lock; spinlock_t lock;
unsigned gpio; unsigned gpio;
...@@ -36,70 +35,62 @@ struct timed_gpio_data { ...@@ -36,70 +35,62 @@ struct timed_gpio_data {
static enum hrtimer_restart gpio_timer_func(struct hrtimer *timer) static enum hrtimer_restart gpio_timer_func(struct hrtimer *timer)
{ {
struct timed_gpio_data *gpio_data = container_of(timer, struct timed_gpio_data, timer); struct timed_gpio_data *data =
container_of(timer, struct timed_gpio_data, timer);
gpio_direction_output(gpio_data->gpio, gpio_data->active_low ? 1 : 0); gpio_direction_output(data->gpio, data->active_low ? 1 : 0);
return HRTIMER_NORESTART; return HRTIMER_NORESTART;
} }
static ssize_t gpio_enable_show(struct device *dev, struct device_attribute *attr, char *buf) static int gpio_get_time(struct timed_output_dev *dev)
{ {
struct timed_gpio_data *gpio_data = dev_get_drvdata(dev); struct timed_gpio_data *data =
int remaining; container_of(dev, struct timed_gpio_data, dev);
if (hrtimer_active(&gpio_data->timer)) { if (hrtimer_active(&data->timer)) {
ktime_t r = hrtimer_get_remaining(&gpio_data->timer); ktime_t r = hrtimer_get_remaining(&data->timer);
struct timeval t = ktime_to_timeval(r); struct timeval t = ktime_to_timeval(r);
remaining = t.tv_sec * 1000 + t.tv_usec / 1000; return t.tv_sec * 1000 + t.tv_usec / 1000;
} else } else
remaining = 0; return 0;
return sprintf(buf, "%d\n", remaining);
} }
static ssize_t gpio_enable_store( static void gpio_enable(struct timed_output_dev *dev, int value)
struct device *dev, struct device_attribute *attr,
const char *buf, size_t size)
{ {
struct timed_gpio_data *gpio_data = dev_get_drvdata(dev); struct timed_gpio_data *data =
int value; container_of(dev, struct timed_gpio_data, dev);
unsigned long flags; unsigned long flags;
sscanf(buf, "%d", &value); spin_lock_irqsave(&data->lock, flags);
spin_lock_irqsave(&gpio_data->lock, flags);
/* cancel previous timer and set GPIO according to value */ /* cancel previous timer and set GPIO according to value */
hrtimer_cancel(&gpio_data->timer); hrtimer_cancel(&data->timer);
gpio_direction_output(gpio_data->gpio, gpio_data->active_low ? !value : !!value); gpio_direction_output(data->gpio, data->active_low ? !value : !!value);
if (value > 0) { if (value > 0) {
if (value > gpio_data->max_timeout) if (value > data->max_timeout)
value = gpio_data->max_timeout; value = data->max_timeout;
hrtimer_start(&gpio_data->timer, hrtimer_start(&data->timer,
ktime_set(value / 1000, (value % 1000) * 1000000), ktime_set(value / 1000, (value % 1000) * 1000000),
HRTIMER_MODE_REL); HRTIMER_MODE_REL);
} }
spin_unlock_irqrestore(&gpio_data->lock, flags); spin_unlock_irqrestore(&data->lock, flags);
return size;
} }
static DEVICE_ATTR(enable, S_IRUGO | S_IWUSR, gpio_enable_show, gpio_enable_store);
static int timed_gpio_probe(struct platform_device *pdev) static int timed_gpio_probe(struct platform_device *pdev)
{ {
struct timed_gpio_platform_data *pdata = pdev->dev.platform_data; struct timed_gpio_platform_data *pdata = pdev->dev.platform_data;
struct timed_gpio *cur_gpio; struct timed_gpio *cur_gpio;
struct timed_gpio_data *gpio_data, *gpio_dat; struct timed_gpio_data *gpio_data, *gpio_dat;
int i, ret = 0; int i, j, ret = 0;
if (!pdata) if (!pdata)
return -EBUSY; return -EBUSY;
gpio_data = kzalloc(sizeof(struct timed_gpio_data) * pdata->num_gpios, GFP_KERNEL); gpio_data = kzalloc(sizeof(struct timed_gpio_data) * pdata->num_gpios,
GFP_KERNEL);
if (!gpio_data) if (!gpio_data)
return -ENOMEM; return -ENOMEM;
...@@ -107,23 +98,26 @@ static int timed_gpio_probe(struct platform_device *pdev) ...@@ -107,23 +98,26 @@ static int timed_gpio_probe(struct platform_device *pdev)
cur_gpio = &pdata->gpios[i]; cur_gpio = &pdata->gpios[i];
gpio_dat = &gpio_data[i]; gpio_dat = &gpio_data[i];
hrtimer_init(&gpio_dat->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL); hrtimer_init(&gpio_dat->timer, CLOCK_MONOTONIC,
HRTIMER_MODE_REL);
gpio_dat->timer.function = gpio_timer_func; gpio_dat->timer.function = gpio_timer_func;
spin_lock_init(&gpio_dat->lock); spin_lock_init(&gpio_dat->lock);
gpio_dat->dev.name = cur_gpio->name;
gpio_dat->dev.get_time = gpio_get_time;
gpio_dat->dev.enable = gpio_enable;
ret = timed_output_dev_register(&gpio_dat->dev);
if (ret < 0) {
for (j = 0; j < i; j++)
timed_output_dev_unregister(&gpio_data[i].dev);
kfree(gpio_data);
return ret;
}
gpio_dat->gpio = cur_gpio->gpio; gpio_dat->gpio = cur_gpio->gpio;
gpio_dat->max_timeout = cur_gpio->max_timeout; gpio_dat->max_timeout = cur_gpio->max_timeout;
gpio_dat->active_low = cur_gpio->active_low; gpio_dat->active_low = cur_gpio->active_low;
gpio_direction_output(gpio_dat->gpio, gpio_dat->active_low); gpio_direction_output(gpio_dat->gpio, gpio_dat->active_low);
gpio_dat->dev = device_create(timed_gpio_class, &pdev->dev, 0, "%s", cur_gpio->name);
if (unlikely(IS_ERR(gpio_dat->dev)))
return PTR_ERR(gpio_dat->dev);
dev_set_drvdata(gpio_dat->dev, gpio_dat);
ret = device_create_file(gpio_dat->dev, &dev_attr_enable);
if (ret)
return ret;
} }
platform_set_drvdata(pdev, gpio_data); platform_set_drvdata(pdev, gpio_data);
...@@ -137,10 +131,8 @@ static int timed_gpio_remove(struct platform_device *pdev) ...@@ -137,10 +131,8 @@ static int timed_gpio_remove(struct platform_device *pdev)
struct timed_gpio_data *gpio_data = platform_get_drvdata(pdev); struct timed_gpio_data *gpio_data = platform_get_drvdata(pdev);
int i; int i;
for (i = 0; i < pdata->num_gpios; i++) { for (i = 0; i < pdata->num_gpios; i++)
device_remove_file(gpio_data[i].dev, &dev_attr_enable); timed_output_dev_unregister(&gpio_data[i].dev);
device_unregister(gpio_data[i].dev);
}
kfree(gpio_data); kfree(gpio_data);
...@@ -151,22 +143,18 @@ static struct platform_driver timed_gpio_driver = { ...@@ -151,22 +143,18 @@ static struct platform_driver timed_gpio_driver = {
.probe = timed_gpio_probe, .probe = timed_gpio_probe,
.remove = timed_gpio_remove, .remove = timed_gpio_remove,
.driver = { .driver = {
.name = "timed-gpio", .name = TIMED_GPIO_NAME,
.owner = THIS_MODULE, .owner = THIS_MODULE,
}, },
}; };
static int __init timed_gpio_init(void) static int __init timed_gpio_init(void)
{ {
timed_gpio_class = class_create(THIS_MODULE, "timed_output");
if (IS_ERR(timed_gpio_class))
return PTR_ERR(timed_gpio_class);
return platform_driver_register(&timed_gpio_driver); return platform_driver_register(&timed_gpio_driver);
} }
static void __exit timed_gpio_exit(void) static void __exit timed_gpio_exit(void)
{ {
class_destroy(timed_gpio_class);
platform_driver_unregister(&timed_gpio_driver); platform_driver_unregister(&timed_gpio_driver);
} }
......
...@@ -16,10 +16,12 @@ ...@@ -16,10 +16,12 @@
#ifndef _LINUX_TIMED_GPIO_H #ifndef _LINUX_TIMED_GPIO_H
#define _LINUX_TIMED_GPIO_H #define _LINUX_TIMED_GPIO_H
#define TIMED_GPIO_NAME "timed-gpio"
struct timed_gpio { struct timed_gpio {
const char *name; const char *name;
unsigned gpio; unsigned gpio;
int max_timeout; int max_timeout;
u8 active_low; u8 active_low;
}; };
......
/* drivers/misc/timed_output.c
*
* Copyright (C) 2009 Google, Inc.
* Author: Mike Lockwood <lockwood@android.com>
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* 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.
*
*/
#include <linux/module.h>
#include <linux/types.h>
#include <linux/device.h>
#include <linux/fs.h>
#include <linux/err.h>
#include "timed_output.h"
static struct class *timed_output_class;
static atomic_t device_count;
static ssize_t enable_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
struct timed_output_dev *tdev = dev_get_drvdata(dev);
int remaining = tdev->get_time(tdev);
return sprintf(buf, "%d\n", remaining);
}
static ssize_t enable_store(
struct device *dev, struct device_attribute *attr,
const char *buf, size_t size)
{
struct timed_output_dev *tdev = dev_get_drvdata(dev);
int value;
sscanf(buf, "%d", &value);
tdev->enable(tdev, value);
return size;
}
static DEVICE_ATTR(enable, S_IRUGO | S_IWUSR, enable_show, enable_store);
static int create_timed_output_class(void)
{
if (!timed_output_class) {
timed_output_class = class_create(THIS_MODULE, "timed_output");
if (IS_ERR(timed_output_class))
return PTR_ERR(timed_output_class);
atomic_set(&device_count, 0);
}
return 0;
}
int timed_output_dev_register(struct timed_output_dev *tdev)
{
int ret;
if (!tdev || !tdev->name || !tdev->enable || !tdev->get_time)
return -EINVAL;
ret = create_timed_output_class();
if (ret < 0)
return ret;
tdev->index = atomic_inc_return(&device_count);
tdev->dev = device_create(timed_output_class, NULL,
MKDEV(0, tdev->index), NULL, tdev->name);
if (IS_ERR(tdev->dev))
return PTR_ERR(tdev->dev);
ret = device_create_file(tdev->dev, &dev_attr_enable);
if (ret < 0)
goto err_create_file;
dev_set_drvdata(tdev->dev, tdev);
tdev->state = 0;
return 0;
err_create_file:
device_destroy(timed_output_class, MKDEV(0, tdev->index));
printk(KERN_ERR "timed_output: Failed to register driver %s\n",
tdev->name);
return ret;
}
EXPORT_SYMBOL_GPL(timed_output_dev_register);
void timed_output_dev_unregister(struct timed_output_dev *tdev)
{
device_remove_file(tdev->dev, &dev_attr_enable);
device_destroy(timed_output_class, MKDEV(0, tdev->index));
dev_set_drvdata(tdev->dev, NULL);
}
EXPORT_SYMBOL_GPL(timed_output_dev_unregister);
static int __init timed_output_init(void)
{
return create_timed_output_class();
}
static void __exit timed_output_exit(void)
{
class_destroy(timed_output_class);
}
module_init(timed_output_init);
module_exit(timed_output_exit);
MODULE_AUTHOR("Mike Lockwood <lockwood@android.com>");
MODULE_DESCRIPTION("timed output class driver");
MODULE_LICENSE("GPL");
/* include/linux/timed_output.h
*
* Copyright (C) 2008 Google, Inc.
*
* This software is licensed under the terms of the GNU General Public
* License version 2, as published by the Free Software Foundation, and
* may be copied, distributed, and modified under those terms.
*
* 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.
*
*/
#ifndef _LINUX_TIMED_OUTPUT_H
#define _LINUX_TIMED_OUTPUT_H
struct timed_output_dev {
const char *name;
/* enable the output and set the timer */
void (*enable)(struct timed_output_dev *sdev, int timeout);
/* returns the current number of milliseconds remaining on the timer */
int (*get_time)(struct timed_output_dev *sdev);
/* private data */
struct device *dev;
int index;
int state;
};
extern int timed_output_dev_register(struct timed_output_dev *dev);
extern void timed_output_dev_unregister(struct timed_output_dev *dev);
#endif
...@@ -516,7 +516,7 @@ static ssize_t odev_set_picture(struct asus_oled_dev *odev, const char *buf, siz ...@@ -516,7 +516,7 @@ static ssize_t odev_set_picture(struct asus_oled_dev *odev, const char *buf, siz
max_offs = odev->width * odev->height; max_offs = odev->width * odev->height;
while (offs < count && odev->buf_offs < max_offs) { while (offs < count && odev->buf_offs < max_offs) {
int ret; int ret = 0;
if (buf[offs] == '1' || buf[offs] == '#') { if (buf[offs] == '1' || buf[offs] == '#') {
ret = append_values(odev, 1, 1); ret = append_values(odev, 1, 1);
......
...@@ -35,14 +35,13 @@ ...@@ -35,14 +35,13 @@
#include <linux/poll.h> #include <linux/poll.h>
#include <linux/wait.h> #include <linux/wait.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/version.h>
#include <linux/uaccess.h> #include <linux/uaccess.h>
static unsigned int b3dfg_nbuf = 2; static unsigned int b3dfg_nbuf = 2;
module_param_named(buffer_count, b3dfg_nbuf, uint, 0444); module_param_named(buffer_count, b3dfg_nbuf, uint, 0444);
MODULE_PARM_DESC(buffer_count, "Number of buffers (min 2, default 2)\n"); MODULE_PARM_DESC(buffer_count, "Number of buffers (min 2, default 2)");
MODULE_AUTHOR("Daniel Drake <ddrake@brontes3d.com>"); MODULE_AUTHOR("Daniel Drake <ddrake@brontes3d.com>");
MODULE_DESCRIPTION("Brontes frame grabber driver"); MODULE_DESCRIPTION("Brontes frame grabber driver");
......
...@@ -13,13 +13,6 @@ config COMEDI_DEBUG ...@@ -13,13 +13,6 @@ config COMEDI_DEBUG
This is an option for use by developers; most people should This is an option for use by developers; most people should
say N here. This enables comedi core and driver debugging. say N here. This enables comedi core and driver debugging.
config COMEDI_RT
tristate "Comedi Real-time support"
depends on COMEDI && RT
default N
---help---
Enable Real time support for the Comedi core.
config COMEDI_PCI_DRIVERS config COMEDI_PCI_DRIVERS
tristate "Comedi PCI drivers" tristate "Comedi PCI drivers"
depends on COMEDI && PCI depends on COMEDI && PCI
...@@ -29,10 +22,10 @@ config COMEDI_PCI_DRIVERS ...@@ -29,10 +22,10 @@ config COMEDI_PCI_DRIVERS
config COMEDI_PCMCIA_DRIVERS config COMEDI_PCMCIA_DRIVERS
tristate "Comedi PCMCIA drivers" tristate "Comedi PCMCIA drivers"
depends on COMEDI && PCMCIAI depends on COMEDI && PCMCIA && PCCARD
default N default N
---help--- ---help---
Enable lots of comedi PCMCIA drivers to be built Enable lots of comedi PCMCIA and PCCARD drivers to be built
config COMEDI_USB_DRIVERS config COMEDI_USB_DRIVERS
tristate "Comedi USB drivers" tristate "Comedi USB drivers"
......
obj-$(CONFIG_COMEDI) += comedi.o obj-$(CONFIG_COMEDI) += comedi.o
obj-$(CONFIG_COMEDI_RT) += comedi_rt.o
obj-$(CONFIG_COMEDI) += kcomedilib/ obj-$(CONFIG_COMEDI) += kcomedilib/
obj-$(CONFIG_COMEDI) += drivers/ obj-$(CONFIG_COMEDI) += drivers/
...@@ -11,7 +10,3 @@ comedi-objs := \ ...@@ -11,7 +10,3 @@ comedi-objs := \
drivers.o \ drivers.o \
comedi_compat32.o \ comedi_compat32.o \
comedi_ksyms.o \ comedi_ksyms.o \
comedi_rt-objs := \
rt_pend_tq.o \
rt.o
...@@ -188,7 +188,6 @@ extern "C" { ...@@ -188,7 +188,6 @@ extern "C" {
#define SDF_WRITABLE 0x00020000 /* subdevice can be written (e.g. analog output) */ #define SDF_WRITABLE 0x00020000 /* subdevice can be written (e.g. analog output) */
#define SDF_WRITEABLE SDF_WRITABLE /* spelling error in API */ #define SDF_WRITEABLE SDF_WRITABLE /* spelling error in API */
#define SDF_INTERNAL 0x00040000 /* subdevice does not have externally visible lines */ #define SDF_INTERNAL 0x00040000 /* subdevice does not have externally visible lines */
#define SDF_RT 0x00080000 /* DEPRECATED: subdevice is RT capable */
#define SDF_GROUND 0x00100000 /* can do aref=ground */ #define SDF_GROUND 0x00100000 /* can do aref=ground */
#define SDF_COMMON 0x00200000 /* can do aref=common */ #define SDF_COMMON 0x00200000 /* can do aref=common */
#define SDF_DIFF 0x00400000 /* can do aref=diff */ #define SDF_DIFF 0x00400000 /* can do aref=diff */
......
...@@ -46,13 +46,6 @@ EXPORT_SYMBOL(range_bipolar2_5); ...@@ -46,13 +46,6 @@ EXPORT_SYMBOL(range_bipolar2_5);
EXPORT_SYMBOL(range_unipolar10); EXPORT_SYMBOL(range_unipolar10);
EXPORT_SYMBOL(range_unipolar5); EXPORT_SYMBOL(range_unipolar5);
EXPORT_SYMBOL(range_unknown); EXPORT_SYMBOL(range_unknown);
#ifdef CONFIG_COMEDI_RT
EXPORT_SYMBOL(comedi_free_irq);
EXPORT_SYMBOL(comedi_request_irq);
EXPORT_SYMBOL(comedi_switch_to_rt);
EXPORT_SYMBOL(comedi_switch_to_non_rt);
EXPORT_SYMBOL(rt_pend_call);
#endif
#ifdef CONFIG_COMEDI_DEBUG #ifdef CONFIG_COMEDI_DEBUG
EXPORT_SYMBOL(comedi_debug); EXPORT_SYMBOL(comedi_debug);
#endif #endif
......
/*
module/comedi_rt.h
header file for real-time structures, variables, and constants
COMEDI - Linux Control and Measurement Device Interface
Copyright (C) 1997-2000 David A. Schleef <ds@schleef.org>
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 _COMEDI_RT_H
#define _COMEDI_RT_H
#ifndef _COMEDIDEV_H
#error comedi_rt.h should only be included by comedidev.h
#endif
#include <linux/kdev_t.h>
#include <linux/slab.h>
#include <linux/errno.h>
#include <linux/spinlock.h>
#include <linux/delay.h>
#ifdef CONFIG_COMEDI_RT
#ifdef CONFIG_COMEDI_RTAI
#include <rtai.h>
#include <rtai_sched.h>
#include <rtai_version.h>
#endif
#ifdef CONFIG_COMEDI_RTL
#include <rtl_core.h>
#include <rtl_time.h>
/* #ifdef RTLINUX_VERSION_CODE */
#include <rtl_sync.h>
/* #endif */
#define rt_printk rtl_printf
#endif
#ifdef CONFIG_COMEDI_FUSION
#define rt_printk(format, args...) printk(format , ## args)
#endif /* CONFIG_COMEDI_FUSION */
#ifdef CONFIG_PRIORITY_IRQ
#define rt_printk printk
#endif
int comedi_request_irq(unsigned int irq, irqreturn_t(*handler) (int,
void *PT_REGS_ARG), unsigned long flags, const char *device,
struct comedi_device *dev_id);
void comedi_free_irq(unsigned int irq, struct comedi_device *dev_id);
void comedi_rt_init(void);
void comedi_rt_cleanup(void);
int comedi_switch_to_rt(struct comedi_device *dev);
void comedi_switch_to_non_rt(struct comedi_device *dev);
void comedi_rt_pend_wakeup(wait_queue_head_t *q);
extern int rt_pend_call(void (*func) (int arg1, void *arg2), int arg1,
void *arg2);
#else
#define comedi_request_irq(a, b, c, d, e) request_irq(a, b, c, d, e)
#define comedi_free_irq(a, b) free_irq(a, b)
#define comedi_rt_init() do {} while (0)
#define comedi_rt_cleanup() do {} while (0)
#define comedi_switch_to_rt(a) (-1)
#define comedi_switch_to_non_rt(a) do {} while (0)
#define comedi_rt_pend_wakeup(a) do {} while (0)
#define rt_printk(format, args...) printk(format, ##args)
#endif
/* Define a spin_lock_irqsave function that will work with rt or without.
* Use inline functions instead of just macros to enforce some type checking.
*/
#define comedi_spin_lock_irqsave(lock_ptr, flags) \
(flags = __comedi_spin_lock_irqsave(lock_ptr))
static inline unsigned long __comedi_spin_lock_irqsave(spinlock_t *lock_ptr)
{
unsigned long flags;
#if defined(CONFIG_COMEDI_RTAI)
flags = rt_spin_lock_irqsave(lock_ptr);
#elif defined(CONFIG_COMEDI_RTL)
rtl_spin_lock_irqsave(lock_ptr, flags);
#elif defined(CONFIG_COMEDI_RTL_V1)
rtl_spin_lock_irqsave(lock_ptr, flags);
#elif defined(CONFIG_COMEDI_FUSION)
rthal_spin_lock_irqsave(lock_ptr, flags);
#else
spin_lock_irqsave(lock_ptr, flags);
#endif
return flags;
}
static inline void comedi_spin_unlock_irqrestore(spinlock_t *lock_ptr,
unsigned long flags)
{
#if defined(CONFIG_COMEDI_RTAI)
rt_spin_unlock_irqrestore(flags, lock_ptr);
#elif defined(CONFIG_COMEDI_RTL)
rtl_spin_unlock_irqrestore(lock_ptr, flags);
#elif defined(CONFIG_COMEDI_RTL_V1)
rtl_spin_unlock_irqrestore(lock_ptr, flags);
#elif defined(CONFIG_COMEDI_FUSION)
rthal_spin_unlock_irqrestore(lock_ptr, flags);
#else
spin_unlock_irqrestore(lock_ptr, flags);
#endif
}
/* define a RT safe udelay */
static inline void comedi_udelay(unsigned int usec)
{
#if defined(CONFIG_COMEDI_RTAI)
static const int nanosec_per_usec = 1000;
rt_busy_sleep(usec * nanosec_per_usec);
#elif defined(CONFIG_COMEDI_RTL)
static const int nanosec_per_usec = 1000;
rtl_delay(usec * nanosec_per_usec);
#else
udelay(usec);
#endif
}
#endif
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/kdev_t.h> #include <linux/kdev_t.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/delay.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/mutex.h> #include <linux/mutex.h>
...@@ -35,10 +36,10 @@ ...@@ -35,10 +36,10 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include "interrupt.h"
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <linux/uaccess.h> #include <linux/uaccess.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/timer.h>
#include "comedi.h" #include "comedi.h"
...@@ -264,7 +265,6 @@ struct comedi_device { ...@@ -264,7 +265,6 @@ struct comedi_device {
const char *board_name; const char *board_name;
const void *board_ptr; const void *board_ptr;
int attached; int attached;
int rt;
spinlock_t spinlock; spinlock_t spinlock;
struct mutex mutex; struct mutex mutex;
int in_request_module; int in_request_module;
...@@ -524,6 +524,17 @@ struct usb_device; /* forward declaration */ ...@@ -524,6 +524,17 @@ struct usb_device; /* forward declaration */
int comedi_usb_auto_config(struct usb_device *usbdev, const char *board_name); int comedi_usb_auto_config(struct usb_device *usbdev, const char *board_name);
void comedi_usb_auto_unconfig(struct usb_device *usbdev); void comedi_usb_auto_unconfig(struct usb_device *usbdev);
#include "comedi_rt.h" #ifdef CONFIG_COMEDI_PCI_DRIVERS
#define CONFIG_COMEDI_PCI
#endif
#ifdef CONFIG_COMEDI_PCI_DRIVERS_MODULE
#define CONFIG_COMEDI_PCI
#endif
#ifdef CONFIG_COMEDI_PCMCIA_DRIVERS
#define CONFIG_COMEDI_PCMCIA
#endif
#ifdef CONFIG_COMEDI_PCMCIA_DRIVERS_MODULE
#define CONFIG_COMEDI_PCMCIA
#endif
#endif /* _COMEDIDEV_H */ #endif /* _COMEDIDEV_H */
...@@ -198,7 +198,7 @@ int comedi_driver_unregister(struct comedi_driver *driver) ...@@ -198,7 +198,7 @@ int comedi_driver_unregister(struct comedi_driver *driver)
struct comedi_device_file_info *dev_file_info = comedi_get_device_file_info(i); struct comedi_device_file_info *dev_file_info = comedi_get_device_file_info(i);
struct comedi_device *dev; struct comedi_device *dev;
if(dev_file_info == NULL) continue; if (dev_file_info == NULL) continue;
dev = dev_file_info->device; dev = dev_file_info->device;
mutex_lock(&dev->mutex); mutex_lock(&dev->mutex);
...@@ -554,7 +554,7 @@ unsigned int comedi_buf_munge(struct comedi_async *async, unsigned int num_bytes ...@@ -554,7 +554,7 @@ unsigned int comedi_buf_munge(struct comedi_async *async, unsigned int num_bytes
block_size = num_bytes - count; block_size = num_bytes - count;
if (block_size < 0) { if (block_size < 0) {
rt_printk("%s: %s: bug! block_size is negative\n", printk("%s: %s: bug! block_size is negative\n",
__FILE__, __func__); __FILE__, __func__);
break; break;
} }
...@@ -633,8 +633,7 @@ unsigned comedi_buf_write_free(struct comedi_async *async, unsigned int nbytes) ...@@ -633,8 +633,7 @@ unsigned comedi_buf_write_free(struct comedi_async *async, unsigned int nbytes)
{ {
if ((int)(async->buf_write_count + nbytes - if ((int)(async->buf_write_count + nbytes -
async->buf_write_alloc_count) > 0) { async->buf_write_alloc_count) > 0) {
rt_printk printk("comedi: attempted to write-free more bytes than have been write-allocated.\n");
("comedi: attempted to write-free more bytes than have been write-allocated.\n");
nbytes = async->buf_write_alloc_count - async->buf_write_count; nbytes = async->buf_write_alloc_count - async->buf_write_count;
} }
async->buf_write_count += nbytes; async->buf_write_count += nbytes;
...@@ -667,8 +666,7 @@ unsigned comedi_buf_read_free(struct comedi_async *async, unsigned int nbytes) ...@@ -667,8 +666,7 @@ unsigned comedi_buf_read_free(struct comedi_async *async, unsigned int nbytes)
smp_mb(); smp_mb();
if ((int)(async->buf_read_count + nbytes - if ((int)(async->buf_read_count + nbytes -
async->buf_read_alloc_count) > 0) { async->buf_read_alloc_count) > 0) {
rt_printk printk("comedi: attempted to read-free more bytes than have been read-allocated.\n");
("comedi: attempted to read-free more bytes than have been read-allocated.\n");
nbytes = async->buf_read_alloc_count - async->buf_read_count; nbytes = async->buf_read_alloc_count - async->buf_read_count;
} }
async->buf_read_count += nbytes; async->buf_read_count += nbytes;
...@@ -801,7 +799,7 @@ int comedi_auto_config(struct device *hardware_device, const char *board_name, c ...@@ -801,7 +799,7 @@ int comedi_auto_config(struct device *hardware_device, const char *board_name, c
} }
minor = comedi_alloc_board_minor(hardware_device); minor = comedi_alloc_board_minor(hardware_device);
if(minor < 0) return minor; if (minor < 0) return minor;
private_data = kmalloc(sizeof(unsigned), GFP_KERNEL); private_data = kmalloc(sizeof(unsigned), GFP_KERNEL);
if (private_data == NULL) { if (private_data == NULL) {
...@@ -824,7 +822,7 @@ int comedi_auto_config(struct device *hardware_device, const char *board_name, c ...@@ -824,7 +822,7 @@ int comedi_auto_config(struct device *hardware_device, const char *board_name, c
mutex_unlock(&dev_file_info->device->mutex); mutex_unlock(&dev_file_info->device->mutex);
cleanup: cleanup:
if(retval < 0) if (retval < 0)
{ {
kfree(private_data); kfree(private_data);
comedi_free_board_minor(minor); comedi_free_board_minor(minor);
...@@ -835,7 +833,7 @@ int comedi_auto_config(struct device *hardware_device, const char *board_name, c ...@@ -835,7 +833,7 @@ int comedi_auto_config(struct device *hardware_device, const char *board_name, c
void comedi_auto_unconfig(struct device *hardware_device) void comedi_auto_unconfig(struct device *hardware_device)
{ {
unsigned *minor = (unsigned *)dev_get_drvdata(hardware_device); unsigned *minor = (unsigned *)dev_get_drvdata(hardware_device);
if(minor == NULL) return; if (minor == NULL) return;
BUG_ON(*minor >= COMEDI_NUM_BOARD_MINORS); BUG_ON(*minor >= COMEDI_NUM_BOARD_MINORS);
...@@ -853,7 +851,8 @@ int comedi_pci_auto_config(struct pci_dev *pcidev, const char *board_name) ...@@ -853,7 +851,8 @@ int comedi_pci_auto_config(struct pci_dev *pcidev, const char *board_name)
/* pci slot */ /* pci slot */
options[1] = PCI_SLOT(pcidev->devfn); options[1] = PCI_SLOT(pcidev->devfn);
return comedi_auto_config(&pcidev->dev, board_name, options, sizeof(options) / sizeof(options[0])); return comedi_auto_config(&pcidev->dev, board_name,
options, ARRAY_SIZE(options));
} }
void comedi_pci_auto_unconfig(struct pci_dev *pcidev) void comedi_pci_auto_unconfig(struct pci_dev *pcidev)
......
...@@ -24,11 +24,7 @@ ...@@ -24,11 +24,7 @@
#ifndef _8253_H #ifndef _8253_H
#define _8253_H #define _8253_H
#ifndef CMDTEST
#include "../comedi.h"
#else
#include "../comedi.h" #include "../comedi.h"
#endif
#define i8253_cascade_ns_to_timer i8253_cascade_ns_to_timer_2div #define i8253_cascade_ns_to_timer i8253_cascade_ns_to_timer_2div
...@@ -205,7 +201,7 @@ static inline void i8253_cascade_ns_to_timer_2div(int i8253_osc_base, ...@@ -205,7 +201,7 @@ static inline void i8253_cascade_ns_to_timer_2div(int i8253_osc_base,
} }
*nanosec = div1 * div2 * i8253_osc_base; *nanosec = div1 * div2 * i8253_osc_base;
*d1 = div1 & 0xffff; // masking is done since counter maps zero to 0x10000 *d1 = div1 & 0xffff; /* masking is done since counter maps zero to 0x10000 */
*d2 = div2 & 0xffff; *d2 = div2 & 0xffff;
return; return;
} }
...@@ -247,12 +243,12 @@ static inline int i8254_load(unsigned long base_address, unsigned int regshift, ...@@ -247,12 +243,12 @@ static inline int i8254_load(unsigned long base_address, unsigned int regshift,
return -1; return -1;
byte = counter_number << 6; byte = counter_number << 6;
byte |= 0x30; // load low then high byte byte |= 0x30; /* load low then high byte */
byte |= (mode << 1); // set counter mode byte |= (mode << 1); /* set counter mode */
outb(byte, base_address + (i8254_control_reg << regshift)); outb(byte, base_address + (i8254_control_reg << regshift));
byte = count & 0xff; // lsb of counter value byte = count & 0xff; /* lsb of counter value */
outb(byte, base_address + (counter_number << regshift)); outb(byte, base_address + (counter_number << regshift));
byte = (count >> 8) & 0xff; // msb of counter value byte = (count >> 8) & 0xff; /* msb of counter value */
outb(byte, base_address + (counter_number << regshift)); outb(byte, base_address + (counter_number << regshift));
return 0; return 0;
...@@ -273,12 +269,12 @@ static inline int i8254_mm_load(void *base_address, unsigned int regshift, ...@@ -273,12 +269,12 @@ static inline int i8254_mm_load(void *base_address, unsigned int regshift,
return -1; return -1;
byte = counter_number << 6; byte = counter_number << 6;
byte |= 0x30; // load low then high byte byte |= 0x30; /* load low then high byte */
byte |= (mode << 1); // set counter mode byte |= (mode << 1); /* set counter mode */
writeb(byte, base_address + (i8254_control_reg << regshift)); writeb(byte, base_address + (i8254_control_reg << regshift));
byte = count & 0xff; // lsb of counter value byte = count & 0xff; /* lsb of counter value */
writeb(byte, base_address + (counter_number << regshift)); writeb(byte, base_address + (counter_number << regshift));
byte = (count >> 8) & 0xff; // msb of counter value byte = (count >> 8) & 0xff; /* msb of counter value */
writeb(byte, base_address + (counter_number << regshift)); writeb(byte, base_address + (counter_number << regshift));
return 0; return 0;
...@@ -294,13 +290,13 @@ static inline int i8254_read(unsigned long base_address, unsigned int regshift, ...@@ -294,13 +290,13 @@ static inline int i8254_read(unsigned long base_address, unsigned int regshift,
if (counter_number > 2) if (counter_number > 2)
return -1; return -1;
// latch counter /* latch counter */
byte = counter_number << 6; byte = counter_number << 6;
outb(byte, base_address + (i8254_control_reg << regshift)); outb(byte, base_address + (i8254_control_reg << regshift));
// read lsb /* read lsb */
ret = inb(base_address + (counter_number << regshift)); ret = inb(base_address + (counter_number << regshift));
// read msb /* read msb */
ret += inb(base_address + (counter_number << regshift)) << 8; ret += inb(base_address + (counter_number << regshift)) << 8;
return ret; return ret;
...@@ -315,13 +311,13 @@ static inline int i8254_mm_read(void *base_address, unsigned int regshift, ...@@ -315,13 +311,13 @@ static inline int i8254_mm_read(void *base_address, unsigned int regshift,
if (counter_number > 2) if (counter_number > 2)
return -1; return -1;
// latch counter /* latch counter */
byte = counter_number << 6; byte = counter_number << 6;
writeb(byte, base_address + (i8254_control_reg << regshift)); writeb(byte, base_address + (i8254_control_reg << regshift));
// read lsb /* read lsb */
ret = readb(base_address + (counter_number << regshift)); ret = readb(base_address + (counter_number << regshift));
// read msb /* read msb */
ret += readb(base_address + (counter_number << regshift)) << 8; ret += readb(base_address + (counter_number << regshift)) << 8;
return ret; return ret;
...@@ -336,9 +332,9 @@ static inline void i8254_write(unsigned long base_address, ...@@ -336,9 +332,9 @@ static inline void i8254_write(unsigned long base_address,
if (counter_number > 2) if (counter_number > 2)
return; return;
byte = count & 0xff; // lsb of counter value byte = count & 0xff; /* lsb of counter value */
outb(byte, base_address + (counter_number << regshift)); outb(byte, base_address + (counter_number << regshift));
byte = (count >> 8) & 0xff; // msb of counter value byte = (count >> 8) & 0xff; /* msb of counter value */
outb(byte, base_address + (counter_number << regshift)); outb(byte, base_address + (counter_number << regshift));
} }
...@@ -350,9 +346,9 @@ static inline void i8254_mm_write(void *base_address, ...@@ -350,9 +346,9 @@ static inline void i8254_mm_write(void *base_address,
if (counter_number > 2) if (counter_number > 2)
return; return;
byte = count & 0xff; // lsb of counter value byte = count & 0xff; /* lsb of counter value */
writeb(byte, base_address + (counter_number << regshift)); writeb(byte, base_address + (counter_number << regshift));
byte = (count >> 8) & 0xff; // msb of counter value byte = (count >> 8) & 0xff; /* msb of counter value */
writeb(byte, base_address + (counter_number << regshift)); writeb(byte, base_address + (counter_number << regshift));
} }
...@@ -374,8 +370,8 @@ static inline int i8254_set_mode(unsigned long base_address, ...@@ -374,8 +370,8 @@ static inline int i8254_set_mode(unsigned long base_address,
return -1; return -1;
byte = counter_number << 6; byte = counter_number << 6;
byte |= 0x30; // load low then high byte byte |= 0x30; /* load low then high byte */
byte |= mode; // set counter mode and BCD|binary byte |= mode; /* set counter mode and BCD|binary */
outb(byte, base_address + (i8254_control_reg << regshift)); outb(byte, base_address + (i8254_control_reg << regshift));
return 0; return 0;
...@@ -392,8 +388,8 @@ static inline int i8254_mm_set_mode(void *base_address, ...@@ -392,8 +388,8 @@ static inline int i8254_mm_set_mode(void *base_address,
return -1; return -1;
byte = counter_number << 6; byte = counter_number << 6;
byte |= 0x30; // load low then high byte byte |= 0x30; /* load low then high byte */
byte |= mode; // set counter mode and BCD|binary byte |= mode; /* set counter mode and BCD|binary */
writeb(byte, base_address + (i8254_control_reg << regshift)); writeb(byte, base_address + (i8254_control_reg << regshift));
return 0; return 0;
......
...@@ -108,10 +108,10 @@ struct subdev_8255_struct { ...@@ -108,10 +108,10 @@ struct subdev_8255_struct {
static int dev_8255_attach(struct comedi_device *dev, struct comedi_devconfig * it); static int dev_8255_attach(struct comedi_device *dev, struct comedi_devconfig * it);
static int dev_8255_detach(struct comedi_device *dev); static int dev_8255_detach(struct comedi_device *dev);
static struct comedi_driver driver_8255 = { static struct comedi_driver driver_8255 = {
driver_name:"8255", .driver_name = "8255",
module:THIS_MODULE, .module = THIS_MODULE,
attach:dev_8255_attach, .attach = dev_8255_attach,
detach:dev_8255_detach, .detach = dev_8255_detach,
}; };
COMEDI_INITCLEANUP(driver_8255); COMEDI_INITCLEANUP(driver_8255);
...@@ -144,7 +144,7 @@ static int subdev_8255_cb(int dir, int port, int data, unsigned long arg) ...@@ -144,7 +144,7 @@ static int subdev_8255_cb(int dir, int port, int data, unsigned long arg)
} }
static int subdev_8255_insn(struct comedi_device *dev, struct comedi_subdevice * s, static int subdev_8255_insn(struct comedi_device *dev, struct comedi_subdevice * s,
struct comedi_insn * insn, unsigned int * data) struct comedi_insn *insn, unsigned int *data)
{ {
if (data[0]) { if (data[0]) {
s->state &= ~data[0]; s->state &= ~data[0];
...@@ -169,7 +169,7 @@ static int subdev_8255_insn(struct comedi_device *dev, struct comedi_subdevice * ...@@ -169,7 +169,7 @@ static int subdev_8255_insn(struct comedi_device *dev, struct comedi_subdevice *
} }
static int subdev_8255_insn_config(struct comedi_device *dev, struct comedi_subdevice * s, static int subdev_8255_insn_config(struct comedi_device *dev, struct comedi_subdevice * s,
struct comedi_insn * insn, unsigned int * data) struct comedi_insn *insn, unsigned int *data)
{ {
unsigned int mask; unsigned int mask;
unsigned int bits; unsigned int bits;
...@@ -223,7 +223,7 @@ static void do_config(struct comedi_device *dev, struct comedi_subdevice * s) ...@@ -223,7 +223,7 @@ static void do_config(struct comedi_device *dev, struct comedi_subdevice * s)
} }
static int subdev_8255_cmdtest(struct comedi_device *dev, struct comedi_subdevice * s, static int subdev_8255_cmdtest(struct comedi_device *dev, struct comedi_subdevice * s,
struct comedi_cmd * cmd) struct comedi_cmd *cmd)
{ {
int err = 0; int err = 0;
unsigned int tmp; unsigned int tmp;
...@@ -361,8 +361,10 @@ int subdev_8255_init_irq(struct comedi_device *dev, struct comedi_subdevice * s, ...@@ -361,8 +361,10 @@ int subdev_8255_init_irq(struct comedi_device *dev, struct comedi_subdevice * s,
void subdev_8255_cleanup(struct comedi_device *dev, struct comedi_subdevice * s) void subdev_8255_cleanup(struct comedi_device *dev, struct comedi_subdevice * s)
{ {
if (s->private) { if (s->private) {
if (subdevpriv->have_irq) { /* this test does nothing, so comment it out
} * if (subdevpriv->have_irq) {
* }
*/
kfree(s->private); kfree(s->private);
} }
...@@ -394,7 +396,8 @@ static int dev_8255_attach(struct comedi_device *dev, struct comedi_devconfig * ...@@ -394,7 +396,8 @@ static int dev_8255_attach(struct comedi_device *dev, struct comedi_devconfig *
return -EINVAL; return -EINVAL;
} }
if ((ret = alloc_subdevices(dev, i)) < 0) ret = alloc_subdevices(dev, i);
if (ret < 0)
return ret; return ret;
for (i = 0; i < dev->n_subdevices; i++) { for (i = 0; i < dev->n_subdevices; i++) {
......
...@@ -28,16 +28,16 @@ ...@@ -28,16 +28,16 @@
#if defined(CONFIG_COMEDI_8255) || defined(CONFIG_COMEDI_8255_MODULE) #if defined(CONFIG_COMEDI_8255) || defined(CONFIG_COMEDI_8255_MODULE)
int subdev_8255_init(struct comedi_device * dev, struct comedi_subdevice * s, int subdev_8255_init(struct comedi_device *dev, struct comedi_subdevice *s,
int (*cb) (int, int, int, unsigned long), unsigned long arg); int (*cb) (int, int, int, unsigned long), unsigned long arg);
int subdev_8255_init_irq(struct comedi_device * dev, struct comedi_subdevice * s, int subdev_8255_init_irq(struct comedi_device *dev, struct comedi_subdevice *s,
int (*cb) (int, int, int, unsigned long), unsigned long arg); int (*cb) (int, int, int, unsigned long), unsigned long arg);
void subdev_8255_cleanup(struct comedi_device * dev, struct comedi_subdevice * s); void subdev_8255_cleanup(struct comedi_device *dev, struct comedi_subdevice *s);
void subdev_8255_interrupt(struct comedi_device * dev, struct comedi_subdevice * s); void subdev_8255_interrupt(struct comedi_device *dev, struct comedi_subdevice *s);
#else #else
static inline int subdev_8255_init(struct comedi_device * dev, struct comedi_subdevice * s, static inline int subdev_8255_init(struct comedi_device *dev, struct comedi_subdevice *s,
void *x, unsigned long y) void *x, unsigned long y)
{ {
printk("8255 support not configured -- disabling subdevice\n"); printk("8255 support not configured -- disabling subdevice\n");
...@@ -47,8 +47,8 @@ static inline int subdev_8255_init(struct comedi_device * dev, struct comedi_sub ...@@ -47,8 +47,8 @@ static inline int subdev_8255_init(struct comedi_device * dev, struct comedi_sub
return 0; return 0;
} }
static inline void subdev_8255_cleanup(struct comedi_device * dev, static inline void subdev_8255_cleanup(struct comedi_device *dev,
struct comedi_subdevice * s) struct comedi_subdevice *s)
{ {
} }
......
...@@ -6,6 +6,7 @@ obj-$(CONFIG_COMEDI) += comedi_fc.o ...@@ -6,6 +6,7 @@ obj-$(CONFIG_COMEDI) += comedi_fc.o
obj-$(CONFIG_COMEDI) += comedi_bond.o obj-$(CONFIG_COMEDI) += comedi_bond.o
obj-$(CONFIG_COMEDI) += comedi_test.o obj-$(CONFIG_COMEDI) += comedi_test.o
obj-$(CONFIG_COMEDI) += comedi_parport.o obj-$(CONFIG_COMEDI) += comedi_parport.o
obj-$(CONFIG_COMEDI) += pcm_common.o
# Comedi PCI drivers # Comedi PCI drivers
obj-$(CONFIG_COMEDI_PCI_DRIVERS) += 8255.o obj-$(CONFIG_COMEDI_PCI_DRIVERS) += 8255.o
...@@ -125,6 +126,8 @@ obj-$(CONFIG_COMEDI_PCMCIA_DRIVERS) += ni_mio_cs.o ...@@ -125,6 +126,8 @@ obj-$(CONFIG_COMEDI_PCMCIA_DRIVERS) += ni_mio_cs.o
obj-$(CONFIG_COMEDI_PCMCIA_DRIVERS) += quatech_daqp_cs.o obj-$(CONFIG_COMEDI_PCMCIA_DRIVERS) += quatech_daqp_cs.o
# Comedi USB drivers # Comedi USB drivers
obj-$(CONFIG_COMEDI_USB_DRIVERS) += dt9812.o
obj-$(CONFIG_COMEDI_USB_DRIVERS) += usbdux.o obj-$(CONFIG_COMEDI_USB_DRIVERS) += usbdux.o
obj-$(CONFIG_COMEDI_USB_DRIVERS) += usbduxfast.o obj-$(CONFIG_COMEDI_USB_DRIVERS) += usbduxfast.o
obj-$(CONFIG_COMEDI_USB_DRIVERS) += dt9812.o obj-$(CONFIG_COMEDI_USB_DRIVERS) += vmk80xx.o
...@@ -26,8 +26,8 @@ static int acl7225b_attach(struct comedi_device *dev, struct comedi_devconfig * ...@@ -26,8 +26,8 @@ static int acl7225b_attach(struct comedi_device *dev, struct comedi_devconfig *
static int acl7225b_detach(struct comedi_device *dev); static int acl7225b_detach(struct comedi_device *dev);
struct boardtype { struct boardtype {
const char *name; // driver name const char *name; /* driver name */
int io_range; // len of I/O space int io_range; /* len of I/O space */
}; };
static const struct boardtype boardtypes[] = { static const struct boardtype boardtypes[] = {
...@@ -39,19 +39,19 @@ static const struct boardtype boardtypes[] = { ...@@ -39,19 +39,19 @@ static const struct boardtype boardtypes[] = {
#define this_board ((const struct boardtype *)dev->board_ptr) #define this_board ((const struct boardtype *)dev->board_ptr)
static struct comedi_driver driver_acl7225b = { static struct comedi_driver driver_acl7225b = {
driver_name:"acl7225b", .driver_name = "acl7225b",
module:THIS_MODULE, .module = THIS_MODULE,
attach:acl7225b_attach, .attach = acl7225b_attach,
detach:acl7225b_detach, .detach = acl7225b_detach,
board_name:&boardtypes[0].name, .board_name = &boardtypes[0].name,
num_names:n_boardtypes, .num_names = n_boardtypes,
offset:sizeof(struct boardtype), .offset = sizeof(struct boardtype),
}; };
COMEDI_INITCLEANUP(driver_acl7225b); COMEDI_INITCLEANUP(driver_acl7225b);
static int acl7225b_do_insn(struct comedi_device *dev, struct comedi_subdevice * s, static int acl7225b_do_insn(struct comedi_device *dev, struct comedi_subdevice * s,
struct comedi_insn * insn, unsigned int * data) struct comedi_insn *insn, unsigned int *data)
{ {
if (insn->n != 2) if (insn->n != 2)
return -EINVAL; return -EINVAL;
...@@ -72,7 +72,7 @@ static int acl7225b_do_insn(struct comedi_device *dev, struct comedi_subdevice * ...@@ -72,7 +72,7 @@ static int acl7225b_do_insn(struct comedi_device *dev, struct comedi_subdevice *
} }
static int acl7225b_di_insn(struct comedi_device *dev, struct comedi_subdevice * s, static int acl7225b_di_insn(struct comedi_device *dev, struct comedi_subdevice * s,
struct comedi_insn * insn, unsigned int * data) struct comedi_insn *insn, unsigned int *data)
{ {
if (insn->n != 2) if (insn->n != 2)
return -EINVAL; return -EINVAL;
......
...@@ -34,40 +34,40 @@ ...@@ -34,40 +34,40 @@
/* /*
* 82X54 TIMER INISIALISATION FUNCTION * 82X54 TIMER INISIALISATION FUNCTION
*/ */
INT i_APCI1710_InsnConfigInitTimer(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI1710_InsnConfigInitTimer(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data); struct comedi_insn *insn, unsigned int *data);
INT i_APCI1710_InsnWriteEnableDisableTimer(struct comedi_device *dev, int i_APCI1710_InsnWriteEnableDisableTimer(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data); struct comedi_insn *insn, unsigned int *data);
/* /*
* 82X54 READ FUNCTION * 82X54 READ FUNCTION
*/ */
INT i_APCI1710_InsnReadAllTimerValue(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI1710_InsnReadAllTimerValue(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data); struct comedi_insn *insn, unsigned int *data);
INT i_APCI1710_InsnBitsTimer(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI1710_InsnBitsTimer(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data); struct comedi_insn *insn, unsigned int *data);
/* /*
* 82X54 READ & WRITE FUNCTION * 82X54 READ & WRITE FUNCTION
*/ */
INT i_APCI1710_ReadTimerValue(struct comedi_device *dev, int i_APCI1710_ReadTimerValue(struct comedi_device *dev,
BYTE b_ModulNbr, BYTE b_TimerNbr, unsigned char b_ModulNbr, unsigned char b_TimerNbr,
PULONG pul_TimerValue); unsigned int *pul_TimerValue);
INT i_APCI1710_GetTimerOutputLevel(struct comedi_device *dev, int i_APCI1710_GetTimerOutputLevel(struct comedi_device *dev,
BYTE b_ModulNbr, BYTE b_TimerNbr, unsigned char b_ModulNbr, unsigned char b_TimerNbr,
PBYTE pb_OutputLevel); unsigned char *pb_OutputLevel);
INT i_APCI1710_GetTimerProgressStatus(struct comedi_device *dev, int i_APCI1710_GetTimerProgressStatus(struct comedi_device *dev,
BYTE b_ModulNbr, BYTE b_TimerNbr, unsigned char b_ModulNbr, unsigned char b_TimerNbr,
PBYTE pb_TimerStatus); unsigned char *pb_TimerStatus);
/* /*
* 82X54 WRITE FUNCTION * 82X54 WRITE FUNCTION
*/ */
INT i_APCI1710_WriteTimerValue(struct comedi_device *dev, int i_APCI1710_WriteTimerValue(struct comedi_device *dev,
BYTE b_ModulNbr, BYTE b_TimerNbr, unsigned char b_ModulNbr, unsigned char b_TimerNbr,
ULONG ul_WriteValue); unsigned int ul_WriteValue);
...@@ -35,10 +35,10 @@ ...@@ -35,10 +35,10 @@
/* /*
* CHRONOMETER INISIALISATION FUNCTION * CHRONOMETER INISIALISATION FUNCTION
*/ */
INT i_APCI1710_InsnConfigInitChrono(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI1710_InsnConfigInitChrono(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data); struct comedi_insn *insn, unsigned int *data);
INT i_APCI1710_InsnWriteEnableDisableChrono(struct comedi_device *dev, int i_APCI1710_InsnWriteEnableDisableChrono(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_subdevice *s,
struct comedi_insn *insn, struct comedi_insn *insn,
unsigned int *data); unsigned int *data);
...@@ -46,29 +46,29 @@ INT i_APCI1710_InsnWriteEnableDisableChrono(struct comedi_device *dev, ...@@ -46,29 +46,29 @@ INT i_APCI1710_InsnWriteEnableDisableChrono(struct comedi_device *dev,
/* /*
* CHRONOMETER READ FUNCTION * CHRONOMETER READ FUNCTION
*/ */
INT i_APCI1710_InsnReadChrono(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI1710_InsnReadChrono(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data); struct comedi_insn *insn, unsigned int *data);
INT i_APCI1710_GetChronoProgressStatus(struct comedi_device *dev, int i_APCI1710_GetChronoProgressStatus(struct comedi_device *dev,
BYTE b_ModulNbr, PBYTE pb_ChronoStatus); unsigned char b_ModulNbr, unsigned char *pb_ChronoStatus);
INT i_APCI1710_ReadChronoValue(struct comedi_device *dev, int i_APCI1710_ReadChronoValue(struct comedi_device *dev,
BYTE b_ModulNbr, unsigned char b_ModulNbr,
UINT ui_TimeOut, PBYTE pb_ChronoStatus, unsigned int ui_TimeOut, unsigned char *pb_ChronoStatus,
PULONG pul_ChronoValue); unsigned int *pul_ChronoValue);
INT i_APCI1710_ConvertChronoValue(struct comedi_device *dev, int i_APCI1710_ConvertChronoValue(struct comedi_device *dev,
BYTE b_ModulNbr, unsigned char b_ModulNbr,
ULONG ul_ChronoValue, unsigned int ul_ChronoValue,
PULONG pul_Hour, unsigned int *pul_Hour,
PBYTE pb_Minute, unsigned char *pb_Minute,
PBYTE pb_Second, unsigned char *pb_Second,
PUINT pui_MilliSecond, PUINT pui_MicroSecond, unsigned int *pui_MilliSecond, unsigned int *pui_MicroSecond,
PUINT pui_NanoSecond); unsigned int *pui_NanoSecond);
/* /*
* CHRONOMETER DIGITAL INPUT OUTPUT FUNCTION * CHRONOMETER DIGITAL INPUT OUTPUT FUNCTION
*/ */
INT i_APCI1710_InsnBitsChronoDigitalIO(struct comedi_device *dev, int i_APCI1710_InsnBitsChronoDigitalIO(struct comedi_device *dev,
struct comedi_subdevice *s, struct comedi_insn *insn, struct comedi_subdevice *s, struct comedi_insn *insn,
unsigned int *data); unsigned int *data);
...@@ -33,11 +33,11 @@ ...@@ -33,11 +33,11 @@
/* /*
* SSI INISIALISATION FUNCTION * SSI INISIALISATION FUNCTION
*/ */
INT i_APCI1710_InsnConfigInitSSI(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI1710_InsnConfigInitSSI(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data); struct comedi_insn *insn, unsigned int *data);
INT i_APCI1710_InsnReadSSIValue(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI1710_InsnReadSSIValue(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data); struct comedi_insn *insn, unsigned int *data);
INT i_APCI1710_InsnBitsSSIDigitalIO(struct comedi_device *dev, struct comedi_subdevice *s, int i_APCI1710_InsnBitsSSIDigitalIO(struct comedi_device *dev, struct comedi_subdevice *s,
struct comedi_insn *insn, unsigned int *data); struct comedi_insn *insn, unsigned int *data);
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册