本文整理汇总了C++中param_set_int函数的典型用法代码示例。如果您正苦于以下问题:C++ param_set_int函数的具体用法?C++ param_set_int怎么用?C++ param_set_int使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了param_set_int函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: set_debug_status_param
static int set_debug_status_param(const char *val, struct kernel_param *kp)
{
int ret;
ret = param_set_int(val, kp);
if (ret) {
pr_err("error setting value %d\n", ret);
return ret;
}
pr_info("Set debug param to %d\n", bq2022_debug);
if (bq2022_debug) {
int i, j;
w1_bq2022_read();
for (i = 0; i < 4; i++) {
printk("Page %d ", i);
for (j = 0; j < 32; j++) {
printk("%02x ", *(batt_crypt_info + (i * 32 + j)));
}
printk("\n");
}
}
return 0;
}
示例2: hotplug_state_set
static int hotplug_state_set(const char *arg, const struct kernel_param *kp)
{
int ret = 0;
if (!tegra3_cpu_lock)
return ret;
//mutex_lock(tegra3_cpu_lock);
ret = param_set_int(arg, kp);
if (ret == 0) {
if(hotplug_num> nr_cpu_ids)
hotplug_num=nr_cpu_ids;
else if (hotplug_num <=0)
hotplug_num=1;
printk("hotplug_state_set hotplug_state_set=%u num_online_cpus=%u\n",hotplug_num,num_online_cpus());
/*if(num_online_cpus() > hotplug_num ){
printk("hotplug_state_set count=%u\n",num_online_cpus()-hotplug_num);
queue_delayed_work(hotplug_wq, &cpu_down_work, 3*HZ);
}*/
}
//mutex_unlock(tegra3_cpu_lock);
return ret;
}
示例3: hcismd_set_enable
static int hcismd_set_enable(const char *val, struct kernel_param *kp)
{
int ret = 0;
pr_err("hcismd_set_enable %d", hcismd_set);
down(&hci_smd_enable);
ret = param_set_int(val, kp);
if (ret)
goto done;
switch (hcismd_set) {
case 1:
if (hs.hdev == NULL)
hci_smd_register_smd(&hs);
break;
case 0:
hci_smd_deregister_dev(&hs);
break;
default:
ret = -EFAULT;
}
done:
up(&hci_smd_enable);
return ret;
}
示例4: bq24192_therm_set_input_i_limit
static int bq24192_therm_set_input_i_limit(const char *val,
const struct kernel_param *kp)
{
int ret;
if (!the_chip)
return -ENODEV;
ret = param_set_int(val, kp);
if (ret) {
pr_err("failed to set input_limit_idx\n");
return ret;
}
if (input_limit_idx >= ARRAY_SIZE(mitigate_tbl))
input_limit_idx = ARRAY_SIZE(mitigate_tbl) - 1;
if (!power_supply_is_system_supplied())
return 0;
schedule_delayed_work(&the_chip->therm_work,
msecs_to_jiffies(2000));
return 0;
}
示例5: set_h2w_path
static int set_h2w_path(const char *val, struct kernel_param *kp)
{
int ret = -EINVAL;
int enable;
ret = param_set_int(val, kp);
if (ret)
return ret;
switch (hero_h2w_path) {
case H2W_GPIO:
enable = 1;
cnf_driver_event("H2W_enable_irq", &enable);
break;
case H2W_UART3:
enable = 0;
cnf_driver_event("H2W_enable_irq", &enable);
break;
default:
hero_h2w_path = -1;
return -EINVAL;
}
h2w_configure(hero_h2w_path);
return ret;
}
示例6: set_test_mode
static int set_test_mode(const char *val, const struct kernel_param *kp)
{
int rv = param_set_int(val, kp);
if (rv)
return rv;
if (test_mode > EARLYSUSPEND) {
test_mode = NONE;
return 0;
}
switch (test_mode) {
case EARLYSUSPEND:
if (!wake_lock_active(&test_wake_lock))
wake_lock(&test_wake_lock);
break;
case SUSPEND:
case NONE:
if (wake_lock_active(&test_wake_lock))
wake_unlock(&test_wake_lock);
}
pr_info("%s: suspend autotest mode is %d\n", __func__, test_mode);
return 0;
}
示例7: set_h2w_path
static int set_h2w_path(const char *val, struct kernel_param *kp)
{
int ret = -EINVAL;
int enable;
int current_h2w_path = bahamas_h2w_path;
ret = param_set_int(val, kp);
if (ret)
return ret;
if (bahamas_h2w_path == current_h2w_path) {
printk(KERN_INFO "%s: H2W path has been set to %s\n", __func__,
(bahamas_h2w_path == H2W_UART3) ? "UART3" : "GPIO");
return ret;
}
switch (bahamas_h2w_path) {
case H2W_GPIO:
enable = 1;
cnf_driver_event("H2W_enable_irq", &enable);
break;
case H2W_UART3:
enable = 0;
cnf_driver_event("H2W_enable_irq", &enable);
break;
default:
bahamas_h2w_path = -1;
return -EINVAL;
}
h2w_configure(bahamas_h2w_path);
return ret;
}
示例8: bluesleep_lpm_btwrite
static int bluesleep_lpm_btwrite(const char *val, const struct kernel_param *kp)
{
int ret;
ret = param_set_int(val, kp);
if (ret) {
BT_ERR("HCIATH3K: lpm btwrite parameter set failed");
return ret;
}
BT_DBG("btwrite : %d", lpm_btwrite);
if (is_lpm_enabled) {
if (lpm_btwrite == 0) {
/*Setting TXEXPIRED bit to make it
compatible with current solution*/
set_bit(BT_TXEXPIRED, &flags);
hsuart_serial_clock_off(bsi->uport);
} else if (lpm_btwrite == 1) {
ath_wakeup_ar3k();
clear_bit(BT_TXEXPIRED, &flags);
} else {
BT_ERR("HCIATH3K invalid btwrite value");
return -EINVAL;
}
}
return 0;
}
示例9: mp_policy_set
static int mp_policy_set(const char *arg, const struct kernel_param *kp)
{
int ret = 0;
if (!tegra3_cpu_lock)
return ret;
mutex_lock(tegra3_cpu_lock);
ret = param_set_int(arg, kp);
if (ret == 0) {
if (mp_policy > 0) {
memcpy(NwNs_Threshold, NwNs, sizeof(unsigned int)*8);
memcpy(TwTs_Threshold, TwTs, sizeof(unsigned int)*8);
set_rq_poll_ms(9);
} else {
mp_policy = 0;
pr_info(CPU_HOTPLUG_TAG" mp_policy is off\n");
}
} else
pr_warn(CPU_HOTPLUG_TAG" %s: unable to set tegra mp_policy %s\n",
__func__, arg);
mutex_unlock(tegra3_cpu_lock);
return ret;
}
示例10: bluesleep_lpm_set
static int bluesleep_lpm_set(const char *val, const struct kernel_param *kp)
{
int ret;
ret = param_set_int(val, kp);
if (ret) {
BT_ERR("HCIATH3K: lpm enable parameter set failed");
return ret;
}
BT_DBG("lpm : %d", lpm_enabled);
if ((lpm_enabled == 0) && is_lpm_enabled) {
ath_lpm_stop();
clear_bit(BT_SLEEPENABLE, &flags);
is_lpm_enabled = false;
} else if ((lpm_enabled == 1) && !is_lpm_enabled) {
if (ath_lpm_start() < 0) {
BT_ERR("HCIATH3K LPM mode failed");
return -EIO;
}
set_bit(BT_SLEEPENABLE, &flags);
is_lpm_enabled = true;
} else {
BT_ERR("HCIATH3K invalid lpm value");
return -EINVAL;
}
return 0;
}
示例11: hcismd_set_enable
static int hcismd_set_enable(const char *val, struct kernel_param *kp)
{
int ret = 0;
mutex_lock(&hci_smd_enable);
ret = param_set_int(val, kp);
if (ret)
goto done;
switch (hcismd_set) {
case 1:
hci_smd_register_dev(&hs);
break;
case 0:
hci_smd_deregister_dev(&hs);
break;
default:
ret = -EFAULT;
}
done:
mutex_unlock(&hci_smd_enable);
return ret;
}
示例12: hcismd_set_enable
static int hcismd_set_enable(const char *val, struct kernel_param *kp)
{
#if 1
int ret = 0;
unsigned long enable;
ret = strict_strtoul(val, 10, &enable);
if (ret)
return ret;
if ( hcismd_set == enable )
return 0;
mutex_lock(&hci_smd_enable);
switch (enable) {
case 1:
if (0 == hci_smd_register_smd(&hs))
hcismd_set = 1;
break;
case 0:
hci_smd_deregister_dev(&hs);
hcismd_set = 0;
break;
default:
ret = -EFAULT;
}
mutex_unlock(&hci_smd_enable);
return ret;
#else
int ret = 0;
mutex_lock(&hci_smd_enable);
ret = param_set_int(val, kp);
if (ret)
goto done;
switch (hcismd_set) {
case 1:
hci_smd_register_smd(&hs);
break;
case 0:
hci_smd_deregister_dev(&hs);
break;
default:
ret = -EFAULT;
}
done:
mutex_unlock(&hci_smd_enable);
return ret;
#endif
}
示例13: param_set_idle_sleep_mode_def
static int param_set_idle_sleep_mode_def(const char *val,
struct kernel_param *kp)
{
int ret;
ret = param_set_int(val, kp);
msm_pm_idle_sleep_mode = idle_sleep_mode_def;
return ret;
}
示例14: hidden_reset_param_set_int
static int hidden_reset_param_set_int(const char *val, struct kernel_param *kp)
{
int ret;
ret = param_set_int(val, kp);
lge_set_hidden_enable(hidden_reset_enable);
return ret;
}
示例15: param_set_core_scaling
static int param_set_core_scaling(const char *val, const struct kernel_param *kp)
{
int ret = param_set_int(val, kp);
if (1 == mali_core_scaling_enable) {
mali_core_scaling_sync(mali_executor_get_num_cores_enabled());
}
return ret;
}