From nobody Sat Apr 18 07:43:56 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC503C43334 for ; Fri, 15 Jul 2022 13:54:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234731AbiGONyk (ORCPT ); Fri, 15 Jul 2022 09:54:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232739AbiGONyi (ORCPT ); Fri, 15 Jul 2022 09:54:38 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E7FA4D4C3 for ; Fri, 15 Jul 2022 06:54:36 -0700 (PDT) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 012151FEA8; Fri, 15 Jul 2022 13:54:35 +0000 (UTC) Received: from adalid.arch.suse.de (adalid.arch.suse.de [10.161.8.13]) by relay2.suse.de (Postfix) with ESMTP id DD99E2C141; Fri, 15 Jul 2022 13:54:34 +0000 (UTC) From: Thomas Bogendoerfer To: Dominik Brodowski , linux-kernel@vger.kernel.org Subject: [PATCH] pcmcia: remove VR41XX PCMCIA driver Date: Fri, 15 Jul 2022 15:54:31 +0200 Message-Id: <20220715135431.134844-1-tsbogend@alpha.franken.de> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Commit d3164e2f3b0a ("MIPS: Remove VR41xx support") removed support for MIPS VR41xx platform, so remove exclusive drivers for this platform, too. Signed-off-by: Thomas Bogendoerfer --- drivers/pcmcia/Kconfig | 4 - drivers/pcmcia/Makefile | 1 - drivers/pcmcia/vrc4171_card.c | 745 ---------------------------------- 3 files changed, 750 deletions(-) delete mode 100644 drivers/pcmcia/vrc4171_card.c diff --git a/drivers/pcmcia/Kconfig b/drivers/pcmcia/Kconfig index bf495bf0f48a..90ebc688ec05 100644 --- a/drivers/pcmcia/Kconfig +++ b/drivers/pcmcia/Kconfig @@ -240,10 +240,6 @@ config PCMCIA_PROBE bool default y if ISA && !ARCH_SA1100 && !PARISC =20 -config PCMCIA_VRC4171 - tristate "NEC VRC4171 Card Controllers support" - depends on CPU_VR41XX && ISA && PCMCIA - config OMAP_CF tristate "OMAP CompactFlash Controller" depends on PCMCIA diff --git a/drivers/pcmcia/Makefile b/drivers/pcmcia/Makefile index c59ddde42007..1c3ae8888e5f 100644 --- a/drivers/pcmcia/Makefile +++ b/drivers/pcmcia/Makefile @@ -29,7 +29,6 @@ obj-$(CONFIG_PCMCIA_SA11XX_BASE) +=3D sa11xx_base.o obj-$(CONFIG_PCMCIA_SA1100) +=3D sa1100_cs.o obj-$(CONFIG_PCMCIA_SA1111) +=3D sa1111_cs.o obj-$(CONFIG_PCMCIA_BCM63XX) +=3D bcm63xx_pcmcia.o -obj-$(CONFIG_PCMCIA_VRC4171) +=3D vrc4171_card.o obj-$(CONFIG_OMAP_CF) +=3D omap_cf.o obj-$(CONFIG_AT91_CF) +=3D at91_cf.o obj-$(CONFIG_ELECTRA_CF) +=3D electra_cf.o diff --git a/drivers/pcmcia/vrc4171_card.c b/drivers/pcmcia/vrc4171_card.c deleted file mode 100644 index 177d77892144..000000000000 --- a/drivers/pcmcia/vrc4171_card.c +++ /dev/null @@ -1,745 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later -/* - * vrc4171_card.c, NEC VRC4171 Card Controller driver for Socket Services. - * - * Copyright (C) 2003-2005 Yoichi Yuasa - */ -#include -#include -#include -#include -#include -#include -#include - -#include - -#include - -#include "i82365.h" - -MODULE_DESCRIPTION("NEC VRC4171 Card Controllers driver for Socket Service= s"); -MODULE_AUTHOR("Yoichi Yuasa "); -MODULE_LICENSE("GPL"); - -#define CARD_MAX_SLOTS 2 -#define CARD_SLOTA 0 -#define CARD_SLOTB 1 -#define CARD_SLOTB_OFFSET 0x40 - -#define CARD_MEM_START 0x10000000 -#define CARD_MEM_END 0x13ffffff -#define CARD_MAX_MEM_OFFSET 0x3ffffff -#define CARD_MAX_MEM_SPEED 1000 - -#define CARD_CONTROLLER_INDEX 0x03e0 -#define CARD_CONTROLLER_DATA 0x03e1 - /* Power register */ - #define VPP_GET_VCC 0x01 - #define POWER_ENABLE 0x10 - #define CARD_VOLTAGE_SENSE 0x1f - #define VCC_3VORXV_CAPABLE 0x00 - #define VCC_XV_ONLY 0x01 - #define VCC_3V_CAPABLE 0x02 - #define VCC_5V_ONLY 0x03 - #define CARD_VOLTAGE_SELECT 0x2f - #define VCC_3V 0x01 - #define VCC_5V 0x00 - #define VCC_XV 0x02 - #define VCC_STATUS_3V 0x02 - #define VCC_STATUS_5V 0x01 - #define VCC_STATUS_XV 0x03 - #define GLOBAL_CONTROL 0x1e - #define EXWRBK 0x04 - #define IRQPM_EN 0x08 - #define CLRPMIRQ 0x10 - -#define INTERRUPT_STATUS 0x05fa - #define IRQ_A 0x02 - #define IRQ_B 0x04 - -#define CONFIGURATION1 0x05fe - #define SLOTB_CONFIG 0xc000 - #define SLOTB_NONE 0x0000 - #define SLOTB_PCCARD 0x4000 - #define SLOTB_CF 0x8000 - #define SLOTB_FLASHROM 0xc000 - -#define CARD_CONTROLLER_START CARD_CONTROLLER_INDEX -#define CARD_CONTROLLER_END CARD_CONTROLLER_DATA - -#define IO_MAX_MAPS 2 -#define MEM_MAX_MAPS 5 - -enum vrc4171_slot { - SLOT_PROBE =3D 0, - SLOT_NOPROBE_IO, - SLOT_NOPROBE_MEM, - SLOT_NOPROBE_ALL, - SLOT_INITIALIZED, -}; - -enum vrc4171_slotb { - SLOTB_IS_NONE, - SLOTB_IS_PCCARD, - SLOTB_IS_CF, - SLOTB_IS_FLASHROM, -}; - -struct vrc4171_socket { - enum vrc4171_slot slot; - struct pcmcia_socket pcmcia_socket; - char name[24]; - int csc_irq; - int io_irq; - spinlock_t lock; -}; - -static struct vrc4171_socket vrc4171_sockets[CARD_MAX_SLOTS]; -static enum vrc4171_slotb vrc4171_slotb =3D SLOTB_IS_NONE; -static char vrc4171_card_name[] =3D "NEC VRC4171 Card Controller"; -static unsigned int vrc4171_irq; -static uint16_t vrc4171_irq_mask =3D 0xdeb8; - -static struct resource vrc4171_card_resource[3] =3D { - { .name =3D vrc4171_card_name, - .start =3D CARD_CONTROLLER_START, - .end =3D CARD_CONTROLLER_END, - .flags =3D IORESOURCE_IO, }, - { .name =3D vrc4171_card_name, - .start =3D INTERRUPT_STATUS, - .end =3D INTERRUPT_STATUS, - .flags =3D IORESOURCE_IO, }, - { .name =3D vrc4171_card_name, - .start =3D CONFIGURATION1, - .end =3D CONFIGURATION1, - .flags =3D IORESOURCE_IO, }, -}; - -static struct platform_device vrc4171_card_device =3D { - .name =3D vrc4171_card_name, - .id =3D 0, - .num_resources =3D 3, - .resource =3D vrc4171_card_resource, -}; - -static inline uint16_t vrc4171_get_irq_status(void) -{ - return inw(INTERRUPT_STATUS); -} - -static inline void vrc4171_set_multifunction_pin(enum vrc4171_slotb config) -{ - uint16_t config1; - - config1 =3D inw(CONFIGURATION1); - config1 &=3D ~SLOTB_CONFIG; - - switch (config) { - case SLOTB_IS_NONE: - config1 |=3D SLOTB_NONE; - break; - case SLOTB_IS_PCCARD: - config1 |=3D SLOTB_PCCARD; - break; - case SLOTB_IS_CF: - config1 |=3D SLOTB_CF; - break; - case SLOTB_IS_FLASHROM: - config1 |=3D SLOTB_FLASHROM; - break; - default: - break; - } - - outw(config1, CONFIGURATION1); -} - -static inline uint8_t exca_read_byte(int slot, uint8_t index) -{ - if (slot =3D=3D CARD_SLOTB) - index +=3D CARD_SLOTB_OFFSET; - - outb(index, CARD_CONTROLLER_INDEX); - return inb(CARD_CONTROLLER_DATA); -} - -static inline uint16_t exca_read_word(int slot, uint8_t index) -{ - uint16_t data; - - if (slot =3D=3D CARD_SLOTB) - index +=3D CARD_SLOTB_OFFSET; - - outb(index++, CARD_CONTROLLER_INDEX); - data =3D inb(CARD_CONTROLLER_DATA); - - outb(index, CARD_CONTROLLER_INDEX); - data |=3D ((uint16_t)inb(CARD_CONTROLLER_DATA)) << 8; - - return data; -} - -static inline uint8_t exca_write_byte(int slot, uint8_t index, uint8_t dat= a) -{ - if (slot =3D=3D CARD_SLOTB) - index +=3D CARD_SLOTB_OFFSET; - - outb(index, CARD_CONTROLLER_INDEX); - outb(data, CARD_CONTROLLER_DATA); - - return data; -} - -static inline uint16_t exca_write_word(int slot, uint8_t index, uint16_t d= ata) -{ - if (slot =3D=3D CARD_SLOTB) - index +=3D CARD_SLOTB_OFFSET; - - outb(index++, CARD_CONTROLLER_INDEX); - outb(data, CARD_CONTROLLER_DATA); - - outb(index, CARD_CONTROLLER_INDEX); - outb((uint8_t)(data >> 8), CARD_CONTROLLER_DATA); - - return data; -} - -static inline int search_nonuse_irq(void) -{ - int i; - - for (i =3D 0; i < 16; i++) { - if (vrc4171_irq_mask & (1 << i)) { - vrc4171_irq_mask &=3D ~(1 << i); - return i; - } - } - - return -1; -} - -static int pccard_init(struct pcmcia_socket *sock) -{ - struct vrc4171_socket *socket; - unsigned int slot; - - sock->features |=3D SS_CAP_PCCARD | SS_CAP_PAGE_REGS; - sock->irq_mask =3D 0; - sock->map_size =3D 0x1000; - sock->pci_irq =3D vrc4171_irq; - - slot =3D sock->sock; - socket =3D &vrc4171_sockets[slot]; - socket->csc_irq =3D search_nonuse_irq(); - socket->io_irq =3D search_nonuse_irq(); - spin_lock_init(&socket->lock); - - return 0; -} - -static int pccard_get_status(struct pcmcia_socket *sock, u_int *value) -{ - unsigned int slot; - uint8_t status, sense; - u_int val =3D 0; - - if (sock =3D=3D NULL || sock->sock >=3D CARD_MAX_SLOTS || value =3D=3D NU= LL) - return -EINVAL; - - slot =3D sock->sock; - - status =3D exca_read_byte(slot, I365_STATUS); - if (exca_read_byte(slot, I365_INTCTL) & I365_PC_IOCARD) { - if (status & I365_CS_STSCHG) - val |=3D SS_STSCHG; - } else { - if (!(status & I365_CS_BVD1)) - val |=3D SS_BATDEAD; - else if ((status & (I365_CS_BVD1 | I365_CS_BVD2)) =3D=3D I365_CS_BVD1) - val |=3D SS_BATWARN; - } - if ((status & I365_CS_DETECT) =3D=3D I365_CS_DETECT) - val |=3D SS_DETECT; - if (status & I365_CS_WRPROT) - val |=3D SS_WRPROT; - if (status & I365_CS_READY) - val |=3D SS_READY; - if (status & I365_CS_POWERON) - val |=3D SS_POWERON; - - sense =3D exca_read_byte(slot, CARD_VOLTAGE_SENSE); - switch (sense) { - case VCC_3VORXV_CAPABLE: - val |=3D SS_3VCARD | SS_XVCARD; - break; - case VCC_XV_ONLY: - val |=3D SS_XVCARD; - break; - case VCC_3V_CAPABLE: - val |=3D SS_3VCARD; - break; - default: - /* 5V only */ - break; - } - - *value =3D val; - - return 0; -} - -static inline uint8_t set_Vcc_value(u_char Vcc) -{ - switch (Vcc) { - case 33: - return VCC_3V; - case 50: - return VCC_5V; - } - - /* Small voltage is chosen for safety. */ - return VCC_3V; -} - -static int pccard_set_socket(struct pcmcia_socket *sock, socket_state_t *s= tate) -{ - struct vrc4171_socket *socket; - unsigned int slot; - uint8_t voltage, power, control, cscint; - - if (sock =3D=3D NULL || sock->sock >=3D CARD_MAX_SLOTS || - (state->Vpp !=3D state->Vcc && state->Vpp !=3D 0) || - (state->Vcc !=3D 50 && state->Vcc !=3D 33 && state->Vcc !=3D 0)) - return -EINVAL; - - slot =3D sock->sock; - socket =3D &vrc4171_sockets[slot]; - - spin_lock_irq(&socket->lock); - - voltage =3D set_Vcc_value(state->Vcc); - exca_write_byte(slot, CARD_VOLTAGE_SELECT, voltage); - - power =3D POWER_ENABLE; - if (state->Vpp =3D=3D state->Vcc) - power |=3D VPP_GET_VCC; - if (state->flags & SS_OUTPUT_ENA) - power |=3D I365_PWR_OUT; - exca_write_byte(slot, I365_POWER, power); - - control =3D 0; - if (state->io_irq !=3D 0) - control |=3D socket->io_irq; - if (state->flags & SS_IOCARD) - control |=3D I365_PC_IOCARD; - if (state->flags & SS_RESET) - control &=3D ~I365_PC_RESET; - else - control |=3D I365_PC_RESET; - exca_write_byte(slot, I365_INTCTL, control); - - cscint =3D 0; - exca_write_byte(slot, I365_CSCINT, cscint); - exca_read_byte(slot, I365_CSC); /* clear CardStatus change */ - if (state->csc_mask !=3D 0) - cscint |=3D socket->csc_irq << 8; - if (state->flags & SS_IOCARD) { - if (state->csc_mask & SS_STSCHG) - cscint |=3D I365_CSC_STSCHG; - } else { - if (state->csc_mask & SS_BATDEAD) - cscint |=3D I365_CSC_BVD1; - if (state->csc_mask & SS_BATWARN) - cscint |=3D I365_CSC_BVD2; - } - if (state->csc_mask & SS_READY) - cscint |=3D I365_CSC_READY; - if (state->csc_mask & SS_DETECT) - cscint |=3D I365_CSC_DETECT; - exca_write_byte(slot, I365_CSCINT, cscint); - - spin_unlock_irq(&socket->lock); - - return 0; -} - -static int pccard_set_io_map(struct pcmcia_socket *sock, struct pccard_io_= map *io) -{ - unsigned int slot; - uint8_t ioctl, addrwin; - u_char map; - - if (sock =3D=3D NULL || sock->sock >=3D CARD_MAX_SLOTS || - io =3D=3D NULL || io->map >=3D IO_MAX_MAPS || - io->start > 0xffff || io->stop > 0xffff || io->start > io->stop) - return -EINVAL; - - slot =3D sock->sock; - map =3D io->map; - - addrwin =3D exca_read_byte(slot, I365_ADDRWIN); - if (addrwin & I365_ENA_IO(map)) { - addrwin &=3D ~I365_ENA_IO(map); - exca_write_byte(slot, I365_ADDRWIN, addrwin); - } - - exca_write_word(slot, I365_IO(map)+I365_W_START, io->start); - exca_write_word(slot, I365_IO(map)+I365_W_STOP, io->stop); - - ioctl =3D 0; - if (io->speed > 0) - ioctl |=3D I365_IOCTL_WAIT(map); - if (io->flags & MAP_16BIT) - ioctl |=3D I365_IOCTL_16BIT(map); - if (io->flags & MAP_AUTOSZ) - ioctl |=3D I365_IOCTL_IOCS16(map); - if (io->flags & MAP_0WS) - ioctl |=3D I365_IOCTL_0WS(map); - exca_write_byte(slot, I365_IOCTL, ioctl); - - if (io->flags & MAP_ACTIVE) { - addrwin |=3D I365_ENA_IO(map); - exca_write_byte(slot, I365_ADDRWIN, addrwin); - } - - return 0; -} - -static int pccard_set_mem_map(struct pcmcia_socket *sock, struct pccard_me= m_map *mem) -{ - unsigned int slot; - uint16_t start, stop, offset; - uint8_t addrwin; - u_char map; - - if (sock =3D=3D NULL || sock->sock >=3D CARD_MAX_SLOTS || - mem =3D=3D NULL || mem->map >=3D MEM_MAX_MAPS || - mem->res->start < CARD_MEM_START || mem->res->start > CARD_MEM_END || - mem->res->end < CARD_MEM_START || mem->res->end > CARD_MEM_END || - mem->res->start > mem->res->end || - mem->card_start > CARD_MAX_MEM_OFFSET || - mem->speed > CARD_MAX_MEM_SPEED) - return -EINVAL; - - slot =3D sock->sock; - map =3D mem->map; - - addrwin =3D exca_read_byte(slot, I365_ADDRWIN); - if (addrwin & I365_ENA_MEM(map)) { - addrwin &=3D ~I365_ENA_MEM(map); - exca_write_byte(slot, I365_ADDRWIN, addrwin); - } - - start =3D (mem->res->start >> 12) & 0x3fff; - if (mem->flags & MAP_16BIT) - start |=3D I365_MEM_16BIT; - exca_write_word(slot, I365_MEM(map)+I365_W_START, start); - - stop =3D (mem->res->end >> 12) & 0x3fff; - switch (mem->speed) { - case 0: - break; - case 1: - stop |=3D I365_MEM_WS0; - break; - case 2: - stop |=3D I365_MEM_WS1; - break; - default: - stop |=3D I365_MEM_WS0 | I365_MEM_WS1; - break; - } - exca_write_word(slot, I365_MEM(map)+I365_W_STOP, stop); - - offset =3D (mem->card_start >> 12) & 0x3fff; - if (mem->flags & MAP_ATTRIB) - offset |=3D I365_MEM_REG; - if (mem->flags & MAP_WRPROT) - offset |=3D I365_MEM_WRPROT; - exca_write_word(slot, I365_MEM(map)+I365_W_OFF, offset); - - if (mem->flags & MAP_ACTIVE) { - addrwin |=3D I365_ENA_MEM(map); - exca_write_byte(slot, I365_ADDRWIN, addrwin); - } - - return 0; -} - -static struct pccard_operations vrc4171_pccard_operations =3D { - .init =3D pccard_init, - .get_status =3D pccard_get_status, - .set_socket =3D pccard_set_socket, - .set_io_map =3D pccard_set_io_map, - .set_mem_map =3D pccard_set_mem_map, -}; - -static inline unsigned int get_events(int slot) -{ - unsigned int events =3D 0; - uint8_t status, csc; - - status =3D exca_read_byte(slot, I365_STATUS); - csc =3D exca_read_byte(slot, I365_CSC); - - if (exca_read_byte(slot, I365_INTCTL) & I365_PC_IOCARD) { - if ((csc & I365_CSC_STSCHG) && (status & I365_CS_STSCHG)) - events |=3D SS_STSCHG; - } else { - if (csc & (I365_CSC_BVD1 | I365_CSC_BVD2)) { - if (!(status & I365_CS_BVD1)) - events |=3D SS_BATDEAD; - else if ((status & (I365_CS_BVD1 | I365_CS_BVD2)) =3D=3D I365_CS_BVD1) - events |=3D SS_BATWARN; - } - } - if ((csc & I365_CSC_READY) && (status & I365_CS_READY)) - events |=3D SS_READY; - if ((csc & I365_CSC_DETECT) && ((status & I365_CS_DETECT) =3D=3D I365_CS_= DETECT)) - events |=3D SS_DETECT; - - return events; -} - -static irqreturn_t pccard_interrupt(int irq, void *dev_id) -{ - struct vrc4171_socket *socket; - unsigned int events; - irqreturn_t retval =3D IRQ_NONE; - uint16_t status; - - status =3D vrc4171_get_irq_status(); - if (status & IRQ_A) { - socket =3D &vrc4171_sockets[CARD_SLOTA]; - if (socket->slot =3D=3D SLOT_INITIALIZED) { - if (status & (1 << socket->csc_irq)) { - events =3D get_events(CARD_SLOTA); - if (events !=3D 0) { - pcmcia_parse_events(&socket->pcmcia_socket, events); - retval =3D IRQ_HANDLED; - } - } - } - } - - if (status & IRQ_B) { - socket =3D &vrc4171_sockets[CARD_SLOTB]; - if (socket->slot =3D=3D SLOT_INITIALIZED) { - if (status & (1 << socket->csc_irq)) { - events =3D get_events(CARD_SLOTB); - if (events !=3D 0) { - pcmcia_parse_events(&socket->pcmcia_socket, events); - retval =3D IRQ_HANDLED; - } - } - } - } - - return retval; -} - -static inline void reserve_using_irq(int slot) -{ - unsigned int irq; - - irq =3D exca_read_byte(slot, I365_INTCTL); - irq &=3D 0x0f; - vrc4171_irq_mask &=3D ~(1 << irq); - - irq =3D exca_read_byte(slot, I365_CSCINT); - irq =3D (irq & 0xf0) >> 4; - vrc4171_irq_mask &=3D ~(1 << irq); -} - -static int vrc4171_add_sockets(void) -{ - struct vrc4171_socket *socket; - int slot, retval; - - for (slot =3D 0; slot < CARD_MAX_SLOTS; slot++) { - if (slot =3D=3D CARD_SLOTB && vrc4171_slotb =3D=3D SLOTB_IS_NONE) - continue; - - socket =3D &vrc4171_sockets[slot]; - if (socket->slot !=3D SLOT_PROBE) { - uint8_t addrwin; - - switch (socket->slot) { - case SLOT_NOPROBE_MEM: - addrwin =3D exca_read_byte(slot, I365_ADDRWIN); - addrwin &=3D 0x1f; - exca_write_byte(slot, I365_ADDRWIN, addrwin); - break; - case SLOT_NOPROBE_IO: - addrwin =3D exca_read_byte(slot, I365_ADDRWIN); - addrwin &=3D 0xc0; - exca_write_byte(slot, I365_ADDRWIN, addrwin); - break; - default: - break; - } - - reserve_using_irq(slot); - continue; - } - - sprintf(socket->name, "NEC VRC4171 Card Slot %1c", 'A' + slot); - socket->pcmcia_socket.dev.parent =3D &vrc4171_card_device.dev; - socket->pcmcia_socket.ops =3D &vrc4171_pccard_operations; - socket->pcmcia_socket.owner =3D THIS_MODULE; - - retval =3D pcmcia_register_socket(&socket->pcmcia_socket); - if (retval < 0) - return retval; - - exca_write_byte(slot, I365_ADDRWIN, 0); - exca_write_byte(slot, GLOBAL_CONTROL, 0); - - socket->slot =3D SLOT_INITIALIZED; - } - - return 0; -} - -static void vrc4171_remove_sockets(void) -{ - struct vrc4171_socket *socket; - int slot; - - for (slot =3D 0; slot < CARD_MAX_SLOTS; slot++) { - if (slot =3D=3D CARD_SLOTB && vrc4171_slotb =3D=3D SLOTB_IS_NONE) - continue; - - socket =3D &vrc4171_sockets[slot]; - if (socket->slot =3D=3D SLOT_INITIALIZED) - pcmcia_unregister_socket(&socket->pcmcia_socket); - - socket->slot =3D SLOT_PROBE; - } -} - -static int vrc4171_card_setup(char *options) -{ - if (options =3D=3D NULL || *options =3D=3D '\0') - return 1; - - if (strncmp(options, "irq:", 4) =3D=3D 0) { - int irq; - options +=3D 4; - irq =3D simple_strtoul(options, &options, 0); - if (irq >=3D 0 && irq < nr_irqs) - vrc4171_irq =3D irq; - - if (*options !=3D ',') - return 1; - options++; - } - - if (strncmp(options, "slota:", 6) =3D=3D 0) { - options +=3D 6; - if (*options !=3D '\0') { - if (strncmp(options, "memnoprobe", 10) =3D=3D 0) { - vrc4171_sockets[CARD_SLOTA].slot =3D SLOT_NOPROBE_MEM; - options +=3D 10; - } else if (strncmp(options, "ionoprobe", 9) =3D=3D 0) { - vrc4171_sockets[CARD_SLOTA].slot =3D SLOT_NOPROBE_IO; - options +=3D 9; - } else if ( strncmp(options, "noprobe", 7) =3D=3D 0) { - vrc4171_sockets[CARD_SLOTA].slot =3D SLOT_NOPROBE_ALL; - options +=3D 7; - } - - if (*options !=3D ',') - return 1; - options++; - } else - return 1; - - } - - if (strncmp(options, "slotb:", 6) =3D=3D 0) { - options +=3D 6; - if (*options !=3D '\0') { - if (strncmp(options, "pccard", 6) =3D=3D 0) { - vrc4171_slotb =3D SLOTB_IS_PCCARD; - options +=3D 6; - } else if (strncmp(options, "cf", 2) =3D=3D 0) { - vrc4171_slotb =3D SLOTB_IS_CF; - options +=3D 2; - } else if (strncmp(options, "flashrom", 8) =3D=3D 0) { - vrc4171_slotb =3D SLOTB_IS_FLASHROM; - options +=3D 8; - } else if (strncmp(options, "none", 4) =3D=3D 0) { - vrc4171_slotb =3D SLOTB_IS_NONE; - options +=3D 4; - } - - if (*options !=3D ',') - return 1; - options++; - - if (strncmp(options, "memnoprobe", 10) =3D=3D 0) - vrc4171_sockets[CARD_SLOTB].slot =3D SLOT_NOPROBE_MEM; - if (strncmp(options, "ionoprobe", 9) =3D=3D 0) - vrc4171_sockets[CARD_SLOTB].slot =3D SLOT_NOPROBE_IO; - if (strncmp(options, "noprobe", 7) =3D=3D 0) - vrc4171_sockets[CARD_SLOTB].slot =3D SLOT_NOPROBE_ALL; - } - } - - return 1; -} - -__setup("vrc4171_card=3D", vrc4171_card_setup); - -static struct platform_driver vrc4171_card_driver =3D { - .driver =3D { - .name =3D vrc4171_card_name, - }, -}; - -static int vrc4171_card_init(void) -{ - int retval; - - retval =3D platform_driver_register(&vrc4171_card_driver); - if (retval < 0) - return retval; - - retval =3D platform_device_register(&vrc4171_card_device); - if (retval < 0) { - platform_driver_unregister(&vrc4171_card_driver); - return retval; - } - - vrc4171_set_multifunction_pin(vrc4171_slotb); - - retval =3D vrc4171_add_sockets(); - if (retval =3D=3D 0) - retval =3D request_irq(vrc4171_irq, pccard_interrupt, IRQF_SHARED, - vrc4171_card_name, vrc4171_sockets); - - if (retval < 0) { - vrc4171_remove_sockets(); - platform_device_unregister(&vrc4171_card_device); - platform_driver_unregister(&vrc4171_card_driver); - return retval; - } - - printk(KERN_INFO "%s, connected to IRQ %d\n", - vrc4171_card_driver.driver.name, vrc4171_irq); - - return 0; -} - -static void vrc4171_card_exit(void) -{ - free_irq(vrc4171_irq, vrc4171_sockets); - vrc4171_remove_sockets(); - platform_device_unregister(&vrc4171_card_device); - platform_driver_unregister(&vrc4171_card_driver); -} - -module_init(vrc4171_card_init); -module_exit(vrc4171_card_exit); --=20 2.29.2