Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 248757
b: refs/heads/master
c: bc57381
h: refs/heads/master
i:
  248755: 640f6a2
v: v3
  • Loading branch information
Kuninori Morimoto authored and Greg Kroah-Hartman committed Apr 30, 2011
1 parent 55e777d commit b63bc43
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 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: 5ea68d541df200d10a373c06f945f98225c2486b
refs/heads/master: bc57381e634782009b1cb2e86b18013699ada576
9 changes: 5 additions & 4 deletions trunk/drivers/usb/renesas_usbhs/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ static void usbhsc_notify_hotplug(struct work_struct *work)
{
struct usbhs_priv *priv = container_of(work,
struct usbhs_priv,
notify_hotplug_work);
notify_hotplug_work.work);
struct platform_device *pdev = usbhs_priv_to_pdev(priv);
struct usbhs_mod *mod = usbhs_mod_get_current(priv);
int id;
Expand Down Expand Up @@ -224,16 +224,17 @@ static void usbhsc_notify_hotplug(struct work_struct *work)
}
}

static int usbhsc_drvcllbck_notify_hotplug(struct platform_device *pdev)
int usbhsc_drvcllbck_notify_hotplug(struct platform_device *pdev)
{
struct usbhs_priv *priv = usbhs_pdev_to_priv(pdev);
int delay = usbhs_get_dparam(priv, detection_delay);

/*
* This functions will be called in interrupt.
* To make sure safety context,
* use workqueue for usbhs_notify_hotplug
*/
schedule_work(&priv->notify_hotplug_work);
schedule_delayed_work(&priv->notify_hotplug_work, delay);
return 0;
}

Expand Down Expand Up @@ -300,7 +301,7 @@ static int __devinit usbhs_probe(struct platform_device *pdev)
*/
priv->irq = irq;
priv->pdev = pdev;
INIT_WORK(&priv->notify_hotplug_work, usbhsc_notify_hotplug);
INIT_DELAYED_WORK(&priv->notify_hotplug_work, usbhsc_notify_hotplug);
spin_lock_init(usbhs_priv_to_lock(priv));

/* call pipe and module init */
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/usb/renesas_usbhs/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ struct usbhs_priv {
struct renesas_usbhs_platform_callback *pfunc;
struct renesas_usbhs_driver_param *dparam;

struct work_struct notify_hotplug_work;
struct delayed_work notify_hotplug_work;
struct platform_device *pdev;

spinlock_t lock;
Expand All @@ -200,6 +200,7 @@ u16 usbhs_read(struct usbhs_priv *priv, u32 reg);
void usbhs_write(struct usbhs_priv *priv, u32 reg, u16 data);
void usbhs_bset(struct usbhs_priv *priv, u32 reg, u16 mask, u16 data);

int usbhsc_drvcllbck_notify_hotplug(struct platform_device *pdev);
/*
* sysconfig
*/
Expand Down
7 changes: 7 additions & 0 deletions trunk/include/linux/usb/renesas_usbhs.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,13 @@ struct renesas_usbhs_driver_param {
* for BUSWAIT :: BWAIT
* */
int buswait_bwait;

/*
* option:
*
* delay time from notify_hotplug callback
*/
int detection_delay;
};

/*
Expand Down

0 comments on commit b63bc43

Please sign in to comment.