linux/drivers/mxc/pmic/core/pmic.h File Reference

This file contains prototypes of all the functions to be defined for each PMIC chip. The implementation of these may differ from PMIC chip to PMIC chip. More...

Data Structures

struct  mxc_pmic

Functions

static int spi_rw (struct spi_device *spi, u8 *buf, size_t len)
void pmic_get_revision (pmic_version_t *ver)
int pmic_spi_setup (struct spi_device *spi)
int pmic_init_registers (void)
unsigned int pmic_get_active_events (unsigned int *active_events)
int pmic_event_mask (type_event event)
int pmic_event_unmask (type_event event)

Detailed Description

This file contains prototypes of all the functions to be defined for each PMIC chip. The implementation of these may differ from PMIC chip to PMIC chip.


Function Documentation

int pmic_event_mask ( type_event  event  ) 

This function sets a bit in mask register of pmic to disable an event IT.

Parameters:
event the event to be masked
Returns:
This function returns PMIC_SUCCESS on SUCCESS, error on FAILURE.

References pmic_write_reg().

Referenced by callback_tsi(), pmic_event_unsubscribe(), and spi_rw().

int pmic_event_unmask ( type_event  event  ) 

This function unsets a bit in mask register of pmic to unmask an event IT.

Parameters:
event the event to be unmasked
Returns:
This function returns PMIC_SUCCESS on SUCCESS, error on FAILURE.

References pmic_write_reg().

Referenced by mc13783_adc_convert(), pmic_event_subscribe(), and spi_rw().

unsigned int pmic_get_active_events ( unsigned int *  active_events  ) 

This function reads the interrupt status registers of PMIC and determine the current active events.

Parameters:
active_events array pointer to be used to return active event numbers.
Returns:
This function returns PMIC version.

References pmic_read(), and pmic_write().

Referenced by pmic_event_task(), and spi_rw().

void pmic_get_revision ( pmic_version_t ver  ) 

This function returns the PMIC version in system.

Parameters:
ver pointer to the pmic_version_t structure
Returns:
This function returns PMIC version.

References pmic_version_t::id, pmic_read(), and pmic_version_t::revision.

Referenced by pmic_probe(), and spi_rw().

int pmic_init_registers ( void   ) 

This function initializes the PMIC registers.

Returns:
None

References pmic_write().

Referenced by pmic_probe(), and spi_rw().

int pmic_spi_setup ( struct spi_device *  spi  ) 

This function initializes the SPI device parameters for this PMIC.

Parameters:
spi the SPI slave device(PMIC)
Returns:
None

References mxc_pmic::spi.

Referenced by pmic_probe(), and spi_rw().

static int spi_rw ( struct spi_device *  spi,
u8 *  buf,
size_t  len 
) [inline, static]

This function is called to transfer data to PMIC on SPI.

Parameters:
spi the SPI slave device(PMIC)
buf the pointer to the data buffer
len the length of the data to be transferred
Returns:
Returns 0 on success -1 on failure.

References pmic_event_mask(), pmic_event_unmask(), pmic_get_active_events(), pmic_get_revision(), pmic_init_registers(), and pmic_spi_setup().

Referenced by pmic_read(), and pmic_write().

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