This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: Device driver open & close
- From: Frank Pagliughi <fpagliughi at mindspring dot com>
- To: Frank Pagliughi <frank at sorosys dot com>, eCos Discussion <ecos-discuss at ecos dot sourceware dot org>
- Date: Tue, 26 Aug 2008 15:57:19 -0400
- Subject: Re: [ECOS] Device driver open & close
- References: <48B340BD.1050201@sorosys.com> <20080826044828.GS31987@lunn.ch>
Andrew Lunn wrote:
On Mon, Aug 25, 2008 at 07:31:09PM -0400, Frank Pagliughi wrote:
Hey All,
Is there a mechanism by which a device driver can be notified when the
application opens or closes the device. For example, I have an LCD in my
system, and I would like to turn it on when the application opens the
device and turn it off when it gets closed. Then turn it back on again
if it gets re-opened, etc.
open() should result in the lookup function being called on the
device.
This gets called for each open?
Close is a problem, since there is no device close function.
You might be better using cyg_io_set_config() mechanism to turn it on
and off.
This is unfortunate. For another example, the system will have the
ability to power down the compact flash drive(s). Which order should the
power down happen?
flush() the buffers, then cyg_io_set_config() to power down the drive,
*then* close() ? I assume you can't use the handle to set_config after
the close(). Right?
Frank
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss