sdioemb_slot Struct Reference
[SDIO slot driver API]

#include <slot_api.h>


Data Fields

char name [64]
enum slot_controller_type type
int(* set_bus_freq )(struct sdioemb_slot *slot, int clk)
int(* set_bus_width )(struct sdioemb_slot *slot, int bus_width)
int(* start_cmd )(struct sdioemb_slot *slot, struct sdioemb_cmd *cmd)
int(* card_present )(struct sdioemb_slot *slot)
int(* card_power )(struct sdioemb_slot *slot, enum sdioemb_power power)
void(* enable_card_int )(struct sdioemb_slot *slot)
void(* disable_card_int )(struct sdioemb_slot *slot)
int(* hard_reset )(struct sdioemb_slot *slot)
struct slot_caps caps
int clock_freq
int bus_width
struct sdioemb_slot_notifiers notifs
int cspi_reg_pad
int cspi_burst_pad
struct sdioemb_slot_priv * priv
void * drv_data


Detailed Description

An SDIO slot driver.

Allocate and free with sdioemb_slot_alloc() and sdioemb_slot_free().


Field Documentation

Name of the slot used in diagnostic messages.

This would typically include the name of the SDIO controller and the slot number if the controller has multiple slots.

This will be set by sdioemb_slot_register() if it is left as an empty string.

Referenced by sdioemb_card_inserted(), sdioemb_card_removed(), sdioemb_slot_register(), sdioemb_slot_unregister(), and sdioemb_start_cmd().

Controller hardware type.

Referenced by sdioemb_set_bus_width().

int(* sdioemb_slot::set_bus_freq)(struct sdioemb_slot *slot, int clk)

Set the SD bus clock frequency.

The driver's implementation should set the SD bus clock to not more than clk Hz (unless clk is equal to SDIOEMB_BUS_FREQ_OFF or SDIOEMB_BUS_FREQ_IDLE).

If clk == SDIOEMB_BUS_FREQ_OFF the clock should be stopped.

clk == SDIOEMB_BUS_FREQ_IDLE indicates that the bus is idle (currently unused) and the host controller may slow (or stop) the SD bus clock to save power on the card. During this idle state the host controller must be capable of receiving SDIO interrupts (for certain host controllers this may require leaving the clock running).

If clk is greater than SDIO_CLOCK_FREQ_NORMAL_SPD (25 MHz) subsequent commands should be done with the controller in high speed mode.

Called from: interrupt context.

Parameters:
slot the slot to configure.
clk new SD bus clock frequency in Hz, SDIOEMB_BUS_FREQ_OFF or SDIOEMB_BUS_FREQ_IDLE.
Returns:
The bus frequency actually configured in Hz.

Set the SD bus width.

The driver's implementation should set the width of the SD bus for all subsequent data transfers to the specified value.

This may be NULL if the driver sets the bus width when starting a command, or the driver is for an SDIO-SPI or CSPI controller.

Called from: thread context.

Parameters:
slot the slot to configure.
bus_width new SD bus width (either 1 or 4).
Returns:
0 on success.

-ve if a low-level error occured when setting the bus width.

int(* sdioemb_slot::start_cmd)(struct sdioemb_slot *slot, struct sdioemb_cmd *cmd)

Start an SDIO command.

The driver's implementation should:

  • set the controller's bus width to bus_width,
  • program the controller to start the command.

Called from: interrupt context.

Parameters:
slot slot to perform the command.
cmd SDIO command to start.

Detect if a card is inserted into the slot.

Called from: thread context.

Parameters:
slot slot to check.
Returns:
non-zero if a card is inserted; 0 otherwise.

Referenced by sdioemb_cmd_complete().

int(* sdioemb_slot::card_power)(struct sdioemb_slot *slot, enum sdioemb_power power)

Switch on/off the SDIO bus power and set the SDIO bus voltage.

Called from: thread context.

Parameters:
slot the slot.
power the requested voltage.
Returns:
0 on success; -ve on error: -EINVAL - requested voltage is not supported.

Enable (unmask) the SDIO card interrupt on the controller.

Called from: interrupt context.

Parameters:
slot the slot to enable the interrupt on..

Referenced by sdioemb_interrupt_acknowledge().

Disable (mask) the SDIO card interrupt on the controller.

Called from: thread context.

Parameters:
slot the slot to disable the interrupt on.

Referenced by sdioemb_interrupt().

int(* sdioemb_slot::hard_reset)(struct sdioemb_slot *slot)

Perform a hard reset of the card.

Hard resets can be achieved in two ways:

  1. Power cycle (if the slot has power control).
  2. Platform-specific assertion of a card/chip reset line.

If hard resets are not supported, either return 0 or set hard_reset to NULL.

Parameters:
slot the slot for the card to reset.
Returns:
0 if a hard reset was performed.

1 if hard resets are not supported.

Referenced by sdioemb_hard_reset().

Slot capabilities.

Referenced by sdioemb_set_bus_width(), and sdioemb_slot_alloc().

SD bus frequency requested by the SDIO layer.

Bus width requested by the SDIO layer.

Slot event notifiers.

Referenced by sdioemb_wdf_slot_register().

Padding for CSPI register reads.

Padding for CSPI burst reads.

struct sdioemb_slot_priv* sdioemb_slot::priv [read]

Data private to the slot driver.

Referenced by sdioemb_slot_alloc(), sdioemb_wdf_create_child_list(), and sdioemb_wdf_destroy_child_list().


The documentation for this struct was generated from the following file:

Generated on Wed Oct 27 15:18:12 2010 for sdioemb by  doxygen 1.5.5