Commit fb1beb29 authored by Linus Torvalds's avatar Linus Torvalds
parents 478e4e9d 9fea84f4
...@@ -108,8 +108,7 @@ static int avmcs_probe(struct pcmcia_device *p_dev) ...@@ -108,8 +108,7 @@ static int avmcs_probe(struct pcmcia_device *p_dev)
p_dev->io.NumPorts2 = 0; p_dev->io.NumPorts2 = 0;
/* Interrupt setup */ /* Interrupt setup */
p_dev->irq.Attributes = IRQ_TYPE_EXCLUSIVE; p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED;
/* General socket configuration */ /* General socket configuration */
p_dev->conf.Attributes = CONF_ENABLE_IRQ; p_dev->conf.Attributes = CONF_ENABLE_IRQ;
......
...@@ -120,8 +120,7 @@ static int avma1cs_probe(struct pcmcia_device *p_dev) ...@@ -120,8 +120,7 @@ static int avma1cs_probe(struct pcmcia_device *p_dev)
p_dev->io.IOAddrLines = 5; p_dev->io.IOAddrLines = 5;
/* Interrupt setup */ /* Interrupt setup */
p_dev->irq.Attributes = IRQ_TYPE_EXCLUSIVE; p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED;
/* General socket configuration */ /* General socket configuration */
p_dev->conf.Attributes = CONF_ENABLE_IRQ; p_dev->conf.Attributes = CONF_ENABLE_IRQ;
......
...@@ -137,7 +137,7 @@ static int elsa_cs_probe(struct pcmcia_device *link) ...@@ -137,7 +137,7 @@ static int elsa_cs_probe(struct pcmcia_device *link)
local->cardnr = -1; local->cardnr = -1;
/* Interrupt setup */ /* Interrupt setup */
link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED; link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
link->irq.Handler = NULL; link->irq.Handler = NULL;
/* /*
......
...@@ -144,7 +144,7 @@ static int sedlbauer_probe(struct pcmcia_device *link) ...@@ -144,7 +144,7 @@ static int sedlbauer_probe(struct pcmcia_device *link)
link->priv = local; link->priv = local;
/* Interrupt setup */ /* Interrupt setup */
link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED; link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
link->irq.Handler = NULL; link->irq.Handler = NULL;
/* /*
......
...@@ -127,7 +127,7 @@ static int teles_probe(struct pcmcia_device *link) ...@@ -127,7 +127,7 @@ static int teles_probe(struct pcmcia_device *link)
link->priv = local; link->priv = local;
/* Interrupt setup */ /* Interrupt setup */
link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED; link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
link->irq.Handler = NULL; link->irq.Handler = NULL;
/* /*
......
...@@ -270,7 +270,7 @@ static int try_io_port(struct pcmcia_device *link) ...@@ -270,7 +270,7 @@ static int try_io_port(struct pcmcia_device *link)
/* for master/slave multifunction cards */ /* for master/slave multifunction cards */
link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
link->irq.Attributes = link->irq.Attributes =
IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED; IRQ_TYPE_DYNAMIC_SHARING;
} }
} else { } else {
/* This should be two 16-port windows */ /* This should be two 16-port windows */
......
...@@ -426,7 +426,7 @@ static int fmvj18x_config(struct pcmcia_device *link) ...@@ -426,7 +426,7 @@ static int fmvj18x_config(struct pcmcia_device *link)
if (link->io.NumPorts2 != 0) { if (link->io.NumPorts2 != 0) {
link->irq.Attributes = link->irq.Attributes =
IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED; IRQ_TYPE_DYNAMIC_SHARING;
ret = mfc_try_io_port(link); ret = mfc_try_io_port(link);
if (ret != 0) goto failed; if (ret != 0) goto failed;
} else if (cardtype == UNGERMANN) { } else if (cardtype == UNGERMANN) {
......
...@@ -490,7 +490,7 @@ static int try_io_port(struct pcmcia_device *link) ...@@ -490,7 +490,7 @@ static int try_io_port(struct pcmcia_device *link)
/* for master/slave multifunction cards */ /* for master/slave multifunction cards */
link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
link->irq.Attributes = link->irq.Attributes =
IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED; IRQ_TYPE_DYNAMIC_SHARING;
} }
} else { } else {
/* This should be two 16-port windows */ /* This should be two 16-port windows */
......
...@@ -454,7 +454,7 @@ static int mhz_mfc_config(struct pcmcia_device *link) ...@@ -454,7 +454,7 @@ static int mhz_mfc_config(struct pcmcia_device *link)
link->conf.Attributes |= CONF_ENABLE_SPKR; link->conf.Attributes |= CONF_ENABLE_SPKR;
link->conf.Status = CCSR_AUDIO_ENA; link->conf.Status = CCSR_AUDIO_ENA;
link->irq.Attributes = link->irq.Attributes =
IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED; IRQ_TYPE_DYNAMIC_SHARING;
link->io.IOAddrLines = 16; link->io.IOAddrLines = 16;
link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
link->io.NumPorts2 = 8; link->io.NumPorts2 = 8;
......
...@@ -841,7 +841,7 @@ xirc2ps_config(struct pcmcia_device * link) ...@@ -841,7 +841,7 @@ xirc2ps_config(struct pcmcia_device * link)
link->conf.Attributes |= CONF_ENABLE_SPKR; link->conf.Attributes |= CONF_ENABLE_SPKR;
link->conf.Status |= CCSR_AUDIO_ENA; link->conf.Status |= CCSR_AUDIO_ENA;
} }
link->irq.Attributes |= IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED ; link->irq.Attributes |= IRQ_TYPE_DYNAMIC_SHARING;
link->io.NumPorts2 = 8; link->io.NumPorts2 = 8;
link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
if (local->dingo) { if (local->dingo) {
......
...@@ -64,7 +64,7 @@ config PCMCIA_IOCTL ...@@ -64,7 +64,7 @@ config PCMCIA_IOCTL
If unsure, say Y. If unsure, say Y.
config CARDBUS config CARDBUS
bool "32-bit CardBus support" bool "32-bit CardBus support"
depends on PCI depends on PCI
default y default y
---help--- ---help---
...@@ -87,8 +87,8 @@ config YENTA ...@@ -87,8 +87,8 @@ config YENTA
select PCCARD_NONSTATIC select PCCARD_NONSTATIC
---help--- ---help---
This option enables support for CardBus host bridges. Virtually This option enables support for CardBus host bridges. Virtually
all modern PCMCIA bridges are CardBus compatible. A "bridge" is all modern PCMCIA bridges are CardBus compatible. A "bridge" is
the hardware inside your computer that PCMCIA cards are plugged the hardware inside your computer that PCMCIA cards are plugged
into. into.
To compile this driver as modules, choose M here: the To compile this driver as modules, choose M here: the
......
...@@ -27,8 +27,8 @@ ...@@ -27,8 +27,8 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/pci.h> #include <linux/pci.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/io.h>
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/io.h>
#include <pcmcia/cs_types.h> #include <pcmcia/cs_types.h>
#include <pcmcia/ss.h> #include <pcmcia/ss.h>
...@@ -58,7 +58,7 @@ ...@@ -58,7 +58,7 @@
image number and an offset within that image. xlate_rom_addr() image number and an offset within that image. xlate_rom_addr()
converts an image/offset address to an absolute offset from the converts an image/offset address to an absolute offset from the
ROM's base address. ROM's base address.
=====================================================================*/ =====================================================================*/
static u_int xlate_rom_addr(void __iomem *b, u_int addr) static u_int xlate_rom_addr(void __iomem *b, u_int addr)
...@@ -85,10 +85,10 @@ static u_int xlate_rom_addr(void __iomem *b, u_int addr) ...@@ -85,10 +85,10 @@ static u_int xlate_rom_addr(void __iomem *b, u_int addr)
These are similar to setup_cis_mem and release_cis_mem for 16-bit These are similar to setup_cis_mem and release_cis_mem for 16-bit
cards. The "result" that is used externally is the cb_cis_virt cards. The "result" that is used externally is the cb_cis_virt
pointer in the struct pcmcia_socket structure. pointer in the struct pcmcia_socket structure.
=====================================================================*/ =====================================================================*/
static void cb_release_cis_mem(struct pcmcia_socket * s) static void cb_release_cis_mem(struct pcmcia_socket *s)
{ {
if (s->cb_cis_virt) { if (s->cb_cis_virt) {
dev_dbg(&s->dev, "cb_release_cis_mem()\n"); dev_dbg(&s->dev, "cb_release_cis_mem()\n");
...@@ -98,7 +98,7 @@ static void cb_release_cis_mem(struct pcmcia_socket * s) ...@@ -98,7 +98,7 @@ static void cb_release_cis_mem(struct pcmcia_socket * s)
} }
} }
static int cb_setup_cis_mem(struct pcmcia_socket * s, struct resource *res) static int cb_setup_cis_mem(struct pcmcia_socket *s, struct resource *res)
{ {
unsigned int start, size; unsigned int start, size;
...@@ -124,10 +124,11 @@ static int cb_setup_cis_mem(struct pcmcia_socket * s, struct resource *res) ...@@ -124,10 +124,11 @@ static int cb_setup_cis_mem(struct pcmcia_socket * s, struct resource *res)
This is used by the CIS processing code to read CIS information This is used by the CIS processing code to read CIS information
from a CardBus device. from a CardBus device.
=====================================================================*/ =====================================================================*/
int read_cb_mem(struct pcmcia_socket * s, int space, u_int addr, u_int len, void *ptr) int read_cb_mem(struct pcmcia_socket *s, int space, u_int addr, u_int len,
void *ptr)
{ {
struct pci_dev *dev; struct pci_dev *dev;
struct resource *res; struct resource *res;
...@@ -181,7 +182,7 @@ int read_cb_mem(struct pcmcia_socket * s, int space, u_int addr, u_int len, void ...@@ -181,7 +182,7 @@ int read_cb_mem(struct pcmcia_socket * s, int space, u_int addr, u_int len, void
cb_alloc() and cb_free() allocate and free the kernel data cb_alloc() and cb_free() allocate and free the kernel data
structures for a Cardbus device, and handle the lowest level PCI structures for a Cardbus device, and handle the lowest level PCI
device setup issues. device setup issues.
=====================================================================*/ =====================================================================*/
static void cardbus_config_irq_and_cls(struct pci_bus *bus, int irq) static void cardbus_config_irq_and_cls(struct pci_bus *bus, int irq)
...@@ -214,14 +215,14 @@ static void cardbus_config_irq_and_cls(struct pci_bus *bus, int irq) ...@@ -214,14 +215,14 @@ static void cardbus_config_irq_and_cls(struct pci_bus *bus, int irq)
} }
} }
int __ref cb_alloc(struct pcmcia_socket * s) int __ref cb_alloc(struct pcmcia_socket *s)
{ {
struct pci_bus *bus = s->cb_dev->subordinate; struct pci_bus *bus = s->cb_dev->subordinate;
struct pci_dev *dev; struct pci_dev *dev;
unsigned int max, pass; unsigned int max, pass;
s->functions = pci_scan_slot(bus, PCI_DEVFN(0, 0)); s->functions = pci_scan_slot(bus, PCI_DEVFN(0, 0));
// pcibios_fixup_bus(bus); /* pcibios_fixup_bus(bus); */
max = bus->secondary; max = bus->secondary;
for (pass = 0; pass < 2; pass++) for (pass = 0; pass < 2; pass++)
...@@ -248,7 +249,7 @@ int __ref cb_alloc(struct pcmcia_socket * s) ...@@ -248,7 +249,7 @@ int __ref cb_alloc(struct pcmcia_socket * s)
return 0; return 0;
} }
void cb_free(struct pcmcia_socket * s) void cb_free(struct pcmcia_socket *s)
{ {
struct pci_dev *bridge = s->cb_dev; struct pci_dev *bridge = s->cb_dev;
......
This diff is collapsed.
...@@ -135,7 +135,7 @@ int pcmcia_socket_dev_resume(struct device *dev) ...@@ -135,7 +135,7 @@ int pcmcia_socket_dev_resume(struct device *dev)
EXPORT_SYMBOL(pcmcia_socket_dev_resume); EXPORT_SYMBOL(pcmcia_socket_dev_resume);
struct pcmcia_socket * pcmcia_get_socket(struct pcmcia_socket *skt) struct pcmcia_socket *pcmcia_get_socket(struct pcmcia_socket *skt)
{ {
struct device *dev = get_device(&skt->dev); struct device *dev = get_device(&skt->dev);
if (!dev) if (!dev)
...@@ -145,7 +145,7 @@ struct pcmcia_socket * pcmcia_get_socket(struct pcmcia_socket *skt) ...@@ -145,7 +145,7 @@ struct pcmcia_socket * pcmcia_get_socket(struct pcmcia_socket *skt)
put_device(&skt->dev); put_device(&skt->dev);
return NULL; return NULL;
} }
return (skt); return skt;
} }
EXPORT_SYMBOL(pcmcia_get_socket); EXPORT_SYMBOL(pcmcia_get_socket);
...@@ -297,7 +297,7 @@ void pcmcia_unregister_socket(struct pcmcia_socket *socket) ...@@ -297,7 +297,7 @@ void pcmcia_unregister_socket(struct pcmcia_socket *socket)
EXPORT_SYMBOL(pcmcia_unregister_socket); EXPORT_SYMBOL(pcmcia_unregister_socket);
struct pcmcia_socket * pcmcia_get_socket_by_nr(unsigned int nr) struct pcmcia_socket *pcmcia_get_socket_by_nr(unsigned int nr)
{ {
struct pcmcia_socket *s; struct pcmcia_socket *s;
...@@ -736,7 +736,7 @@ EXPORT_SYMBOL(pcmcia_parse_events); ...@@ -736,7 +736,7 @@ EXPORT_SYMBOL(pcmcia_parse_events);
/* register pcmcia_callback */ /* register pcmcia_callback */
int pccard_register_pcmcia(struct pcmcia_socket *s, struct pcmcia_callback *c) int pccard_register_pcmcia(struct pcmcia_socket *s, struct pcmcia_callback *c)
{ {
int ret = 0; int ret = 0;
/* s->skt_mutex also protects s->callback */ /* s->skt_mutex also protects s->callback */
mutex_lock(&s->skt_mutex); mutex_lock(&s->skt_mutex);
...@@ -848,7 +848,7 @@ EXPORT_SYMBOL(pcmcia_suspend_card); ...@@ -848,7 +848,7 @@ EXPORT_SYMBOL(pcmcia_suspend_card);
int pcmcia_resume_card(struct pcmcia_socket *skt) int pcmcia_resume_card(struct pcmcia_socket *skt)
{ {
int ret; int ret;
dev_dbg(&skt->dev, "waking up socket\n"); dev_dbg(&skt->dev, "waking up socket\n");
mutex_lock(&skt->skt_mutex); mutex_lock(&skt->skt_mutex);
...@@ -876,7 +876,7 @@ EXPORT_SYMBOL(pcmcia_resume_card); ...@@ -876,7 +876,7 @@ EXPORT_SYMBOL(pcmcia_resume_card);
int pcmcia_eject_card(struct pcmcia_socket *skt) int pcmcia_eject_card(struct pcmcia_socket *skt)
{ {
int ret; int ret;
dev_dbg(&skt->dev, "user eject request\n"); dev_dbg(&skt->dev, "user eject request\n");
mutex_lock(&skt->skt_mutex); mutex_lock(&skt->skt_mutex);
......
...@@ -57,7 +57,7 @@ static void pcmcia_check_driver(struct pcmcia_driver *p_drv) ...@@ -57,7 +57,7 @@ static void pcmcia_check_driver(struct pcmcia_driver *p_drv)
"function\n", p_drv->drv.name); "function\n", p_drv->drv.name);
while (did && did->match_flags) { while (did && did->match_flags) {
for (i=0; i<4; i++) { for (i = 0; i < 4; i++) {
if (!did->prod_id[i]) if (!did->prod_id[i])
continue; continue;
...@@ -105,7 +105,7 @@ pcmcia_store_new_id(struct device_driver *driver, const char *buf, size_t count) ...@@ -105,7 +105,7 @@ pcmcia_store_new_id(struct device_driver *driver, const char *buf, size_t count)
__u16 match_flags, manf_id, card_id; __u16 match_flags, manf_id, card_id;
__u8 func_id, function, device_no; __u8 func_id, function, device_no;
__u32 prod_id_hash[4] = {0, 0, 0, 0}; __u32 prod_id_hash[4] = {0, 0, 0, 0};
int fields=0; int fields = 0;
int retval = 0; int retval = 0;
fields = sscanf(buf, "%hx %hx %hx %hhx %hhx %hhx %x %x %x %x", fields = sscanf(buf, "%hx %hx %hx %hhx %hhx %hhx %x %x %x %x",
...@@ -214,7 +214,7 @@ EXPORT_SYMBOL(pcmcia_unregister_driver); ...@@ -214,7 +214,7 @@ EXPORT_SYMBOL(pcmcia_unregister_driver);
/* pcmcia_device handling */ /* pcmcia_device handling */
struct pcmcia_device * pcmcia_get_dev(struct pcmcia_device *p_dev) struct pcmcia_device *pcmcia_get_dev(struct pcmcia_device *p_dev)
{ {
struct device *tmp_dev; struct device *tmp_dev;
tmp_dev = get_device(&p_dev->dev); tmp_dev = get_device(&p_dev->dev);
...@@ -258,7 +258,7 @@ static void pcmcia_add_device_later(struct pcmcia_socket *s, int mfc) ...@@ -258,7 +258,7 @@ static void pcmcia_add_device_later(struct pcmcia_socket *s, int mfc)
return; return;
} }
static int pcmcia_device_probe(struct device * dev) static int pcmcia_device_probe(struct device *dev)
{ {
struct pcmcia_device *p_dev; struct pcmcia_device *p_dev;
struct pcmcia_driver *p_drv; struct pcmcia_driver *p_drv;
...@@ -325,7 +325,7 @@ static int pcmcia_device_probe(struct device * dev) ...@@ -325,7 +325,7 @@ static int pcmcia_device_probe(struct device * dev)
put_dev: put_dev:
if (ret) if (ret)
put_device(dev); put_device(dev);
return (ret); return ret;
} }
...@@ -354,7 +354,7 @@ static void pcmcia_card_remove(struct pcmcia_socket *s, struct pcmcia_device *le ...@@ -354,7 +354,7 @@ static void pcmcia_card_remove(struct pcmcia_socket *s, struct pcmcia_device *le
spin_lock_irqsave(&pcmcia_dev_list_lock, flags); spin_lock_irqsave(&pcmcia_dev_list_lock, flags);
list_del(&p_dev->socket_device_list); list_del(&p_dev->socket_device_list);
p_dev->_removed=1; p_dev->_removed = 1;
spin_unlock_irqrestore(&pcmcia_dev_list_lock, flags); spin_unlock_irqrestore(&pcmcia_dev_list_lock, flags);
dev_dbg(&p_dev->dev, "unregistering device\n"); dev_dbg(&p_dev->dev, "unregistering device\n");
...@@ -364,7 +364,7 @@ static void pcmcia_card_remove(struct pcmcia_socket *s, struct pcmcia_device *le ...@@ -364,7 +364,7 @@ static void pcmcia_card_remove(struct pcmcia_socket *s, struct pcmcia_device *le
return; return;
} }
static int pcmcia_device_remove(struct device * dev) static int pcmcia_device_remove(struct device *dev)
{ {
struct pcmcia_device *p_dev; struct pcmcia_device *p_dev;
struct pcmcia_driver *p_drv; struct pcmcia_driver *p_drv;
...@@ -391,7 +391,7 @@ static int pcmcia_device_remove(struct device * dev) ...@@ -391,7 +391,7 @@ static int pcmcia_device_remove(struct device * dev)
return 0; return 0;
if (p_drv->remove) if (p_drv->remove)
p_drv->remove(p_dev); p_drv->remove(p_dev);
p_dev->dev_node = NULL; p_dev->dev_node = NULL;
...@@ -499,7 +499,7 @@ static int pcmcia_device_query(struct pcmcia_device *p_dev) ...@@ -499,7 +499,7 @@ static int pcmcia_device_query(struct pcmcia_device *p_dev)
*/ */
static DEFINE_MUTEX(device_add_lock); static DEFINE_MUTEX(device_add_lock);
struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int function) struct pcmcia_device *pcmcia_device_add(struct pcmcia_socket *s, unsigned int function)
{ {
struct pcmcia_device *p_dev, *tmp_dev; struct pcmcia_device *p_dev, *tmp_dev;
unsigned long flags; unsigned long flags;
...@@ -545,8 +545,8 @@ struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int f ...@@ -545,8 +545,8 @@ struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int f
* Note that this is serialized by the device_add_lock, so that * Note that this is serialized by the device_add_lock, so that
* only one such struct will be created. * only one such struct will be created.
*/ */
list_for_each_entry(tmp_dev, &s->devices_list, socket_device_list) list_for_each_entry(tmp_dev, &s->devices_list, socket_device_list)
if (p_dev->func == tmp_dev->func) { if (p_dev->func == tmp_dev->func) {
p_dev->function_config = tmp_dev->function_config; p_dev->function_config = tmp_dev->function_config;
p_dev->io = tmp_dev->io; p_dev->io = tmp_dev->io;
p_dev->irq = tmp_dev->irq; p_dev->irq = tmp_dev->irq;
...@@ -627,10 +627,10 @@ static int pcmcia_card_add(struct pcmcia_socket *s) ...@@ -627,10 +627,10 @@ static int pcmcia_card_add(struct pcmcia_socket *s)
no_funcs = 1; no_funcs = 1;
s->functions = no_funcs; s->functions = no_funcs;
for (i=0; i < no_funcs; i++) for (i = 0; i < no_funcs; i++)
pcmcia_device_add(s, i); pcmcia_device_add(s, i);
return (ret); return ret;
} }
...@@ -756,7 +756,7 @@ static int pcmcia_load_firmware(struct pcmcia_device *dev, char * filename) ...@@ -756,7 +756,7 @@ static int pcmcia_load_firmware(struct pcmcia_device *dev, char * filename)
release: release:
release_firmware(fw); release_firmware(fw);
return (ret); return ret;
} }
#else /* !CONFIG_PCMCIA_LOAD_CIS */ #else /* !CONFIG_PCMCIA_LOAD_CIS */
...@@ -852,7 +852,7 @@ static inline int pcmcia_devmatch(struct pcmcia_device *dev, ...@@ -852,7 +852,7 @@ static inline int pcmcia_devmatch(struct pcmcia_device *dev,
if (did->match_flags & PCMCIA_DEV_ID_MATCH_ANONYMOUS) { if (did->match_flags & PCMCIA_DEV_ID_MATCH_ANONYMOUS) {
int i; int i;
for (i=0; i<4; i++) for (i = 0; i < 4; i++)
if (dev->prod_id[i]) if (dev->prod_id[i])
return 0; return 0;
if (dev->has_manf_id || dev->has_card_id || dev->has_func_id) if (dev->has_manf_id || dev->has_card_id || dev->has_func_id)
...@@ -865,9 +865,10 @@ static inline int pcmcia_devmatch(struct pcmcia_device *dev, ...@@ -865,9 +865,10 @@ static inline int pcmcia_devmatch(struct pcmcia_device *dev,
} }
static int pcmcia_bus_match(struct device * dev, struct device_driver * drv) { static int pcmcia_bus_match(struct device *dev, struct device_driver *drv)
struct pcmcia_device * p_dev = to_pcmcia_dev(dev); {
struct pcmcia_driver * p_drv = to_pcmcia_drv(drv); struct pcmcia_device *p_dev = to_pcmcia_dev(dev);
struct pcmcia_driver *p_drv = to_pcmcia_drv(drv);
struct pcmcia_device_id *did = p_drv->id_table; struct pcmcia_device_id *did = p_drv->id_table;
struct pcmcia_dynid *dynid; struct pcmcia_dynid *dynid;
...@@ -917,7 +918,7 @@ static int pcmcia_bus_uevent(struct device *dev, struct kobj_uevent_env *env) ...@@ -917,7 +918,7 @@ static int pcmcia_bus_uevent(struct device *dev, struct kobj_uevent_env *env)
p_dev = to_pcmcia_dev(dev); p_dev = to_pcmcia_dev(dev);
/* calculate hashes */ /* calculate hashes */
for (i=0; i<4; i++) { for (i = 0; i < 4; i++) {
if (!p_dev->prod_id[i]) if (!p_dev->prod_id[i])
continue; continue;
hash[i] = crc32(0, p_dev->prod_id[i], strlen(p_dev->prod_id[i])); hash[i] = crc32(0, p_dev->prod_id[i], strlen(p_dev->prod_id[i]));
...@@ -984,14 +985,14 @@ static void runtime_resume(struct device *dev) ...@@ -984,14 +985,14 @@ static void runtime_resume(struct device *dev)
static ssize_t field##_show (struct device *dev, struct device_attribute *attr, char *buf) \ static ssize_t field##_show (struct device *dev, struct device_attribute *attr, char *buf) \
{ \ { \
struct pcmcia_device *p_dev = to_pcmcia_dev(dev); \ struct pcmcia_device *p_dev = to_pcmcia_dev(dev); \
return p_dev->test ? sprintf (buf, format, p_dev->field) : -ENODEV; \ return p_dev->test ? sprintf(buf, format, p_dev->field) : -ENODEV; \
} }
#define pcmcia_device_stringattr(name, field) \ #define pcmcia_device_stringattr(name, field) \
static ssize_t name##_show (struct device *dev, struct device_attribute *attr, char *buf) \ static ssize_t name##_show (struct device *dev, struct device_attribute *attr, char *buf) \
{ \ { \
struct pcmcia_device *p_dev = to_pcmcia_dev(dev); \ struct pcmcia_device *p_dev = to_pcmcia_dev(dev); \
return p_dev->field ? sprintf (buf, "%s\n", p_dev->field) : -ENODEV; \ return p_dev->field ? sprintf(buf, "%s\n", p_dev->field) : -ENODEV; \
} }
pcmcia_device_attr(func, socket, "0x%02x\n"); pcmcia_device_attr(func, socket, "0x%02x\n");
...@@ -1020,8 +1021,8 @@ static ssize_t pcmcia_store_pm_state(struct device *dev, struct device_attribute ...@@ -1020,8 +1021,8 @@ static ssize_t pcmcia_store_pm_state(struct device *dev, struct device_attribute
struct pcmcia_device *p_dev = to_pcmcia_dev(dev); struct pcmcia_device *p_dev = to_pcmcia_dev(dev);
int ret = 0; int ret = 0;
if (!count) if (!count)
return -EINVAL; return -EINVAL;
if ((!p_dev->suspended) && !strncmp(buf, "off", 3)) if ((!p_dev->suspended) && !strncmp(buf, "off", 3))
ret = runtime_suspend(dev); ret = runtime_suspend(dev);
...@@ -1039,10 +1040,11 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *attr, ...@@ -1039,10 +1040,11 @@ static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
u32 hash[4] = { 0, 0, 0, 0}; u32 hash[4] = { 0, 0, 0, 0};
/* calculate hashes */ /* calculate hashes */
for (i=0; i<4; i++) { for (i = 0; i < 4; i++) {
if (!p_dev->prod_id[i]) if (!p_dev->prod_id[i])
continue; continue;
hash[i] = crc32(0,p_dev->prod_id[i],strlen(p_dev->prod_id[i])); hash[i] = crc32(0, p_dev->prod_id[i],
strlen(p_dev->prod_id[i]));
} }
return sprintf(buf, "pcmcia:m%04Xc%04Xf%02Xfn%02Xpfn%02X" return sprintf(buf, "pcmcia:m%04Xc%04Xf%02Xfn%02Xpfn%02X"
"pa%08Xpb%08Xpc%08Xpd%08X\n", "pa%08Xpb%08Xpc%08Xpd%08X\n",
...@@ -1091,7 +1093,7 @@ static struct device_attribute pcmcia_dev_attrs[] = { ...@@ -1091,7 +1093,7 @@ static struct device_attribute pcmcia_dev_attrs[] = {
/* PM support, also needed for reset */ /* PM support, also needed for reset */
static int pcmcia_dev_suspend(struct device * dev, pm_message_t state) static int pcmcia_dev_suspend(struct device *dev, pm_message_t state)
{ {
struct pcmcia_device *p_dev = to_pcmcia_dev(dev); struct pcmcia_device *p_dev = to_pcmcia_dev(dev);
struct pcmcia_driver *p_drv = NULL; struct pcmcia_driver *p_drv = NULL;
...@@ -1131,10 +1133,10 @@ static int pcmcia_dev_suspend(struct device * dev, pm_message_t state) ...@@ -1131,10 +1133,10 @@ static int pcmcia_dev_suspend(struct device * dev, pm_message_t state)
} }
static int pcmcia_dev_resume(struct device * dev) static int pcmcia_dev_resume(struct device *dev)
{ {
struct pcmcia_device *p_dev = to_pcmcia_dev(dev); struct pcmcia_device *p_dev = to_pcmcia_dev(dev);
struct pcmcia_driver *p_drv = NULL; struct pcmcia_driver *p_drv = NULL;
int ret = 0; int ret = 0;
if (!p_dev->suspended) if (!p_dev->suspended)
...@@ -1211,7 +1213,7 @@ static int pcmcia_bus_suspend(struct pcmcia_socket *skt) ...@@ -1211,7 +1213,7 @@ static int pcmcia_bus_suspend(struct pcmcia_socket *skt)
/*====================================================================== /*======================================================================
The card status event handler. The card status event handler.
======================================================================*/ ======================================================================*/
/* Normally, the event is passed to individual drivers after /* Normally, the event is passed to individual drivers after
...@@ -1264,7 +1266,7 @@ static int ds_event(struct pcmcia_socket *skt, event_t event, int priority) ...@@ -1264,7 +1266,7 @@ static int ds_event(struct pcmcia_socket *skt, event_t event, int priority)
} /* ds_event */ } /* ds_event */
struct pcmcia_device * pcmcia_dev_present(struct pcmcia_device *_p_dev) struct pcmcia_device *pcmcia_dev_present(struct pcmcia_device *_p_dev)
{ {
struct pcmcia_device *p_dev; struct pcmcia_device *p_dev;
struct pcmcia_device *ret = NULL; struct pcmcia_device *ret = NULL;
...@@ -1329,7 +1331,7 @@ static int __devinit pcmcia_bus_add_socket(struct device *dev, ...@@ -1329,7 +1331,7 @@ static int __devinit pcmcia_bus_add_socket(struct device *dev,
if (ret) { if (ret) {
dev_printk(KERN_ERR, dev, "PCMCIA registration failed\n"); dev_printk(KERN_ERR, dev, "PCMCIA registration failed\n");
pcmcia_put_socket(socket); pcmcia_put_socket(socket);
return (ret); return ret;
} }
return 0; return 0;
...@@ -1400,7 +1402,7 @@ static int __init init_pcmcia_bus(void) ...@@ -1400,7 +1402,7 @@ static int __init init_pcmcia_bus(void)
return 0; return 0;
} }
fs_initcall(init_pcmcia_bus); /* one level after subsys_initcall so that fs_initcall(init_pcmcia_bus); /* one level after subsys_initcall so that
* pcmcia_socket_class is already registered */ * pcmcia_socket_class is already registered */
......
...@@ -88,12 +88,12 @@ static struct pcmcia_driver *get_pcmcia_driver(dev_info_t *dev_info) ...@@ -88,12 +88,12 @@ static struct pcmcia_driver *get_pcmcia_driver(dev_info_t *dev_info)
p_drv = container_of(drv, struct pcmcia_driver, drv); p_drv = container_of(drv, struct pcmcia_driver, drv);
return (p_drv); return p_drv;
} }
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
static struct proc_dir_entry *proc_pccard = NULL; static struct proc_dir_entry *proc_pccard;
static int proc_read_drivers_callback(struct device_driver *driver, void *_m) static int proc_read_drivers_callback(struct device_driver *driver, void *_m)
{ {
...@@ -158,7 +158,8 @@ static int adjust_irq(struct pcmcia_socket *s, adjust_t *adj) ...@@ -158,7 +158,8 @@ static int adjust_irq(struct pcmcia_socket *s, adjust_t *adj)
#else #else
static inline int adjust_irq(struct pcmcia_socket *s, adjust_t *adj) { static inline int adjust_irq(struct pcmcia_socket *s, adjust_t *adj)
{
return 0; return 0;
} }
...@@ -195,7 +196,7 @@ static int pcmcia_adjust_resource_info(adjust_t *adj) ...@@ -195,7 +196,7 @@ static int pcmcia_adjust_resource_info(adjust_t *adj)
begin = adj->resource.memory.Base; begin = adj->resource.memory.Base;
end = adj->resource.memory.Base + adj->resource.memory.Size - 1; end = adj->resource.memory.Base + adj->resource.memory.Size - 1;
if (s->resource_ops->add_mem) if (s->resource_ops->add_mem)
ret =s->resource_ops->add_mem(s, adj->Action, begin, end); ret = s->resource_ops->add_mem(s, adj->Action, begin, end);
case RES_IO_RANGE: case RES_IO_RANGE:
begin = adj->resource.io.BasePort; begin = adj->resource.io.BasePort;
end = adj->resource.io.BasePort + adj->resource.io.NumPorts - 1; end = adj->resource.io.BasePort + adj->resource.io.NumPorts - 1;
...@@ -215,7 +216,7 @@ static int pcmcia_adjust_resource_info(adjust_t *adj) ...@@ -215,7 +216,7 @@ static int pcmcia_adjust_resource_info(adjust_t *adj)
} }
up_read(&pcmcia_socket_list_rwsem); up_read(&pcmcia_socket_list_rwsem);
return (ret); return ret;
} }
...@@ -490,7 +491,7 @@ static int bind_request(struct pcmcia_socket *s, bind_info_t *bind_info) ...@@ -490,7 +491,7 @@ static int bind_request(struct pcmcia_socket *s, bind_info_t *bind_info)
} }
spin_lock_irqsave(&pcmcia_dev_list_lock, flags); spin_lock_irqsave(&pcmcia_dev_list_lock, flags);
list_for_each_entry(p_dev, &s->devices_list, socket_device_list) { list_for_each_entry(p_dev, &s->devices_list, socket_device_list) {
if (p_dev->func == bind_info->function) { if (p_dev->func == bind_info->function) {
if ((p_dev->dev.driver == &p_drv->drv)) { if ((p_dev->dev.driver == &p_drv->drv)) {
if (p_dev->cardmgr) { if (p_dev->cardmgr) {
...@@ -558,7 +559,7 @@ static int bind_request(struct pcmcia_socket *s, bind_info_t *bind_info) ...@@ -558,7 +559,7 @@ static int bind_request(struct pcmcia_socket *s, bind_info_t *bind_info)
err_put: err_put:
pcmcia_put_socket(s); pcmcia_put_socket(s);
return (ret); return ret;
} /* bind_request */ } /* bind_request */
#ifdef CONFIG_CARDBUS #ifdef CONFIG_CARDBUS
...@@ -655,7 +656,7 @@ static int get_device_info(struct pcmcia_socket *s, bind_info_t *bind_info, int ...@@ -655,7 +656,7 @@ static int get_device_info(struct pcmcia_socket *s, bind_info_t *bind_info, int
err_put: err_put:
pcmcia_put_dev(p_dev); pcmcia_put_dev(p_dev);
return (ret); return ret;
} /* get_device_info */ } /* get_device_info */
...@@ -664,7 +665,7 @@ static int ds_open(struct inode *inode, struct file *file) ...@@ -664,7 +665,7 @@ static int ds_open(struct inode *inode, struct file *file)
socket_t i = iminor(inode); socket_t i = iminor(inode);
struct pcmcia_socket *s; struct pcmcia_socket *s;
user_info_t *user; user_info_t *user;
static int warning_printed = 0; static int warning_printed;
int ret = 0; int ret = 0;
pr_debug("ds_open(socket %d)\n", i); pr_debug("ds_open(socket %d)\n", i);
...@@ -738,12 +739,13 @@ static int ds_release(struct inode *inode, struct file *file) ...@@ -738,12 +739,13 @@ static int ds_release(struct inode *inode, struct file *file)
s = user->socket; s = user->socket;
/* Unlink user data structure */ /* Unlink user data structure */
if ((file->f_flags & O_ACCMODE) != O_RDONLY) { if ((file->f_flags & O_ACCMODE) != O_RDONLY)
s->pcmcia_state.busy = 0; s->pcmcia_state.busy = 0;
}
file->private_data = NULL; file->private_data = NULL;
for (link = &s->user; *link; link = &(*link)->next) for (link = &s->user; *link; link = &(*link)->next)
if (*link == user) break; if (*link == user)
break;
if (link == NULL) if (link == NULL)
goto out; goto out;
*link = user->next; *link = user->next;
...@@ -774,7 +776,7 @@ static ssize_t ds_read(struct file *file, char __user *buf, ...@@ -774,7 +776,7 @@ static ssize_t ds_read(struct file *file, char __user *buf,
s = user->socket; s = user->socket;
if (s->pcmcia_state.dead) if (s->pcmcia_state.dead)
return -EIO; return -EIO;
ret = wait_event_interruptible(s->queue, !queue_empty(user)); ret = wait_event_interruptible(s->queue, !queue_empty(user));
if (ret == 0) if (ret == 0)
...@@ -824,7 +826,7 @@ static u_int ds_poll(struct file *file, poll_table *wait) ...@@ -824,7 +826,7 @@ static u_int ds_poll(struct file *file, poll_table *wait)
/*====================================================================*/ /*====================================================================*/
static int ds_ioctl(struct inode * inode, struct file * file, static int ds_ioctl(struct inode *inode, struct file *file,
u_int cmd, u_long arg) u_int cmd, u_long arg)
{ {
struct pcmcia_socket *s; struct pcmcia_socket *s;
...@@ -842,10 +844,11 @@ static int ds_ioctl(struct inode * inode, struct file * file, ...@@ -842,10 +844,11 @@ static int ds_ioctl(struct inode * inode, struct file * file,
s = user->socket; s = user->socket;
if (s->pcmcia_state.dead) if (s->pcmcia_state.dead)
return -EIO; return -EIO;
size = (cmd & IOCSIZE_MASK) >> IOCSIZE_SHIFT; size = (cmd & IOCSIZE_MASK) >> IOCSIZE_SHIFT;
if (size > sizeof(ds_ioctl_arg_t)) return -EINVAL; if (size > sizeof(ds_ioctl_arg_t))
return -EINVAL;
/* Permission check */ /* Permission check */
if (!(cmd & IOC_OUT) && !capable(CAP_SYS_ADMIN)) if (!(cmd & IOC_OUT) && !capable(CAP_SYS_ADMIN))
...@@ -1024,8 +1027,8 @@ static int ds_ioctl(struct inode * inode, struct file * file, ...@@ -1024,8 +1027,8 @@ static int ds_ioctl(struct inode * inode, struct file * file,
} }
if (cmd & IOC_OUT) { if (cmd & IOC_OUT) {
if (__copy_to_user(uarg, (char *)buf, size)) if (__copy_to_user(uarg, (char *)buf, size))
err = -EFAULT; err = -EFAULT;
} }
free_out: free_out:
...@@ -1045,7 +1048,8 @@ static const struct file_operations ds_fops = { ...@@ -1045,7 +1048,8 @@ static const struct file_operations ds_fops = {
.poll = ds_poll, .poll = ds_poll,
}; };
void __init pcmcia_setup_ioctl(void) { void __init pcmcia_setup_ioctl(void)
{
int i; int i;
/* Set up character device for user mode clients */ /* Set up character device for user mode clients */
...@@ -1064,7 +1068,8 @@ void __init pcmcia_setup_ioctl(void) { ...@@ -1064,7 +1068,8 @@ void __init pcmcia_setup_ioctl(void) {
} }
void __exit pcmcia_cleanup_ioctl(void) { void __exit pcmcia_cleanup_ioctl(void)
{
#ifdef CONFIG_PROC_FS #ifdef CONFIG_PROC_FS
if (proc_pccard) { if (proc_pccard) {
remove_proc_entry("drivers", proc_pccard); remove_proc_entry("drivers", proc_pccard);
......
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
/* Access speed for IO windows */ /* Access speed for IO windows */
static int io_speed = 0; static int io_speed;
module_param(io_speed, int, 0444); module_param(io_speed, int, 0444);
...@@ -62,7 +62,8 @@ static int alloc_io_space(struct pcmcia_socket *s, u_int attr, ...@@ -62,7 +62,8 @@ static int alloc_io_space(struct pcmcia_socket *s, u_int attr,
num, align); num, align);
align = 0; align = 0;
} else } else
while (align && (align < num)) align <<= 1; while (align && (align < num))
align <<= 1;
} }
if (*base & ~(align-1)) { if (*base & ~(align-1)) {
dev_dbg(&s->dev, "odd IO request: base %#x align %#x\n", dev_dbg(&s->dev, "odd IO request: base %#x align %#x\n",
...@@ -338,7 +339,7 @@ static int pcmcia_release_io(struct pcmcia_device *p_dev, io_req_t *req) ...@@ -338,7 +339,7 @@ static int pcmcia_release_io(struct pcmcia_device *p_dev, io_req_t *req)
struct pcmcia_socket *s = p_dev->socket; struct pcmcia_socket *s = p_dev->socket;
config_t *c = p_dev->function_config; config_t *c = p_dev->function_config;
if (!p_dev->_io ) if (!p_dev->_io)
return -EINVAL; return -EINVAL;
p_dev->_io = 0; p_dev->_io = 0;
...@@ -362,7 +363,7 @@ static int pcmcia_release_io(struct pcmcia_device *p_dev, io_req_t *req) ...@@ -362,7 +363,7 @@ static int pcmcia_release_io(struct pcmcia_device *p_dev, io_req_t *req)
static int pcmcia_release_irq(struct pcmcia_device *p_dev, irq_req_t *req) static int pcmcia_release_irq(struct pcmcia_device *p_dev, irq_req_t *req)
{ {
struct pcmcia_socket *s = p_dev->socket; struct pcmcia_socket *s = p_dev->socket;
config_t *c= p_dev->function_config; config_t *c = p_dev->function_config;
if (!p_dev->_irq) if (!p_dev->_irq)
return -EINVAL; return -EINVAL;
...@@ -383,9 +384,8 @@ static int pcmcia_release_irq(struct pcmcia_device *p_dev, irq_req_t *req) ...@@ -383,9 +384,8 @@ static int pcmcia_release_irq(struct pcmcia_device *p_dev, irq_req_t *req)
s->irq.AssignedIRQ = 0; s->irq.AssignedIRQ = 0;
} }
if (req->Handler) { if (req->Handler)
free_irq(req->AssignedIRQ, p_dev->priv); free_irq(req->AssignedIRQ, p_dev->priv);
}
#ifdef CONFIG_PCMCIA_PROBE #ifdef CONFIG_PCMCIA_PROBE
pcmcia_used_irq[req->AssignedIRQ]--; pcmcia_used_irq[req->AssignedIRQ]--;
...@@ -656,7 +656,8 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req) ...@@ -656,7 +656,8 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req)
type = IRQF_SHARED; type = IRQF_SHARED;
else if (req->Attributes & IRQ_TYPE_DYNAMIC_SHARING) else if (req->Attributes & IRQ_TYPE_DYNAMIC_SHARING)
type = IRQF_SHARED; type = IRQF_SHARED;
else printk(KERN_WARNING "pcmcia: Driver needs updating to support IRQ sharing.\n"); else
printk(KERN_WARNING "pcmcia: Driver needs updating to support IRQ sharing.\n");
#ifdef CONFIG_PCMCIA_PROBE #ifdef CONFIG_PCMCIA_PROBE
...@@ -788,7 +789,8 @@ int pcmcia_request_window(struct pcmcia_device *p_dev, win_req_t *req, window_ha ...@@ -788,7 +789,8 @@ int pcmcia_request_window(struct pcmcia_device *p_dev, win_req_t *req, window_ha
/* Allocate system memory window */ /* Allocate system memory window */
for (w = 0; w < MAX_WIN; w++) for (w = 0; w < MAX_WIN; w++)
if (!(s->state & SOCKET_WIN_REQ(w))) break; if (!(s->state & SOCKET_WIN_REQ(w)))
break;
if (w == MAX_WIN) { if (w == MAX_WIN) {
dev_dbg(&s->dev, "all windows are used already\n"); dev_dbg(&s->dev, "all windows are used already\n");
return -EINVAL; return -EINVAL;
...@@ -826,18 +828,19 @@ int pcmcia_request_window(struct pcmcia_device *p_dev, win_req_t *req, window_ha ...@@ -826,18 +828,19 @@ int pcmcia_request_window(struct pcmcia_device *p_dev, win_req_t *req, window_ha
s->state |= SOCKET_WIN_REQ(w); s->state |= SOCKET_WIN_REQ(w);
/* Return window handle */ /* Return window handle */
if (s->features & SS_CAP_STATIC_MAP) { if (s->features & SS_CAP_STATIC_MAP)
req->Base = win->static_start; req->Base = win->static_start;
} else { else
req->Base = win->res->start; req->Base = win->res->start;
}
*wh = w + 1; *wh = w + 1;
return 0; return 0;
} /* pcmcia_request_window */ } /* pcmcia_request_window */
EXPORT_SYMBOL(pcmcia_request_window); EXPORT_SYMBOL(pcmcia_request_window);
void pcmcia_disable_device(struct pcmcia_device *p_dev) { void pcmcia_disable_device(struct pcmcia_device *p_dev)
{
pcmcia_release_configuration(p_dev); pcmcia_release_configuration(p_dev);
pcmcia_release_io(p_dev, &p_dev->io); pcmcia_release_io(p_dev, &p_dev->io);
pcmcia_release_irq(p_dev, &p_dev->irq); pcmcia_release_irq(p_dev, &p_dev->irq);
...@@ -970,7 +973,7 @@ int pcmcia_loop_tuple(struct pcmcia_device *p_dev, cisdata_t code, ...@@ -970,7 +973,7 @@ int pcmcia_loop_tuple(struct pcmcia_device *p_dev, cisdata_t code,
return pccard_loop_tuple(p_dev->socket, p_dev->func, code, NULL, return pccard_loop_tuple(p_dev->socket, p_dev->func, code, NULL,
&loop, pcmcia_do_loop_tuple); &loop, pcmcia_do_loop_tuple);
}; }
EXPORT_SYMBOL(pcmcia_loop_tuple); EXPORT_SYMBOL(pcmcia_loop_tuple);
...@@ -1000,7 +1003,7 @@ static int pcmcia_do_get_tuple(struct pcmcia_device *p_dev, tuple_t *tuple, ...@@ -1000,7 +1003,7 @@ static int pcmcia_do_get_tuple(struct pcmcia_device *p_dev, tuple_t *tuple,
} else } else
dev_dbg(&p_dev->dev, "do_get_tuple: out of memory\n"); dev_dbg(&p_dev->dev, "do_get_tuple: out of memory\n");
return 0; return 0;
}; }
/** /**
* pcmcia_get_tuple() - get first tuple from CIS * pcmcia_get_tuple() - get first tuple from CIS
...@@ -1024,7 +1027,7 @@ size_t pcmcia_get_tuple(struct pcmcia_device *p_dev, cisdata_t code, ...@@ -1024,7 +1027,7 @@ size_t pcmcia_get_tuple(struct pcmcia_device *p_dev, cisdata_t code,
pcmcia_loop_tuple(p_dev, code, pcmcia_do_get_tuple, &get); pcmcia_loop_tuple(p_dev, code, pcmcia_do_get_tuple, &get);
return get.len; return get.len;
}; }
EXPORT_SYMBOL(pcmcia_get_tuple); EXPORT_SYMBOL(pcmcia_get_tuple);
...@@ -1057,7 +1060,7 @@ static int pcmcia_do_get_mac(struct pcmcia_device *p_dev, tuple_t *tuple, ...@@ -1057,7 +1060,7 @@ static int pcmcia_do_get_mac(struct pcmcia_device *p_dev, tuple_t *tuple,
for (i = 0; i < 6; i++) for (i = 0; i < 6; i++)
dev->dev_addr[i] = tuple->TupleData[i+2]; dev->dev_addr[i] = tuple->TupleData[i+2];
return 0; return 0;
}; }
/** /**
* pcmcia_get_mac_from_cis() - read out MAC address from CISTPL_FUNCE * pcmcia_get_mac_from_cis() - read out MAC address from CISTPL_FUNCE
...@@ -1071,6 +1074,6 @@ static int pcmcia_do_get_mac(struct pcmcia_device *p_dev, tuple_t *tuple, ...@@ -1071,6 +1074,6 @@ static int pcmcia_do_get_mac(struct pcmcia_device *p_dev, tuple_t *tuple,
int pcmcia_get_mac_from_cis(struct pcmcia_device *p_dev, struct net_device *dev) int pcmcia_get_mac_from_cis(struct pcmcia_device *p_dev, struct net_device *dev)
{ {
return pcmcia_loop_tuple(p_dev, CISTPL_FUNCE, pcmcia_do_get_mac, dev); return pcmcia_loop_tuple(p_dev, CISTPL_FUNCE, pcmcia_do_get_mac, dev);
}; }
EXPORT_SYMBOL(pcmcia_get_mac_from_cis); EXPORT_SYMBOL(pcmcia_get_mac_from_cis);
...@@ -126,16 +126,16 @@ static void pcmcia_align(void *align_data, struct resource *res, ...@@ -126,16 +126,16 @@ static void pcmcia_align(void *align_data, struct resource *res,
res->start = start; res->start = start;
#ifdef CONFIG_X86 #ifdef CONFIG_X86
if (res->flags & IORESOURCE_IO) { if (res->flags & IORESOURCE_IO) {
if (start & 0x300) { if (start & 0x300) {
start = (start + 0x3ff) & ~0x3ff; start = (start + 0x3ff) & ~0x3ff;
res->start = start; res->start = start;
} }
} }
#endif #endif
#ifdef CONFIG_M68K #ifdef CONFIG_M68K
if (res->flags & IORESOURCE_IO) { if (res->flags & IORESOURCE_IO) {
if ((res->start + size - 1) >= 1024) if ((res->start + size - 1) >= 1024)
res->start = res->end; res->start = res->end;
} }
......
This diff is collapsed.
...@@ -164,7 +164,7 @@ static ssize_t pccard_store_irq_mask(struct device *dev, ...@@ -164,7 +164,7 @@ static ssize_t pccard_store_irq_mask(struct device *dev,
if (!count) if (!count)
return -EINVAL; return -EINVAL;
ret = sscanf (buf, "0x%x\n", &mask); ret = sscanf(buf, "0x%x\n", &mask);
if (ret == 1) { if (ret == 1) {
s->irq_mask &= mask; s->irq_mask &= mask;
...@@ -278,7 +278,7 @@ static ssize_t pccard_extract_cis(struct pcmcia_socket *s, char *buf, loff_t off ...@@ -278,7 +278,7 @@ static ssize_t pccard_extract_cis(struct pcmcia_socket *s, char *buf, loff_t off
free_tuple: free_tuple:
kfree(tuplebuffer); kfree(tuplebuffer);
return (ret); return ret;
} }
static ssize_t pccard_show_cis(struct kobject *kobj, static ssize_t pccard_show_cis(struct kobject *kobj,
...@@ -308,7 +308,7 @@ static ssize_t pccard_show_cis(struct kobject *kobj, ...@@ -308,7 +308,7 @@ static ssize_t pccard_show_cis(struct kobject *kobj,
count = pccard_extract_cis(s, buf, off, count); count = pccard_extract_cis(s, buf, off, count);
} }
return (count); return count;
} }
static ssize_t pccard_store_cis(struct kobject *kobj, static ssize_t pccard_store_cis(struct kobject *kobj,
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* Changelog: * Changelog:
* Aug 2002: Manfred Spraul <manfred@colorfullife.com> * Aug 2002: Manfred Spraul <manfred@colorfullife.com>
* Dynamically adjust the size of the bridge resource * Dynamically adjust the size of the bridge resource
* *
* May 2003: Dominik Brodowski <linux@brodo.de> * May 2003: Dominik Brodowski <linux@brodo.de>
* Merge pci_socket.c and yenta.c into one file * Merge pci_socket.c and yenta.c into one file
*/ */
...@@ -16,13 +16,12 @@ ...@@ -16,13 +16,12 @@
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/io.h>
#include <pcmcia/cs_types.h> #include <pcmcia/cs_types.h>
#include <pcmcia/ss.h> #include <pcmcia/ss.h>
#include <pcmcia/cs.h> #include <pcmcia/cs.h>
#include <asm/io.h>
#include "yenta_socket.h" #include "yenta_socket.h"
#include "i82365.h" #include "i82365.h"
...@@ -55,7 +54,7 @@ static int yenta_probe_cb_irq(struct yenta_socket *socket); ...@@ -55,7 +54,7 @@ static int yenta_probe_cb_irq(struct yenta_socket *socket);
static unsigned int override_bios; static unsigned int override_bios;
module_param(override_bios, uint, 0000); module_param(override_bios, uint, 0000);
MODULE_PARM_DESC (override_bios, "yenta ignore bios resource allocation"); MODULE_PARM_DESC(override_bios, "yenta ignore bios resource allocation");
/* /*
* Generate easy-to-use ways of reading a cardbus sockets * Generate easy-to-use ways of reading a cardbus sockets
...@@ -237,24 +236,42 @@ static void yenta_set_power(struct yenta_socket *socket, socket_state_t *state) ...@@ -237,24 +236,42 @@ static void yenta_set_power(struct yenta_socket *socket, socket_state_t *state)
/* i82365SL-DF style */ /* i82365SL-DF style */
if (socket->flags & YENTA_16BIT_POWER_DF) { if (socket->flags & YENTA_16BIT_POWER_DF) {
switch (state->Vcc) { switch (state->Vcc) {
case 33: reg |= I365_VCC_3V; break; case 33:
case 50: reg |= I365_VCC_5V; break; reg |= I365_VCC_3V;
default: reg = 0; break; break;
case 50:
reg |= I365_VCC_5V;
break;
default:
reg = 0;
break;
} }
switch (state->Vpp) { switch (state->Vpp) {
case 33: case 33:
case 50: reg |= I365_VPP1_5V; break; case 50:
case 120: reg |= I365_VPP1_12V; break; reg |= I365_VPP1_5V;
break;
case 120:
reg |= I365_VPP1_12V;
break;
} }
} else { } else {
/* i82365SL-B style */ /* i82365SL-B style */
switch (state->Vcc) { switch (state->Vcc) {
case 50: reg |= I365_VCC_5V; break; case 50:
default: reg = 0; break; reg |= I365_VCC_5V;
break;
default:
reg = 0;
break;
} }
switch (state->Vpp) { switch (state->Vpp) {
case 50: reg |= I365_VPP1_5V | I365_VPP2_5V; break; case 50:
case 120: reg |= I365_VPP1_12V | I365_VPP2_12V; break; reg |= I365_VPP1_5V | I365_VPP2_5V;
break;
case 120:
reg |= I365_VPP1_12V | I365_VPP2_12V;
break;
} }
} }
...@@ -263,14 +280,26 @@ static void yenta_set_power(struct yenta_socket *socket, socket_state_t *state) ...@@ -263,14 +280,26 @@ static void yenta_set_power(struct yenta_socket *socket, socket_state_t *state)
} else { } else {
u32 reg = 0; /* CB_SC_STPCLK? */ u32 reg = 0; /* CB_SC_STPCLK? */
switch (state->Vcc) { switch (state->Vcc) {
case 33: reg = CB_SC_VCC_3V; break; case 33:
case 50: reg = CB_SC_VCC_5V; break; reg = CB_SC_VCC_3V;
default: reg = 0; break; break;
case 50:
reg = CB_SC_VCC_5V;
break;
default:
reg = 0;
break;
} }
switch (state->Vpp) { switch (state->Vpp) {
case 33: reg |= CB_SC_VPP_3V; break; case 33:
case 50: reg |= CB_SC_VPP_5V; break; reg |= CB_SC_VPP_3V;
case 120: reg |= CB_SC_VPP_12V; break; break;
case 50:
reg |= CB_SC_VPP_5V;
break;
case 120:
reg |= CB_SC_VPP_12V;
break;
} }
if (reg != cb_readl(socket, CB_SOCKET_CONTROL)) if (reg != cb_readl(socket, CB_SOCKET_CONTROL))
cb_writel(socket, CB_SOCKET_CONTROL, reg); cb_writel(socket, CB_SOCKET_CONTROL, reg);
...@@ -314,23 +343,29 @@ static int yenta_set_socket(struct pcmcia_socket *sock, socket_state_t *state) ...@@ -314,23 +343,29 @@ static int yenta_set_socket(struct pcmcia_socket *sock, socket_state_t *state)
reg = exca_readb(socket, I365_POWER) & (I365_VCC_MASK|I365_VPP1_MASK); reg = exca_readb(socket, I365_POWER) & (I365_VCC_MASK|I365_VPP1_MASK);
reg |= I365_PWR_NORESET; reg |= I365_PWR_NORESET;
if (state->flags & SS_PWR_AUTO) reg |= I365_PWR_AUTO; if (state->flags & SS_PWR_AUTO)
if (state->flags & SS_OUTPUT_ENA) reg |= I365_PWR_OUT; reg |= I365_PWR_AUTO;
if (state->flags & SS_OUTPUT_ENA)
reg |= I365_PWR_OUT;
if (exca_readb(socket, I365_POWER) != reg) if (exca_readb(socket, I365_POWER) != reg)
exca_writeb(socket, I365_POWER, reg); exca_writeb(socket, I365_POWER, reg);
/* CSC interrupt: no ISA irq for CSC */ /* CSC interrupt: no ISA irq for CSC */
reg = I365_CSC_DETECT; reg = I365_CSC_DETECT;
if (state->flags & SS_IOCARD) { if (state->flags & SS_IOCARD) {
if (state->csc_mask & SS_STSCHG) reg |= I365_CSC_STSCHG; if (state->csc_mask & SS_STSCHG)
reg |= I365_CSC_STSCHG;
} else { } else {
if (state->csc_mask & SS_BATDEAD) reg |= I365_CSC_BVD1; if (state->csc_mask & SS_BATDEAD)
if (state->csc_mask & SS_BATWARN) reg |= I365_CSC_BVD2; reg |= I365_CSC_BVD1;
if (state->csc_mask & SS_READY) reg |= I365_CSC_READY; if (state->csc_mask & SS_BATWARN)
reg |= I365_CSC_BVD2;
if (state->csc_mask & SS_READY)
reg |= I365_CSC_READY;
} }
exca_writeb(socket, I365_CSCINT, reg); exca_writeb(socket, I365_CSCINT, reg);
exca_readb(socket, I365_CSC); exca_readb(socket, I365_CSC);
if(sock->zoom_video) if (sock->zoom_video)
sock->zoom_video(sock, state->flags & SS_ZVCARD); sock->zoom_video(sock, state->flags & SS_ZVCARD);
} }
config_writew(socket, CB_BRIDGE_CONTROL, bridge); config_writew(socket, CB_BRIDGE_CONTROL, bridge);
...@@ -368,9 +403,12 @@ static int yenta_set_io_map(struct pcmcia_socket *sock, struct pccard_io_map *io ...@@ -368,9 +403,12 @@ static int yenta_set_io_map(struct pcmcia_socket *sock, struct pccard_io_map *io
exca_writew(socket, I365_IO(map)+I365_W_STOP, io->stop); exca_writew(socket, I365_IO(map)+I365_W_STOP, io->stop);
ioctl = exca_readb(socket, I365_IOCTL) & ~I365_IOCTL_MASK(map); ioctl = exca_readb(socket, I365_IOCTL) & ~I365_IOCTL_MASK(map);
if (io->flags & MAP_0WS) ioctl |= I365_IOCTL_0WS(map); if (io->flags & MAP_0WS)
if (io->flags & MAP_16BIT) ioctl |= I365_IOCTL_16BIT(map); ioctl |= I365_IOCTL_0WS(map);
if (io->flags & MAP_AUTOSZ) ioctl |= I365_IOCTL_IOCS16(map); if (io->flags & MAP_16BIT)
ioctl |= I365_IOCTL_16BIT(map);
if (io->flags & MAP_AUTOSZ)
ioctl |= I365_IOCTL_IOCS16(map);
exca_writeb(socket, I365_IOCTL, ioctl); exca_writeb(socket, I365_IOCTL, ioctl);
if (io->flags & MAP_ACTIVE) if (io->flags & MAP_ACTIVE)
...@@ -416,10 +454,17 @@ static int yenta_set_mem_map(struct pcmcia_socket *sock, struct pccard_mem_map * ...@@ -416,10 +454,17 @@ static int yenta_set_mem_map(struct pcmcia_socket *sock, struct pccard_mem_map *
word = (stop >> 12) & 0x0fff; word = (stop >> 12) & 0x0fff;
switch (to_cycles(mem->speed)) { switch (to_cycles(mem->speed)) {
case 0: break; case 0:
case 1: word |= I365_MEM_WS0; break; break;
case 2: word |= I365_MEM_WS1; break; case 1:
default: word |= I365_MEM_WS1 | I365_MEM_WS0; break; word |= I365_MEM_WS0;
break;
case 2:
word |= I365_MEM_WS1;
break;
default:
word |= I365_MEM_WS1 | I365_MEM_WS0;
break;
} }
exca_writew(socket, I365_MEM(map) + I365_W_STOP, word); exca_writew(socket, I365_MEM(map) + I365_W_STOP, word);
...@@ -547,9 +592,9 @@ static int yenta_sock_suspend(struct pcmcia_socket *sock) ...@@ -547,9 +592,9 @@ static int yenta_sock_suspend(struct pcmcia_socket *sock)
* max 4 MB, min 16 kB. We try very hard to not get below * max 4 MB, min 16 kB. We try very hard to not get below
* the "ACC" values, though. * the "ACC" values, though.
*/ */
#define BRIDGE_MEM_MAX 4*1024*1024 #define BRIDGE_MEM_MAX (4*1024*1024)
#define BRIDGE_MEM_ACC 128*1024 #define BRIDGE_MEM_ACC (128*1024)
#define BRIDGE_MEM_MIN 16*1024 #define BRIDGE_MEM_MIN (16*1024)
#define BRIDGE_IO_MAX 512 #define BRIDGE_IO_MAX 512
#define BRIDGE_IO_ACC 256 #define BRIDGE_IO_ACC 256
...@@ -574,7 +619,7 @@ static int yenta_search_one_res(struct resource *root, struct resource *res, ...@@ -574,7 +619,7 @@ static int yenta_search_one_res(struct resource *root, struct resource *res,
int i; int i;
size = BRIDGE_MEM_MAX; size = BRIDGE_MEM_MAX;
if (size > avail/8) { if (size > avail/8) {
size=(avail+1)/8; size = (avail+1)/8;
/* round size down to next power of 2 */ /* round size down to next power of 2 */
i = 0; i = 0;
while ((size /= 2) != 0) while ((size /= 2) != 0)
...@@ -590,7 +635,7 @@ static int yenta_search_one_res(struct resource *root, struct resource *res, ...@@ -590,7 +635,7 @@ static int yenta_search_one_res(struct resource *root, struct resource *res,
do { do {
if (allocate_resource(root, res, size, start, end, align, if (allocate_resource(root, res, size, start, end, align,
NULL, NULL)==0) { NULL, NULL) == 0) {
return 1; return 1;
} }
size = size/2; size = size/2;
...@@ -605,8 +650,8 @@ static int yenta_search_res(struct yenta_socket *socket, struct resource *res, ...@@ -605,8 +650,8 @@ static int yenta_search_res(struct yenta_socket *socket, struct resource *res,
u32 min) u32 min)
{ {
int i; int i;
for (i=0; i<PCI_BUS_NUM_RESOURCES; i++) { for (i = 0; i < PCI_BUS_NUM_RESOURCES; i++) {
struct resource * root = socket->dev->bus->resource[i]; struct resource *root = socket->dev->bus->resource[i];
if (!root) if (!root)
continue; continue;
...@@ -704,7 +749,7 @@ static void yenta_allocate_resources(struct yenta_socket *socket) ...@@ -704,7 +749,7 @@ static void yenta_allocate_resources(struct yenta_socket *socket)
static void yenta_free_resources(struct yenta_socket *socket) static void yenta_free_resources(struct yenta_socket *socket)
{ {
int i; int i;
for (i=0;i<4;i++) { for (i = 0; i < 4; i++) {
struct resource *res; struct resource *res;
res = socket->dev->resource + PCI_BRIDGE_RESOURCES + i; res = socket->dev->resource + PCI_BRIDGE_RESOURCES + i;
if (res->start != 0 && res->end != 0) if (res->start != 0 && res->end != 0)
...@@ -726,7 +771,7 @@ static void __devexit yenta_close(struct pci_dev *dev) ...@@ -726,7 +771,7 @@ static void __devexit yenta_close(struct pci_dev *dev)
/* we don't want a dying socket registered */ /* we don't want a dying socket registered */
pcmcia_unregister_socket(&sock->socket); pcmcia_unregister_socket(&sock->socket);
/* Disable all events so we don't die in an IRQ storm */ /* Disable all events so we don't die in an IRQ storm */
cb_writel(sock, CB_SOCKET_MASK, 0x0); cb_writel(sock, CB_SOCKET_MASK, 0x0);
exca_writeb(sock, I365_CSCINT, 0); exca_writeb(sock, I365_CSCINT, 0);
...@@ -898,7 +943,7 @@ static irqreturn_t yenta_probe_handler(int irq, void *dev_id) ...@@ -898,7 +943,7 @@ static irqreturn_t yenta_probe_handler(int irq, void *dev_id)
{ {
struct yenta_socket *socket = (struct yenta_socket *) dev_id; struct yenta_socket *socket = (struct yenta_socket *) dev_id;
u8 csc; u8 csc;
u32 cb_event; u32 cb_event;
/* Clear interrupt status for the event */ /* Clear interrupt status for the event */
cb_event = cb_readl(socket, CB_SOCKET_EVENT); cb_event = cb_readl(socket, CB_SOCKET_EVENT);
...@@ -1019,7 +1064,7 @@ static void yenta_fixup_parent_bridge(struct pci_bus *cardbus_bridge) ...@@ -1019,7 +1064,7 @@ static void yenta_fixup_parent_bridge(struct pci_bus *cardbus_bridge)
{ {
struct list_head *tmp; struct list_head *tmp;
unsigned char upper_limit; unsigned char upper_limit;
/* /*
* We only check and fix the parent bridge: All systems which need * We only check and fix the parent bridge: All systems which need
* this fixup that have been reviewed are laptops and the only bridge * this fixup that have been reviewed are laptops and the only bridge
* which needed fixing was the parent bridge of the CardBus bridge: * which needed fixing was the parent bridge of the CardBus bridge:
...@@ -1038,7 +1083,7 @@ static void yenta_fixup_parent_bridge(struct pci_bus *cardbus_bridge) ...@@ -1038,7 +1083,7 @@ static void yenta_fixup_parent_bridge(struct pci_bus *cardbus_bridge)
/* check the bus ranges of all silbling bridges to prevent overlap */ /* check the bus ranges of all silbling bridges to prevent overlap */
list_for_each(tmp, &bridge_to_fix->parent->children) { list_for_each(tmp, &bridge_to_fix->parent->children) {
struct pci_bus * silbling = pci_bus_b(tmp); struct pci_bus *silbling = pci_bus_b(tmp);
/* /*
* If the silbling has a higher secondary bus number * If the silbling has a higher secondary bus number
* and it's secondary is equal or smaller than our * and it's secondary is equal or smaller than our
...@@ -1083,7 +1128,7 @@ static void yenta_fixup_parent_bridge(struct pci_bus *cardbus_bridge) ...@@ -1083,7 +1128,7 @@ static void yenta_fixup_parent_bridge(struct pci_bus *cardbus_bridge)
* interrupt, and that we can map the cardbus area. Fill in the * interrupt, and that we can map the cardbus area. Fill in the
* socket information structure.. * socket information structure..
*/ */
static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_id *id) static int __devinit yenta_probe(struct pci_dev *dev, const struct pci_device_id *id)
{ {
struct yenta_socket *socket; struct yenta_socket *socket;
int ret; int ret;
...@@ -1302,7 +1347,7 @@ static struct dev_pm_ops yenta_pm_ops = { ...@@ -1302,7 +1347,7 @@ static struct dev_pm_ops yenta_pm_ops = {
#define YENTA_PM_OPS NULL #define YENTA_PM_OPS NULL
#endif #endif
#define CB_ID(vend,dev,type) \ #define CB_ID(vend, dev, type) \
{ \ { \
.vendor = vend, \ .vendor = vend, \
.device = dev, \ .device = dev, \
...@@ -1313,7 +1358,7 @@ static struct dev_pm_ops yenta_pm_ops = { ...@@ -1313,7 +1358,7 @@ static struct dev_pm_ops yenta_pm_ops = {
.driver_data = CARDBUS_TYPE_##type, \ .driver_data = CARDBUS_TYPE_##type, \
} }
static struct pci_device_id yenta_table [] = { static struct pci_device_id yenta_table[] = {
CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_1031, TI), CB_ID(PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_1031, TI),
/* /*
...@@ -1403,13 +1448,13 @@ static struct pci_driver yenta_cardbus_driver = { ...@@ -1403,13 +1448,13 @@ static struct pci_driver yenta_cardbus_driver = {
static int __init yenta_socket_init(void) static int __init yenta_socket_init(void)
{ {
return pci_register_driver (&yenta_cardbus_driver); return pci_register_driver(&yenta_cardbus_driver);
} }
static void __exit yenta_socket_exit (void) static void __exit yenta_socket_exit(void)
{ {
pci_unregister_driver (&yenta_cardbus_driver); pci_unregister_driver(&yenta_cardbus_driver);
} }
......
...@@ -126,8 +126,8 @@ typedef struct irq_req_t { ...@@ -126,8 +126,8 @@ typedef struct irq_req_t {
#define IRQ_TYPE_TIME 0x01 #define IRQ_TYPE_TIME 0x01
#define IRQ_TYPE_DYNAMIC_SHARING 0x02 #define IRQ_TYPE_DYNAMIC_SHARING 0x02
#define IRQ_FORCED_PULSE 0x04 #define IRQ_FORCED_PULSE 0x04
#define IRQ_FIRST_SHARED 0x08 #define IRQ_FIRST_SHARED 0x08 /* unused */
//#define IRQ_HANDLE_PRESENT 0x10 #define IRQ_HANDLE_PRESENT 0x10 /* unused */
#define IRQ_PULSE_ALLOCATED 0x100 #define IRQ_PULSE_ALLOCATED 0x100
/* Bits in IRQInfo1 field */ /* Bits in IRQInfo1 field */
......
...@@ -82,7 +82,7 @@ struct pcmcia_device { ...@@ -82,7 +82,7 @@ struct pcmcia_device {
/* the hardware "function" device; certain subdevices can /* the hardware "function" device; certain subdevices can
* share one hardware "function" device. */ * share one hardware "function" device. */
u8 func; u8 func;
struct config_t* function_config; struct config_t *function_config;
struct list_head socket_device_list; struct list_head socket_device_list;
...@@ -121,14 +121,14 @@ struct pcmcia_device { ...@@ -121,14 +121,14 @@ struct pcmcia_device {
u16 manf_id; u16 manf_id;
u16 card_id; u16 card_id;
char * prod_id[4]; char *prod_id[4];
u64 dma_mask; u64 dma_mask;
struct device dev; struct device dev;
#ifdef CONFIG_PCMCIA_IOCTL #ifdef CONFIG_PCMCIA_IOCTL
/* device driver wanted by cardmgr */ /* device driver wanted by cardmgr */
struct pcmcia_driver * cardmgr; struct pcmcia_driver *cardmgr;
#endif #endif
/* data private to drivers */ /* data private to drivers */
......
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
#ifndef _LINUX_MEM_OP_H #ifndef _LINUX_MEM_OP_H
#define _LINUX_MEM_OP_H #define _LINUX_MEM_OP_H
#include <linux/io.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/io.h>
/* /*
If UNSAFE_MEMCPY is defined, we use the (optimized) system routines If UNSAFE_MEMCPY is defined, we use the (optimized) system routines
......
...@@ -154,7 +154,7 @@ struct pcmcia_socket { ...@@ -154,7 +154,7 @@ struct pcmcia_socket {
struct list_head socket_list; struct list_head socket_list;
struct completion socket_released; struct completion socket_released;
/* deprecated */ /* deprecated */
unsigned int sock; /* socket number */ unsigned int sock; /* socket number */
...@@ -164,7 +164,7 @@ struct pcmcia_socket { ...@@ -164,7 +164,7 @@ struct pcmcia_socket {
u_int map_size; u_int map_size;
u_int io_offset; u_int io_offset;
u_int pci_irq; u_int pci_irq;
struct pci_dev * cb_dev; struct pci_dev *cb_dev;
/* socket setup is done so resources should be able to be allocated. /* socket setup is done so resources should be able to be allocated.
...@@ -179,9 +179,9 @@ struct pcmcia_socket { ...@@ -179,9 +179,9 @@ struct pcmcia_socket {
u8 reserved:5; u8 reserved:5;
/* socket operations */ /* socket operations */
struct pccard_operations * ops; struct pccard_operations *ops;
struct pccard_resource_ops * resource_ops; struct pccard_resource_ops *resource_ops;
void * resource_data; void *resource_data;
/* Zoom video behaviour is so chip specific its not worth adding /* Zoom video behaviour is so chip specific its not worth adding
this to _ops */ this to _ops */
...@@ -245,7 +245,7 @@ struct pcmcia_socket { ...@@ -245,7 +245,7 @@ struct pcmcia_socket {
/* cardbus (32-bit) */ /* cardbus (32-bit) */
#ifdef CONFIG_CARDBUS #ifdef CONFIG_CARDBUS
struct resource * cb_cis_res; struct resource *cb_cis_res;
void __iomem *cb_cis_virt; void __iomem *cb_cis_virt;
#endif /* CONFIG_CARDBUS */ #endif /* CONFIG_CARDBUS */
......
...@@ -143,7 +143,8 @@ static int snd_pdacf_probe(struct pcmcia_device *link) ...@@ -143,7 +143,8 @@ static int snd_pdacf_probe(struct pcmcia_device *link)
link->io.NumPorts1 = 16; link->io.NumPorts1 = 16;
link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_FORCED_PULSE; link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_FORCED_PULSE;
// link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED; /* FIXME: This driver should be updated to allow for dynamic IRQ sharing */
/* link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING | IRQ_FORCED_PULSE; */
link->irq.Handler = pdacf_interrupt; link->irq.Handler = pdacf_interrupt;
link->conf.Attributes = CONF_ENABLE_IRQ; link->conf.Attributes = CONF_ENABLE_IRQ;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment