Exemplo n.º 1
0
static void init_hw(void)
{
#ifndef CONFIG_S5PC110_DEMPSEY_BOARD
	gpio_direction_output(_3_GPIO_TOUCH_EN, 1);

#if !(defined(CONFIG_ARIES_NTT) || defined(CONFIG_S5PC110_DEMPSEY_BOARD))
	gpio_direction_output(_3_GPIO_TOUCH_CE, 1);
#endif
#else
	Set_MAX8998_PM_REG(ELDO13, 0);
	msleep(10);


	Set_MAX8998_PM_OUTPUT_Voltage(LDO13, VCC_3p200);	
	Set_MAX8998_PM_REG(ELDO13, 1);
	msleep(300);
#endif
	msleep(200);
	s3c_gpio_setpull(_3_GPIO_TOUCH_INT, S3C_GPIO_PULL_NONE);
#ifdef CONFIG_S5PC110_DEMPSEY_BOARD
	set_irq_type(IRQ_TOUCH_INT, IRQ_TYPE_EDGE_FALLING);
#else
	set_irq_type(IRQ_TOUCH_INT, IRQ_TYPE_LEVEL_LOW);
#endif
	s3c_gpio_cfgpin(_3_GPIO_TOUCH_INT, _3_GPIO_TOUCH_INT_AF);
}
Exemplo n.º 2
0
void fsa9480_s3c_udc_off(void)
{
    printk("[Psedo FSA9480]%s\n ", __func__);

    /*LDO control*/
	if(!Set_MAX8998_PM_REG(ELDO3, 0) || !Set_MAX8998_PM_REG(ELDO8, 0))
		printk("[Psedo FSA9480]%s : Fail to LDO OFF\n ", __func__);
}
Exemplo n.º 3
0
static void gp2a_chip_init(void)
{
	debug("%s called",__func__); 
	/*Enabling LD04 of MAX8998(PMIC) and setting it to 2.8V*/
	Set_MAX8998_PM_REG(ELDO4, 1);  	 // enable LDO4
	Set_MAX8998_PM_REG(LDO4, 0x0C);  // Set LDO4 voltage to 2.8V
	
	/*Enabling LDO16 of MAX8998(PMIC) and setting it to 3V*/
	Set_MAX8998_PM_REG(ELDO16, 1);    // enable LDO16
	Set_MAX8998_PM_REG(LDO16, 0x0E);  // Set LDO16 voltage to 3V
	
	/*After Power Supply is supplied, about 1ms delay is required before issuing read/write commands */
	mdelay(1);
}
Exemplo n.º 4
0
int __init s5p_tv_init(void)
{
	int ret;

	printk(banner);

	Set_MAX8998_PM_REG(ELDO3, 1);    //HDMI power on temp code 20100614 kyungrok
	Set_MAX8998_PM_REG(ELDO8, 1);

	ret = platform_driver_register(&s5p_tv_driver);

	if (ret) {
		printk(KERN_ERR "Platform Device Register Failed %d\n", ret);
		return -1;
	}

#ifdef CONFIG_PM
#ifdef CONFIG_HAS_EARLYSUSPEND
    register_early_suspend(&s5p_tv_early_suspend_desc);
#endif
#endif
	return 0;
}
Exemplo n.º 5
0
static void melfas_touchkey_early_suspend(struct early_suspend *h)
{
	touchkey_enable = 0;
	set_touchkey_debug('S');
	printk(KERN_DEBUG "melfas_touchkey_early_suspend\n");
	if (touchkey_enable < 0) {
		printk("---%s---touchkey_enable: %d\n", __FUNCTION__,
		       touchkey_enable);
		return;
	}

	disable_irq(IRQ_TOUCH_INT);
#ifndef CONFIG_S5PC110_DEMPSEY_BOARD
	gpio_direction_output(_3_GPIO_TOUCH_EN, 0);
#else
//	Set_MAX8998_PM_OUTPUT_Voltage(LDO13, VCC_2p800);	
	Set_MAX8998_PM_REG(ELDO13, 0);
#endif
#if !(defined(CONFIG_ARIES_NTT) || defined(CONFIG_S5PC110_DEMPSEY_BOARD))
	gpio_direction_output(_3_GPIO_TOUCH_CE, 0);
#endif
	gpio_direction_output(_3_TOUCH_SDA_28V, 0);
	gpio_direction_output(_3_TOUCH_SCL_28V, 0);
}
Exemplo n.º 6
0
static int cm3607_prox_probe( struct platform_device* pdev )
{	
	int ret=0;	
;
	
	/*misc device registration*/
    if( (ret = misc_register(&cm3607_misc_device)) < 0 )
    {
        error("cm3607_probe misc_register failed");
        goto ERR_MISC_REG; 	  	
    }
	
	/*Enabling LD016 of MAX8998(PMIC) and setting it to 2.8V*/
	Set_MAX8998_PM_REG(ELDO16, 1);  // enable LDO16
	Set_MAX8998_PM_REG(LDO16, 0x0C);  // Set LDO16 voltage to 2.8V
	
	/*Initialisation of GPIO_PS_OUT of proximity sensor*/
	s3c_gpio_cfgpin(GPIO_PS_OUT, S3C_GPIO_SFN(GPIO_PS_OUT_STATE));
	s3c_gpio_setpull(GPIO_PS_OUT, S3C_GPIO_PULL_NONE);

	/* Allocate driver_data */
	cm3607_data = kzalloc(sizeof(struct cm3607_prox_data),GFP_KERNEL);
	if(!cm3607_data)
	{
		error("kzalloc:allocating driver_data error");
		ret = -ENOMEM;
		goto ERR_MISC_REG;
	} 
	
	/*Input Device Settings*/
	cm3607_data->prox_input_dev = input_allocate_device();
	if (!cm3607_data->prox_input_dev) 
	{
        error("Not enough memory for cm3607_data->prox_input_dev");
        ret = -ENOMEM;
        goto ERR_INPUT_DEV;
    }
	cm3607_data->prox_input_dev->name = "proximity_cm3607";
	set_bit(EV_SYN,cm3607_data->prox_input_dev->evbit);
	set_bit(EV_ABS,cm3607_data->prox_input_dev->evbit);	
	input_set_abs_params(cm3607_data->prox_input_dev, ABS_DISTANCE, 0, 1, 0, 0);
	ret = input_register_device(cm3607_data->prox_input_dev);
    if (ret) 
	{
        error("Failed to register input device");
		input_free_device(cm3607_data->prox_input_dev);
        goto ERR_INPUT_REG;
    }
	debug("Input device settings complete");
	
	/* Workqueue Settings */
    cm3607_wq = create_singlethread_workqueue("cm3607_wq");
    if (!cm3607_wq)
	{
        error("Not enough memory for cm3607_wq");
        ret = -ENOMEM;
        goto ERR_INPUT_REG;
    }	     
    INIT_WORK(&cm3607_data->work_prox, cm3607_prox_work_func);
	debug("Workqueue settings complete");	
	
	/* Setting platform driver data */
	platform_set_drvdata(pdev, cm3607_data);

	cm3607_data->irq = -1;	
	set_irq_type(PROX_INT, IRQ_TYPE_EDGE_FALLING);	
	if( (ret = request_irq(PROX_INT, cm3607_irq_handler,IRQF_DISABLED , "proximity_int", NULL )) )
	{
        error("CM3607 request_irq failed IRQ_NO:%d", PROX_INT);
        goto ERR_INT_REQ;
	} 
	else
		debug("CM3607 request_irq success IRQ_NO:%d", PROX_INT);
	
	cm3607_data->irq = PROX_INT;
	
	/*GPIO_PS_EN Initialisation*/
	if (gpio_is_valid(GPIO_PS_EN)) 
	{
		if (gpio_request(GPIO_PS_EN, "GPJ3"))	
		{
			error("Failed to request GPIO_PS_EN");
			ret =-1;
			goto ERR_GPIO_REQ;
		}
		if(gpio_direction_output(GPIO_PS_EN, GPIO_LEVEL_LOW))
		{
			error("Failed to set output direction GPIO_PS_EN");
			ret=-1;
			goto ERR_GPIO_REQ;
		}		
	}
	else
	{
		error("GPIO_PS_EN is not valid");
		ret =-1;
		goto ERR_GPIO_REQ;
	}
	/*Setting CM3607 proximity sensor in normal operation mode*/
	proximity_mode(1);

	/*Pulling the Interrupt Pin High*/
	s3c_gpio_setpull(GPIO_PS_OUT, S3C_GPIO_PULL_UP);		
	debug("gpio_get_value of GPIO_PS_OUT is %d",gpio_get_value(GPIO_PS_OUT));   //test			
	
	input_report_abs(cm3607_data->prox_input_dev,ABS_DISTANCE,gpio_get_value(GPIO_PS_OUT));
	input_sync(cm3607_data->prox_input_dev);
	mdelay(1);
;
	
	//TEST
	if (device_create_file(cm3607_misc_device.this_device, &dev_attr_prox_value) < 0)
		error("Failed to create device file %s \n", dev_attr_prox_value.attr.name);
	
	return ret;
ERR_GPIO_REQ:	
ERR_INT_REQ:
    destroy_workqueue(cm3607_wq);
	input_unregister_device(cm3607_data->prox_input_dev);
ERR_INPUT_REG:
ERR_INPUT_DEV:
	kfree(cm3607_data);
ERR_MISC_REG:
	return ret;
}