Linux Kernel
3.7.1
|
#include <linux/hsi/hsi.h>
#include <linux/compiler.h>
#include <linux/list.h>
#include <linux/kobject.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/notifier.h>
#include "hsi_core.h"
Go to the source code of this file.
EXPORT_SYMBOL_GPL | ( | hsi_unregister_controller | ) |
EXPORT_SYMBOL_GPL | ( | hsi_register_controller | ) |
EXPORT_SYMBOL_GPL | ( | hsi_register_client_driver | ) |
EXPORT_SYMBOL_GPL | ( | hsi_put_controller | ) |
EXPORT_SYMBOL_GPL | ( | hsi_alloc_controller | ) |
EXPORT_SYMBOL_GPL | ( | hsi_free_msg | ) |
EXPORT_SYMBOL_GPL | ( | hsi_alloc_msg | ) |
EXPORT_SYMBOL_GPL | ( | hsi_async | ) |
EXPORT_SYMBOL_GPL | ( | hsi_claim_port | ) |
EXPORT_SYMBOL_GPL | ( | hsi_release_port | ) |
EXPORT_SYMBOL_GPL | ( | hsi_register_port_event | ) |
EXPORT_SYMBOL_GPL | ( | hsi_unregister_port_event | ) |
EXPORT_SYMBOL_GPL | ( | hsi_event | ) |
|
read |
hsi_alloc_controller - Allocate an HSI controller and its ports : Number of ports on the HSI controller : Kernel allocation flags
Return NULL on failure or a pointer to an hsi_controller on success.
hsi_alloc_msg - Allocate an HSI message : Number of memory entries : Kernel allocation flags
nents can be 0. This mainly makes sense for read transfer. In that case, HSI drivers will call the complete callback when there is data to be read without consuming it.
Return NULL on failure or a pointer to an hsi_msg on success.
int hsi_async | ( | struct hsi_client * | cl, |
struct hsi_msg * | msg | ||
) |
hsi_async - Submit an HSI transfer to the controller : HSI client sending the transfer : The HSI transfer passed to controller
The HSI message must have the channel, ttype, complete and destructor fields set beforehand. If nents > 0 then the client has to initialize also the scatterlists to point to the buffers to write to or read from.
HSI controllers relay on pre-allocated buffers from their clients and they do not allocate buffers on their own.
Once the HSI message transfer finishes, the HSI controller calls the complete callback with the status and actual_len fields of the HSI message updated. The complete callback can be called before returning from hsi_async.
Returns -errno on failure or 0 on success
int hsi_claim_port | ( | struct hsi_client * | cl, |
unsigned int | share | ||
) |
hsi_event -Notifies clients about port events : Port where the event occurred : The event type
Clients should not be concerned about wake line behavior. However, due to a race condition in HSI HW protocol, clients need to be notified about wake line changes, so they can implement a workaround for it.
Events: HSI_EVENT_START_RX - Incoming wake line high HSI_EVENT_STOP_RX - Incoming wake line down
Returns -errno on error, or 0 on success.
void hsi_put_controller | ( | struct hsi_controller * | hsi | ) |
hsi_put_controller - Free an HSI controller
: Pointer to the HSI controller to freed
HSI controller drivers should only use this function if they need to free their allocated hsi_controller structures before a successful call to hsi_register_controller. Other use is not allowed.
int hsi_register_client_driver | ( | struct hsi_client_driver * | drv | ) |
int hsi_register_controller | ( | struct hsi_controller * | hsi | ) |
int hsi_register_port_event | ( | struct hsi_client * | cl, |
void(*)(struct hsi_client *, unsigned long) | handler | ||
) |
hsi_register_port_event - Register a client to receive port events : HSI client that wants to receive port events : Event handler callback
Clients should register a callback to be able to receive events from the ports. Registration should happen after claiming the port. The handler can be called in interrupt context.
Returns -errno on error, or 0 on success.
void hsi_release_port | ( | struct hsi_client * | cl | ) |
void hsi_unregister_controller | ( | struct hsi_controller * | hsi | ) |
int hsi_unregister_port_event | ( | struct hsi_client * | cl | ) |
MODULE_AUTHOR | ( | "Carlos Chinea <[email protected]>" | ) |
module_exit | ( | hsi_exit | ) |
MODULE_LICENSE | ( | "GPL v2" | ) |
postcore_initcall | ( | hsi_init | ) |