Logo Search packages:      
Sourcecode: linux-fsl-imx51 version File versions  Download package

dvfs_dptc_struct.h

/*
 * Copyright 2004-2009 Freescale Semiconductor, Inc. All Rights Reserved.
 */

/*
 * The code contained herein is licensed under the GNU General Public
 * License. You may obtain a copy of the GNU General Public License
 * Version 2 or later at the following locations:
 *
 * http://www.opensource.org/licenses/gpl-license.html
 * http://www.gnu.org/copyleft/gpl.html
 */

/*!
 * @file arch-mxc/dvfs_dptc_struct.h
 *
 * @brief MXC dvfs & dptc structure definitions file.
 *
 * @ingroup PM_MX27 PM_MX31 PM_MXC91321 PM_MXC91311
 */
#ifndef __ASM_ARCH_MXC_DVFS_DPTC_STRUCT_H__
#define __ASM_ARCH_MXC_DVFS_DPTC_STRUCT_H__

#include <linux/semaphore.h>
#include <mach/pm_api.h>

/*!
 * Number of entries in the DPTC log buffer
 */
#define LOG_ENTRIES 1024

/*!
 * Log buffer Structure.\n
 * This structure records the DPTC changes. \n
 * This structure can be read by the user using the proc file system DPTC read entry.
 */
00037 typedef struct {
      /*!
       * Index to the head of the log buffer
       */
00041       int head;

      /*!
       * Index to the tail of the log buffer
       */
00046       int tail;

      /*!
       * Mutex to allow access to the log buffer
       */
00051       struct semaphore mutex;

      /*!
       * Array of log buffer entries
       */
00056       dptc_log_entry_s entries[LOG_ENTRIES];
} dptc_log_s;

/*!
 * DPTC driver data structure.\n
 * Holds all driver parameters and data structures.
 */
00063 typedef struct {
      /*!
       * This variable holds the current frequency index
       */
00067       int current_freq_index;

      /*!
       * Boolean variable, if TRUE the DPTC module is enabled
       * if FALSE the DPTC module is disabled
       */
00073       int dptc_is_active;

      /*!
       * Boolean variable, if TRUE turbo mode enable
       * if FALSE turbo mode disabled
       */
00079       int turbo_mode_active;

      /*!
       * Boolean variable, if TRUE the DVFS module is enabled
       * if FALSE the DPTC module is disabled
       */
00085       int dvfs_is_active;

      /*!
       * Boolean variable, if TRUE the DPTC module is suspended
       */
00090       int suspended;

      unsigned char rc_state;

      /*!
       * Pointer to the DVFS & DPTC translation table
       */
00097       dvfs_dptc_tables_s *dvfs_dptc_tables_ptr;

      /*!
       * The DPTC log buffer
       */
00102       dptc_log_s dptc_log_buffer;

      /*!
       * The DVFS log buffer
       */
00107       unsigned char *dvfs_log_buffer;

      /*!
       * The DVFS log buffer physical address (for SDMA)
       */
00112       dma_addr_t dvfs_log_buffer_phys;

#ifdef CONFIG_MXC_DVFS_SDMA
      /*!
       * SDMA channel number
       */
      int sdma_channel;

      /*!
       * This holds the previous working point
       */
      int prev_wp;

      /*!
       * Wait entry for predictive DVFS
       */
      wait_queue_head_t dvfs_pred_wait;
#endif

      /*!
       * This holds the current DVFS mode
       */
00134       unsigned int dvfs_mode;

      /*!
       * Log buffer read pointer
       */
00139       unsigned char *read_ptr;

      /*
       * Number of characters in log buffer
       */
      int chars_in_buffer;
} dvfs_dptc_params_s;

/*!
 * This struct contains the array with values of supported frequencies in Hz
 */
00150 typedef struct {
      /*
       * Number of supported states
       */
      unsigned int num_of_states;
      /*!
       * Array of frequencies
       */
00158       unsigned int *freqs;
} dvfs_states_table;

/*
 * if not defined define TREU and FALSE values.
 */
#ifndef TRUE
#define TRUE  1
#define FALSE 0
#endif                        /* TRUE */

#endif

Generated by  Doxygen 1.6.0   Back to index