*/
static struct dentry *energy_dir = NULL;
+/**
+ * @brief Destroy debugfs for LCD
+ *
+ * @return Dentry of energy debugfs
+ */
struct dentry *get_energy_dir(void)
{
return energy_dir;
}
+/**
+ * @brief Destroy debugfs for energy
+ *
+ * @return Void
+ */
void exit_debugfs_energy(void)
{
if (energy_dir)
energy_dir = NULL;
}
+/**
+ * @brief Create debugfs for energy
+ *
+ * @return Error code
+ */
int init_debugfs_energy(void)
{
int i;
#ifndef _DEBUGFS_ENERGY_H
#define _DEBUGFS_ENERGY_H
-/*
- * Dynamic Binary Instrumentation Module based on KProbes
- * energy/debugfs_energy.h
+/**
+ * @file energy/debugfs_energy.h
+ * @author Vyacheslav Cherkashin <v.cherkashin@samsung.com>
*
+ * @section LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
+ * @section COPYRIGHT
* Copyright (C) Samsung Electronics, 2013
*
- * 2013 Vyacheslav Cherkashin <v.cherkashin@samsung.com>
- *
+ * @section DESCRIPTION
+ * Debugfs for energy
*/
return 0;
}
+/**
+ * @brief Get energy parameter
+ *
+ * @param pe Type of energy parameter
+ * @param buf Buffer
+ * @param sz Buffer size
+ * @return Error code
+ */
int get_parameter_energy(enum parameter_energy pe, void *buf, size_t sz)
{
unsigned long flags;
static DEFINE_MUTEX(mutex_enable);
static int energy_enable = 0;
+/**
+ * @brief Start measuring the energy consumption
+ *
+ * @return Error code
+ */
int set_energy(void)
{
int ret = -EINVAL;
}
EXPORT_SYMBOL_GPL(set_energy);
+/**
+ * @brief Stop measuring the energy consumption
+ *
+ * @return Error code
+ */
int unset_energy(void)
{
int ret = 0;
}
EXPORT_SYMBOL_GPL(unset_energy);
+
+/**
+ * @brief Initialization energy
+ *
+ * @return Error code
+ */
int energy_init(void)
{
int ret;
return 0;
}
+/**
+ * @brief Deinitialization energy
+ *
+ * @return Void
+ */
void energy_uninit(void)
{
lcd_exit();
#ifndef _ENERGY_H
#define _ENERGY_H
-/*
- * Dynamic Binary Instrumentation Module based on KProbes
- * energy/energy.h
+/**
+ * @file energy/energy.h
+ * @author Vyacheslav Cherkashin <v.cherkashin@samsung.com>
*
+ * @section LICENCE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
+ * @section COPYRIGHT
* Copyright (C) Samsung Electronics, 2013
*
- * 2013 Vyacheslav Cherkashin <v.cherkashin@samsung.com>
+ * @section DESCRIPTION
*
*/
#include <linux/types.h>
+/** Description of parameters */
enum parameter_energy {
- PE_TIME_IDLE,
- PE_TIME_SYSTEM,
- PE_TIME_APPS,
- PE_READ_SYSTEM,
- PE_WRITE_SYSTEM,
- PE_READ_APPS,
- PE_WRITE_APPS
+ PE_TIME_IDLE, /**< IDLE working time */
+ PE_TIME_SYSTEM, /**< system working time */
+ PE_TIME_APPS, /**< apps working time */
+ PE_READ_SYSTEM, /**< number of bytes are read by system */
+ PE_WRITE_SYSTEM, /**< number of bytes are write by system */
+ PE_READ_APPS, /**< number of bytes are read by apps */
+ PE_WRITE_APPS /**< number of bytes are write by apps*/
};
#include "lcd_debugfs.h"
+/**
+ * @brief Read the number of file
+ *
+ * @param path of the file
+ * @return Value or error(when negative)
+ */
int read_val(const char *path)
{
int ret;
return 0;
}
+/**
+ * @brief Get the array size of LCD
+ *
+ * @param ops LCD operations
+ * @return Array size
+ */
size_t get_lcd_size_array(struct lcd_ops *ops)
{
struct lcd_priv_data *lcd = get_lcd_priv(ops);
return lcd->tms_brt_cnt;
}
+/**
+ * @brief Get an array of times
+ *
+ * @param ops LCD operations
+ * @param array_time[out] Array of times
+ * @return Void
+ */
void get_lcd_array_time(struct lcd_ops *ops, u64 *array_time)
{
struct lcd_priv_data *lcd = get_lcd_priv(ops);
mutex_unlock(&lcd_lock);
}
+/**
+ * @brief LCD deinitialization
+ *
+ * @return Void
+ */
void lcd_exit(void)
{
do_lcd_exit();
return count ? 0 : -EPERM;
}
+/**
+ * @brief LCD initialization
+ *
+ * @return Error code
+ */
int lcd_init(void)
{
int ret;
* === LCD_SET_ENERGY/LCD_UNSET_ENERGY ===
* ============================================================================
*/
+
+/**
+ * @brief Start measuring the energy consumption of LСD
+ *
+ * @return Error code
+ */
int lcd_set_energy(void)
{
int i, ret, count = 0;
return count ? 0 : -EPERM;
}
+/**
+ * @brief Stop measuring the energy consumption of LСD
+ *
+ * @return Void
+ */
void lcd_unset_energy(void)
{
int i, ret;
#ifndef _LCD_BASE_H
#define _LCD_BASE_H
-/*
- * Dynamic Binary Instrumentation Module based on KProbes
- * energy/lcd/lcd_base.h
+/**
+ * @file energy/lcd/lcd_base.h
+ * @author Vyacheslav Cherkashin <v.cherkashin@samsung.com>
*
+ * @section LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
+ * @section COPYRIGHT
* Copyright (C) Samsung Electronics, 2013
*
- * 2013 Vyacheslav Cherkashin <v.cherkashin@samsung.com>
- *
+ * @section DESCRIPTION
+ * Description of the interface for interacting with LСD
*/
#include <energy/rational_debugfs.h>
+/** Description of actions */
enum lcd_action_type {
- LAT_BRIGHTNESS,
- LAT_POWER
+ LAT_BRIGHTNESS, /**< LCD brightness */
+ LAT_POWER /**< LCD power */
};
+
+/** Description of parameters */
enum lcd_parameter_type {
- LPD_MIN_BRIGHTNESS,
- LPD_MAX_BRIGHTNESS,
- LPD_BRIGHTNESS,
+ LPD_MIN_BRIGHTNESS, /**< minimum brightness value */
+ LPD_MAX_BRIGHTNESS, /**< maximum brightness value */
+ LPD_BRIGHTNESS, /**< current brightness value */
- LPD_POWER
+ LPD_POWER /**< current power value */
};
struct lcd_ops;
+/**
+ * @brief LCD callback type
+ *
+ * @param ops LCD operations
+ * @return Error code
+ */
typedef int (*call_lcd)(struct lcd_ops *ops);
+
+/**
+ * @brief LCD notifier type
+ *
+ * @param ops LCD operations
+ * @param action Event type
+ * @param data Date
+ * @return Error code
+ */
typedef int (*notifier_lcd)(struct lcd_ops *ops, enum lcd_action_type action,
void *data);
+
+/**
+ * @brief LCD parameter type
+ *
+ * @param ops LCD operations
+ * @param type Requested parameter type
+ * @return Requested parameter value
+ *
+ */
typedef unsigned long (*get_parameter_lcd)(struct lcd_ops *ops,
enum lcd_parameter_type type);
+/**
+ * @struct lcd_ops
+ * @breaf set of operations available for LСD
+ */
struct lcd_ops {
- char *name;
- notifier_lcd notifier;
- get_parameter_lcd get;
+ char *name; /**< LCD driver name */
+ notifier_lcd notifier; /**< Notifier */
+ get_parameter_lcd get; /**< Method to obtain the parameters */
- call_lcd check;
- call_lcd set;
- call_lcd unset;
+ call_lcd check; /**< LCD check on device */
+ call_lcd set; /**< LCD initialization */
+ call_lcd unset; /**< LCD deinitialization */
/* for debugfs */
- struct dentry *dentry;
- struct rational min_coef;
- struct rational max_coef;
+ struct dentry *dentry; /**< Dentry of debugfs for this LCD */
+ struct rational min_coef; /**< Minimum coefficient */
+ struct rational max_coef; /**< Maximum coefficient */
- void *priv;
+ void *priv; /**< Private data */
};
size_t get_lcd_size_array(struct lcd_ops *ops);
static struct dentry *lcd_dir = NULL;
+/**
+ * @brief Register LCD in debugfs
+ *
+ * @param ops LCD operations
+ * @return Error code
+ */
int register_lcd_debugfs(struct lcd_ops *ops)
{
int ret;
return -ENOMEM;
}
+/**
+ * @brief Unregister LCD in debugfs
+ *
+ * @param ops LCD operations
+ * @return Void
+ */
void unregister_lcd_debugfs(struct lcd_ops *ops)
{
debugfs_remove_recursive(ops->dentry);
}
+/**
+ * @brief Destroy debugfs for LCD
+ *
+ * @return Void
+ */
void exit_lcd_debugfs(void)
{
if (lcd_dir)
lcd_dir = NULL;
}
+/**
+ * @brief Create debugfs for LCD
+ *
+ * @param dentry Dentry
+ * @return Error code
+ */
int init_lcd_debugfs(struct dentry *energy_dir)
{
lcd_dir = debugfs_create_dir("lcd", energy_dir);
#ifndef _LCD_DEBUGFS_H
#define _LCD_DEBUGFS_H
-/*
- * Dynamic Binary Instrumentation Module based on KProbes
- * energy/lcd/lcd_debugfs.h
+/**
+ * @file energy/lcd/lcd_debugfs.h
+ * @author Vyacheslav Cherkashin <v.cherkashin@samsung.com>
*
+ * @section LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
+ * @section COPYRIGHT
* Copyright (C) Samsung Electronics, 2013
*
- * 2013 Vyacheslav Cherkashin <v.cherkashin@samsung.com>
+ * @section DESCRIPTION
+ * Debugfs for LСD
*
*/
DEFINE_SIMPLE_ATTRIBUTE(fops_denom, denom_get, denom_set, "%llu\n");
+/**
+ * @brief Create file in debugfs for rational struct
+ *
+ * @param parent Dentry parent
+ * @param r Pointer to the rational struct
+ * @param num_name File name of numerator
+ * @param denom_name File name of denominator
+ * @return Error code
+ */
int create_rational_files(struct dentry *parent, struct rational *r,
const char *num_name, const char *denom_name)
{
#ifndef _RATIONAL_DEBUGFS_H
#define _RATIONAL_DEBUGFS_H
-/*
- * Dynamic Binary Instrumentation Module based on KProbes
- * energy/rational_debugfs.h
+/**
+ * @file energy/rational_debugfs.h
+ * @author Vyacheslav Cherkashin <v.cherkashin@samsung.com>
*
+ * @section LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
+ * @section COPYRIGHT
* Copyright (C) Samsung Electronics, 2013
- *
- * 2013 Vyacheslav Cherkashin <v.cherkashin@samsung.com>
- *
*/
#include <linux/types.h>
+/**
+ * @struct rational
+ * @brief Description of rational number
+ */
struct rational {
- u64 num;
- u64 denom;
+ u64 num; /**< Numerator */
+ u64 denom; /**< Denominator */
};
+/**
+ * @def DEFINE_RATIONAL
+ * Initialize of rational struct @hideinitializer
+ */
#define DEFINE_RATIONAL(rational_name) \
struct rational rational_name = { \
.num = 1, \
struct dentry;
-
int create_rational_files(struct dentry *parent, struct rational *r,
const char *num_name, const char *denom_name);
#ifndef _TM_STAT_H
#define _TM_STAT_H
-/*
- * Dynamic Binary Instrumentation Module based on KProbes
- * energy/tm_stat.h
+/**
+ * @file energy/tm_stat.h
+ * @author Vyacheslav Cherkashin <v.cherkashin@samsung.com>
*
+ * @section LICENSE
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
+ * @section COPYFIGHT
* Copyright (C) Samsung Electronics, 2013
*
- * 2013 Vyacheslav Cherkashin <v.cherkashin@samsung.com>
- *
*/
#include <linux/time.h>
+/**
+ * @struct tm_stat
+ * @brief Description of statistic time
+ */
struct tm_stat {
- u64 timestamp;
- u64 running;
+ u64 timestamp; /**< Time stamp */
+ u64 running; /**< Running time */
};
-
+/**
+ * @def DEFINE_TM_STAT
+ * Initialize of tm_stat struct @hideinitializer
+ */
#define DEFINE_TM_STAT(tm_name) \
struct tm_stat tm_name = { \
.timestamp = 0, \