示例#1
0
void __init msm8930_init_gpu(void)
{
	unsigned int version = socinfo_get_version();

	/* Set the turbo speed for the AA and AB respectively */

	if (cpu_is_msm8930aa())
		kgsl_3d0_pdata.pwrlevel[0].gpu_freq = 487500000;
	else if (cpu_is_msm8930ab()) {
		kgsl_3d0_pdata.pwrlevel[0].gpu_freq = 500000000;
		grp3d_max_vectors[0].ib = KGSL_CONVERT_TO_MBPS(4800);
	}

	/* Set up the chip ID based on the SoC version */

	if (cpu_is_msm8930ab())
		kgsl_3d0_pdata.chipid = ADRENO_CHIPID(3, 0, 5, 3);
	else if ((SOCINFO_VERSION_MAJOR(version) == 1) &&
		(SOCINFO_VERSION_MINOR(version) == 2))
		kgsl_3d0_pdata.chipid = ADRENO_CHIPID(3, 0, 5, 2);
	else
		kgsl_3d0_pdata.chipid = ADRENO_CHIPID(3, 0, 5, 0);

	platform_device_register(&device_kgsl_3d0);
}
示例#2
0
int msm_spm_turn_on_cpu_rail(unsigned int cpu)
{
	uint32_t val = 0;
	uint32_t timeout = 0;
	void *reg = NULL;
	void *saw_bases[] = {
		0,
		MSM_SAW1_BASE,
		MSM_SAW2_BASE,
		MSM_SAW3_BASE
	};

	if (cpu == 0 || cpu >= num_possible_cpus())
		return -EINVAL;

	reg = saw_bases[cpu];

	if (cpu_is_msm8960() || cpu_is_msm8930() || cpu_is_msm8930aa() ||
	    cpu_is_apq8064() || cpu_is_msm8627() || cpu_is_msm8960ab() ||
						cpu_is_apq8064ab()) {
		val = 0xA4;
		reg += 0x14;
		timeout = 512;
	} else {
		return -ENOSYS;
	}

	writel_relaxed(val, reg);
	mb();
	udelay(timeout);

	return 0;
}
void __init msm8930_init_gpu(void)
{
	if (cpu_is_msm8930aa())
		kgsl_3d0_pdata.pwrlevel[0].gpu_freq = 450000000;

	platform_device_register(&device_kgsl_3d0);
}
示例#4
0
void __init msm8930_init_gpu(void)
{
	unsigned int version = socinfo_get_version();

	

	if (cpu_is_msm8930aa())
		kgsl_3d0_pdata.pwrlevel[0].gpu_freq = 450000000;
	else if (cpu_is_msm8930ab()) {
		kgsl_3d0_pdata.pwrlevel[0].gpu_freq = 500000000;
		grp3d_max_vectors[0].ib = KGSL_CONVERT_TO_MBPS(4800);
	}

	

	if (cpu_is_msm8930ab())
		kgsl_3d0_pdata.chipid = ADRENO_CHIPID(3, 0, 5, 3);
	else if ((SOCINFO_VERSION_MAJOR(version) == 1) &&
		(SOCINFO_VERSION_MINOR(version) == 2))
		kgsl_3d0_pdata.chipid = ADRENO_CHIPID(3, 0, 5, 2);
	else
		kgsl_3d0_pdata.chipid = ADRENO_CHIPID(3, 0, 5, 0);

	platform_device_register(&device_kgsl_3d0);
}
static int tz_init(struct kgsl_device *device, struct kgsl_pwrscale *pwrscale)
{
	struct tz_priv *priv;
	int ret;

	
	if (!(cpu_is_msm8x60() || cpu_is_msm8960() || cpu_is_apq8064() ||
		cpu_is_msm8930() || cpu_is_msm8930aa() || cpu_is_msm8627()))
		return -EINVAL;

	priv = pwrscale->priv = kzalloc(sizeof(struct tz_priv), GFP_KERNEL);
	if (pwrscale->priv == NULL)
		return -ENOMEM;

	priv->governor = TZ_GOVERNOR_ONDEMAND;
	spin_lock_init(&tz_lock);
	kgsl_pwrscale_policy_add_files(device, pwrscale, &tz_attr_group);

	ret = __secure_tz_entry(TZ_CMD_ID, 0, PARAM_INDEX_WRITE_ALGORITHM);

	if(ret == 1)
		pr_info("Using HTC GPU DCVS algorithm\n");
	else
		pr_info("Using QCT GPU DCVS algorithm\n");

	return 0;
}
示例#6
0
static void __exit msm8930_audio_exit(void)
{
	if (!cpu_is_msm8930() && !cpu_is_msm8930aa() && !cpu_is_msm8627()) {
		pr_err("%s: Not the right machine type\n", __func__);
		return ;
	}
	msm8930_free_headset_mic_gpios();
	platform_device_unregister(msm8930_snd_device);
	kfree(mbhc_cfg.calibration);
}
void __init msm8930_init_gpu(void)
{
	unsigned int version = socinfo_get_version();

	if (cpu_is_msm8930aa())
		kgsl_3d0_pdata.pwrlevel[0].gpu_freq = 450000000;

	if ((SOCINFO_VERSION_MAJOR(version) == 1) &&
		(SOCINFO_VERSION_MINOR(version) == 2))
		kgsl_3d0_pdata.chipid = ADRENO_CHIPID(3, 0, 5, 2);
	else
		kgsl_3d0_pdata.chipid = ADRENO_CHIPID(3, 0, 5, 0);

	platform_device_register(&device_kgsl_3d0);
}
示例#8
0
static int __init msm8930_audio_init(void)
{
	int ret;

/* Jen Chang merge from detroit_2.0 for boot log */
	printk("BootLog, +%s\n", __func__);
/* Jen Chang, 20120924 */

	if (!cpu_is_msm8930() && !cpu_is_msm8930aa() && !cpu_is_msm8627()) {
		pr_err("%s: Not the right machine type\n", __func__);
		return -ENODEV ;
	}
	mbhc_cfg.calibration = def_sitar_mbhc_cal();
	if (!mbhc_cfg.calibration) {
		pr_err("Calibration data allocation failed\n");
		return -ENOMEM;
	}

	msm8930_snd_device = platform_device_alloc("soc-audio", 0);
	if (!msm8930_snd_device) {
		pr_err("Platform device allocation failed\n");
		kfree(mbhc_cfg.calibration);
		return -ENOMEM;
	}

	platform_set_drvdata(msm8930_snd_device, &snd_soc_card_msm8930);
	ret = platform_device_add(msm8930_snd_device);
	if (ret) {
		platform_device_put(msm8930_snd_device);
		kfree(mbhc_cfg.calibration);
		return ret;
	}

	if (msm8930_configure_headset_mic_gpios()) {
		pr_err("%s Fail to configure headset mic gpios\n", __func__);
		msm8930_headset_gpios_configured = 0;
	} else
		msm8930_headset_gpios_configured = 1;

	atomic_set(&auxpcm_rsc_ref, 0);
/* Jen Chang merge from detroit_2.0 for boot log */
	snd_create_kernel_debuglevel_entries();
	printk("BootLog, -%s, ret=%d\n", __func__, ret);
/* Jen Chang, 20120924 */
	return ret;

}
示例#9
0
static int __cpuinit release_secondary(unsigned int cpu)
{
	BUG_ON(cpu >= get_core_count());

	if (cpu_is_msm8x60())
		return scorpion_release_secondary();

	if (machine_is_msm8960_sim() || machine_is_msm8960_rumi3() ||
	    machine_is_apq8064_sim())
		return krait_release_secondary_sim(0x02088000, cpu);

	if (cpu_is_msm8960() || cpu_is_msm8930() || cpu_is_msm8930aa() ||
	    cpu_is_apq8064() || cpu_is_msm8627() || cpu_is_apq8064ab())
		return krait_release_secondary(0x02088000, cpu);

	WARN(1, "unknown CPU case in release_secondary\n");
	return -EINVAL;
}
示例#10
0
void operaul_init_gpu(void)
{
    unsigned int version = socinfo_get_version();

    /* Set the turbo speed for the AA and AB respectively */

    if (cpu_is_msm8930aa())
        kgsl_3d0_pdata.pwrlevel[0].gpu_freq = 450000000;

    /* Set up the chip ID based on the SoC version */

    if ((SOCINFO_VERSION_MAJOR(version) == 1) &&
            (SOCINFO_VERSION_MINOR(version) == 2))
        kgsl_3d0_pdata.chipid = ADRENO_CHIPID(3, 0, 5, 2);
    else
        kgsl_3d0_pdata.chipid = ADRENO_CHIPID(3, 0, 5, 0);

    platform_device_register(&device_kgsl_3d0);
}
static int tz_init(struct kgsl_device *device, struct kgsl_pwrscale *pwrscale)
{
	struct tz_priv *priv;

	/* Trustzone is only valid for some SOCs */
	if (!(cpu_is_msm8x60() || cpu_is_msm8960() || cpu_is_apq8064() ||
		cpu_is_msm8930() || cpu_is_msm8930aa() || cpu_is_msm8627()))
		return -EINVAL;

	priv = pwrscale->priv = kzalloc(sizeof(struct tz_priv), GFP_KERNEL);
	if (pwrscale->priv == NULL)
		return -ENOMEM;

	priv->governor = TZ_GOVERNOR_ONDEMAND;
	spin_lock_init(&tz_lock);
	kgsl_pwrscale_policy_add_files(device, pwrscale, &tz_attr_group);

	return 0;
}
示例#12
0
static int __init msm8930_audio_init(void)
{
	int ret;

	if (!cpu_is_msm8930() && !cpu_is_msm8930aa() && !cpu_is_msm8627()) {
		pr_err("%s: Not the right machine type\n", __func__);
		return -ENODEV ;
	}
	mbhc_cfg.calibration = def_sitar_mbhc_cal();
	if (!mbhc_cfg.calibration) {
		pr_err("Calibration data allocation failed\n");
		return -ENOMEM;
	}

	msm8930_snd_device = platform_device_alloc("soc-audio", 0);
	if (!msm8930_snd_device) {
		pr_err("Platform device allocation failed\n");
		kfree(mbhc_cfg.calibration);
		return -ENOMEM;
	}

	platform_set_drvdata(msm8930_snd_device, &snd_soc_card_msm8930);
	ret = platform_device_add(msm8930_snd_device);
	if (ret) {
		platform_device_put(msm8930_snd_device);
		kfree(mbhc_cfg.calibration);
		return ret;
	}

	if (msm8930_configure_headset_mic_gpios()) {
		pr_err("%s Fail to configure headset mic gpios\n", __func__);
		msm8930_headset_gpios_configured = 0;
	} else
		msm8930_headset_gpios_configured = 1;

	atomic_set(&auxpcm_rsc_ref, 0);
	return ret;

}
static int __init modem_8960_init(void)
{
    int ret;

    if (!cpu_is_msm8960() && !cpu_is_msm8930() && !cpu_is_msm8930aa() &&
            !cpu_is_msm9615() && !cpu_is_msm8627())
        return -ENODEV;

    ret = smsm_state_cb_register(SMSM_MODEM_STATE, SMSM_RESET,
                                 smsm_state_cb, 0);

    if (ret < 0)
        pr_err("%s: Unable to register SMSM callback! (%d)\n",
               __func__, ret);

    ret = request_irq(Q6FW_WDOG_EXPIRED_IRQ, modem_wdog_bite_irq,
                      IRQF_TRIGGER_RISING, "modem_wdog_fw", NULL);

    if (ret < 0) {
        pr_err("%s: Unable to request q6fw watchdog IRQ. (%d)\n",
               __func__, ret);
        goto out;
    }

    ret = request_irq(Q6SW_WDOG_EXPIRED_IRQ, modem_wdog_bite_irq,
                      IRQF_TRIGGER_RISING, "modem_wdog_sw", NULL);

    if (ret < 0) {
        pr_err("%s: Unable to request q6sw watchdog IRQ. (%d)\n",
               __func__, ret);
        disable_irq_nosync(Q6FW_WDOG_EXPIRED_IRQ);
        goto out;
    }

    ret = modem_subsystem_restart_init();

    if (ret < 0) {
        pr_err("%s: Unable to reg with subsystem restart. (%d)\n",
               __func__, ret);
        goto out;
    }

    modemfw_ramdump_dev = create_ramdump_device("modem_fw");

    if (!modemfw_ramdump_dev) {
        pr_err("%s: Unable to create modem fw ramdump device. (%d)\n",
               __func__, -ENOMEM);
        ret = -ENOMEM;
        goto out;
    }

    modemsw_ramdump_dev = create_ramdump_device("modem_sw");

    if (!modemsw_ramdump_dev) {
        pr_err("%s: Unable to create modem sw ramdump device. (%d)\n",
               __func__, -ENOMEM);
        ret = -ENOMEM;
        goto out;
    }

    smem_ramdump_dev = create_ramdump_device("smem-modem");

    if (!smem_ramdump_dev) {
        pr_err("%s: Unable to create smem ramdump device. (%d)\n",
               __func__, -ENOMEM);
        ret = -ENOMEM;
        goto out;
    }

    ret = modem_debugfs_init();

    pr_info("%s: modem fatal driver init'ed.\n", __func__);
out:
    return ret;
}
示例#14
0
static int __init smd_tty_init(void)
{
	int ret;
	int n;
	int idx;

	smd_tty_driver = alloc_tty_driver(MAX_SMD_TTYS);
	if (smd_tty_driver == 0)
		return -ENOMEM;

	smd_tty_driver->owner = THIS_MODULE;
	smd_tty_driver->driver_name = "smd_tty_driver";
	smd_tty_driver->name = "smd";
	smd_tty_driver->major = 0;
	smd_tty_driver->minor_start = 0;
	smd_tty_driver->type = TTY_DRIVER_TYPE_SERIAL;
	smd_tty_driver->subtype = SERIAL_TYPE_NORMAL;
	smd_tty_driver->init_termios = tty_std_termios;
	smd_tty_driver->init_termios.c_iflag = 0;
	smd_tty_driver->init_termios.c_oflag = 0;
	smd_tty_driver->init_termios.c_cflag = B38400 | CS8 | CREAD;
	smd_tty_driver->init_termios.c_lflag = 0;
	smd_tty_driver->flags = TTY_DRIVER_RESET_TERMIOS |
		TTY_DRIVER_REAL_RAW | TTY_DRIVER_DYNAMIC_DEV;
	tty_set_operations(smd_tty_driver, &smd_tty_ops);

	ret = tty_register_driver(smd_tty_driver);
	if (ret) {
		put_tty_driver(smd_tty_driver);
		pr_err("%s: driver registration failed %d\n", __func__, ret);
		return ret;
	}

	for (n = 0; n < ARRAY_SIZE(smd_configs); ++n) {
		idx = smd_configs[n].tty_dev_index;

		if (smd_configs[n].dev_name == NULL)
			smd_configs[n].dev_name = smd_configs[n].port_name;

		if (idx == DS_IDX) {
			int legacy_ds = 0;

			legacy_ds |= cpu_is_msm7x01() || cpu_is_msm7x25();
			legacy_ds |= cpu_is_msm7x27() || cpu_is_msm7x30();
			legacy_ds |= cpu_is_qsd8x50() || cpu_is_msm8x55();
			legacy_ds |= (cpu_is_msm8960() || cpu_is_msm8930() || cpu_is_msm8930aa()) && (board_mfg_mode() == 8);
			legacy_ds |= cpu_is_msm8x60() &&
					(socinfo_get_platform_subtype() == 0x0);
			#ifdef CONFIG_MACH_DUMMY
			legacy_ds = 1;
			#endif

			if (!legacy_ds)
				continue;
		}

		tty_register_device(smd_tty_driver, idx, 0);
		init_completion(&smd_tty[idx].ch_allocated);

		
		smd_tty[idx].driver.probe = smd_tty_dummy_probe;
		smd_tty[idx].driver.driver.name = smd_configs[n].dev_name;
		smd_tty[idx].driver.driver.owner = THIS_MODULE;
		spin_lock_init(&smd_tty[idx].reset_lock);
		smd_tty[idx].is_open = 0;
		setup_timer(&smd_tty[idx].buf_req_timer, buf_req_retry,
				(unsigned long)&smd_tty[idx]);
		init_waitqueue_head(&smd_tty[idx].ch_opened_wait_queue);
		ret = platform_driver_register(&smd_tty[idx].driver);

		if (ret) {
			pr_err("%s: init failed %d (%d)\n", __func__, idx, ret);
			smd_tty[idx].driver.probe = NULL;
			goto out;
		}
		smd_tty[idx].smd = &smd_configs[n];
	}
	INIT_DELAYED_WORK(&loopback_work, loopback_probe_worker);
	return 0;

out:
	
	for (n = 0; n < ARRAY_SIZE(smd_configs); ++n) {
		idx = smd_configs[n].tty_dev_index;

		if (smd_tty[idx].driver.probe) {
			platform_driver_unregister(&smd_tty[idx].driver);
			tty_unregister_device(smd_tty_driver, idx);
		}
	}

	tty_unregister_driver(smd_tty_driver);
	put_tty_driver(smd_tty_driver);
	return ret;
}
示例#15
0
文件: msm8930.c 项目: manl/pubile
/* ZTE_Audio_LCX_130325, lichaoxia, 2013-03-25, end */
static int msm8930_configure_headset_mic_gpios(void)
{
	int ret;
	
/* ZTE_Audio_LCX_130325, lichaoxia, 2013-03-25, start */
#if defined(CONFIG_US_EURO_SWITCH)   
	
	struct pm_gpio param = {
		.direction      = PM_GPIO_DIR_OUT,
		.output_buffer  = PM_GPIO_OUT_BUF_CMOS,
		.output_value   = 1,
		.pull	   = PM_GPIO_PULL_NO,
		.vin_sel	= PM_GPIO_VIN_S4,
		.out_strength   = PM_GPIO_STRENGTH_MED,
		.function       = PM_GPIO_FUNC_NORMAL,
	};

	ret = gpio_request(us_euro_sel_gpio, "US_EURO_SWITCH");
	if (ret) {
		pr_err("%s: Failed to request gpio %d\n", __func__,
		       us_euro_sel_gpio);
		return ret;
	}

	ret = pm8xxx_gpio_config(us_euro_sel_gpio, &param);
	if (ret)
		pr_err("%s: Failed to configure gpio %d\n", __func__,
		       us_euro_sel_gpio);
	else

	gpio_direction_output(us_euro_sel_gpio, 0);

#else
	ret = gpio_request(80, "US_EURO_SWITCH");
	if (ret) {
		pr_err("%s: Failed to request gpio 80\n", __func__);
		return ret;
	}
	ret = gpio_direction_output(80, 0);
	if (ret) {
		pr_err("%s: Unable to set direction\n", __func__);
		gpio_free(80);
	}
#endif
/* ZTE_Audio_LCX_130325, lichaoxia, 2013-03-25, end */

	msm8930_headset_gpios_configured = 0;
	return 0;
}

static void msm8930_free_headset_mic_gpios(void)
{
	if (msm8930_headset_gpios_configured)

/* ZTE_Audio_LCX_130325, lichaoxia, 2013-03-25, start */
#if defined(CONFIG_US_EURO_SWITCH)
		gpio_free(us_euro_sel_gpio);
#else
		gpio_free(80);
#endif
/* ZTE_Audio_LCX_130325, lichaoxia, 2013-03-25, end */
}

static int __init msm8930_audio_init(void)
{
	int ret;

	if (!cpu_is_msm8930() && !cpu_is_msm8930aa() && !cpu_is_msm8627()) {
		pr_err("%s: Not the right machine type\n", __func__);
		return -ENODEV ;
	}
	mbhc_cfg.calibration = def_sitar_mbhc_cal();
	if (!mbhc_cfg.calibration) {
		pr_err("Calibration data allocation failed\n");
		return -ENOMEM;
	}

	msm8930_snd_device = platform_device_alloc("soc-audio", 0);
	if (!msm8930_snd_device) {
		pr_err("Platform device allocation failed\n");
		kfree(mbhc_cfg.calibration);
		return -ENOMEM;
	}

	platform_set_drvdata(msm8930_snd_device, &snd_soc_card_msm8930);
	ret = platform_device_add(msm8930_snd_device);
	if (ret) {
		platform_device_put(msm8930_snd_device);
		kfree(mbhc_cfg.calibration);
		return ret;
	}

	if (msm8930_configure_headset_mic_gpios()) {
		pr_err("%s Fail to configure headset mic gpios\n", __func__);
		msm8930_headset_gpios_configured = 0;
	} else
		msm8930_headset_gpios_configured = 1;

	atomic_set(&auxpcm_rsc_ref, 0);
	return ret;

}