From 0c168e13200e69223905946d865fceba15ba830f Mon Sep 17 00:00:00 2001 From: patacongo Date: Thu, 31 Jan 2013 19:20:26 +0000 Subject: Missing calls to class SUSPEND/RESUME methods in all USB drivers git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5590 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/arch/arm/src/lpc214x/lpc214x_usbdev.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'nuttx/arch/arm/src/lpc214x/lpc214x_usbdev.c') diff --git a/nuttx/arch/arm/src/lpc214x/lpc214x_usbdev.c b/nuttx/arch/arm/src/lpc214x/lpc214x_usbdev.c index 78a5fe1c3..78dc86992 100644 --- a/nuttx/arch/arm/src/lpc214x/lpc214x_usbdev.c +++ b/nuttx/arch/arm/src/lpc214x/lpc214x_usbdev.c @@ -1,7 +1,7 @@ /******************************************************************************* * arch/arm/src/lpc214x/lpc214x_usbdev.c * - * Copyright (C) 2008-2010, 2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2008-2010, 2012-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt * * Redistribution and use in source and binary forms, with or without @@ -2139,6 +2139,22 @@ static int lpc214x_usbinterrupt(int irq, FAR void *context) { usbtrace(TRACE_INTDECODE(LPC214X_TRACEINTID_SUSPENDCHG), (uint16_t)g_usbdev.devstatus); + + /* Inform the Class driver of the change */ + + if (priv->driver) + { + if (DEVSTATUS_SUSPEND(g_usbdev.devstatus)) + { + CLASS_SUSPEND(priv->driver, &priv->usbdev); + } + else + { + CLASS_RESUME(priv->driver, &priv->usbdev); + } + } + + /* TODO: Perform power management operations here. */ } /* Device reset */ -- cgit v1.2.3