Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 16254
b: refs/heads/master
c: 98e4c28
h: refs/heads/master
v: v3
  • Loading branch information
Dominik Brodowski committed Jan 5, 2006
1 parent d4460e9 commit 21a18a9
Show file tree
Hide file tree
Showing 46 changed files with 1,432 additions and 992 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 63e7ebd06402951bc8863ba5b7bc9b9f42044849
refs/heads/master: 98e4c28b7ec390c2dad6a4c69d69629c0f7e8b10
6 changes: 6 additions & 0 deletions trunk/Documentation/pcmcia/driver-changes.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
This file details changes in 2.6 which affect PCMCIA card driver authors:

* Move suspend, resume and reset out of event handler (as of 2.6.16)
int (*suspend) (struct pcmcia_device *dev);
int (*resume) (struct pcmcia_device *dev);
should be initialized in struct pcmcia_driver, and handle
(SUSPEND == RESET_PHYSICAL) and (RESUME == CARD_RESET) events

* event handler initialization in struct pcmcia_driver (as of 2.6.13)
The event handler is notified of all events, and must be initialized
as the event() callback in the driver's struct pcmcia_driver.
Expand Down
37 changes: 23 additions & 14 deletions trunk/drivers/bluetooth/bluecard_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1045,6 +1045,27 @@ static void bluecard_release(dev_link_t *link)
link->state &= ~DEV_CONFIG;
}

static int bluecard_suspend(struct pcmcia_device *dev)
{
dev_link_t *link = dev_to_instance(dev);

link->state |= DEV_SUSPEND;
if (link->state & DEV_CONFIG)
pcmcia_release_configuration(link->handle);

return 0;
}

static int bluecard_resume(struct pcmcia_device *dev)
{
dev_link_t *link = dev_to_instance(dev);

link->state &= ~DEV_SUSPEND;
if (DEV_OK(link))
pcmcia_request_configuration(link->handle, &link->conf);

return 0;
}

static int bluecard_event(event_t event, int priority, event_callback_args_t *args)
{
Expand All @@ -1063,20 +1084,6 @@ static int bluecard_event(event_t event, int priority, event_callback_args_t *ar
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
bluecard_config(link);
break;
case CS_EVENT_PM_SUSPEND:
link->state |= DEV_SUSPEND;
/* Fall through... */
case CS_EVENT_RESET_PHYSICAL:
if (link->state & DEV_CONFIG)
pcmcia_release_configuration(link->handle);
break;
case CS_EVENT_PM_RESUME:
link->state &= ~DEV_SUSPEND;
/* Fall through... */
case CS_EVENT_CARD_RESET:
if (DEV_OK(link))
pcmcia_request_configuration(link->handle, &link->conf);
break;
}

return 0;
Expand All @@ -1099,6 +1106,8 @@ static struct pcmcia_driver bluecard_driver = {
.event = bluecard_event,
.detach = bluecard_detach,
.id_table = bluecard_ids,
.suspend = bluecard_suspend,
.resume = bluecard_resume,
};

static int __init init_bluecard_cs(void)
Expand Down
37 changes: 23 additions & 14 deletions trunk/drivers/bluetooth/bt3c_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -891,6 +891,27 @@ static void bt3c_release(dev_link_t *link)
link->state &= ~DEV_CONFIG;
}

static int bt3c_suspend(struct pcmcia_device *dev)
{
dev_link_t *link = dev_to_instance(dev);

link->state |= DEV_SUSPEND;
if (link->state & DEV_CONFIG)
pcmcia_release_configuration(link->handle);

return 0;
}

static int bt3c_resume(struct pcmcia_device *dev)
{
dev_link_t *link = dev_to_instance(dev);

link->state &= ~DEV_SUSPEND;
if (DEV_OK(link))
pcmcia_request_configuration(link->handle, &link->conf);

return 0;
}

static int bt3c_event(event_t event, int priority, event_callback_args_t *args)
{
Expand All @@ -909,20 +930,6 @@ static int bt3c_event(event_t event, int priority, event_callback_args_t *args)
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
bt3c_config(link);
break;
case CS_EVENT_PM_SUSPEND:
link->state |= DEV_SUSPEND;
/* Fall through... */
case CS_EVENT_RESET_PHYSICAL:
if (link->state & DEV_CONFIG)
pcmcia_release_configuration(link->handle);
break;
case CS_EVENT_PM_RESUME:
link->state &= ~DEV_SUSPEND;
/* Fall through... */
case CS_EVENT_CARD_RESET:
if (DEV_OK(link))
pcmcia_request_configuration(link->handle, &link->conf);
break;
}

return 0;
Expand All @@ -943,6 +950,8 @@ static struct pcmcia_driver bt3c_driver = {
.event = bt3c_event,
.detach = bt3c_detach,
.id_table = bt3c_ids,
.suspend = bt3c_suspend,
.resume = bt3c_resume,
};

static int __init init_bt3c_cs(void)
Expand Down
38 changes: 24 additions & 14 deletions trunk/drivers/bluetooth/btuart_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,28 @@ static void btuart_release(dev_link_t *link)
link->state &= ~DEV_CONFIG;
}

static int btuart_suspend(struct pcmcia_device *dev)
{
dev_link_t *link = dev_to_instance(dev);

link->state |= DEV_SUSPEND;
if (link->state & DEV_CONFIG)
pcmcia_release_configuration(link->handle);

return 0;
}

static int btuart_resume(struct pcmcia_device *dev)
{
dev_link_t *link = dev_to_instance(dev);

link->state &= ~DEV_SUSPEND;
if (DEV_OK(link))
pcmcia_request_configuration(link->handle, &link->conf);

return 0;
}


static int btuart_event(event_t event, int priority, event_callback_args_t *args)
{
Expand All @@ -829,20 +851,6 @@ static int btuart_event(event_t event, int priority, event_callback_args_t *args
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
btuart_config(link);
break;
case CS_EVENT_PM_SUSPEND:
link->state |= DEV_SUSPEND;
/* Fall through... */
case CS_EVENT_RESET_PHYSICAL:
if (link->state & DEV_CONFIG)
pcmcia_release_configuration(link->handle);
break;
case CS_EVENT_PM_RESUME:
link->state &= ~DEV_SUSPEND;
/* Fall through... */
case CS_EVENT_CARD_RESET:
if (DEV_OK(link))
pcmcia_request_configuration(link->handle, &link->conf);
break;
}

return 0;
Expand All @@ -863,6 +871,8 @@ static struct pcmcia_driver btuart_driver = {
.event = btuart_event,
.detach = btuart_detach,
.id_table = btuart_ids,
.suspend = btuart_suspend,
.resume = btuart_resume,
};

static int __init init_btuart_cs(void)
Expand Down
37 changes: 23 additions & 14 deletions trunk/drivers/bluetooth/dtl1_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -763,6 +763,27 @@ static void dtl1_release(dev_link_t *link)
link->state &= ~DEV_CONFIG;
}

static int dtl1_suspend(struct pcmcia_device *dev)
{
dev_link_t *link = dev_to_instance(dev);

link->state |= DEV_SUSPEND;
if (link->state & DEV_CONFIG)
pcmcia_release_configuration(link->handle);

return 0;
}

static int dtl1_resume(struct pcmcia_device *dev)
{
dev_link_t *link = dev_to_instance(dev);

link->state &= ~DEV_SUSPEND;
if (DEV_OK(link))
pcmcia_request_configuration(link->handle, &link->conf);

return 0;
}

static int dtl1_event(event_t event, int priority, event_callback_args_t *args)
{
Expand All @@ -781,20 +802,6 @@ static int dtl1_event(event_t event, int priority, event_callback_args_t *args)
link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
dtl1_config(link);
break;
case CS_EVENT_PM_SUSPEND:
link->state |= DEV_SUSPEND;
/* Fall through... */
case CS_EVENT_RESET_PHYSICAL:
if (link->state & DEV_CONFIG)
pcmcia_release_configuration(link->handle);
break;
case CS_EVENT_PM_RESUME:
link->state &= ~DEV_SUSPEND;
/* Fall through... */
case CS_EVENT_CARD_RESET:
if (DEV_OK(link))
pcmcia_request_configuration(link->handle, &link->conf);
break;
}

return 0;
Expand All @@ -816,6 +823,8 @@ static struct pcmcia_driver dtl1_driver = {
.event = dtl1_event,
.detach = dtl1_detach,
.id_table = dtl1_ids,
.suspend = dtl1_suspend,
.resume = dtl1_resume,
};

static int __init init_dtl1_cs(void)
Expand Down
61 changes: 34 additions & 27 deletions trunk/drivers/char/pcmcia/cm4000_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -1893,33 +1893,6 @@ static int cm4000_event(event_t event, int priority,
link->state &= ~DEV_PRESENT;
stop_monitor(dev);
break;
case CS_EVENT_PM_SUSPEND:
DEBUGP(5, dev, "CS_EVENT_PM_SUSPEND "
"(fall-through to CS_EVENT_RESET_PHYSICAL)\n");
link->state |= DEV_SUSPEND;
/* fall-through */
case CS_EVENT_RESET_PHYSICAL:
DEBUGP(5, dev, "CS_EVENT_RESET_PHYSICAL\n");
if (link->state & DEV_CONFIG) {
DEBUGP(5, dev, "ReleaseConfiguration\n");
pcmcia_release_configuration(link->handle);
}
stop_monitor(dev);
break;
case CS_EVENT_PM_RESUME:
DEBUGP(5, dev, "CS_EVENT_PM_RESUME "
"(fall-through to CS_EVENT_CARD_RESET)\n");
link->state &= ~DEV_SUSPEND;
/* fall-through */
case CS_EVENT_CARD_RESET:
DEBUGP(5, dev, "CS_EVENT_CARD_RESET\n");
if ((link->state & DEV_CONFIG)) {
DEBUGP(5, dev, "RequestConfiguration\n");
pcmcia_request_configuration(link->handle, &link->conf);
}
if (link->open)
start_monitor(dev);
break;
default:
DEBUGP(5, dev, "unknown event %.2x\n", event);
break;
Expand All @@ -1928,6 +1901,38 @@ static int cm4000_event(event_t event, int priority,
return CS_SUCCESS;
}

static int cm4000_suspend(struct pcmcia_device *p_dev)
{
dev_link_t *link = dev_to_instance(p_dev);
struct cm4000_dev *dev;

dev = link->priv;

link->state |= DEV_SUSPEND;
if (link->state & DEV_CONFIG)
pcmcia_release_configuration(link->handle);
stop_monitor(dev);

return 0;
}

static int cm4000_resume(struct pcmcia_device *p_dev)
{
dev_link_t *link = dev_to_instance(p_dev);
struct cm4000_dev *dev;

dev = link->priv;

link->state &= ~DEV_SUSPEND;
if (link->state & DEV_CONFIG)
pcmcia_request_configuration(link->handle, &link->conf);

if (link->open)
start_monitor(dev);

return 0;
}

static void cm4000_release(dev_link_t *link)
{
cmm_cm4000_release(link->priv); /* delay release until device closed */
Expand Down Expand Up @@ -2044,6 +2049,8 @@ static struct pcmcia_driver cm4000_driver = {
},
.attach = cm4000_attach,
.detach = cm4000_detach,
.suspend = cm4000_suspend,
.resume = cm4000_resume,
.event = cm4000_event,
.id_table = cm4000_ids,
};
Expand Down
Loading

0 comments on commit 21a18a9

Please sign in to comment.