pm_wakeup.h

/*

* pm_wakeup.h - Power management wakeup interface

*

* Copyright (C) 2008 Alan Stern

* Copyright (C) 2010 Rafael J. Wysocki, Novell Inc.

*

* 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

* (at your option) any later version.

*

* This program is distributed in the hope that it will be useful,

* but WITHOUT ANY WARRANTY; without even the implied warranty of

* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the

* GNU General Public License for more details.

*

* You should have received a copy of the GNU General Public License

* along with this program; if not, write to the Free Software

* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

*/

#ifndef _LINUX_PM_WAKEUP_H

#define _LINUX_PM_WAKEUP_H

#ifndef _DEVICE_H_

# error "please don't include this file directly"

#endif

#include <linux/types.h>

struct wake_irq;

/**

* struct wakeup_source - Representation of wakeup sources

*

* @name: Name of the wakeup source

* @entry: Wakeup source list entry

* @lock: Wakeup source lock

* @wakeirq: Optional device specific wakeirq

* @timer: Wakeup timer list

* @timer_expires: Wakeup timer expiration

* @total_time: Total time this wakeup source has been active.

* @max_time: Maximum time this wakeup source has been continuously active.

* @last_time: Monotonic clock when the wakeup source's was touched last time.

* @prevent_sleep_time: Total time this source has been preventing autosleep.

* @event_count: Number of signaled wakeup events.

* @active_count: Number of times the wakeup source was activated.

* @relax_count: Number of times the wakeup source was deactivated.

* @expire_count: Number of times the wakeup source's timeout has expired.

* @wakeup_count: Number of times the wakeup source might abort suspend.

* @active: Status of the wakeup source.

* @has_timeout: The wakeup source has been activated with a timeout.

*/

struct wakeup_source {

const char *name;

struct list_head entry;

spinlock_t lock;

struct wake_irq *wakeirq;

struct timer_list timer;

unsigned long timer_expires;

ktime_t total_time;

ktime_t max_time;

ktime_t last_time;

ktime_t start_prevent_time;

ktime_t prevent_sleep_time;

unsigned long event_count;

unsigned long active_count;

unsigned long relax_count;

unsigned long expire_count;

unsigned long wakeup_count;

bool active:1;

bool autosleep_enabled:1;

};

#ifdef CONFIG_PM_SLEEP

/*

* Changes to device_may_wakeup take effect on the next pm state change.

*/

static inline bool device_can_wakeup(struct device *dev)

{

return dev->power.can_wakeup;

}

static inline bool device_may_wakeup(struct device *dev)

{

return dev->power.can_wakeup && !!dev->power.wakeup;

}

static inline void device_set_wakeup_path(struct device *dev)

{

dev->power.wakeup_path = true;

}

/* drivers/base/power/wakeup.c */

extern void wakeup_source_prepare(struct wakeup_source *ws, const char *name);

extern struct wakeup_source *wakeup_source_create(const char *name);

extern void wakeup_source_drop(struct wakeup_source *ws);

extern void wakeup_source_destroy(struct wakeup_source *ws);

extern void wakeup_source_add(struct wakeup_source *ws);

extern void wakeup_source_remove(struct wakeup_source *ws);

extern struct wakeup_source *wakeup_source_register(const char *name);

extern void wakeup_source_unregister(struct wakeup_source *ws);

extern int device_wakeup_enable(struct device *dev);

extern int device_wakeup_disable(struct device *dev);

extern void device_set_wakeup_capable(struct device *dev, bool capable);

extern int device_init_wakeup(struct device *dev, bool val);

extern int device_set_wakeup_enable(struct device *dev, bool enable);

extern void __pm_stay_awake(struct wakeup_source *ws);

extern void pm_stay_awake(struct device *dev);

extern void __pm_relax(struct wakeup_source *ws);

extern void pm_relax(struct device *dev);

extern void pm_wakeup_ws_event(struct wakeup_source *ws, unsigned int msec, bool hard);

extern void pm_wakeup_dev_event(struct device *dev, unsigned int msec, bool hard);

#else /* !CONFIG_PM_SLEEP */

static inline void device_set_wakeup_capable(struct device *dev, bool capable)

{

dev->power.can_wakeup = capable;

}

static inline bool device_can_wakeup(struct device *dev)

{

return dev->power.can_wakeup;

}

static inline void wakeup_source_prepare(struct wakeup_source *ws,

const char *name) {}

static inline struct wakeup_source *wakeup_source_create(const char *name)

{

return NULL;

}

static inline void wakeup_source_drop(struct wakeup_source *ws) {}

static inline void wakeup_source_destroy(struct wakeup_source *ws) {}

static inline void wakeup_source_add(struct wakeup_source *ws) {}

static inline void wakeup_source_remove(struct wakeup_source *ws) {}

static inline struct wakeup_source *wakeup_source_register(const char *name)

{

return NULL;

}

static inline void wakeup_source_unregister(struct wakeup_source *ws) {}

static inline int device_wakeup_enable(struct device *dev)

{

dev->power.should_wakeup = true;

return 0;

}

static inline int device_wakeup_disable(struct device *dev)

{

dev->power.should_wakeup = false;

return 0;

}

static inline int device_set_wakeup_enable(struct device *dev, bool enable)

{

dev->power.should_wakeup = enable;

return 0;

}

static inline int device_init_wakeup(struct device *dev, bool val)

{

device_set_wakeup_capable(dev, val);

device_set_wakeup_enable(dev, val);

return 0;

}

static inline bool device_may_wakeup(struct device *dev)

{

return dev->power.can_wakeup && dev->power.should_wakeup;

}

static inline void device_set_wakeup_path(struct device *dev) {}

static inline void __pm_stay_awake(struct wakeup_source *ws) {}

static inline void pm_stay_awake(struct device *dev) {}

static inline void __pm_relax(struct wakeup_source *ws) {}

static inline void pm_relax(struct device *dev) {}

static inline void pm_wakeup_ws_event(struct wakeup_source *ws,

unsigned int msec, bool hard) {}

static inline void pm_wakeup_dev_event(struct device *dev, unsigned int msec,

bool hard) {}

#endif /* !CONFIG_PM_SLEEP */

static inline void wakeup_source_init(struct wakeup_source *ws,

const char *name)

{

wakeup_source_prepare(ws, name);

wakeup_source_add(ws);

}

static inline void wakeup_source_trash(struct wakeup_source *ws)

{

wakeup_source_remove(ws);

wakeup_source_drop(ws);

}

static inline void __pm_wakeup_event(struct wakeup_source *ws, unsigned int msec)

{

return pm_wakeup_ws_event(ws, msec, false);

}

static inline void pm_wakeup_event(struct device *dev, unsigned int msec)

{

return pm_wakeup_dev_event(dev, msec, false);

}

static inline void pm_wakeup_hard_event(struct device *dev)

{

return pm_wakeup_dev_event(dev, 0, true);

}

#endif /* _LINUX_PM_WAKEUP_H */

这些文件是与音频处理相关的代码文件,属于Android系统中的音频相关模块。下面简单介绍一下每个文件的作用: - alsa_config_parameters.c:alsa驱动的配置参数管理。 - alsa_manager.c:alsa驱动的管理,包括打开、关闭、读写等操作。 - aml_audio_delay.c:音频延迟的处理。 - aml_audio_dev2mix_process.c:音频设备到混音器的音频数据处理。 - aml_audio_ease.c:音频的平滑处理。 - aml_audio_hal_avsync.c:音频硬件同步的处理。 - aml_audio_mixer.c、amlAudioMixer.c、sub_mixing_factory.c:音频混音的处理。 - aml_audio_ms12_bypass.c、aml_audio_ms12_render.c、aml_audio_ms12_sync.c:Dolby MS12音频的处理。 - aml_audio_nonms12_render.c:非Dolby MS12音频的处理。 - aml_audio_scaletempo.c:音频的变速变调处理。 - aml_audio_spdifout.c:SPDIF音频输出的处理。 - aml_audio_stream.c:音频流的处理。 - aml_audio_timer.c:音频定时器的处理。 - aml_avsync_tuning.c:音视频同步的调节。 - aml_config_data.c、aml_config_parser.c:音频相关配置数据的处理。 - aml_dtvsync.c:DTV同步的处理。 - aml_hfp.c:音频头戴式设备的处理。 - aml_mmap_audio.c:音频内存映射的处理。 - aml_vad_wakeup.c:语音唤醒的处理。 - audio_aec.c:音频回声消除的处理。 - audio_bt_sco.c:蓝牙SCO音频的处理。 - audio_dtv_utils.c:DTV音频的处理。 - audio_format_parse.c:音频格式解析的处理。 - audio_hdmi_util.c:HDMI音频的处理。 - audio_hw.c、audio_hw_dtv.c、audio_hw_ms12.c、audio_hw_ms12_common.c、audio_hw_ms12_v2.c、audio_hw_profile.c:音频硬件相关的处理。 - audio_hwsync.c、audio_hwsync_wrap.c:音频硬件同步的处理。 - audio_hw_utils.c:音频硬件工具类的处理。 - audio_kara.c:卡拉OK音频的处理。 - audio_mediasync_wrap.c:媒体同步的处理。 - audio_policy.c:音频策略的处理。 - audio_port.c:音频端口的管理。 - audio_post_process.c:音频后处理的处理。 - audio_tsync_wrap.c:时间同步的处理。 - audio_usb_hal.c:USB音频的处理。 - audio_virtual_buf.c:虚拟音频缓冲的处理。 - dolby_lib_api.c:Dolby音频库的API。 - earc_utils.c:EARC音频的处理。 - hw_avsync.c、hw_avsync_callbacks.c:硬件音视频同步的处理。 - karaoke_manager.c:卡拉OK管理的处理。 - spdif_encoder_api.c:SPDIF编码的API。
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值