#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 |
Allocate and free with sdioemb_slot_alloc() and sdioemb_slot_free().
char sdioemb_slot::name[64] |
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.
slot | the slot to configure. | |
clk | new SD bus clock frequency in Hz, SDIOEMB_BUS_FREQ_OFF or SDIOEMB_BUS_FREQ_IDLE. |
int(* sdioemb_slot::set_bus_width)(struct sdioemb_slot *slot, int bus_width) |
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.
slot | the slot to configure. | |
bus_width | new SD bus width (either 1 or 4). |
-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:
Called from: interrupt context.
slot | slot to perform the command. | |
cmd | SDIO command to start. |
int(* sdioemb_slot::card_present)(struct sdioemb_slot *slot) |
Detect if a card is inserted into the slot.
Called from: thread context.
slot | slot to check. |
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.
slot | the slot. | |
power | the requested voltage. |
void(* sdioemb_slot::enable_card_int)(struct sdioemb_slot *slot) |
Enable (unmask) the SDIO card interrupt on the controller.
Called from: interrupt context.
slot | the slot to enable the interrupt on.. |
Referenced by sdioemb_interrupt_acknowledge().
void(* sdioemb_slot::disable_card_int)(struct sdioemb_slot *slot) |
Disable (mask) the SDIO card interrupt on the controller.
Called from: thread context.
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:
If hard resets are not supported, either return 0 or set hard_reset to NULL.
slot | the slot for the card to reset. |
1 if hard resets are not supported.
Referenced by sdioemb_hard_reset().
struct slot_caps sdioemb_slot::caps [read] |
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.
struct sdioemb_slot_notifiers sdioemb_slot::notifs [read] |
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 SDIO layer.
Referenced by sdioemb_card_inserted(), sdioemb_card_removed(), sdioemb_hard_reset(), sdioemb_idle_function(), sdioemb_interrupt(), sdioemb_interrupt_acknowledge(), sdioemb_interrupt_disable(), sdioemb_interrupt_enable(), sdioemb_power_off(), sdioemb_power_on(), sdioemb_resume(), sdioemb_set_bus_width(), sdioemb_set_max_bus_freq(), sdioemb_slot_alloc(), sdioemb_slot_free(), sdioemb_slot_register(), and sdioemb_suspend().
void* sdioemb_slot::drv_data |
Data private to the slot driver.
Referenced by sdioemb_slot_alloc(), sdioemb_wdf_create_child_list(), and sdioemb_wdf_destroy_child_list().