netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dominik Brodowski <linux@dominikbrodowski.net>
To: linux-pcmcia@lists.infradead.org
Cc: netdev@vger.kernel.org, linux-mtd@lists.infradead.org
Subject: [PATCH 20/33] pcmcia: remove export of pcmcia_release_configuration
Date: Fri, 31 Mar 2006 22:20:27 +0200	[thread overview]
Message-ID: <20060331202027.GI28037@dominikbrodowski.de> (raw)
In-Reply-To: <20060331195852.GB27888@dominikbrodowski.de>

Handle the _modifying_ operation sm91c92_cs requires in
pcmcia_modify_configuration, so that the only remaining users
of pcmcia_release_configuration() are within the pcmcia core
module.

Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>

---

 drivers/mtd/maps/pcmciamtd.c     |    3 +--
 drivers/net/pcmcia/smc91c92_cs.c |   29 +++++++++++------------------
 drivers/pcmcia/ds_internal.h     |    2 ++
 drivers/pcmcia/pcmcia_resource.c |   23 ++++++++++++++++++++++-
 include/pcmcia/cs.h              |   10 +++++-----
 5 files changed, 41 insertions(+), 26 deletions(-)

4bbed5231468014b500b048d7370a1c6c349231a
diff --git a/drivers/mtd/maps/pcmciamtd.c b/drivers/mtd/maps/pcmciamtd.c
index f988c81..f45ff25 100644
--- a/drivers/mtd/maps/pcmciamtd.c
+++ b/drivers/mtd/maps/pcmciamtd.c
@@ -353,8 +353,7 @@ static void pcmciamtd_release(dev_link_t
 		}
 		pcmcia_release_window(link->win);
 	}
-	pcmcia_release_configuration(link->handle);
-	link->state &= ~DEV_CONFIG;
+	pcmcia_disable_device(link->handle);
 }
 
 
diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c
index 84e18bb..86942c0 100644
--- a/drivers/net/pcmcia/smc91c92_cs.c
+++ b/drivers/net/pcmcia/smc91c92_cs.c
@@ -874,11 +874,8 @@ static int smc91c92_suspend(struct pcmci
 	dev_link_t *link = dev_to_instance(p_dev);
 	struct net_device *dev = link->priv;
 
-	if (link->state & DEV_CONFIG) {
-		if (link->open)
-			netif_device_detach(dev);
-		pcmcia_release_configuration(link->handle);
-	}
+	if ((link->state & DEV_CONFIG) && (link->open))
+		netif_device_detach(dev);
 
 	return 0;
 }
@@ -894,7 +891,6 @@ static int smc91c92_resume(struct pcmcia
 		if ((smc->manfid == MANFID_MEGAHERTZ) &&
 		    (smc->cardid == PRODID_MEGAHERTZ_EM3288))
 			mhz_3288_power(link);
-		pcmcia_request_configuration(link->handle, &link->conf);
 		if (smc->manfid == MANFID_MOTOROLA)
 			mot_config(link);
 		if ((smc->manfid == MANFID_OSITECH) &&
@@ -963,18 +959,15 @@ static int check_sig(dev_link_t *link)
     }
 
     if (width) {
-	printk(KERN_INFO "smc91c92_cs: using 8-bit IO window.\n");
-	/* call pcmcia_release_configuration() in _suspend */
-	smc91c92_suspend(link->handle);
-
-	link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
-	link->handle->socket->io[0].res->flags &= ~IO_DATA_PATH_WIDTH;
-	link->handle->socket->io[0].res->flags |= IO_DATA_PATH_WIDTH_8;
-
-	/* call pcmcia_request_configuration() in _resume, it handles the
-	 * flag update */
-	smc91c92_resume(link->handle);
-	return check_sig(link);
+	    modconf_t mod = {
+		    .Attributes = CONF_IO_CHANGE_WIDTH,
+	    };
+	    printk(KERN_INFO "smc91c92_cs: using 8-bit IO window.\n");
+
+	    smc91c92_suspend(link->handle);
+	    pcmcia_modify_configuration(link->handle, &mod);
+	    smc91c92_resume(link->handle);
+	    return check_sig(link);
     }
     return -ENODEV;
 }
diff --git a/drivers/pcmcia/ds_internal.h b/drivers/pcmcia/ds_internal.h
index 783d861..3a2b25e 100644
--- a/drivers/pcmcia/ds_internal.h
+++ b/drivers/pcmcia/ds_internal.h
@@ -8,6 +8,8 @@ extern void pcmcia_put_dev(struct pcmcia
 
 struct pcmcia_device * pcmcia_device_add(struct pcmcia_socket *s, unsigned int function);
 
+extern int pcmcia_release_configuration(struct pcmcia_device *p_dev);
+
 #ifdef CONFIG_PCMCIA_IOCTL
 extern void __init pcmcia_setup_ioctl(void);
 extern void __exit pcmcia_cleanup_ioctl(void);
diff --git a/drivers/pcmcia/pcmcia_resource.c b/drivers/pcmcia/pcmcia_resource.c
index f4dcea6..16504f8 100644
--- a/drivers/pcmcia/pcmcia_resource.c
+++ b/drivers/pcmcia/pcmcia_resource.c
@@ -442,6 +442,28 @@ int pcmcia_modify_configuration(struct p
 		   (mod->Attributes & CONF_VPP2_CHANGE_VALID))
 		return CS_BAD_VPP;
 
+	if (mod->Attributes & CONF_IO_CHANGE_WIDTH) {
+		pccard_io_map io_off = { 0, 0, 0, 0, 1 };
+		pccard_io_map io_on;
+		int i;
+
+		io_on.speed = io_speed;
+		for (i = 0; i < MAX_IO_WIN; i++) {
+			if (!s->io[i].res)
+				continue;
+			io_off.map = i;
+			io_on.map = i;
+
+			io_on.flags = MAP_ACTIVE | IO_DATA_PATH_WIDTH_8;
+			io_on.start = s->io[i].res->start;
+			io_on.stop = s->io[i].res->end;
+
+			s->ops->set_io_map(s, &io_off);
+			mdelay(40);
+			s->ops->set_io_map(s, &io_on);
+		}
+	}
+
 	return CS_SUCCESS;
 } /* modify_configuration */
 EXPORT_SYMBOL(pcmcia_modify_configuration);
@@ -479,7 +501,6 @@ int pcmcia_release_configuration(struct 
 
 	return CS_SUCCESS;
 } /* pcmcia_release_configuration */
-EXPORT_SYMBOL(pcmcia_release_configuration);
 
 
 /** pcmcia_release_io
diff --git a/include/pcmcia/cs.h b/include/pcmcia/cs.h
index 7b91520..087b3bc 100644
--- a/include/pcmcia/cs.h
+++ b/include/pcmcia/cs.h
@@ -116,10 +116,11 @@ typedef struct modconf_t {
 } modconf_t;
 
 /* Attributes for ModifyConfiguration */
-#define CONF_IRQ_CHANGE_VALID	0x100
-#define CONF_VCC_CHANGE_VALID	0x200
-#define CONF_VPP1_CHANGE_VALID	0x400
-#define CONF_VPP2_CHANGE_VALID	0x800
+#define CONF_IRQ_CHANGE_VALID	0x0100
+#define CONF_VCC_CHANGE_VALID	0x0200
+#define CONF_VPP1_CHANGE_VALID	0x0400
+#define CONF_VPP2_CHANGE_VALID	0x0800
+#define CONF_IO_CHANGE_WIDTH	0x1000
 
 /* For RequestConfiguration */
 typedef struct config_req_t {
@@ -378,7 +379,6 @@ int pcmcia_get_status(struct pcmcia_devi
 int pcmcia_get_mem_page(window_handle_t win, memreq_t *req);
 int pcmcia_map_mem_page(window_handle_t win, memreq_t *req);
 int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod);
-int pcmcia_release_configuration(struct pcmcia_device *p_dev);
 int pcmcia_release_window(window_handle_t win);
 int pcmcia_request_configuration(struct pcmcia_device *p_dev, config_req_t *req);
 int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req);
-- 
1.2.4


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

  parent reply	other threads:[~2006-03-31 20:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20060331195852.GB27888@dominikbrodowski.de>
2006-03-31 20:16 ` [PATCH 17/33] pcmcia: add pcmcia_disable_device Dominik Brodowski
2006-03-31 20:17 ` [PATCH 18/33] pcmcia: convert remaining users of pcmcia_release_io and _irq Dominik Brodowski
2006-03-31 20:19 ` [PATCH 19/33] pcmcia: default suspend and resume handling Dominik Brodowski
2006-03-31 20:20 ` Dominik Brodowski [this message]
2006-03-31 20:22 ` [PATCH 21/33] pcmcia: remove unneeded Vcc pseudo setting Dominik Brodowski
2006-03-31 20:25 ` [PATCH 25/33] pcmcia: add return value to _config() functions Dominik Brodowski
2006-03-31 20:30 ` [PATCH 29/33] pcmcia: convert DEV_OK to pcmcia_dev_present Dominik Brodowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060331202027.GI28037@dominikbrodowski.de \
    --to=linux@dominikbrodowski.net \
    --cc=linux-mtd@lists.infradead.org \
    --cc=linux-pcmcia@lists.infradead.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).