#include "cirrus.h"
MODULE_LICENSE("GPL");
+MODULE_DESCRIPTION("Driver for the Cirrus PD6729 PCI-PCMCIA bridge");
+MODULE_AUTHOR("Jun Komuro <komurojun@mbn.nifty.com>");
#define MAX_SOCKETS 2
-/* simple helper functions */
-/* External clock time, in nanoseconds. 120 ns = 8.33 MHz */
+/*
+ * simple helper functions
+ * External clock time, in nanoseconds. 120 ns = 8.33 MHz
+ */
#define to_cycles(ns) ((ns)/120)
static spinlock_t port_lock = SPIN_LOCK_UNLOCKED;
*value |= SS_DETECT;
}
- /* IO cards have a different meaning of bits 0,1 */
- /* Also notice the inverse-logic on the bits */
+ /*
+ * IO cards have a different meaning of bits 0,1
+ * Also notice the inverse-logic on the bits
+ */
if (indirect_read(socket, I365_INTCTL) & I365_PC_IOCARD) {
/* IO card */
if (!(status & I365_CS_STSCHG))
state->io_irq = 0;
state->csc_mask = 0;
- /* First the power status of the socket */
- /* PCTRL - Power Control Register */
+ /*
+ * First the power status of the socket
+ * PCTRL - Power Control Register
+ */
reg = indirect_read(socket, I365_POWER);
if (reg & I365_PWR_AUTO)
state->Vpp = 120;
}
- /* Now the IO card, RESET flags and IO interrupt */
- /* IGENC, Interrupt and General Control */
+ /*
+ * Now the IO card, RESET flags and IO interrupt
+ * IGENC, Interrupt and General Control
+ */
reg = indirect_read(socket, I365_INTCTL);
if ((reg & I365_PC_RESET) == 0)
/* Set the IRQ number */
state->io_irq = socket->socket.pci_irq;
- /* Card status change */
- /* CSCICR, Card Status Change Interrupt Configuration */
+ /*
+ * Card status change
+ * CSCICR, Card Status Change Interrupt Configuration
+ */
reg = indirect_read(socket, I365_CSCINT);
if (reg & I365_CSC_DETECT)
return -EINVAL;
}
- if ((mem->sys_start > mem->sys_stop) || (mem->speed > 1000)) {
+ if ((mem->res->start > mem->res->end) || (mem->speed > 1000)) {
printk("pd6729_set_mem_map: invalid address / speed");
/* printk("invalid mem map for socket %i : %lx to %lx with a start of %x\n",
- sock, mem->sys_start, mem->sys_stop, mem->card_start); */
+ sock, mem->res->start, mem->res->end, mem->card_start); */
return -EINVAL;
}
/* write the start address */
base = I365_MEM(map);
- i = (mem->sys_start >> 12) & 0x0fff;
+ i = (mem->res->start >> 12) & 0x0fff;
if (mem->flags & MAP_16BIT)
i |= I365_MEM_16BIT;
if (mem->flags & MAP_0WS)
/* write the stop address */
- i= (mem->sys_stop >> 12) & 0x0fff;
+ i= (mem->res->end >> 12) & 0x0fff;
switch (to_cycles(mem->speed)) {
case 0:
break;
/* Take care of high byte */
indirect_write(socket, PD67_EXT_INDEX, PD67_MEM_PAGE(map));
- indirect_write(socket, PD67_EXT_DATA, mem->sys_start >> 24);
+ indirect_write(socket, PD67_EXT_DATA, mem->res->start >> 24);
/* card start */
- i = ((mem->card_start - mem->sys_start) >> 12) & 0x3fff;
+ i = ((mem->card_start - mem->res->start) >> 12) & 0x3fff;
if (mem->flags & MAP_WRPROT)
i |= I365_MEM_WRPROT;
if (mem->flags & MAP_ATTRIB) {
int i;
struct resource res = { .end = 0x0fff };
pccard_io_map io = { 0, 0, 0, 0, 1 };
- pccard_mem_map mem = { .res = &res, .sys_stop = 0x0fff };
+ pccard_mem_map mem = { .res = &res, };
pd6729_set_socket(sock, &dead_socket);
for (i = 0; i < 2; i++) {
printk(KERN_INFO "pd6729: Cirrus PD6729 PCI to PCMCIA Bridge at 0x%lx on irq %d\n",
pci_resource_start(dev, 0), dev->irq);
printk(KERN_INFO "pd6729: configured as a %d socket device.\n", MAX_SOCKETS);
- /* Since we have no memory BARs some firmware we may not
- have had PCI_COMMAND_MEM enabled, yet the device needs
- it. */
+ /*
+ * Since we have no memory BARs some firmware we may not
+ * have had PCI_COMMAND_MEM enabled, yet the device needs
+ * it.
+ */
pci_read_config_byte(dev, PCI_COMMAND, &configbyte);
if (!(configbyte & PCI_COMMAND_MEMORY)) {
printk(KERN_DEBUG "pd6729: Enabling PCI_COMMAND_MEMORY.\n");