Tizen HAL API  1.0
Power

The Power provides functions for getting and setting hardware information.

Required Header

#include <hal-power.h>

Overview

The Power provides functions to get and set hardware information.

The type of hardware information includes:

The hardware operations provided by DVFS involve getting or setting information related to CPU frequency.
This information includes governor, available governor, current frequency, minimum/maximum frequency, available minimum/maximum frequency, up threshold, and load table.

The Power functions of DVFS includes:

The hardware operations provided by CPU hotplug involve getting or setting information related to online CPU.
This information includes online CPU list and the number of minimum/maximum online CPU.

The Power functions of CPU hotplug includes:

The hardware operations provided by thermal involve getting or setting information related to temperature, cooling device, and battery.
This information includes current temperature, policy of thermal management unit, state and maximum state of thermal cooling device, and state of battery charging and current.

The Power functions of thermal includes:

The hardware operations provided by memory involve getting or setting information related to fault around bytes.
This information includes the number of bytes read in after a page fault.

The Power functions of memory includes:

For more information on the Power features and the macros, see HAL Power programming guides and tutorials.

Typedefs

typedef struct
_hal_backend_power_funcs 
hal_backend_power_funcs
 Structure for power functions.

Data Structure Documentation

struct hal_power_resource_dvfs_ops

Structure for DVFS (Dynamic Volt. & Freq. Scaling) operations.

Since:
HAL_MODULE_POWER 1.0

Data Fields

int(* get_curr_governor )(char *res_name, char *governor)
int(* set_curr_governor )(char *res_name, char *governor)
int(* get_avail_governor )(char *res_name, char **avail_governor)
int(* get_curr_freq )(char *res_name)
int(* get_min_freq )(char *res_name)
int(* set_min_freq )(char *res_name, int freq)
int(* get_max_freq )(char *res_name)
int(* set_max_freq )(char *res_name, int freq)
int(* get_available_min_freq )(char *res_name)
int(* get_available_max_freq )(char *res_name)
int(* get_up_threshold )(char *res_name)
int(* set_up_threshold )(char *res_name, int up_threshold)
int(* get_load_table )(char *name, void *hal_power_cpu_load_table)

Field Documentation

int(* hal_power_resource_dvfs_ops::get_avail_governor)(char *res_name, char **avail_governor)

Get the available governor

Get the maximum frequency which can be set to resource

Get the minimum frequency which can be set to resource

Get the current frequency

int(* hal_power_resource_dvfs_ops::get_curr_governor)(char *res_name, char *governor)

Get the current governor

int(* hal_power_resource_dvfs_ops::get_load_table)(char *name, void *hal_power_cpu_load_table)

Get the load_table of each resource to estimate the system load

Get the maximum frequency

Get the minimum frequency

Get the up_threshold to support boosting

int(* hal_power_resource_dvfs_ops::set_curr_governor)(char *res_name, char *governor)

Set the current governor

int(* hal_power_resource_dvfs_ops::set_max_freq)(char *res_name, int freq)

Set the maximum frequency

int(* hal_power_resource_dvfs_ops::set_min_freq)(char *res_name, int freq)

Set the minimum frequency

int(* hal_power_resource_dvfs_ops::set_up_threshold)(char *res_name, int up_threshold)

Set the up_threshold to support boosting

struct hal_power_resource_hotplug_ops

Structure for CPU hotplug operations.

Since:
HAL_MODULE_POWER 1.0

Data Fields

int(* get_online_state )(char *res_name, int cpu)
int(* set_online_state )(char *res_name, int cpu, int on)
int(* get_online_max_num )(char *res_name)
int(* set_online_max_num )(char *res_name, int max_num)

Field Documentation

Get the maximum number of online CPUs

int(* hal_power_resource_hotplug_ops::get_online_state)(char *res_name, int cpu)

Get the online status of resource

int(* hal_power_resource_hotplug_ops::set_online_max_num)(char *res_name, int max_num)

Set the maximum number of online CPUs

int(* hal_power_resource_hotplug_ops::set_online_state)(char *res_name, int cpu, int on)

Set the online status of resource

struct hal_power_resource_tmu_ops

Structure for TMU (Thermal Management Unit) operations.

Since:
HAL_MODULE_POWER 1.0

Data Fields

int(* get_temp )(char *res_thermal_name)
int(* get_policy )(char *res_thermal_name, char *policy)
int(* set_cooling_device_state )(char *cooling_device_name, int state)
int(* get_cooling_device_state )(char *cooling_device_name)
int(* get_cooling_device_max_state )(char *cooling_device_name)

Field Documentation

Get the maximum state of thermal cooling-device

int(* hal_power_resource_tmu_ops::get_cooling_device_state)(char *cooling_device_name)

Get the state of thermal cooling-device

int(* hal_power_resource_tmu_ops::get_policy)(char *res_thermal_name, char *policy)

Get the policy of thermal management unit

int(* hal_power_resource_tmu_ops::get_temp)(char *res_thermal_name)

Get the current temperature of resource

int(* hal_power_resource_tmu_ops::set_cooling_device_state)(char *cooling_device_name, int state)

Set the state of thermal cooling-device

struct hal_power_resource_battery_ops

Structure for battery operations.

Since:
HAL_MODULE_POWER 1.0

Data Fields

int(* set_charging_status )(char *res_name, int state)
int(* get_charging_status )(char *res_name)
int(* set_charging_current )(char *res_name, int charging_current_uA)
int(* get_charging_current )(char *res_name)

Field Documentation

Get the battery charging current (unit: uA)

Get the state of battery charging

int(* hal_power_resource_battery_ops::set_charging_current)(char *res_name, int charging_current_uA)

Set the battery charging current (unit: uA)

int(* hal_power_resource_battery_ops::set_charging_status)(char *res_name, int state)

Set the state of battery charging

struct hal_power_resource_cpu

Structure for CPU H/W.

Since:
HAL_MODULE_POWER 1.0

Data Fields

struct hal_power_resource_dvfs_ops dvfs
struct hal_power_resource_tmu_ops tmu
struct
hal_power_resource_hotplug_ops 
hotplug

Field Documentation

Function lists for DVFS (Dynamic Volt. & Freq. Scaling)

Function lists for the CPU on/off

Function lists for function lists for the TMU (Thermal Management Unit)

struct hal_power_resource_bus

Structure for Memory Bus H/W.

Since:
HAL_MODULE_POWER 1.0

Data Fields

struct hal_power_resource_dvfs_ops dvfs
struct hal_power_resource_tmu_ops tmu

Field Documentation

Function lists for DVFS (Dynamic Volt. & Freq. Scaling)

Function lists for function lists for the TMU (Thermal Management Unit)

struct hal_power_resource_gpu

Structure for GPU H/W.

Since:
HAL_MODULE_POWER 1.0

Data Fields

struct hal_power_resource_dvfs_ops dvfs
struct hal_power_resource_tmu_ops tmu

Field Documentation

Function lists for DVFS (Dynamic Volt. & Freq. Scaling)

Function lists for function lists for the TMU (Thermal Management Unit)

struct hal_power_resource_memory

Structure for Memory H/W.

Since:
HAL_MODULE_POWER 1.0

Data Fields

int(* get_fault_around_bytes )(char *res_name)
int(* set_fault_around_bytes )(char *res_name, int fault_around_bytes)

Field Documentation

Get the /sys/kernel/debug/fault_around_bytes

int(* hal_power_resource_memory::set_fault_around_bytes)(char *res_name, int fault_around_bytes)

Set the /sys/kernel/debug/fault_around_bytes

struct hal_power_resource_battery

Structure for Battery H/W.

Since:
HAL_MODULE_POWER 1.0

Data Fields

struct hal_power_resource_tmu_ops tmu
struct
hal_power_resource_battery_ops 
battery

Field Documentation

Function lists for thermal management unit

struct _hal_backend_power_funcs

Structure for power functions.

Since:
HAL_MODULE_POWER 1.0

Data Fields

struct hal_power_resource_cpucpu
struct hal_power_resource_busbus
struct hal_power_resource_gpugpu
struct hal_power_resource_memorymemory
struct hal_power_resource_batterybattery

Field Documentation

Function lists for bus

Function lists for CPU

Function lists for GPU


Typedef Documentation

Structure for power functions.

Since:
HAL_MODULE_POWER 1.0