Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
dock.c File Reference
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/types.h>
#include <linux/notifier.h>
#include <linux/platform_device.h>
#include <linux/jiffies.h>
#include <linux/stddef.h>
#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>

Go to the source code of this file.

Data Structures

struct  dock_station
 
struct  dock_dependent_device
 
struct  dock_data
 

Macros

#define PREFIX   "ACPI: "
 
#define ACPI_DOCK_DRIVER_DESCRIPTION   "ACPI Dock Station Driver"
 
#define DOCK_DOCKING   0x00000001
 
#define DOCK_UNDOCKING   0x00000002
 
#define DOCK_IS_DOCK   0x00000010
 
#define DOCK_IS_ATA   0x00000020
 
#define DOCK_IS_BAT   0x00000040
 
#define DOCK_EVENT   3
 
#define UNDOCK_EVENT   2
 

Functions

 ACPI_MODULE_NAME ("dock")
 
 MODULE_AUTHOR ("Kristen Carlson Accardi")
 
 MODULE_DESCRIPTION (ACPI_DOCK_DRIVER_DESCRIPTION)
 
 MODULE_LICENSE ("GPL")
 
 module_param (immediate_undock, bool, 0644)
 
 MODULE_PARM_DESC (immediate_undock,"1 (default) will cause the driver to ""undock immediately when the undock button is pressed, 0 will cause"" the driver to wait for userspace to write the undock sysfs file "" before undocking")
 
 MODULE_DEVICE_TABLE (acpi, dock_device_ids)
 
int is_dock_device (acpi_handle handle)
 
 EXPORT_SYMBOL_GPL (is_dock_device)
 
int register_dock_notifier (struct notifier_block *nb)
 
 EXPORT_SYMBOL_GPL (register_dock_notifier)
 
void unregister_dock_notifier (struct notifier_block *nb)
 
 EXPORT_SYMBOL_GPL (unregister_dock_notifier)
 
int register_hotplug_dock_device (acpi_handle handle, const struct acpi_dock_ops *ops, void *context)
 
 EXPORT_SYMBOL_GPL (register_hotplug_dock_device)
 
void unregister_hotplug_dock_device (acpi_handle handle)
 
 EXPORT_SYMBOL_GPL (unregister_hotplug_dock_device)
 
 subsys_initcall (dock_init)
 
 module_exit (dock_exit)
 

Macro Definition Documentation

#define ACPI_DOCK_DRIVER_DESCRIPTION   "ACPI Dock Station Driver"

Definition at line 39 of file dock.c.

#define DOCK_DOCKING   0x00000001

Definition at line 84 of file dock.c.

#define DOCK_EVENT   3

Definition at line 89 of file dock.c.

#define DOCK_IS_ATA   0x00000020

Definition at line 87 of file dock.c.

#define DOCK_IS_BAT   0x00000040

Definition at line 88 of file dock.c.

#define DOCK_IS_DOCK   0x00000010

Definition at line 86 of file dock.c.

#define DOCK_UNDOCKING   0x00000002

Definition at line 85 of file dock.c.

#define PREFIX   "ACPI: "

Definition at line 37 of file dock.c.

#define UNDOCK_EVENT   2

Definition at line 90 of file dock.c.

Function Documentation

ACPI_MODULE_NAME ( "dock"  )
EXPORT_SYMBOL_GPL ( is_dock_device  )
EXPORT_SYMBOL_GPL ( register_dock_notifier  )
EXPORT_SYMBOL_GPL ( unregister_dock_notifier  )
EXPORT_SYMBOL_GPL ( register_hotplug_dock_device  )
EXPORT_SYMBOL_GPL ( unregister_hotplug_dock_device  )
int is_dock_device ( acpi_handle  handle)

is_dock_device - see if a device is on a dock station : acpi handle of the device

If this device is either the dock station itself, or is a device dependent on the dock station, then it is a dock device

Definition at line 260 of file dock.c.

MODULE_AUTHOR ( "Kristen Carlson Accardi"  )
MODULE_DESCRIPTION ( ACPI_DOCK_DRIVER_DESCRIPTION  )
MODULE_DEVICE_TABLE ( acpi  ,
dock_device_ids   
)
module_exit ( dock_exit  )
MODULE_LICENSE ( "GPL"  )
module_param ( immediate_undock  ,
bool  ,
0644   
)
MODULE_PARM_DESC ( immediate_undock  ,
"1 (default) will cause the driver to ""undock immediately when the undock button is  pressed,
0 will cause""the driver to wait for userspace to write the undock sysfs file""before undocking"   
)
int register_dock_notifier ( struct notifier_block nb)

register_dock_notifier - add yourself to the dock notifier list : the callers notifier block

If a driver wishes to be notified about dock events, they can use this function to put a notifier block on the dock notifier list. this notifier call chain will be called after a dock event, but before hotplugging any new devices.

Definition at line 559 of file dock.c.

int register_hotplug_dock_device ( acpi_handle  handle,
const struct acpi_dock_ops ops,
void context 
)

register_hotplug_dock_device - register a hotplug function : the handle of the device : handlers to call after docking : device specific data

If a driver would like to perform a hotplug operation after a dock event, they can register an acpi_notifiy_handler to be called by the dock driver after _DCK is executed.

Definition at line 592 of file dock.c.

subsys_initcall ( dock_init  )
void unregister_dock_notifier ( struct notifier_block nb)

unregister_dock_notifier - remove yourself from the dock notifier list : the callers notifier block

Definition at line 572 of file dock.c.

void unregister_hotplug_dock_device ( acpi_handle  handle)

unregister_hotplug_dock_device - remove yourself from the hotplug list : the acpi handle of the device

Definition at line 629 of file dock.c.