コード例 #1
0
ファイル: gpu_notifier.c プロジェクト: ColinIanKing/m576
int gpu_notifier_init(struct kbase_device *kbdev)
{
	struct exynos_context *platform = (struct exynos_context *)kbdev->platform_context;
	if (!platform)
		return -ENODEV;

	platform->voltage_margin = 0;
#ifdef CONFIG_EXYNOS_THERMAL
	exynos_gpu_add_notifier(&gpu_tmu_nb);
#endif /* CONFIG_EXYNOS_THERMAL */

#ifdef CONFIG_MALI_RT_PM
	if (register_pm_notifier(&gpu_pm_nb))
		return -1;
#endif /* CONFIG_MALI_RT_PM */

#ifdef CONFIG_CPU_IDLE
	if (register_pm_notifier(&gpu_lpc_nb))
		return -1;
#endif /* CONFIG_CPU_IDLE */

	pm_runtime_enable(kbdev->dev);

	return 0;
}
コード例 #2
0
ファイル: mali_kernel_pm.c プロジェクト: ARMP/ARMP-i9300
/** This function is called when Mali GPU device is initialized
 */
int _mali_dev_platform_register(void)
{
	int err;

#ifdef CONFIG_PM_RUNTIME
	set_mali_parent_power_domain((void *)&mali_gpu_device);
#endif

#ifdef CONFIG_PM_RUNTIME
	err = register_pm_notifier(&mali_pwr_notif_block);
	if (err)
	{
		return err;
	}
#endif

#if MALI_LICENSE_IS_GPL
	err = platform_device_register(&mali_gpu_device);
	if (!err) 
	{
		err = platform_driver_register(&mali_plat_driver);
		if (err)
		{
#ifdef CONFIG_PM_RUNTIME
			unregister_pm_notifier(&mali_pwr_notif_block);
#endif
			platform_device_unregister(&mali_gpu_device);
		}
	}
#endif

	return err;
}
コード例 #3
0
static int __init hisi_clkmbox_init(void)
{
	int ret = 0;

	mbox_clk = kzalloc(sizeof(*mbox_clk), GFP_KERNEL);
	if (!mbox_clk) {
		pr_err("[%s] fail to alloc mbox_clk!\n", __func__);
		ret = -ENOMEM;
		goto err;
	}

	/* get mailbox to communicate with lpm3 */
	mbox_clk->mbox = hisi_mbox_get(HISI_MAILBOX_RP_LPM3, NULL);
	if (!mbox_clk->mbox) {
		pr_err("[%s] fail to get mbox!\n", __func__);
		ret = -ENODEV;
		goto err_mbox;
	}

	mailbox_disable = 0;
	register_pm_notifier(&mailbox_pm_notif_block);

	return ret;

err_mbox:
	kfree(mbox_clk);
	mbox_clk = NULL;
err:
	return ret;
}
コード例 #4
0
ファイル: cpuidle.c プロジェクト: 1ee7/linux_l4t_tx1
static int __init tegra_cpuidle_init(void)
{
	unsigned int cpu;
	int ret;

#ifdef CONFIG_PM_SLEEP
	tegra_pd_min_residency = tegra_cpu_lp2_min_residency();
	tegra_pg_exit_latency = tegra_cpu_power_good_time();
	tegra_pd_power_off_time = tegra_cpu_power_off_time();

	tegra_cpuidle_init_soc(&tegra_idle_ops);
#endif
	for_each_possible_cpu(cpu) {
		ret = tegra_cpuidle_register(cpu);
		if (ret) {
			pr_err("CPU%u: CPUidle registration failed\n",
				cpu);
			return ret;
		}
	}

#ifdef CONFIG_TEGRA_MC_DOMAINS
	work_on_cpu(0, pm_attach_cpuidle_work, NULL);
#endif
	register_pm_notifier(&tegra_cpuidle_pm_notifier);
	return 0;
}
コード例 #5
0
static void set_pm_notifier(int mask)
{
	int ret = 0;
	bool val = (mask & KCOLLECT_SUSPEND_MASK) ? true : false;

	if (val) { // previous state is off, and now is on
		if (PRE_MASK_IS_OFF(KCOLLECT_SUSPEND_MASK, mask)) {
			ret = register_pm_notifier(&suspend_notifier);
			if (ret < 0) {
				pr_err("hw_kcollect %s : register_pm_notifier failed!\n", __func__);
			} else {
				pr_debug("hw_kcollect %s : register_pm_notifier\n", __func__);
			}
		}
	} else { // previous state is on, and now is off
		if (PRE_MASK_IS_ON(KCOLLECT_SUSPEND_MASK, mask)) {
			ret = unregister_pm_notifier(&suspend_notifier);
			if (ret < 0) {
				pr_err("hw_kcollect %s : unregister_pm_notifier failed!\n", __func__);
			} else {
				pr_debug("hw_kcollect %s : unregister_pm_notifier\n", __func__);
			}
		}
	}
}
コード例 #6
0
static int __init exynos5_manta_battery_late_init(void)
{
	int ret;
	struct usb_phy *usb_xceiv;

	ret = power_supply_register(NULL, &manta_battery_psy);
	if (ret)
		pr_err("%s: failed to register power_supply\n",
		       __func__);

	ret = request_threaded_irq(gpio_to_irq(GPIO_OTG_VBUS_SENSE),
				   NULL, ta_int_intr,
				   IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING |
				   IRQF_ONESHOT, "usb_vbus", NULL);
	if (ret) {
		pr_err("%s: usb_vbus irq register failed, ret=%d\n",
		       __func__, ret);
	} else {
		ret = enable_irq_wake(gpio_to_irq(GPIO_OTG_VBUS_SENSE));
		if (ret)
			pr_warn("%s: failed to enable irq_wake for usb_vbus\n",
				__func__);
	}

	ret = request_threaded_irq(gpio_to_irq(GPIO_VBUS_POGO_5V), NULL,
				   ta_int_intr,
				   IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING |
				   IRQF_ONESHOT, "pogo_vbus", NULL);
	if (ret) {
		pr_err("%s: pogo_vbus irq register failed, ret=%d\n",
		       __func__, ret);
	} else {
		ret = enable_irq_wake(gpio_to_irq(GPIO_VBUS_POGO_5V));
		if (ret)
			pr_warn("%s: failed to enable irq_wake for pogo_vbus\n",
				__func__);
	}

	ret = register_pm_notifier(&exynos5_manta_battery_pm_notifier_block);
	if (ret)
		pr_warn("%s: failed to register PM notifier; ret=%d\n",
			__func__, ret);

	usb_xceiv = usb_get_transceiver();

	if (!usb_xceiv) {
		pr_err("%s: No USB transceiver found\n", __func__);
	} else {
		ret = usb_register_notifier(usb_xceiv, &manta_bat_usb_nb);

		if (ret) {
			pr_err("%s: usb_register_notifier on transceiver %s failed\n",
			       __func__, dev_name(usb_xceiv->dev));
		}
	}

	/* get initial charger status */
	change_charger_status(false, false);
	return 0;
}
コード例 #7
0
ファイル: sony_ssm.c プロジェクト: 1n/xperia-m-source
static int ssm_enable(struct ssm_data *sd)
{
	int rc;

	dev_dbg(sd->dev, "%s\n", __func__);

	mutex_lock(&sd->lock);

	if (sd->enabled) {
		dev_err(sd->dev, "%s: Already enabled!\n", __func__);
		rc = -EINVAL;
		goto exit;
	}

	rc = register_pm_notifier(&sd->pm_notifier);
	if (rc) {
		dev_err(sd->dev, "%s: Failed to register pm_notifier (%d)\n",
			__func__, rc);
		goto exit;
	}

	register_early_suspend(&sd->early_suspend);

	sd->notify_next_suspend_prepare = false;
	sd->notify_late_resume = false;
	sd->enabled = true;

exit:
	mutex_unlock(&sd->lock);
	return rc;
}
コード例 #8
0
static int __init cmdq_init(void)
{
	int status;

	CMDQ_MSG("CMDQ driver init begin\n");

	/* Initialize group callback */
	cmdqCoreInitGroupCB();

	/* Register MDP callback */
	cmdqCoreRegisterCB(CMDQ_GROUP_MDP,
			   cmdqMdpClockOn, cmdqMdpDumpInfo, cmdqMdpResetEng, cmdqMdpClockOff);

	/* Register VENC callback */
	cmdqCoreRegisterCB(CMDQ_GROUP_VENC, NULL, cmdqVEncDumpInfo, NULL, NULL);

	status = platform_driver_register(&gCmdqDriver);
	if (0 != status) {
		CMDQ_ERR("Failed to register the CMDQ driver(%d)\n", status);
		return -ENODEV;
	}

	/* register pm notifier */
	status = register_pm_notifier(&cmdq_pm_notifier_block);
	if (0 != status) {
		CMDQ_ERR("Failed to register_pm_notifier(%d)\n", status);
		return -ENODEV;
	}

	CMDQ_MSG("CMDQ driver init end\n");

	return 0;
}
コード例 #9
0
static int __init cbp_init(void)
{
	int ret;

	ret = platform_device_register(&cbp_device);
	if (ret) {
		LOGPRT(LOG_ERR,  "platform_device_register failed\n");
		goto err_platform_device_register;
	}

	ret = platform_driver_register(&cbp_driver);
	if (ret) {
		LOGPRT(LOG_ERR,  "platform_driver_register failed\n");
		goto err_platform_driver_register;
	}


   ret = register_pm_notifier(&cbp_pm_notifier_block);
   if (ret) {
       LOGPRT(LOG_ERR,  "%s failed to register PM notifier\n", __func__);
       goto err_platform_driver_register;
   }else{
       LOGPRT(LOG_ERR,  "%s sucess to register PM notifier\n", __func__);
    }


	return ret;
err_platform_driver_register:
	platform_device_unregister(&cbp_device);
err_platform_device_register:
	return ret;
}
コード例 #10
0
static int __init ledtrig_sleep_init(void)
{
	led_trigger_register_simple("sleep", &ledtrig_sleep);
	register_pm_notifier(&ledtrig_sleep_pm_notifier);
	register_early_suspend(&ledtrig_sleep_early_suspend_handler);
	return 0;
}
コード例 #11
0
int gpu_notifier_init(struct kbase_device *kbdev)
{
	struct exynos_context *platform = (struct exynos_context *)kbdev->platform_context;
	if (!platform)
		return -ENODEV;

	platform->voltage_margin = 0;
#if defined(CONFIG_EXYNOS_THERMAL) && defined(CONFIG_GPU_THERMAL)
	exynos_gpu_add_notifier(&gpu_tmu_nb);
#endif /* CONFIG_EXYNOS_THERMAL */

#ifdef CONFIG_MALI_RT_PM
	if (register_pm_notifier(&gpu_pm_nb))
		return -1;
#endif /* CONFIG_MALI_RT_PM */

#ifdef CONFIG_EXYNOS_BUSMONITOR
	busmon_notifier_chain_register(&gpu_noc_nb);
#endif
	pm_runtime_enable(kbdev->dev);

	platform->power_status = true;

	return 0;
}
コード例 #12
0
ファイル: core.c プロジェクト: 020gzh/linux
static int __init omap_dss_probe(struct platform_device *pdev)
{
	struct omap_dss_board_info *pdata = pdev->dev.platform_data;
	int r;

	core.pdev = pdev;

	dss_features_init(omapdss_get_version());

	r = dss_initialize_debugfs();
	if (r)
		goto err_debugfs;

	if (def_disp_name)
		core.default_display_name = def_disp_name;
	else if (pdata->default_display_name)
		core.default_display_name = pdata->default_display_name;
	else if (pdata->default_device)
		core.default_display_name = pdata->default_device->name;

	register_pm_notifier(&omap_dss_pm_notif_block);

	return 0;

err_debugfs:

	return r;
}
コード例 #13
0
static int __init tegra_cpuidle_init(void)
{
	unsigned int cpu;
	int ret;

	ret = cpuidle_register_driver(&tegra_idle);
	if (ret)
		return ret;

#ifdef CONFIG_PM_SLEEP
	tegra_lp2_min_residency = tegra_cpu_lp2_min_residency();
	tegra_lp2_exit_latency = tegra_cpu_power_good_time();
	tegra_lp2_power_off_time = tegra_cpu_power_off_time();

	ret = tegra_cpudile_init_soc();
	if (ret)
		return ret;
#endif

	for_each_possible_cpu(cpu) {
		if (tegra_cpuidle_register_device(cpu))
			pr_err("CPU%u: error initializing idle loop\n", cpu);
	}

	register_pm_notifier(&tegra_cpuidle_pm_notifier);
	return 0;
}
コード例 #14
0
int gpu_notifier_init(struct kbase_device *kbdev)
{
	struct exynos_context *platform = (struct exynos_context *)kbdev->platform_context;
	if (!platform)
		return -ENODEV;

	platform->voltage_margin = 0;
#if defined(CONFIG_EXYNOS_THERMAL)
	exynos_gpu_add_notifier(&gpu_tmu_nb);
	platform->tmu_status = true;
#else /* CONFIG_EXYNOS_THERMAL */
	platform->tmu_status = false;
#endif /* CONFIG_EXYNOS_THERMAL */

#ifdef CONFIG_MALI_MIDGARD_RT_PM
	if (register_pm_notifier(&gpu_pm_nb))
		return MALI_FALSE;
#endif /* CONFIG_MALI_MIDGARD_RT_PM */

	pm_runtime_enable(kbdev->dev);

	pm_qos_add_notifier(PM_QOS_GPU_FREQ_MIN, &exynos_gpu_min_qos_notifier);
	pm_qos_add_notifier(PM_QOS_GPU_FREQ_MAX, &exynos_gpu_max_qos_notifier);

	return MALI_TRUE;
}
コード例 #15
0
static int __init swsusp_helper_init(void)
{
	int ret;

	hib_log("[%s] enter...\n", __func__);

	/* init restore_noirq callback function table */
	memset((void *)restore_noirq_func_table, 0, sizeof(restore_noirq_func_table));

	ret = platform_device_register(&swsusp_helper_device);
	if (ret) {
		hib_err("swsusp_helper_device register fail(%d)\n", ret);
		return ret;
	}

	ret = platform_driver_register(&swsusp_helper_driver);
	if (ret) {
		hib_err("swsusp_helper_driver register fail(%d)\n", ret);
		return ret;
	}

	ret = register_pm_notifier(&swsusp_pm_notifier_block);
	if (ret)
		hib_err("failed to register PM notifier %d\n", ret);

	initialized = 1;
	return 0;
}
コード例 #16
0
void __init tegra_wdt_recovery_init(void)
{
#ifdef CONFIG_PM
	/* Register PM notifier. */
	register_pm_notifier(&tegra_wdt_notify);
#endif
	register_syscore_ops(&tegra_wdt_syscore_ops);
}
コード例 #17
0
static int __init msm_pil_init(void)
{
	int ret = msm_pil_debugfs_init();
	if (ret)
		return ret;
	register_pm_notifier(&pil_pm_notifier);
	return bus_register(&pil_bus_type);
}
コード例 #18
0
static int __init omap_die_governor_init(void)
{
	struct thermal_dev *thermal_fw;

	omap_gov = kzalloc(sizeof(struct omap_die_governor), GFP_KERNEL);
	if (!omap_gov) {
		pr_err("%s:Cannot allocate memory\n", __func__);
		return -ENOMEM;
	}

	thermal_fw = kzalloc(sizeof(struct thermal_dev), GFP_KERNEL);
	if (thermal_fw) {
		thermal_fw->name = "omap_ondie_governor";
		thermal_fw->domain_name = "cpu";
		thermal_fw->dev_ops = &omap_gov_ops;
		thermal_governor_dev_register(thermal_fw);
		therm_fw = thermal_fw;
	} else {
		pr_err("%s: Cannot allocate memory\n", __func__);
		kfree(omap_gov);
		return -ENOMEM;
	}

	if (cpu_is_omap446x()) {
		omap_gov->gradient_slope = OMAP_GRADIENT_SLOPE_4460;
		omap_gov->gradient_const = OMAP_GRADIENT_CONST_4460;
		omap_gov->gradient_slope_w_pcb = OMAP_GRADIENT_SLOPE_W_PCB_4460;
		omap_gov->gradient_const_w_pcb = OMAP_GRADIENT_CONST_W_PCB_4460;
	} else if (cpu_is_omap447x()) {
		omap_gov->gradient_slope = OMAP_GRADIENT_SLOPE_4470;
		omap_gov->gradient_const = OMAP_GRADIENT_CONST_4470;
		omap_gov->gradient_slope_w_pcb = OMAP_GRADIENT_SLOPE_W_PCB_4470;
		omap_gov->gradient_const_w_pcb = OMAP_GRADIENT_CONST_W_PCB_4470;
	} else {
		omap_gov->gradient_slope = 0;
		omap_gov->gradient_const = 0;
		omap_gov->gradient_slope_w_pcb = 0;
		omap_gov->gradient_const_w_pcb = 0;
	}

	/* Init delayed work to average on-die temperature */
	INIT_DELAYED_WORK(&omap_gov->average_cpu_sensor_work,
			  average_cpu_sensor_delayed_work_fn);
	INIT_DELAYED_WORK(&omap_gov->decrease_mpu_freq_work,
			  decrease_mpu_freq_fn);

	omap_gov->average_period = NORMAL_TEMP_MONITORING_RATE;
	omap_gov->decrease_mpu_freq_period = DECREASE_MPU_FREQ_PERIOD;
	omap_gov->avg_is_valid = 0;

	if (register_pm_notifier(&omap_die_pm_notifier))
		pr_err("%s: omap_die pm registration failed!\n", __func__);

	schedule_delayed_work(&omap_gov->average_cpu_sensor_work,
			msecs_to_jiffies(0));

	return 0;
}
コード例 #19
0
ファイル: exynos4.c プロジェクト: Ricky310711/RTL_KERNEL
int mali_platform_device_register(void)
{
    int err;

    MALI_DEBUG_PRINT(4, ("mali_platform_device_register() called\n"));

#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)
    exynos_pm_add_dev_to_genpd(&mali_gpu_device, &exynos4_pd_g3d);
#endif

    /* Connect resources to the device */
    err = platform_device_add_resources(&mali_gpu_device, mali_gpu_resources, sizeof(mali_gpu_resources) / sizeof(mali_gpu_resources[0]));
    if (0 == err)
    {
        err = platform_device_add_data(&mali_gpu_device, &mali_gpu_data, sizeof(mali_gpu_data));
        if (0 == err)
        {
#ifdef CONFIG_PM_RUNTIME
#if defined(USE_PM_NOTIFIER)
            err = register_pm_notifier(&mali_pwr_notif_block);
            if (err)
            {
                goto plat_init_err;
            }
#endif
#endif /* CONFIG_PM_RUNTIME */

            /* Register the platform device */
            err = platform_device_register(&mali_gpu_device);
            if (0 == err)
            {
                mali_platform_init(&(mali_gpu_device.dev));

#ifdef CONFIG_PM_RUNTIME
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
                pm_runtime_set_autosuspend_delay(&(mali_gpu_device.dev), 1000);
                pm_runtime_use_autosuspend(&(mali_gpu_device.dev));
#endif
                pm_runtime_enable(&(mali_gpu_device.dev));
#endif

                return 0;
            }
        }

#ifdef CONFIG_PM_RUNTIME
#if defined(USE_PM_NOTIFIER)
plat_init_err:
        unregister_pm_notifier(&mali_pwr_notif_block);
#endif
#endif /* CONFIG_PM_RUNTIME */
        platform_device_unregister(&mali_gpu_device);
    }

    return err;
}
コード例 #20
0
ファイル: bbswitch.c プロジェクト: TheFrozenFire/bumblebeed
static int __init bbswitch_init(void) {
    struct proc_dir_entry *acpi_entry;
    struct pci_dev *pdev = NULL;
    int class = PCI_CLASS_DISPLAY_VGA << 8;

    while ((pdev = pci_get_class(class, pdev)) != NULL) {
        struct acpi_buffer buf = { ACPI_ALLOCATE_BUFFER, NULL };
        acpi_handle handle;

        handle = DEVICE_ACPI_HANDLE(&pdev->dev);
        if (!handle)
            continue;

        if (pdev->vendor != PCI_VENDOR_ID_INTEL) {
            dis_dev = pdev;
            dis_handle = handle;
            acpi_get_name(handle, ACPI_FULL_PATHNAME, &buf);
            printk(KERN_INFO "bbswitch: Found discrete VGA device %s: %s\n",
                dev_name(&pdev->dev), (char *)buf.pointer);
        }
        kfree(buf.pointer);
    }

    if (dis_dev == NULL) {
        printk(KERN_ERR "bbswitch: No discrete VGA device found\n");
        return -ENODEV;
    }

    if (has_dsm_func(acpi_optimus_dsm_muid, 0x100, 0x1A)) {
        dsm_type = DSM_TYPE_OPTIMUS;
        printk(KERN_INFO "bbswitch: detected an Optimus _DSM function\n");
    } else if (has_dsm_func(acpi_nvidia_dsm_muid, 0x102, 0x3)) {
        dsm_type = DSM_TYPE_NVIDIA;
        printk(KERN_INFO "bbswitch: detected a nVidia _DSM function\n");
    } else {
        printk(KERN_ERR "bbswitch: No suitable _DSM call found.\n");
        return -ENODEV;
    }

    acpi_entry = create_proc_entry("bbswitch", 0660, acpi_root_dir);
    if (acpi_entry == NULL) {
        printk(KERN_ERR "bbswitch: Couldn't create proc entry\n");
        return -ENOMEM;
    }

    printk(KERN_INFO "bbswitch: Succesfully loaded. Discrete card %s is %s\n",
        dev_name(&dis_dev->dev), is_card_disabled() ? "off" : "on");

    acpi_entry->write_proc = bbswitch_write;
    acpi_entry->read_proc = bbswitch_read;

    nb.notifier_call = &bbswitch_pm_handler;
    register_pm_notifier(&nb);

    return 0;
}
コード例 #21
0
static int suspend_time_syscore_init(void)
{
#ifdef CONFIG_SUSPEND_TIME_TIMEKEEPING
	register_pm_notifier(&suspend_time_pm_notifier_block);
#else
	register_syscore_ops(&suspend_time_syscore_ops);
#endif

	return 0;
}
コード例 #22
0
/*
  rk3288 hardware specific initialization
 */
mali_bool kbase_platform_rk_init(kbase_device *kbdev)
{
 	if(MALI_ERROR_NONE == kbase_platform_init(kbdev))
 	{
		if (register_pm_notifier(&mali_pm_nb)) {
			return MALI_FALSE;
		}
 		return MALI_TRUE;
 	}
	return MALI_FALSE;
}
コード例 #23
0
static int __init heartbeat_trig_init(void)
{
	int rc = led_trigger_register(&heartbeat_led_trigger);

	if (!rc) {
		atomic_notifier_chain_register(&panic_notifier_list,
					       &heartbeat_panic_nb);
		register_reboot_notifier(&heartbeat_reboot_nb);
		register_pm_notifier(&heartbeat_pm_nb);
	}
	return rc;
}
コード例 #24
0
ファイル: cpuidle-exynos64.c プロジェクト: ColinIanKing/m576
static int __init exynos_init_cpuidle(void)
{
	int ret;

	ret = exynos_idle_state_init(&exynos64_idle_cluster0_driver, &hmp_fast_cpu_mask);
	if (ret) {
		pr_err("fail exynos_idle_state_init(cluster 0) ret = %d\n", ret);
		return ret;
	}

	cpuidle_profile_state_init(&exynos64_idle_cluster0_driver);

	exynos64_idle_cluster0_driver.safe_state_index = IDLE_C1;
	exynos64_idle_cluster0_driver.cpumask = &hmp_fast_cpu_mask;
	ret = cpuidle_register(&exynos64_idle_cluster0_driver, NULL);

	if (ret) {
		pr_err("fast cpu cpuidle_register fail ret = %d\n", ret);
		return ret;
	}

	ret = exynos_idle_state_init(&exynos64_idle_cluster1_driver, &hmp_slow_cpu_mask);
	if (ret) {
		pr_err("fail exynos_idle_state_init(cluster 1) ret = %d\n", ret);
		return ret;
	}

	exynos64_idle_cluster1_driver.safe_state_index = IDLE_C1;
	exynos64_idle_cluster1_driver.cpumask = &hmp_slow_cpu_mask;
	ret = cpuidle_register(&exynos64_idle_cluster1_driver, NULL);

	if (ret) {
		pr_err("slow cpu cpuidle_register fail ret = %d\n", ret);
		return ret;
	}

	/* TODO : SKIP idle correlation */

	register_pm_notifier(&exynos_cpuidle_notifier);
	register_reboot_notifier(&exynos_cpuidle_reboot_nb);

#if defined(CONFIG_EXYNOS_MARCH_DYNAMIC_CPU_HOTPLUG)
	fb_register_client(&fb_block);
#endif

	pr_info("%s, finish initialization of cpuidle\n", __func__);

	return 0;
}
コード例 #25
0
static int __init smd_debugfs_init(void)
{
	struct dentry *dent;
#if CONFIG_SMD_OFFSET_TCXO_STAT
	int ret;
	int i;
#endif

	dent = debugfs_create_dir("smd", 0);
	if (IS_ERR(dent))
		return PTR_ERR(dent);

	debug_create("ch", 0444, dent, debug_read_ch);
	debug_create("diag", 0444, dent, debug_read_diag_msg);
	debug_create("mem", 0444, dent, debug_read_mem);
	debug_create("version", 0444, dent, debug_read_smd_version);
	debug_create("tbl", 0444, dent, debug_read_alloc_tbl);
	debug_create("modem_err", 0444, dent, debug_modem_err);
	debug_create("modem_err_f3", 0444, dent, debug_modem_err_f3);
	debug_create("print_diag", 0444, dent, debug_diag);
	debug_create("print_f3", 0444, dent, debug_f3);
	debug_create("int_stats", 0444, dent, debug_int_stats);
	debug_create("int_stats_reset", 0444, dent, debug_int_stats_reset);

	/* NNV: this is google only stuff */
	debug_create("build", 0444, dent, debug_read_build_id);
#if CONFIG_SMD_OFFSET_TCXO_STAT
	sleep_stat = get_smem_sleep_stat();
	negate_client_stat = get_smem_negate_client_stat();
	register_early_suspend(&sleep_stat_screen_hdl);
	register_pm_notifier(&sleep_stat_notif_block);

	mutex_init(&mem_sleep_stat_lock);
	sleep_stat_kobj = kobject_create_and_add("systemlog", NULL);
	if (sleep_stat_kobj == NULL) {
		pr_err("smd_debugfs_init: create sleep_stat_kobj failed\n");
		return 0;
	}

	for (i = 0; i < ARRAY_SIZE(mem_sleep_stat_attrs); i++) {
		ret = sysfs_create_file(sleep_stat_kobj, &mem_sleep_stat_attrs[i].attr);
		if (ret)
			pr_err("%s: sysfs_create_file for attr %d failed\n", __func__, i);
	}
#else
	pr_info("No sleep statistics\n");
#endif
	return 0;
}
コード例 #26
0
static int __init cpu_core_voltage_init(void)
{
	struct clk *cpu_clk;
	struct cpu_core_voltage *pcore = &cpu_core_vol;

	pcore->down_wq = alloc_workqueue("voltage_down", 0, 1);
	if (!pcore->down_wq)
		return -ENOMEM;
	INIT_DELAYED_WORK(&pcore->vol_down_work,
			cpu_core_vol_down);

	pcore->core_vcc = regulator_get(NULL, CPU_CORE_NAME);
	if(IS_ERR(pcore->core_vcc))
		return -1;

	cpu_clk = clk_get(NULL, CLK_NAME_CCLK);
	if (IS_ERR(cpu_clk))
		return -1;
	pcore->current_rate = clk_get_rate(cpu_clk);
	clk_put(cpu_clk);
	if(pcore->current_rate <= 0) {
		return -1;
	}

	pcore->msc_adj = 0;
	pcore->gpu_adj = 0;
	pcore->vpu_adj = 0;
	pcore->all_adj = 0;

	atomic_set(&pcore->qwork_atomic, 0);

	mutex_init(&pcore->mutex);
	pcore->current_vol = regulator_get_voltage(pcore->core_vcc);
	pcore->target_vol = pcore->current_vol;
	pcore->clk_prechange.jz_notify = clk_prechange_notify;
	pcore->clk_prechange.level = NOTEFY_PROI_HIGH;
	pcore->clk_prechange.msg = JZ_CLK_PRECHANGE;
	jz_notifier_register(&pcore->clk_prechange, NOTEFY_PROI_HIGH);

	pcore->clkgate_change.jz_notify = clkgate_change_notify;
	pcore->clkgate_change.level = NOTEFY_PROI_HIGH;
	pcore->clkgate_change.msg = JZ_CLKGATE_CHANGE;
	jz_notifier_register(&pcore->clkgate_change, NOTEFY_PROI_HIGH);

	register_pm_notifier(&cpu_core_sleep_pm_notifier);

	return 0;
}
コード例 #27
0
/**
 *  * Exynos5 hardware specific initialization
 *   */
mali_bool kbase_platform_exynos5_init(kbase_device *kbdev)
{
	if (MALI_ERROR_NONE == kbase_platform_init(kbdev)) {
		if (register_pm_notifier(&mali_pm_nb)) {
			return MALI_FALSE;
		}
#ifdef CONFIG_MALI_T6XX_DEBUG_SYS
		if (kbase_platform_create_sysfs_file(kbdev->osdev.dev)) {
			return MALI_ERROR_FUNCTION_FAILED;
		}
#endif /* CONFIG_MALI_T6XX_DEBUG_SYS */
		return MALI_TRUE;
	}

	return MALI_FALSE;
}
コード例 #28
0
ファイル: gx_wdt.c プロジェクト: gcsuri/linux-wetek-3.14.y
static int aml_wdt_probe(struct platform_device *pdev)
{
	struct watchdog_device *aml_wdt;
	struct aml_wdt_dev *wdev;
	int ret;
	aml_wdt = devm_kzalloc(&pdev->dev, sizeof(*aml_wdt), GFP_KERNEL);
	if (!aml_wdt)
		return -ENOMEM;

	wdev = devm_kzalloc(&pdev->dev, sizeof(*wdev), GFP_KERNEL);
	if (!wdev)
		return -ENOMEM;
	wdev->dev		= &pdev->dev;
	mutex_init(&wdev->lock);
	aml_init_pdata(wdev);

	aml_wdt->info	      = &aml_wdt_info;
	aml_wdt->ops	      = &aml_wdt_ops;
	aml_wdt->min_timeout = wdev->min_timeout;
	aml_wdt->max_timeout = wdev->max_timeout;
	aml_wdt->timeout = 0xffffffff;
	wdev->timeout = 0xffffffff;

	watchdog_set_drvdata(aml_wdt, wdev);
	platform_set_drvdata(pdev, aml_wdt);
	if (wdev->reset_watchdog_method == 1) {

		INIT_DELAYED_WORK(&wdev->boot_queue, boot_moniter_work);
		mod_delayed_work(system_freezable_wq, &wdev->boot_queue,
	 round_jiffies(msecs_to_jiffies(wdev->reset_watchdog_time*1000)));
		enable_watchdog(wdev);
		set_watchdog_cnt(wdev,
				 wdev->default_timeout * wdev->one_second);
		dev_info(wdev->dev, "creat work queue for watch dog\n");
	}
	ret = watchdog_register_device(aml_wdt);
	if (ret)
		return ret;
	awdtv = wdev;
	register_pm_notifier(&aml_wdt_pm_notifier);
	register_reboot_notifier(&aml_wdt_reboot_notifier);
	dev_info(wdev->dev, "AML Watchdog Timer probed done\n");

	return 0;
}
コード例 #29
0
ファイル: cci_powermonitor.c プロジェクト: Arunvasu/taoshan
static int __init cci_pm_init(void)
{
	int retval = 0;
	cci_pm_dev = platform_device_register_simple("cci_pm", -1, NULL, 0);
	/* Create the files associated with this kobject */
#if 0
	cci_pm.pm_notifier.notifier_call = cci_pm_notifier;
	cci_pm.pm_notifier.priority = 0;
	register_pm_notifier(&cci_pm.pm_notifier);	
#endif
#ifdef CONFIG_HAS_EARLYSUSPEND
	cci_pm.early_suspend.level = EARLY_SUSPEND_LEVEL_STOP_DRAWING;
	cci_pm.early_suspend.suspend =cci_pm_early_suspend;
	cci_pm.early_suspend.resume = cci_pm_late_resume;
	register_early_suspend(&cci_pm.early_suspend);
#endif
	return retval;
}