public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* Where can I find some documentation/examples?
@ 2004-01-08  4:26 Dino Klein
       [not found] ` <LAW11-OE2428gdq0f690001fb1d-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org>
  0 siblings, 1 reply; 4+ messages in thread
From: Dino Klein @ 2004-01-08  4:26 UTC (permalink / raw)
  To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

I'm interested in playing with acpi, by writing a simple driver for device PNP0C04 (the FPU), which obviously won't do much.
I am trying to figure out how to populate acpi_driver structure, but I'm not quite clear as to which of the operation a device
should implement.
I've taken a look at the serial driver's use of acpi in order to discover ports, and their resources (in kernel 2.6.0). One thing
puzzled me there, since it seems that it is possible to unload their acpi related, and therefore having it call
acpi_bus_unregister_driver(); however, as far as I can tell, the serial port itself is still being used by the serial driver. This
is why I'm not quite sure about the relationship between a regular linux driver, and the acpi subsystem.
So, any pointers would be appreciated.

Thanks.


-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Where can I find some documentation/examples?
       [not found] ` <LAW11-OE2428gdq0f690001fb1d-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org>
@ 2004-01-08  4:52   ` Matthew Wilcox
  0 siblings, 0 replies; 4+ messages in thread
From: Matthew Wilcox @ 2004-01-08  4:52 UTC (permalink / raw)
  To: Dino Klein; +Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

On Wed, Jan 07, 2004 at 11:26:08PM -0500, Dino Klein wrote:
> I've taken a look at the serial driver's use of acpi in order to discover ports, and their resources (in kernel 2.6.0). One thing
> puzzled me there, since it seems that it is possible to unload their acpi related, and therefore having it call
> acpi_bus_unregister_driver(); however, as far as I can tell, the serial port itself is still being used by the serial driver. This
> is why I'm not quite sure about the relationship between a regular linux driver, and the acpi subsystem.
> So, any pointers would be appreciated.

You don't necessarily want to take that driver as a good example of
what's needed to write an ACPI driver.  Actually somebody else just
pointed out the same thing to me earlier today.  On the systems I work
on, I use serial console, so it's pretty much mandatory to have 8250
built in and hence the remove method never gets called ;-)

Take a look at something like the button driver instead.

-- 
"Next the statesmen will invent cheap lies, putting the blame upon 
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince 
himself that the war is just, and will thank God for the better sleep 
he enjoys after this process of grotesque self-deception." -- Mark Twain


-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Where can I find some documentation/examples?
@ 2004-01-08 15:15 Dino Klein
  0 siblings, 0 replies; 4+ messages in thread
From: Dino Klein @ 2004-01-08 15:15 UTC (permalink / raw)
  To: willy-8fiUuRrzOP0dnm+yROfE0A; +Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

One comment about removing - I didn't mean calling the serial device's 
remove method in the ACPI namespace, but rather having the serial driver 
call serial_unregister() to release the resources.
I would think that if the driver unregisters from the acpi bus, then it 
should also release the resources, after all, wouldn't it be possible that 
after the driver unregisters with the acpi bus, yet still holds the 
resources, couldn't a second serial driver come along and register for the 
same type of devices, and get the same serial device that is already handled 
by the first serial driver?


>On Wed, Jan 07, 2004 at 11:26:08PM -0500, Dino Klein wrote:
> > I've taken a look at the serial driver's use of acpi in order to 
>discover ports, and their resources (in kernel 2.6.0). One thing
> > puzzled me there, since it seems that it is possible to unload their 
>acpi related, and therefore having it call
> > acpi_bus_unregister_driver(); however, as far as I can tell, the serial 
>port itself is still being used by the serial driver. This
> > is why I'm not quite sure about the relationship between a regular linux 
>driver, and the acpi subsystem.
> > So, any pointers would be appreciated.
>
>You don't necessarily want to take that driver as a good example of
>what's needed to write an ACPI driver.  Actually somebody else just
>pointed out the same thing to me earlier today.  On the systems I work
>on, I use serial console, so it's pretty much mandatory to have 8250
>built in and hence the remove method never gets called ;-)
>
>Take a look at something like the button driver instead.

_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail



-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: Where can I find some documentation/examples?
@ 2004-01-12  7:20 Yu, Luming
  0 siblings, 0 replies; 4+ messages in thread
From: Yu, Luming @ 2004-01-12  7:20 UTC (permalink / raw)
  To: Dino Klein, willy-8fiUuRrzOP0dnm+yROfE0A
  Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

> One comment about removing - I didn't mean calling the serial 
> device's 
> remove method in the ACPI namespace, but rather having the 
> serial driver 
> call serial_unregister() to release the resources.
> I would think that if the driver unregisters from the acpi 
> bus, then it 
> should also release the resources, after all, wouldn't it be 
> possible that 
> after the driver unregisters with the acpi bus, yet still holds the 
> resources, couldn't a second serial driver come along and 
> register for the 
> same type of devices, and get the same serial device that is 
> already handled 
> by the first serial driver?
> 

As for resources management, ACPI seems to just let other
driver know the resources configuration. So you cannot count 
on acpi for that purpose.


-------------------------------------------------------
This SF.net email is sponsored by: Perforce Software.
Perforce is the Fast Software Configuration Management System offering
advanced branching capabilities and atomic changes on 50+ platforms.
Free Eval! http://www.perforce.com/perforce/loadprog.html

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-01-12  7:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-01-08  4:26 Where can I find some documentation/examples? Dino Klein
     [not found] ` <LAW11-OE2428gdq0f690001fb1d-PkbjNfxxIARBDgjK7y7TUQ@public.gmane.org>
2004-01-08  4:52   ` Matthew Wilcox
  -- strict thread matches above, loose matches on Subject: below --
2004-01-08 15:15 Dino Klein
2004-01-12  7:20 Yu, Luming

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox