本文整理汇总了C++中smsm_change_state函数的典型用法代码示例。如果您正苦于以下问题:C++ smsm_change_state函数的具体用法?C++ smsm_change_state怎么用?C++ smsm_change_state使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了smsm_change_state函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: smsm_riva_reset
/* SMSM reset Riva */
static void smsm_riva_reset(void)
{
/* per SS reset request bit is not available now,
* all SS host modules are setting this bit
* This is still under discussion*/
smsm_change_state(SMSM_APPS_STATE, SMSM_RESET, SMSM_RESET);
}
开发者ID:Ca1ne,项目名称:Enoch213,代码行数:8,代码来源:wcnss-ssr-8960.c
示例2: dsps_crash_shutdown
/**
* Crash shutdown function
* called by the restart notifier
*
*/
static void dsps_crash_shutdown(const struct subsys_desc *subsys)
{
pr_debug("%s\n", __func__);
disable_irq_nosync(drv->wdog_irq);
dsps_crash_shutdown_g = 1;
smsm_change_state(SMSM_DSPS_STATE, SMSM_RESET, SMSM_RESET);
}
开发者ID:Arunvasu,项目名称:taoshan,代码行数:12,代码来源:msm_dsps.c
示例3: rpcrouter_smd_remote_probe
static int rpcrouter_smd_remote_probe(struct platform_device *pdev)
{
int rc;
smd_remote_xprt.xprt.name = "rpcrotuer_smd_xprt";
smd_remote_xprt.xprt.read_avail = rpcrouter_smd_remote_read_avail;
smd_remote_xprt.xprt.read = rpcrouter_smd_remote_read;
smd_remote_xprt.xprt.write_avail = rpcrouter_smd_remote_write_avail;
smd_remote_xprt.xprt.write = rpcrouter_smd_remote_write;
smd_remote_xprt.xprt.close = rpcrouter_smd_remote_close;
smd_remote_xprt.xprt.priv = NULL;
/* Open up SMD channel */
rc = smd_open("RPCCALL", &smd_remote_xprt.channel, NULL,
rpcrouter_smd_remote_notify);
if (rc < 0)
return rc;
smd_disable_read_intr(smd_remote_xprt.channel);
msm_rpcrouter_xprt_notify(&smd_remote_xprt.xprt,
RPCROUTER_XPRT_EVENT_OPEN);
smsm_change_state(SMSM_APPS_STATE, 0, SMSM_RPCINIT);
return 0;
}
开发者ID:underdarkonsole,项目名称:huawei_vision_kernel_JB,代码行数:27,代码来源:rpcrouter_smd_xprt.c
示例4: dsps_crash_shutdown
static void dsps_crash_shutdown(const struct subsys_desc *desc)
{
struct dsps_data *drv = desc_to_drv(desc);
disable_irq_nosync(drv->wdog_irq);
drv->crash = 1;
smsm_change_state(SMSM_DSPS_STATE, SMSM_RESET, SMSM_RESET);
}
开发者ID:Gilbert32,项目名称:dellstreak5-kernel-3.4,代码行数:8,代码来源:pil-dsps.c
示例5: loopback_probe_worker
static void loopback_probe_worker(struct work_struct *work)
{
if (!is_modem_smsm_inited())
schedule_delayed_work(&loopback_work, msecs_to_jiffies(1000));
else
smsm_change_state(SMSM_APPS_STATE,
0, SMSM_SMD_LOOPBACK);
}
开发者ID:JmzTaylor,项目名称:Evita-Jellybean,代码行数:9,代码来源:smd_tty.c
示例6: riva_crash_shutdown
/* Riva crash handler */
static void riva_crash_shutdown(const struct subsys_desc *desc)
{
struct riva_data *drv;
drv = container_of(desc, struct riva_data, subsys_desc);
pr_err("riva crash shutdown %d\n", drv->crash);
if (drv->crash != true)
smsm_change_state(SMSM_APPS_STATE, SMSM_RESET, SMSM_RESET);
}
开发者ID:1041574425,项目名称:Z5S_NX503A_KitKat_kernel,代码行数:10,代码来源:pil-riva.c
示例7: loopback_probe_worker
static void loopback_probe_worker(struct work_struct *work)
{
/* wait for modem to restart before requesting loopback server */
if (!is_modem_smsm_inited())
schedule_delayed_work(&loopback_work, msecs_to_jiffies(1000));
else
smsm_change_state(SMSM_APPS_STATE,
0, SMSM_SMD_LOOPBACK);
}
开发者ID:NooNameR,项目名称:QSD3.0,代码行数:9,代码来源:smd_tty.c
示例8: wcn36xx_dxe_alloc_ctl_blks
int wcn36xx_dxe_alloc_ctl_blks(struct wcn36xx *wcn)
{
int ret;
wcn->dxe_tx_l_ch.ch_type = WCN36XX_DXE_CH_TX_L;
wcn->dxe_tx_h_ch.ch_type = WCN36XX_DXE_CH_TX_H;
wcn->dxe_rx_l_ch.ch_type = WCN36XX_DXE_CH_RX_L;
wcn->dxe_rx_h_ch.ch_type = WCN36XX_DXE_CH_RX_H;
wcn->dxe_tx_l_ch.desc_num = WCN36XX_DXE_CH_DESC_NUMB_TX_L;
wcn->dxe_tx_h_ch.desc_num = WCN36XX_DXE_CH_DESC_NUMB_TX_H;
wcn->dxe_rx_l_ch.desc_num = WCN36XX_DXE_CH_DESC_NUMB_RX_L;
wcn->dxe_rx_h_ch.desc_num = WCN36XX_DXE_CH_DESC_NUMB_RX_H;
wcn->dxe_tx_l_ch.dxe_wq = WCN36XX_DXE_WQ_TX_L;
wcn->dxe_tx_h_ch.dxe_wq = WCN36XX_DXE_WQ_TX_H;
wcn->dxe_tx_l_ch.ctrl_bd = WCN36XX_DXE_CTRL_TX_L_BD;
wcn->dxe_tx_h_ch.ctrl_bd = WCN36XX_DXE_CTRL_TX_H_BD;
wcn->dxe_tx_l_ch.ctrl_skb = WCN36XX_DXE_CTRL_TX_L_SKB;
wcn->dxe_tx_h_ch.ctrl_skb = WCN36XX_DXE_CTRL_TX_H_SKB;
wcn->dxe_tx_l_ch.reg_ctrl = WCN36XX_DXE_REG_CTL_TX_L;
wcn->dxe_tx_h_ch.reg_ctrl = WCN36XX_DXE_REG_CTL_TX_H;
wcn->dxe_tx_l_ch.def_ctrl = WCN36XX_DXE_CH_DEFAULT_CTL_TX_L;
wcn->dxe_tx_h_ch.def_ctrl = WCN36XX_DXE_CH_DEFAULT_CTL_TX_H;
/* DXE control block allocation */
ret = wcn36xx_dxe_allocate_ctl_block(&wcn->dxe_tx_l_ch);
if (ret)
goto out_err;
ret = wcn36xx_dxe_allocate_ctl_block(&wcn->dxe_tx_h_ch);
if (ret)
goto out_err;
ret = wcn36xx_dxe_allocate_ctl_block(&wcn->dxe_rx_l_ch);
if (ret)
goto out_err;
ret = wcn36xx_dxe_allocate_ctl_block(&wcn->dxe_rx_h_ch);
if (ret)
goto out_err;
/* TODO most probably do not need this */
/* Initialize SMSM state Clear TX Enable RING EMPTY STATE */
ret = smsm_change_state(SMSM_APPS_STATE,
WCN36XX_SMSM_WLAN_TX_ENABLE,
WCN36XX_SMSM_WLAN_TX_RINGS_EMPTY);
return 0;
out_err:
wcn36xx_error("Failed to allocate DXE control blocks");
wcn36xx_dxe_free_ctl_blks(wcn);
return -ENOMEM;
}
开发者ID:dreamfly281,项目名称:wcn36xx,代码行数:56,代码来源:dxe.c
示例9: smsm_riva_reset
/* SMSM reset Riva */
static void smsm_riva_reset(void)
{
pr_info(MODULE_NAME ": smsm_riva_reset, smsm_change_state(SMSM_APPS_STATE, SMSM_RESET, SMSM_RESET).\n");
//ASUS_BSP+++ "for /data/log/ASUSEvtlog"
ASUSEvtlog("[wcnss]: smsm_riva_reset, smsm_change_state(SMSM_APPS_STATE, SMSM_RESET, SMSM_RESET).\n");
//ASUS_BSP--- "for /data/log/ASUSEvtlog"
/* per SS reset request bit is not available now,
* all SS host modules are setting this bit
* This is still under discussion*/
smsm_change_state(SMSM_APPS_STATE, SMSM_RESET, SMSM_RESET);
}
开发者ID:SmokyBob,项目名称:android_kernel_asus_padfone2,代码行数:14,代码来源:wcnss-ssr-8960.c
示例10: smd_tty_open
static int smd_tty_open(struct tty_struct *tty, struct file *f)
{
int res = 0;
int n = tty->index;
struct smd_tty_info *info;
const char *name;
if (n == 0)
name = "SMD_DS";
// else if (n == 7)
// name = "DATA1";
// else if (n == 21)
// name = "DATA21";
else if (n == 27)
name = "SMD_GPSNMEA";
// else if (n == 36)
// name = "LOOPBACK";
else
return -ENODEV;
info = smd_tty + n;
mutex_lock(&smd_tty_lock);
tty->driver_data = info;
if (info->open_count++ == 0) {
info->tty = tty;
tasklet_init(&info->tty_tsklt, smd_tty_read,
(unsigned long)info);
wake_lock_init(&info->wake_lock, WAKE_LOCK_SUSPEND, name);
if (!info->ch) {
#if 0
if (n == 36) {
/* set smsm state to SMSM_SMD_LOOPBACK state
** and wait allowing enough time for Modem side
** to open the loopback port (Currently, this is
** this is effecient than polling).
*/
smsm_change_state(SMSM_APPS_STATE,
0, SMSM_SMD_LOOPBACK);
msleep(100);
}
#endif
res = smd_open(name, &info->ch, info,
smd_tty_notify);
}
}
mutex_unlock(&smd_tty_lock);
return res;
}
开发者ID:klothius,项目名称:htc_magic_kernel_2635,代码行数:51,代码来源:smd_tty.c
示例11: bit
/**
@brief wpalNotifySmsm provides a mechansim for a client to
notify SMSM to start DXE engine and/or condition of Tx
ring buffer
@param clrSt: bit(s) to be cleared on the MASK
@param setSt: bit(s) to be set on the MASK
@return SUCCESS if the operation is successful
*/
wpt_status wpalNotifySmsm
(
wpt_uint32 clrSt,
wpt_uint32 setSt
)
{
int rc;
rc = smsm_change_state(SMSM_APPS_STATE, clrSt, setSt);
if(0 != rc)
{
WPAL_TRACE(eWLAN_MODULE_DAL_DATA, eWLAN_PAL_TRACE_LEVEL_ERROR,
"%s: smsm_change_state failed",
__func__);
return eWLAN_PAL_STATUS_E_FAILURE;
}
return eWLAN_PAL_STATUS_SUCCESS;
}
开发者ID:fantomlez,项目名称:android_kernel_acer_hemingway,代码行数:27,代码来源:wlan_qct_pal_device.c
示例12: MSM_PM_DPRINTK
/*
* Power collapse the Apps processor. This function executes the handshake
* protocol with Modem.
*
* Return value:
* -EAGAIN: modem reset occurred or early exit from power collapse
* -EBUSY: modem not ready for our power collapse -- no power loss
* -ETIMEDOUT: timed out waiting for modem's handshake -- no power loss
* 0: success
*/
static int msm_pm_power_collapse
(bool from_idle, uint32_t sleep_delay, uint32_t sleep_limit)
{
struct msm_pm_polled_group state_grps[2];
unsigned long saved_acpuclk_rate;
int collapsed = 0;
int ret;
int val;
int modem_early_exit = 0;
MSM_PM_DPRINTK(MSM_PM_DEBUG_SUSPEND|MSM_PM_DEBUG_POWER_COLLAPSE,
KERN_INFO, "%s(): idle %d, delay %u, limit %u\n", __func__,
(int)from_idle, sleep_delay, sleep_limit);
if (!(smsm_get_state(SMSM_POWER_MASTER_DEM) & DEM_MASTER_SMSM_READY)) {
MSM_PM_DPRINTK(
MSM_PM_DEBUG_SUSPEND | MSM_PM_DEBUG_POWER_COLLAPSE,
KERN_INFO, "%s(): master not ready\n", __func__);
ret = -EBUSY;
goto power_collapse_bail;
}
memset(msm_pm_smem_data, 0, sizeof(*msm_pm_smem_data));
if (cpu_is_msm8625()) {
/* Program the SPM */
ret = msm_spm_set_low_power_mode(MSM_SPM_MODE_POWER_COLLAPSE,
false);
WARN_ON(ret);
}
/* Call CPR suspend only for "idlePC" case */
if (msm_cpr_ops && from_idle)
msm_cpr_ops->cpr_suspend();
msm_pm_irq_extns->enter_sleep1(true, from_idle,
&msm_pm_smem_data->irq_mask);
msm_sirc_enter_sleep();
msm_gpio_enter_sleep(from_idle);
msm_pm_smem_data->sleep_time = sleep_delay;
msm_pm_smem_data->resources_used = sleep_limit;
/* Enter PWRC/PWRC_SUSPEND */
if (from_idle)
smsm_change_state(SMSM_APPS_DEM, DEM_SLAVE_SMSM_RUN,
DEM_SLAVE_SMSM_PWRC);
else
smsm_change_state(SMSM_APPS_DEM, DEM_SLAVE_SMSM_RUN,
DEM_SLAVE_SMSM_PWRC | DEM_SLAVE_SMSM_PWRC_SUSPEND);
MSM_PM_DEBUG_PRINT_STATE("msm_pm_power_collapse(): PWRC");
MSM_PM_DEBUG_PRINT_SLEEP_INFO();
memset(state_grps, 0, sizeof(state_grps));
state_grps[0].group_id = SMSM_POWER_MASTER_DEM;
state_grps[0].bits_all_set = DEM_MASTER_SMSM_RSA;
state_grps[1].group_id = SMSM_MODEM_STATE;
state_grps[1].bits_all_set = SMSM_RESET;
ret = msm_pm_poll_state(ARRAY_SIZE(state_grps), state_grps);
if (ret < 0) {
printk(KERN_EMERG "%s(): power collapse entry "
"timed out waiting for Modem's response\n", __func__);
msm_pm_timeout();
}
if (ret == 1) {
MSM_PM_DPRINTK(
MSM_PM_DEBUG_SUSPEND|MSM_PM_DEBUG_POWER_COLLAPSE,
KERN_INFO,
"%s(): msm_pm_poll_state detected Modem reset\n",
__func__);
goto power_collapse_early_exit;
}
/* DEM Master in RSA */
MSM_PM_DEBUG_PRINT_STATE("msm_pm_power_collapse(): PWRC RSA");
ret = msm_pm_irq_extns->enter_sleep2(true, from_idle);
if (ret < 0) {
MSM_PM_DPRINTK(
MSM_PM_DEBUG_SUSPEND|MSM_PM_DEBUG_POWER_COLLAPSE,
KERN_INFO,
"%s(): msm_irq_enter_sleep2 aborted, %d\n", __func__,
ret);
goto power_collapse_early_exit;
//.........这里部分代码省略.........
开发者ID:18712886438,项目名称:NewWorld-F160-JB-Kernel,代码行数:101,代码来源:pm2.c
示例13: msm_pm_init
//.........这里部分代码省略.........
};
#ifdef CONFIG_CPU_V7
pgd_t *pc_pgd;
pmd_t *pmd;
unsigned long pmdval;
unsigned long exit_phys;
exit_phys = virt_to_phys(msm_pm_collapse_exit);
/* Page table for cores to come back up safely. */
pc_pgd = pgd_alloc(&init_mm);
if (!pc_pgd)
return -ENOMEM;
pmd = pmd_offset(pud_offset(pc_pgd + pgd_index(exit_phys), exit_phys),
exit_phys);
pmdval = (exit_phys & PGDIR_MASK) |
PMD_TYPE_SECT | PMD_SECT_AP_WRITE;
pmd[0] = __pmd(pmdval);
pmd[1] = __pmd(pmdval + (1 << (PGDIR_SHIFT - 1)));
msm_saved_state_phys =
allocate_contiguous_ebi_nomap(CPU_SAVED_STATE_SIZE *
num_possible_cpus(), 4);
if (!msm_saved_state_phys)
return -ENOMEM;
msm_saved_state = ioremap_nocache(msm_saved_state_phys,
CPU_SAVED_STATE_SIZE *
num_possible_cpus());
if (!msm_saved_state)
return -ENOMEM;
/* It is remotely possible that the code in msm_pm_collapse_exit()
* which turns on the MMU with this mapping is in the
* next even-numbered megabyte beyond the
* start of msm_pm_collapse_exit().
* Map this megabyte in as well.
*/
pmd[2] = __pmd(pmdval + (2 << (PGDIR_SHIFT - 1)));
flush_pmd_entry(pmd);
msm_pm_pc_pgd = virt_to_phys(pc_pgd);
clean_caches((unsigned long)&msm_pm_pc_pgd, sizeof(msm_pm_pc_pgd),
virt_to_phys(&msm_pm_pc_pgd));
#endif
msm_pm_smem_data = smem_alloc(SMEM_APPS_DEM_SLAVE_DATA,
sizeof(*msm_pm_smem_data));
if (msm_pm_smem_data == NULL) {
printk(KERN_ERR "%s: failed to get smsm_data\n", __func__);
return -ENODEV;
}
ret = msm_timer_init_time_sync(msm_pm_timeout);
if (ret)
return ret;
ret = smsm_change_intr_mask(SMSM_POWER_MASTER_DEM, 0xFFFFFFFF, 0);
if (ret) {
printk(KERN_ERR "%s: failed to clear interrupt mask, %d\n",
__func__, ret);
return ret;
}
if (cpu_is_msm8625()) {
target_type = TARGET_IS_8625;
clean_caches((unsigned long)&target_type, sizeof(target_type),
virt_to_phys(&target_type));
/*
* Configure the MPA5_GDFS_CNT_VAL register for
* DBGPWRUPEREQ_OVERRIDE[17:16] = Override the
* DBGNOPOWERDN for each cpu.
* MPA5_GDFS_CNT_VAL[9:0] = Delay counter for
* GDFS control.
*/
val = 0x00030002;
__raw_writel(val, (MSM_CFG_CTL_BASE + 0x38));
l2x0_base_addr = MSM_L2CC_BASE;
}
#ifdef CONFIG_MSM_MEMORY_LOW_POWER_MODE
/* The wakeup_reason field is overloaded during initialization time
to signal Modem that Apps will control the low power modes of
the memory.
*/
msm_pm_smem_data->wakeup_reason = 1;
smsm_change_state(SMSM_APPS_DEM, 0, DEM_SLAVE_SMSM_RUN);
#endif
BUG_ON(msm_pm_modes == NULL);
suspend_set_ops(&msm_pm_ops);
msm_pm_mode_sysfs_add();
msm_pm_add_stats(enable_stats, ARRAY_SIZE(enable_stats));
atomic_set(&msm_pm_init_done, 1);
return 0;
}
开发者ID:18712886438,项目名称:NewWorld-F160-JB-Kernel,代码行数:101,代码来源:pm2.c
示例14: smem_alloc
/* Time Slave State Bits */
#define SLAVE_TIME_REQUEST 0x0400
#define SLAVE_TIME_POLL 0x0800
#define SLAVE_TIME_INIT 0x1000
uint32_t *smem_clock;
uint32_t smem_clock_val;
uint32_t state;
smem_clock = smem_alloc(SMEM_SMEM_SLOW_CLOCK_VALUE, sizeof(uint32_t));
if (smem_clock == NULL) {
printk(KERN_ERR "no smem clock\n");
return 0;
}
state = smsm_get_state(SMSM_MODEM_STATE);
if ((state & SMSM_INIT) == 0) {
printk(KERN_ERR "smsm not initialized\n");
return 0;
}
time_start(data);
while ((state = smsm_get_state(SMSM_TIME_MASTER_DEM)) &
MASTER_TIME_PENDING) {
if (time_expired(data)) {
printk(KERN_INFO "get_smem_clock: timeout 1 still "
"invalid state %x\n", state);
return 0;
}
}
smsm_change_state(SMSM_APPS_DEM, SLAVE_TIME_POLL | SLAVE_TIME_INIT,
SLAVE_TIME_REQUEST);
time_start(data);
while (!((state = smsm_get_state(SMSM_TIME_MASTER_DEM)) &
MASTER_TIME_PENDING)) {
if (time_expired(data)) {
printk(KERN_INFO "get_smem_clock: timeout 2 still "
"invalid state %x\n", state);
smem_clock_val = 0;
goto sync_sclk_exit;
}
}
smsm_change_state(SMSM_APPS_DEM, SLAVE_TIME_REQUEST, SLAVE_TIME_POLL);
time_start(data);
do {
smem_clock_val = *smem_clock;
} while (smem_clock_val == 0 && !time_expired(data));
state = smsm_get_state(SMSM_TIME_MASTER_DEM);
if (smem_clock_val) {
if (update != NULL)
update(data, smem_clock_val);
if (msm_timer_debug_mask & MSM_TIMER_DEBUG_SYNC)
printk(KERN_INFO
"get_smem_clock: state %x clock %u\n",
state, smem_clock_val);
} else {
printk(KERN_INFO "get_smem_clock: timeout state %x clock %u\n",
state, smem_clock_val);
}
sync_sclk_exit:
smsm_change_state(SMSM_APPS_DEM, SLAVE_TIME_REQUEST | SLAVE_TIME_POLL,
SLAVE_TIME_INIT);
return smem_clock_val;
}
#else /* CONFIG_MSM_N_WAY_SMSM */
static uint32_t msm_timer_sync_sclk(
void (*time_start)(struct msm_timer_sync_data_t *data),
bool (*time_expired)(struct msm_timer_sync_data_t *data),
void (*update)(struct msm_timer_sync_data_t *data, uint32_t clk_val),
struct msm_timer_sync_data_t *data)
{
uint32_t *smem_clock;
uint32_t smem_clock_val;
uint32_t last_state;
uint32_t state;
smem_clock = smem_alloc(SMEM_SMEM_SLOW_CLOCK_VALUE,
sizeof(uint32_t));
if (smem_clock == NULL) {
printk(KERN_ERR "no smem clock\n");
return 0;
}
last_state = state = smsm_get_state(SMSM_MODEM_STATE);
smem_clock_val = *smem_clock;
if (smem_clock_val) {
printk(KERN_INFO "get_smem_clock: invalid start state %x "
"clock %u\n", state, smem_clock_val);
smsm_change_state(SMSM_APPS_STATE,
SMSM_TIMEWAIT, SMSM_TIMEINIT);
//.........这里部分代码省略.........
开发者ID:Racing1,项目名称:zeppelin_kernel,代码行数:101,代码来源:timer.c
示例15: smsm_riva_reset
static void smsm_riva_reset(void)
{
smsm_change_state(SMSM_APPS_STATE, SMSM_RESET, SMSM_RESET);
}
开发者ID:Ca1ne,项目名称:Enoch316,代码行数:4,代码来源:wcnss-ssr-8960.c
示例16: debug_test_smsm
static int debug_test_smsm(char *buf, int max)
{
int i = 0;
int test_num = 0;
int ret;
do {
test_num++;
SMSM_CB_TEST_INIT();
ret = smsm_state_cb_register(SMSM_APPS_STATE, SMSM_SMDINIT,
smsm_state_cb, (void *)0x1234);
UT_EQ_INT(ret, 0);
UT_EQ_INT(smsm_cb_data.cb_count, 0);
INIT_COMPLETION(smsm_cb_completion);
smsm_change_state(SMSM_APPS_STATE, SMSM_SMDINIT, 0x0);
UT_GT_INT((int)wait_for_completion_timeout(&smsm_cb_completion,
msecs_to_jiffies(20)), 0);
UT_EQ_INT(smsm_cb_data.cb_count, 1);
UT_EQ_INT(smsm_cb_data.old_state & SMSM_SMDINIT, SMSM_SMDINIT);
UT_EQ_INT(smsm_cb_data.new_state & SMSM_SMDINIT, 0x0);
UT_EQ_INT((int)smsm_cb_data.data, 0x1234);
INIT_COMPLETION(smsm_cb_completion);
smsm_change_state(SMSM_APPS_STATE, 0x0, SMSM_SMDINIT);
UT_GT_INT((int)wait_for_completion_timeout(&smsm_cb_completion,
msecs_to_jiffies(20)), 0);
UT_EQ_INT(smsm_cb_data.cb_count, 2);
UT_EQ_INT(smsm_cb_data.old_state & SMSM_SMDINIT, 0x0);
UT_EQ_INT(smsm_cb_data.new_state & SMSM_SMDINIT, SMSM_SMDINIT);
ret = smsm_state_cb_deregister(SMSM_APPS_STATE, SMSM_SMDINIT,
smsm_state_cb, (void *)0x1234);
UT_EQ_INT(ret, 2);
INIT_COMPLETION(smsm_cb_completion);
smsm_change_state(SMSM_APPS_STATE, SMSM_SMDINIT, 0x0);
smsm_change_state(SMSM_APPS_STATE, 0x0, SMSM_SMDINIT);
UT_EQ_INT((int)wait_for_completion_timeout(&smsm_cb_completion,
msecs_to_jiffies(20)), 0);
UT_EQ_INT(smsm_cb_data.cb_count, 2);
i += scnprintf(buf + i, max - i, "Test %d - PASS\n", test_num);
} while (0);
do {
test_num++;
SMSM_CB_TEST_INIT();
ret = smsm_state_cb_register(SMSM_APPS_STATE, SMSM_SMDINIT,
smsm_state_cb, (void *)0x1234);
UT_EQ_INT(ret, 0);
ret = smsm_state_cb_register(SMSM_APPS_STATE, SMSM_INIT,
smsm_state_cb, (void *)0x1234);
UT_EQ_INT(ret, 1);
INIT_COMPLETION(smsm_cb_completion);
UT_EQ_INT(smsm_cb_data.cb_count, 0);
smsm_change_state(SMSM_APPS_STATE, SMSM_SMDINIT, 0x0);
UT_GT_INT((int)wait_for_completion_timeout(&smsm_cb_completion,
msecs_to_jiffies(20)), 0);
UT_EQ_INT(smsm_cb_data.cb_count, 1);
INIT_COMPLETION(smsm_cb_completion);
smsm_change_state(SMSM_APPS_STATE, 0x0, SMSM_SMDINIT);
UT_GT_INT((int)wait_for_completion_timeout(&smsm_cb_completion,
msecs_to_jiffies(20)), 0);
UT_EQ_INT(smsm_cb_data.cb_count, 2);
INIT_COMPLETION(smsm_cb_completion);
smsm_change_state(SMSM_APPS_STATE, SMSM_INIT, 0x0);
UT_GT_INT((int)wait_for_completion_timeout(&smsm_cb_completion,
msecs_to_jiffies(20)), 0);
UT_EQ_INT(smsm_cb_data.cb_count, 3);
INIT_COMPLETION(smsm_cb_completion);
smsm_change_state(SMSM_APPS_STATE, 0x0, SMSM_INIT);
UT_GT_INT((int)wait_for_completion_timeout(&smsm_cb_completion,
msecs_to_jiffies(20)), 0);
UT_EQ_INT(smsm_cb_data.cb_count, 4);
ret = smsm_state_cb_deregister(SMSM_APPS_STATE, SMSM_SMDINIT,
smsm_state_cb, (void *)0x1234);
UT_EQ_INT(ret, 1);
INIT_COMPLETION(smsm_cb_completion);
smsm_change_state(SMSM_APPS_STATE, SMSM_SMDINIT, 0x0);
smsm_change_state(SMSM_APPS_STATE, 0x0, SMSM_SMDINIT);
UT_EQ_INT((int)wait_for_completion_timeout(&smsm_cb_completion,
msecs_to_jiffies(20)), 0);
UT_EQ_INT(smsm_cb_data.cb_count, 4);
INIT_COMPLETION(smsm_cb_completion);
smsm_change_state(SMSM_APPS_STATE, SMSM_INIT, 0x0);
UT_GT_INT((int)wait_for_completion_timeout(&smsm_cb_completion,
//.........这里部分代码省略.........
开发者ID:Gilbert32,项目名称:leo-3.4,代码行数:101,代码来源:smd_debug.c
示例17: smd_tty_port_activate
static int smd_tty_port_activate(struct tty_port *tport,
struct tty_struct *tty)
{
int res = 0;
unsigned int n = tty->index;
struct smd_tty_info *info;
const char *peripheral = NULL;
if (n >= MAX_SMD_TTYS || !smd_tty[n].smd)
return -ENODEV;
info = smd_tty + n;
mutex_lock(&smd_tty_lock);
tty->driver_data = info;
peripheral = smd_edge_to_subsystem(smd_tty[n].smd->edge);
if (peripheral) {
info->pil = subsystem_get(peripheral);
if (IS_ERR(info->pil)) {
SMD_TTY_INFO(
"%s failed on smd_tty device :%s subsystem_get failed for %s",
__func__, smd_tty[n].smd->port_name,
peripheral);
/*
* Sleep, inorder to reduce the frequency of
* retry by user-space modules and to avoid
* possible watchdog bite.
*/
msleep((smd_tty[n].open_wait * 1000));
res = PTR_ERR(info->pil);
goto out;
}
/* Wait for the modem SMSM to be inited for the SMD
* Loopback channel to be allocated at the modem. Since
* the wait need to be done atmost once, using msleep
* doesn't degrade the performance.
*/
if (n == LOOPBACK_IDX) {
if (!is_modem_smsm_inited())
msleep(5000);
smsm_change_state(SMSM_APPS_STATE,
0, SMSM_SMD_LOOPBACK);
msleep(100);
}
/*
* Wait for a channel to be allocated so we know
* the modem is ready enough.
*/
if (smd_tty[n].open_wait) {
res = wait_for_completion_interruptible_timeout(
&info->ch_allocated,
msecs_to_jiffies(smd_tty[n].open_wait *
1000));
if (res == 0) {
SMD_TTY_INFO(
"Timed out waiting for SMD channel %s",
smd_tty[n].smd->port_name);
res = -ETIMEDOUT;
goto release_pil;
} else if (res < 0) {
SMD_TTY_INFO(
"Error waiting for SMD channel %s : %d\n",
smd_tty[n].smd->port_name, res);
goto release_pil;
}
#ifdef CONFIG_MSM_SMD_TTY_DS_LEGACY
/*
* on boot, process tried to open smd0 sleeps until
* modem is ready or timeout.
*/
if (n == DS_IDX) {
/* wait for open ready status in seconds */
pr_info("%s: checking DS modem status\n", __func__);
res = wait_event_interruptible_timeout(
info->ch_opened_wait_queue,
info->is_dsmodem_ready,
(smd_tty_ds_modem_wait * HZ));
if (!res) {
res = -ETIMEDOUT;
pr_err("%s: timeout to wait for %s modem: %d\n",
__func__,
smd_tty[n].smd->port_name,
res);
goto release_pil;
} else if (res < 0) {
pr_err("%s: Error waiting for %s modem: %d\n",
__func__,
smd_tty[n].smd->port_name,
res);
goto release_pil;
}
pr_info("%s: DS modem is OK, open smd0..\n",
__func__);
}
//.........这里部分代码省略.........
开发者ID:GAXUSXX,项目名称:GaXusKernel,代码行数:101,代码来源:smd_tty.c
示例18: try_to_suspend
static void try_to_suspend(struct work_struct *work)
{
unsigned int initial_count, final_count;
if (!pm_get_wakeup_count(&initial_count, true)) {
#ifdef CONFIG_HTC_POWER_DEBUG
pr_info("[P] suspend abort, wakeup event nonzero\n");
htc_print_active_wakeup_sources();
#endif
goto out;
}
mutex_lock(&autosleep_lock);
if (!pm_save_wakeup_count(initial_count) ||
system_state != SYSTEM_RUNNING) {
#ifdef CONFIG_HTC_POWER_DEBUG
pr_info("[P] suspend abort, events not matched or being processed\n");
#endif
mutex_unlock(&autosleep_lock);
goto out;
}
if (autosleep_state == PM_SUSPEND_ON) {
#ifdef CONFIG_HTC_POWER_DEBUG
pr_info("[P] suspend abort, autosleep_state is ON\n");
#endif
mutex_unlock(&autosleep_lock);
return;
}
if (autosleep_state >= PM_SUSPEND_MAX)
hibernate();
else {
smsm_change_state(SMSM_APPS_STATE, HTC_SMSM_APPS_RESUME, HTC_SMSM_APPS_SUSPEND);
printk(KERN_DEBUG "Enable garbage filter\n");
#ifdef CONFIG_HTC_POWER_DEBUG
pr_info("[R] suspend start\n");
#endif
pm_suspend(autosleep_state);
}
mutex_unlock(&autosleep_lock);
if (!pm_get_wakeup_count(&final_count, false)) {
#ifdef CONFIG_HTC_POWER_DEBUG
pr_info("[R] resume end\n");
#endif
smsm_change_state(SMSM_APPS_STATE, HTC_SMSM_APPS_SUSPEND, HTC_SMSM_APPS_RESUME);
printk(KERN_DEBUG "Disable garbage filter\n");
goto out;
}
if (final_count == initial_count) {
#ifdef CONFIG_HTC_POWER_DEBUG
pr_info("[P] wakeup occured for an unknown reason, wait HZ/2\n");
#endif
schedule_timeout_uninterruptible(HZ / 2);
}
#ifdef CONFIG_HTC_POWER_DEBUG
pr_info("[R] resume end\n");
#endif
out:
queue_up_suspend_work();
}
开发者ID:Clumsy-Kernel-Development,项目名称:M9_Kernel,代码行数:63,代码来源:autosleep.c
示例19: notify_modem_app_reboot
static void notify_modem_app_reboot(void)
{
smsm_change_state(SMSM_APPS_STATE, SMSM_APPS_REBOOT, SMSM_APPS_REBOOT);
}
开发者ID:MethHeadAlert,项目名称:M9,代码行数:4,代码来源:htc_modem_notifier.c
示例20: rpcrouter_smd_remote_close
static int rpcrouter_smd_remote_close(void)
{
smsm_change_state(SMSM_APPS_STATE, SMSM_RPCINIT, 0);
return smd_close(smd_remote_xprt.channel);
}
开发者ID:underdarkonsole,项目名称:huawei_vision_kernel_JB,代码行数:5,代码来源:rpcrouter_smd_xprt.c
注:本文中的smsm_change_state函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论