linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Alfred E. Heggestad" <aeh@db.org>
To: Oliver Neukum <oliver@neukum.org>
Cc: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] input: driver for USB VoIP phones with CM109 chipset
Date: Mon, 03 Mar 2008 23:10:16 +0100	[thread overview]
Message-ID: <47CC7748.3030004@db.org> (raw)
In-Reply-To: <200802091023.02580.oliver@neukum.org>

Oliver Neukum wrote:
> Am Donnerstag, 7. Februar 2008 19:38:10 schrieb Alfred E. Heggestad:
>> +static void buzz(struct cm109_dev *dev, int on)
>> +{
>> +       int ret;
>> +
>> +       if (dev == NULL) {
>> +               err("buzz: dev is NULL");
>> +               return;
>> +       }
>> +
>> +       dbg("Buzzer %s", on ? "on" : "off");
>> +       if (on)
>> +               dev->ctl_data->byte[HID_OR0] |= BUZZER_ON;
>> +       else
>> +               dev->ctl_data->byte[HID_OR0] &= ~BUZZER_ON;
>> +
>> +       ret = usb_submit_urb(dev->urb_ctl, GFP_ATOMIC);
>> +       if (ret)
>> +               err("%s - usb_submit_urb failed %d", __FUNCTION__, ret);
>> +}
>> +
>> +static int input_ev(struct input_dev *idev, unsigned int type,
>> +                   unsigned int code, int value)
>> +{
>> +       struct cm109_dev *dev = input_get_drvdata(idev);
>> +       unsigned long flags;
>> +
>> +#ifdef CM109_DEBUG
>> +       info("input_ev: type=%u code=%u value=%d", type, code, value);
>> +#endif
>> +
>> +       if (type != EV_SND)
>> +               return -EINVAL;
>> +
>> +       switch (code) {
>> +       case SND_TONE:
>> +       case SND_BELL:
>> +               break;
>> +       default:
>> +               return -EINVAL;
>> +       }
>> +
>> +       spin_lock_irqsave(&cm109_buzz_lock, flags);
>> +       buzz(dev, value);
>> +       spin_unlock_irqrestore(&cm109_buzz_lock, flags);
>> +
>> +       return 0;
>> +}
> 
> What makes you sure you finished the URB to switch the buzzer on before
> you try to switch it off again? It seems that you might be attempting to
> manipulate a live URB there if you hit the window.
> 

thanks for the hint. could you let me know how I can fix this properly,
or point me to some USB driver code that implements this correctly.. ?


/alfred

> 	Regards
> 		Oliver

      parent reply	other threads:[~2008-03-03 22:10 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-07 18:38 [PATCH] input: driver for USB VoIP phones with CM109 chipset Alfred E. Heggestad
2008-02-07 21:59 ` Dmitry Torokhov
2008-02-08 21:23   ` Alfred E. Heggestad
2008-06-21 22:23   ` Alfred E. Heggestad
2008-06-24  4:59     ` Dmitry Torokhov
2008-06-25 20:07       ` Alfred E. Heggestad
2008-06-26 10:31         ` Oliver Neukum
2008-02-09 19:12 ` Pavel Machek
2008-03-03 22:07   ` Alfred E. Heggestad
2008-03-03 22:13     ` Pavel Machek
     [not found] ` <200802091023.02580.oliver@neukum.org>
2008-03-03 22:10   ` Alfred E. Heggestad [this message]

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=47CC7748.3030004@db.org \
    --to=aeh@db.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oliver@neukum.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).