public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tom <Tom.Rix@windriver.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v4 06/12] SPEAr : usbd driver support for SPEAr SoCs
Date: Thu, 14 Jan 2010 09:34:31 -0600	[thread overview]
Message-ID: <4B4F3987.60204@windriver.com> (raw)
In-Reply-To: <83d1d72b1001140300gd0c9f7dq3a50d45948dd9c76@mail.gmail.com>

Vipin Kumar wrote:
> Hello Tom,
> 
>> +static void udc_state_transition(usb_device_state_t initial,
>> +                                usb_device_state_t final)
>> +{
>> +       if (initial < final) {
>> +               switch (initial) {
>> +               case STATE_ATTACHED:
>> +                       usbd_device_event_irq(udc_device,
>> +                                             DEVICE_HUB_CONFIGURED, 0);
>> +                       if (final == STATE_POWERED)
>> +                               break;
>> +               case STATE_POWERED:
>> +                       usbd_device_event_irq(udc_device, DEVICE_RESET, 0);
>> +                       if (final == STATE_DEFAULT)
>> +                               break;
>> +               case STATE_DEFAULT:
>> +                       usbd_device_event_irq(udc_device,
>> +                                             DEVICE_ADDRESS_ASSIGNED, 0);
>> +                       if (final == STATE_ADDRESSED)
>> +                               break;
>> +               case STATE_ADDRESSED:
>> +                       usbd_device_event_irq(udc_device, DEVICE_CONFIGURED, 0);
>> +               case STATE_CONFIGURED:
>> +                       break;
>> +               default:
>> +                       break;
>> +               }
>> +       } else if (initial > final) {
>> +               switch (initial) {
>> +               case STATE_CONFIGURED:
>> +                       usbd_device_event_irq(udc_device,
>> +                                             DEVICE_DE_CONFIGURED, 0);
>> +                       if (final == STATE_ADDRESSED)
>> +                               break;
>> +               case STATE_ADDRESSED:
>> +                       usbd_device_event_irq(udc_device, DEVICE_RESET, 0);
>> +                       if (final == STATE_DEFAULT)
>> +                               break;
>> +               case STATE_DEFAULT:
>> +                       usbd_device_event_irq(udc_device,
>> +                                             DEVICE_POWER_INTERRUPTION, 0);
>> +                       if (final == STATE_POWERED)
>> +                               break;
>> +               case STATE_POWERED:
>> +                       usbd_device_event_irq(udc_device, DEVICE_HUB_RESET, 0);
>> +               case STATE_ATTACHED:
>> +                       break;
>> +               default:
>> +                       break;
>> +               }
>> +       }
>> No panicing if the state transition is the default ?
> 
> default here is not an error case. The device state may be other than what are
> written as switch cases

Ok

Tom

> 
> All other review feedbacks are accepted.
> Patch set v5 would contain the changes
> 
> Regards
> Vipin

  parent reply	other threads:[~2010-01-14 15:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-13 13:18 [U-Boot] [PATCH v4 06/12] SPEAr : usbd driver support for SPEAr SoCs Tom
     [not found] ` <83d1d72b1001140300gd0c9f7dq3a50d45948dd9c76@mail.gmail.com>
2010-01-14 15:34   ` Tom [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-01-11 11:15 [U-Boot] [PATCH v4 00/12] Support " Vipin KUMAR
2010-01-11 11:15 ` [U-Boot] [PATCH v4 01/12] SPEAr : Adding README.spear in doc Vipin KUMAR
2010-01-11 11:15   ` [U-Boot] [PATCH v4 02/12] SPEAr : Adding basic SPEAr architecture support Vipin KUMAR
2010-01-11 11:15     ` [U-Boot] [PATCH v4 03/12] SPEAr : i2c driver support added for SPEAr SoCs Vipin KUMAR
2010-01-11 11:15       ` [U-Boot] [PATCH v4 04/12] SPEAr : smi driver support " Vipin KUMAR
2010-01-11 11:15         ` [U-Boot] [PATCH v4 05/12] SPEAr : nand " Vipin KUMAR
2010-01-11 11:15           ` [U-Boot] [PATCH v4 06/12] SPEAr : usbd " Vipin KUMAR

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=4B4F3987.60204@windriver.com \
    --to=tom.rix@windriver.com \
    --cc=u-boot@lists.denx.de \
    /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