linux/drivers/mxc/pmic/core/pmic_core_spi.c File Reference

This is the main file for the PMIC Core/Protocol driver. SPI should be providing the interface between the PMIC and the MCU. More...

Functions

static void pmic_pdev_register (void)
static void pmic_pdev_unregister (void)
void pmic_event_list_init (void)
void pmic_event_callback (type_event event)
irqreturn_t pmic_irq_handler (int irq, void *dev_id)
static int pmic_suspend (struct spi_device *spi, pm_message_t message)
static int pmic_resume (struct spi_device *spi)
static int __devinit pmic_probe (struct spi_device *spi)
static int __devexit pmic_remove (struct spi_device *spi)
static int __init pmic_init (void)
static void __exit pmic_exit (void)

Variables

static struct spi_driver pmic_driver

Detailed Description

This is the main file for the PMIC Core/Protocol driver. SPI should be providing the interface between the PMIC and the MCU.


Function Documentation

void pmic_event_callback ( type_event  event  ) 

This function calls all callback of a specific event.

Parameters:
event the active event number
Returns:
None

References pmic_event_callback_list_t::callback, pmic_event_callback_t::func, and pmic_event_callback_t::param.

Referenced by pmic_event_task().

void pmic_event_list_init ( void   ) 

This function initializes event list for PMIC event handling.

Referenced by pmic_probe().

static void __exit pmic_exit ( void   )  [static]

This function implements the exit function of the PMIC device. This function is called when the module is unloaded. It unregisters the PMIC Protocol driver.

References pmic_driver.

static int __init pmic_init ( void   )  [static]

This function implements the init function of the PMIC device. This function is called when the module is loaded. It registers the PMIC Protocol driver.

Returns:
This function returns 0.

References pmic_driver.

irqreturn_t pmic_irq_handler ( int  irq,
void *  dev_id 
)

This function is called when pmic interrupt occurs on the processor. It is the interrupt handler for the pmic module.

Parameters:
irq the irq number
dev_id the pointer on the device
Returns:
The function returns IRQ_HANDLED when handled.

References IRQ_HANDLED.

Referenced by pmic_probe().

static void pmic_pdev_register ( void   )  [static]

This function registers platform device structures for PMIC client drivers.

Referenced by pmic_probe().

static void pmic_pdev_unregister ( void   )  [static]

This function unregisters platform device structures for PMIC client drivers.

Referenced by pmic_remove().

static int __devinit pmic_probe ( struct spi_device *  spi  )  [static]

This function is called whenever the SPI slave device is detected.

Parameters:
spi the SPI slave device
Returns:
Returns 0 on SUCCESS and error on FAILURE.

References pmic_event_list_init(), pmic_get_revision(), pmic_init_registers(), pmic_irq_handler(), pmic_pdev_register(), pmic_spi_setup(), and pmic_version_t::revision.

static int __devexit pmic_remove ( struct spi_device *  spi  )  [static]

This function is called whenever the SPI slave device is removed.

Parameters:
spi the SPI slave device
Returns:
Returns 0 on SUCCESS and error on FAILURE.

References pmic_pdev_unregister().

static int pmic_resume ( struct spi_device *  spi  )  [static]

This function brings the SPI slave device back from low-power mode/state.

Parameters:
spi the SPI slave device
Returns:
Returns 0 on SUCCESS and error on FAILURE.
static int pmic_suspend ( struct spi_device *  spi,
pm_message_t  message 
) [static]

This function puts the SPI slave device in low-power mode/state.

Parameters:
spi the SPI slave device
message the power state to enter
Returns:
Returns 0 on SUCCESS and error on FAILURE.

Variable Documentation

static struct spi_driver pmic_driver [static]
Initial value:
 {
        .driver = {
                   .name = "pmic_spi",
                   .bus = &spi_bus_type,
                   .owner = THIS_MODULE,
                   },
        .probe = pmic_probe,
        .remove = __devexit_p(pmic_remove),
        .suspend = pmic_suspend,
        .resume = pmic_resume,
}

This structure contains pointers to the power management callback functions.

Referenced by pmic_exit(), and pmic_init().

footer
©  Freescale Semiconductor, Inc., 2007.  All rights reserved.
Freescale Confidential Proprietary
NDA Required
doxygen