Re: [PATCH 2/2] [RFC] pl2303 autosuspend

Greg KH <[email protected]>
Newsgroups gmane.linux.usb.devel
Message-ID <[email protected]>
On Thu, Oct 25, 2007 at 10:58:45AM -0700, Sarah Sharp wrote:
> Addition of autosuspend to pl2303 usb-serial converter.
> 
> Signed-off-by: Sarah Sharp <[email protected]>
> ---
> 
> As Alan Stern suggested, I tried to add most of the autosuspend support to
> usb-serial.c (which seems to be the glue layer between the tty and the driver
> for the specific usb-serial chip).  I added the claim and release interface
> calls to the tty open and close functions in the usb-serial.c layer.
> 
> To enable the device to be autosuspended, the driver for the USB to serial
> device would then only need to add pointers to the usb-serial.c's suspend and
> resume functions and the .supports_autosuspend to their usb_driver structure.
> They would also need to add a suspend/resume pointer to their usb_serial_driver
> structure if they wanted the serial core to call them in its suspend/resume
> functions.  It's kind of convoluted; the alternative would be to just add
> suspend and resume functions to each driver.
> 
> For now, I didn't add a suspend and resume function to the usb_serial_driver
> structure in pl2303.c.  (Hence the need for the first patch to avoid the NULL
> pointer dereference.)  I did add the .supports_autosuspend flag to the
> usb_driver structure with pointers to usb-serial.c's suspend and resume
> functions.  AFAIK, this works with autosuspend in many cases.
> 
> However, I think it will break with kernel swsuspend (and writing "suspend" to
> the level sysfs file) if the tty is open.  I'm looking for suggestions on how to
> make it work, along with any other comments.  I was looking at taking some of
> the code out of the pl2303's close function and putting into a separate kill
> traffic function, but I think it would require some work to be able to be called
> in interrupt context (as I think would be the case with a swsuspend?).
> 
> The other gotcha is that the pl2303 claims to support remote wakeup.  I haven't
> found a good explanation on any datasheet I've seen about *when* remote wakeup
> is triggered.  One datasheet for the pl2303-HX [1] lists a register RW_MODE that
> if set to 0 "When engages remote wakeup, the device issues disconnect signal" or
> if set to 1 "When engages remote wakeup, the device issues resume signal".  If
> anyone can help me decode this, it would be appreciated.

True data sheets for this hardware are very hard to come by.  What you
found at:

> [1]
> http://www.prolific.com.tw/support/files/%5CIO%20Cable%5CPL-2303%5CDoc%5CData%20Sheet%5Cds_pl2303H_v16B.pdf

Is just the basic hardware spec, and the config register shows how the
device could be configured at the factory through the internal i2c
interface on the chip.

Rumor has it that you can read this information from the chip itself
through a vendor-specific command, but I have not seen any public
information on how to do that :(

So, does this patch work for you with your devices?

thanks,

greg k-h

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.