Ejemplo n.º 1
0
int s5p_hpd_set_hdmiint(void)
{
	/* EINT -> HDMI */

	set_irq_type(IRQ_EINT13, IRQ_TYPE_NONE);

	if (last_hpd_state)
		s5p_hdmi_disable_interrupts(HDMI_IRQ_HPD_UNPLUG);
	else
		s5p_hdmi_disable_interrupts(HDMI_IRQ_HPD_PLUG);

	atomic_set(&hdmi_status, HDMI_ON);

	s3c_gpio_cfgpin(S5PV210_GPH1(5), S3C_GPIO_SFN(0x4));
	s3c_gpio_setpull(S5PV210_GPH1(5), S3C_GPIO_PULL_DOWN);
	writel(readl(S5PV210_GPH1DRV)|0x3<<10, S5PV210_GPH1DRV);

	s5p_hdmi_hpd_gen();

#ifdef CONFIG_MACH_MANGO210_EVT0
	if (!s5p_hdmi_get_hpd_status())
#else
	if (s5p_hdmi_get_hpd_status())
#endif
		s5p_hdmi_enable_interrupts(HDMI_IRQ_HPD_UNPLUG);
	else
		s5p_hdmi_enable_interrupts(HDMI_IRQ_HPD_PLUG);

	return 0;
}
Ejemplo n.º 2
0
int s5p_hpd_set_hdmiint(void)
{
	/* EINT -> HDMI */

	set_irq_type(IRQ_EINT13, IRQ_TYPE_NONE);

	if (last_hpd_state)
		s5p_hdmi_disable_interrupts(HDMI_IRQ_HPD_UNPLUG);
	else
		s5p_hdmi_disable_interrupts(HDMI_IRQ_HPD_PLUG);

	atomic_set(&hdmi_status, HDMI_ON);

	s3c_gpio_cfgpin(S5PV210_GPH1(5), S5PV210_GPH1_5_HDMI_HPD);
	s3c_gpio_setpull(S5PV210_GPH1(5), S3C_GPIO_PULL_DOWN);
	s3c_gpio_set_drvstrength(S5PV210_GPH1(5), S3C_GPIO_DRVSTR_4X);

	s5p_hdmi_hpd_gen();

	if (s5p_hdmi_get_hpd_status())
		s5p_hdmi_enable_interrupts(HDMI_IRQ_HPD_UNPLUG);
	else{
		s5p_hdmi_enable_interrupts(HDMI_IRQ_HPD_PLUG);
	printk("\n++ %d",__LINE__);
	}
	return 0;
}
Ejemplo n.º 3
0
static int __init s5p_cec_probe(struct platform_device *pdev)
{
	u8 *buffer;
	int irq_num;
	int ret;

	s3c_gpio_cfgpin(S5PV210_GPH1(4), S3C_GPIO_SFN(0x4));
	s3c_gpio_setpull(S5PV210_GPH1(4), S3C_GPIO_PULL_NONE);

	/* get ioremap addr */
	__s5p_cec_probe(pdev);

	if (misc_register(&cec_misc_device)) {
		printk(KERN_WARNING " Couldn't register device 10, %d.\n",
			CEC_MINOR);
		return -EBUSY;
	}

	irq_num = platform_get_irq(pdev, 0);
	if (irq_num < 0) {
		printk(KERN_ERR  "failed to get %s irq resource\n", "cec");
		ret = -ENOENT;
		return ret;
	}

	ret = request_irq(irq_num, s5p_cec_irq_handler, IRQF_DISABLED,
		pdev->name, &pdev->id);
	if (ret != 0) {
		printk(KERN_ERR  "failed to install %s irq (%d)\n", "cec", ret);
		return ret;
	}


	init_waitqueue_head(&cec_rx_struct.waitq);
	spin_lock_init(&cec_rx_struct.lock);
	init_waitqueue_head(&cec_tx_struct.waitq);

	buffer = kmalloc(CEC_TX_BUFF_SIZE, GFP_KERNEL);

	if (!buffer) {
		printk(KERN_ERR " kmalloc() failed!\n");
		misc_deregister(&cec_misc_device);
		return -EIO;
	}

	cec_rx_struct.buffer = buffer;

	cec_rx_struct.size   = 0;

	return 0;
}
Ejemplo n.º 4
0
/* Set for MIPI-CSI Camera module Power Enable */
static int mini210_mipi_cam_pwr_en(int enabled)
{
	int err;

	err = gpio_request(S5PV210_GPH1(2), "GPH1");
	if (err)
		printk(KERN_ERR "#### failed to request(GPH1)for CAM_2V8\n");

	s3c_gpio_setpull(S5PV210_GPH1(2), S3C_GPIO_PULL_NONE);
	gpio_direction_output(S5PV210_GPH1(2), enabled);
	gpio_free(S5PV210_GPH1(2));

	return 0;
}
Ejemplo n.º 5
0
static int smdkv210_mipi_cam_power(int onoff)
{
	int err;

	/* added for V210 CAM power */
	err = gpio_request(S5PV210_GPH1(2), "GPH1");
	if (err)
		printk(KERN_ERR "#### failed to request(GPH1)for CAM_2V8\n");

	s3c_gpio_setpull(S5PV210_GPH1(2), S3C_GPIO_PULL_NONE);
	gpio_direction_output(S5PV210_GPH1(2), onoff);
	gpio_free(S5PV210_GPH1(2));

	return 0;
}
Ejemplo n.º 6
0
static int irq_eint(int irq)
{
	if (gpio_get_value(S5PV210_GPH1(5))) {
		if (g_last_hpd_state == HPD_HI)
			return IRQ_HANDLED;
		atomic_set(&g_hpd_struct.state, HPD_HI);
		atomic_set(&g_poll_state, 1);

		g_last_hpd_state = HPD_HI;
		wake_up_interruptible(&g_hpd_struct.waitq);
	} else {
		if (g_last_hpd_state == HPD_LO)
			return IRQ_HANDLED;
		atomic_set(&g_hpd_struct.state, HPD_LO);
		atomic_set(&g_poll_state, 1);

		g_last_hpd_state = HPD_LO;
		wake_up_interruptible(&g_hpd_struct.waitq);
	}

	schedule_work(&g_hpd_work);

	HPDIFPRINTK("%s\n", atomic_read(&g_hpd_struct.state) == HPD_HI ?
		"HPD HI" : "HPD LO");

	return IRQ_HANDLED;
}
Ejemplo n.º 7
0
int irq_eint(int irq)
{
	if (gpio_get_value(S5PV210_GPH1(5))) {
		atomic_set(&hpd_struct.state, HPD_HI);
		atomic_set(&poll_state, 1);

		last_hpd_state = HPD_HI;
		wake_up_interruptible(&hpd_struct.waitq);
	} else {
		atomic_set(&hpd_struct.state, HPD_LO);
		atomic_set(&poll_state, 1);

		last_hpd_state = HPD_LO;
		wake_up_interruptible(&hpd_struct.waitq);
	}

	if (atomic_read(&hpd_struct.state))
		set_irq_type(IRQ_EINT13, IRQ_TYPE_EDGE_FALLING);
	else
		set_irq_type(IRQ_EINT13, IRQ_TYPE_EDGE_RISING);

	schedule_work(&hpd_work);

	HPDIFPRINTK("%s\n", atomic_read(&hpd_struct.state) == HPD_HI ?
		"HPD HI" : "HPD LO");

	return IRQ_HANDLED;

}
Ejemplo n.º 8
0
irqreturn_t s5p_hpd_irq_handler(int irq)
{
	int ret = IRQ_HANDLED;
	unsigned long flags;

	spin_lock_irqsave(&hpd_struct.lock, flags);

	if (gpio_get_value(S5PV210_GPH1(5))) {

		if (irq_event == EVENT_FALLING) {
			mod_timer(&hpd_irq_check_timer, jiffies + HZ/20);
		}
		irq_event = EVENT_RISING;
	} else {
		irq_event =  EVENT_FALLING;
		del_timer(&hpd_irq_check_timer);
	}

	/* check HDMI status */
	if (atomic_read(&hdmi_status)) {
		/* HDMI on */
		ret = irq_hdmi(irq);
		HPDIFPRINTK("HDMI HPD interrupt\n");
	} else {
		/* HDMI off */
		ret = irq_eint(irq);
		HPDIFPRINTK("EINT HPD interrupt\n");
	}

	spin_unlock_irqrestore(&hpd_struct.lock, flags);

	return ret;
}
Ejemplo n.º 9
0
int s5p_hpd_set_eint(void)
{
	/* HDMI -> EINT */
	atomic_set(&hdmi_status, HDMI_OFF);

	s5p_hdmi_clear_pending(HDMI_IRQ_HPD_PLUG);
	s5p_hdmi_clear_pending(HDMI_IRQ_HPD_UNPLUG);

	s5p_hdmi_disable_interrupts(HDMI_IRQ_HPD_PLUG);
	s5p_hdmi_disable_interrupts(HDMI_IRQ_HPD_UNPLUG);

	s3c_gpio_cfgpin(S5PV210_GPH1(5), S3C_GPIO_SFN(0xf));
	s3c_gpio_setpull(S5PV210_GPH1(5), S3C_GPIO_PULL_DOWN);
	writel(readl(S5PV210_GPH1DRV)|0x3<<10, S5PV210_GPH1DRV);

	return 0;
}
Ejemplo n.º 10
0
static int __init s5p_hpd_probe(struct platform_device *pdev)
{
	if (misc_register(&hpd_misc_device)) {
		pr_err("%s::Couldn't register device 10, %d.\n", __func__,
			HPD_MINOR);
		return -EBUSY;
	}

	init_waitqueue_head(&g_hpd_struct.waitq);

	spin_lock_init(&g_hpd_struct.lock);

	atomic_set(&g_hpd_struct.state, -1);

	atomic_set(&g_hdmi_status, HDMI_OFF);

	s3c_gpio_cfgpin(S5PV210_GPH1(5), S3C_GPIO_SFN(0xf));
	s3c_gpio_setpull(S5PV210_GPH1(5), S3C_GPIO_PULL_DOWN);
	writel(readl(S5PV210_GPH1DRV)|0x3<<10, S5PV210_GPH1DRV);

	if (gpio_get_value(S5PV210_GPH1(5))) {
		atomic_set(&g_hpd_struct.state, HPD_HI);
		g_last_hpd_state = HPD_HI;
	} else {
		atomic_set(&g_hpd_struct.state, HPD_LO);
		g_last_hpd_state = HPD_LO;
	}

	set_irq_type(IRQ_EINT13, IRQ_TYPE_EDGE_BOTH);

	if (request_irq(IRQ_EINT13, s5p_hpd_irq_handler, IRQF_DISABLED,
		"hpd", s5p_hpd_irq_handler)) {
		pr_err("%s::failed to install %s irq\n", __func__, "hpd");
		misc_deregister(&hpd_misc_device);
		return -EIO;
	}

	if (s5p_hdmi_register_isr(s5p_hpd_irq_handler, (u8)HDMI_IRQ_HPD_PLUG) != 0)
		pr_err("%s::s5p_hdmi_register_isr(HDMI_IRQ_HPD_PLUG) fail\n", __func__);

	if (s5p_hdmi_register_isr(s5p_hpd_irq_handler, (u8)HDMI_IRQ_HPD_UNPLUG) != 0)
		pr_err("%s::s5p_hdmi_register_isr(HDMI_IRQ_HPD_UNPLUG) fail\n", __func__);

	return 0;
}
Ejemplo n.º 11
0
static int __init s5p_hpd_probe(struct platform_device *pdev)
{
	if (misc_register(&hpd_misc_device)) {
		printk(KERN_WARNING " Couldn't register device 10, %d.\n",
			HPD_MINOR);
		return -EBUSY;
	}

	init_waitqueue_head(&hpd_struct.waitq);

	spin_lock_init(&hpd_struct.lock);

	atomic_set(&hpd_struct.state, -1);

	atomic_set(&hdmi_status, HDMI_OFF);

	s3c_gpio_cfgpin(S5PV210_GPH1(5), S5PV210_GPH1_5_EXT_INT31_5);
	s3c_gpio_setpull(S5PV210_GPH1(5), S3C_GPIO_PULL_DOWN);
	s3c_gpio_set_drvstrength(S5PV210_GPH1(5), S3C_GPIO_DRVSTR_4X);

	if (gpio_get_value(S5PV210_GPH1(5))) {
		atomic_set(&hpd_struct.state, HPD_HI);
		last_hpd_state = HPD_HI;
		irq_event = EVENT_RISING;
	} else {
		atomic_set(&hpd_struct.state, HPD_LO);
		last_hpd_state = HPD_LO;
		irq_event = EVENT_FALLING;
	}

	set_irq_type(IRQ_EINT13, IRQ_TYPE_EDGE_BOTH);

	if (request_irq(IRQ_EINT13, s5p_hpd_irq_handler, IRQF_DISABLED,
		"hpd", s5p_hpd_irq_handler)) {
		printk(KERN_ERR  "failed to install %s irq\n", "hpd");
		misc_deregister(&hpd_misc_device);
		return -EIO;
	}

	s5p_hdmi_register_isr((void *) s5p_hpd_irq_handler, (u8)HDMI_IRQ_HPD_PLUG);
	s5p_hdmi_register_isr((void *) s5p_hpd_irq_handler, (u8)HDMI_IRQ_HPD_UNPLUG);

	return 0;
}
Ejemplo n.º 12
0
int s5p_hpd_open(struct inode *inode, struct file *file)
{
#ifdef USEEXTINT
#else
	/* adjust the duration of HPD detection */
	s5p_tv_clk_gate(true);
	hdmi_on = true;

	s5p_hdmi_hpd_gen();

	s3c_gpio_cfgpin(S5PV210_GPH1(5), S3C_GPIO_SFN(0x4));
	s3c_gpio_setpull(S5PV210_GPH1(5), S3C_GPIO_PULL_UP);
	
	s5p_hdmi_enable_interrupts(HDMI_IRQ_HPD_PLUG);
	s5p_hdmi_enable_interrupts(HDMI_IRQ_HPD_UNPLUG);
#endif
	
	
	return 0;
}
Ejemplo n.º 13
0
static void hpd_irq_check_timer_func(unsigned long dummy)
{
	unsigned long flags;

	//printk("[TVOUT][%s:called]\n",__func__);
	
	if (irq_event ==EVENT_RISING && !gpio_get_value(S5PV210_GPH1(5))) {
		printk("[TVOUT][%s:re-call irq handler]\n",__func__);
		//local_irq_save(flags);
		s5p_hpd_irq_handler(IRQ_EINT13);
		//local_irq_restore(flags);
	}
}
Ejemplo n.º 14
0
static int __init s5p_hpd_probe(struct platform_device *pdev)
{
	if (misc_register(&hpd_misc_device)) {
		printk(KERN_WARNING " Couldn't register device 10, %d.\n", HPD_MINOR);
		return -EBUSY;
	}

	init_waitqueue_head(&hpd_struct.waitq);

	spin_lock_init(&hpd_struct.lock);

	atomic_set(&hpd_struct.state, -1);

#ifdef USEEXTINT
	s3c_gpio_cfgpin(S5PV210_GPH1(5), S3C_GPIO_SFN(0xf));
	s3c_gpio_setpull(S5PV210_GPH1(5), S3C_GPIO_PULL_UP);

	if (gpio_get_value(S5PV210_GPH1(5)))
		atomic_set(&hpd_struct.state, HPD_HI);
	else
		atomic_set(&hpd_struct.state, HPD_LO);

	set_irq_type(IRQ_EINT13, IRQ_TYPE_EDGE_BOTH);

	if (request_irq(IRQ_EINT13, s5p_hpd_irq_handler, IRQF_DISABLED, "hpd", s5p_hpd_irq_handler)){
		printk(KERN_ERR  "failed to install %s irq\n", "hpd");
		misc_deregister(&hpd_misc_device);
		return -EIO;
	}

#else
	/* must be checked */
	s5p_hdmi_register_isr(s5p_hpd_irq_handler, (u8)HDMI_IRQ_HPD_PLUG);
	s5p_hdmi_register_isr(s5p_hpd_irq_handler, (u8)HDMI_IRQ_HPD_UNPLUG);	
#endif

	return 0;
}
Ejemplo n.º 15
0
int s5p_hpd_set_eint(void)
{
	/* HDMI -> EINT */
	atomic_set(&hdmi_status, HDMI_OFF);

	s5p_hdmi_clear_pending(HDMI_IRQ_HPD_PLUG);
	s5p_hdmi_clear_pending(HDMI_IRQ_HPD_UNPLUG);

	s5p_hdmi_disable_interrupts(HDMI_IRQ_HPD_PLUG);
	s5p_hdmi_disable_interrupts(HDMI_IRQ_HPD_UNPLUG);

	s3c_gpio_cfgpin(S5PV210_GPH1(5), S5PV210_GPH1_5_EXT_INT31_5);
	s3c_gpio_setpull(S5PV210_GPH1(5), S3C_GPIO_PULL_DOWN);
	if (s5p_hpd_get_state())
		set_irq_type(IRQ_EINT13, IRQ_TYPE_EDGE_FALLING);
	else
		set_irq_type(IRQ_EINT13, IRQ_TYPE_EDGE_RISING);
	
	s3c_gpio_set_drvstrength(S5PV210_GPH1(5), S3C_GPIO_DRVSTR_4X);
	
	printk("\n++ s5p_hpd_set_eint\n"); 
	return 0;
}
Ejemplo n.º 16
0
static void gpiokeys_init(void)
{
	s3c_gpio_cfgpin(S5PV210_GPH3(4), S3C_GPIO_SFN(0xf));
	set_irq_type(IRQ_EINT(28), IRQ_TYPE_LEVEL_LOW);

	s3c_gpio_cfgpin(S5PV210_GPH3(3), S3C_GPIO_SFN(0xf));
	set_irq_type(IRQ_EINT(27), IRQ_TYPE_LEVEL_LOW);

	
	//add by luis
	s3c_gpio_cfgpin(S5PV210_GPH1(2), S3C_GPIO_SFN(0xf));
	set_irq_type(IRQ_EINT(10), IRQ_TYPE_LEVEL_LOW);

	s3c_gpio_cfgpin(S5PV210_GPH3(1), S3C_GPIO_SFN(0xf));
	set_irq_type(IRQ_EINT(25), IRQ_TYPE_LEVEL_LOW);

	s3c_gpio_cfgpin(S5PV210_GPH3(6), S3C_GPIO_SFN(0xf));
	set_irq_type(IRQ_EINT(30), IRQ_TYPE_LEVEL_LOW);

	s3c_gpio_cfgpin(S5PV210_GPH3(5), S3C_GPIO_SFN(0xf));
	set_irq_type(IRQ_EINT(29), IRQ_TYPE_LEVEL_LOW);

	//add by luis
}
Ejemplo n.º 17
0
int irq_eint(int irq)
{
// by pjlee : Interrupt Signal Change
#ifdef CONFIG_MACH_MANGO210_EVT0
	if (!gpio_get_value(S5PV210_GPH1(5))) {
#else
	if (gpio_get_value(S5PV210_GPH1(5))) {
#endif
		if(last_hpd_state == HPD_HI)
			return;
		atomic_set(&hpd_struct.state, HPD_HI);
		atomic_set(&poll_state, 1);

		last_hpd_state = HPD_HI;
		wake_up_interruptible(&hpd_struct.waitq);
	} else {
		if(last_hpd_state == HPD_LO)
			return;
		atomic_set(&hpd_struct.state, HPD_LO);
		atomic_set(&poll_state, 1);

		last_hpd_state = HPD_LO;
		wake_up_interruptible(&hpd_struct.waitq);
	}

	schedule_work(&hpd_work);

	HPDIFPRINTK("%s\n", atomic_read(&hpd_struct.state) == HPD_HI ?
		"HPD HI" : "HPD LO");

	return IRQ_HANDLED;

}

int irq_hdmi(int irq)
{
	u8 flag;
	int ret = IRQ_HANDLED;

	/* read flag register */
	flag = s5p_hdmi_get_interrupts();

#ifdef CONFIG_MACH_MANGO210_EVT0
	if (!s5p_hdmi_get_hpd_status())
#else
	if (s5p_hdmi_get_hpd_status())
#endif
		s5p_hdmi_clear_pending(HDMI_IRQ_HPD_PLUG);

	else
		s5p_hdmi_clear_pending(HDMI_IRQ_HPD_UNPLUG);

	s5p_hdmi_disable_interrupts(HDMI_IRQ_HPD_UNPLUG);
	s5p_hdmi_disable_interrupts(HDMI_IRQ_HPD_PLUG);


	/* is this our interrupt? */

	if (!(flag & (1 << HDMI_IRQ_HPD_PLUG | 1 << HDMI_IRQ_HPD_UNPLUG))) {
		ret = IRQ_NONE;
		goto out;
	}

	if (flag == (1 << HDMI_IRQ_HPD_PLUG | 1 << HDMI_IRQ_HPD_UNPLUG)) {

		HPDIFPRINTK("HPD_HI && HPD_LO\n");

#ifdef CONFIG_MACH_MANGO210_EVT0
		if (last_hpd_state == HPD_HI && !s5p_hdmi_get_hpd_status())
#else
		if (last_hpd_state == HPD_HI && s5p_hdmi_get_hpd_status())
#endif
			flag = 1 << HDMI_IRQ_HPD_UNPLUG;
		else
			flag = 1 << HDMI_IRQ_HPD_PLUG;
	}

	if (flag & (1 << HDMI_IRQ_HPD_PLUG)) {

		s5p_hdmi_enable_interrupts(HDMI_IRQ_HPD_UNPLUG);

		atomic_set(&hpd_struct.state, HPD_HI);
		atomic_set(&poll_state, 1);

		last_hpd_state = HPD_HI;
		wake_up_interruptible(&hpd_struct.waitq);

		s5p_hdcp_encrypt_stop(true);

		HPDIFPRINTK("HPD_HI\n");

	} else if (flag & (1 << HDMI_IRQ_HPD_UNPLUG)) {

		s5p_hdcp_encrypt_stop(false);

		s5p_hdmi_enable_interrupts(HDMI_IRQ_HPD_PLUG);

		atomic_set(&hpd_struct.state, HPD_LO);
		atomic_set(&poll_state, 1);

		last_hpd_state = HPD_LO;
		wake_up_interruptible(&hpd_struct.waitq);

		HPDIFPRINTK("HPD_LO\n");
	}

	schedule_work(&hpd_work);

out:
	return IRQ_HANDLED;
}
Ejemplo n.º 18
0
#endif
#ifdef CONFIG_S3C_DEV_HSMMC2
static struct s3c_sdhci_platdata smdkc110_hsmmc2_pdata __initdata = {
	.cd_type		= S3C_SDHCI_CD_INTERNAL,
	.wp_gpio		= S5PV210_GPH3(1),
	.has_wp_gpio		= true,
#if defined(CONFIG_S5PV210_SD_CH2_8BIT)
	.max_width		= 8,
	.host_caps		= MMC_CAP_8_BIT_DATA,
#endif
};
#endif
#ifdef CONFIG_S3C_DEV_HSMMC3
static struct s3c_sdhci_platdata smdkc110_hsmmc3_pdata __initdata = {
	.cd_type		= S3C_SDHCI_CD_INTERNAL,
	.wp_gpio		= S5PV210_GPH1(0),
	.has_wp_gpio		= true,
};
#endif

static int __init smdkc110_bl_init(struct device *dev)
{
    s3c_gpio_cfgpin(S5PV210_GPD0(3), S3C_GPIO_SFN(2));
    return 0;
}

static struct platform_pwm_backlight_data smdkc110_backlight_data = {
        .pwm_id         = 3,
        .max_brightness = 1000,
        .dft_brightness = 600,
        .pwm_period_ns  = 1000000000 / (1000 * 20),
Ejemplo n.º 19
0
	} else {
		printk(KERN_ERR "no memory for ADC platform data\n");
	}
}
#endif /* CONFIG_S5P_ADC */

/******************************************************************************
 * gpio keypad
 ******************************************************************************/

//#ifdef CONFIG_KEYBOARD_GPIO
#include <linux/input.h>
#include <linux/gpio_keys.h>
static struct gpio_keys_button gpio_buttons[] = {
	{
		.gpio		= S5PV210_GPH1(0),
		.code		= KEY_POWER,
		.desc		= "POWER",
		.active_low	= 1,
		.wakeup		= 1,
		.debounce_interval = 5,
		.can_disable = 1,
	},	

};

static struct gpio_keys_platform_data gpio_button_data = {
	.buttons	= gpio_buttons,
	.nbuttons	= ARRAY_SIZE(gpio_buttons),
};
Ejemplo n.º 20
0
	{
		.code	= GPIO_KEY_VOLUP, 
		.gpio	= S5PV210_GPH3(4),
		.desc	= "Volume up button", 
		.type	= EV_KEY,
		.active_low	= 1,
		.debounce_interval	= 10,
		.timer_interval	= 10,
		.longpress_time = 2000,
		.key_status = "volup_key_status",
	},

	//add by luis
	{	//key map define in framework /system/usr/keylayout/s3c-keypad.kl
		.code = 5,
		.gpio	= S5PV210_GPH1(2),
		.desc	= "Serch button", 
		.type	= EV_KEY,
		.active_low	= 1,
		.debounce_interval	= 10,
		.timer_interval	= 50,
		.longpress_time = 1900,
		.key_status = "serch_key_status",
	},

		{
		.code = 34,
		.gpio	= S5PV210_GPH3(1),
		.desc	= "Back button", 
		.type	= EV_KEY,
		.active_low	= 1,
Ejemplo n.º 21
0
/*
 * HPD interrupt handler
 *
 * Handles interrupt requests from HPD hardware.
 * Handler changes value of internal variable and notifies waiting thread.
 */
irqreturn_t s5p_hpd_irq_handler(int irq, void *pw)
{
#ifdef USEEXTINT
	spin_lock_irq(&hpd_struct.lock);

	if (gpio_get_value(S5PV210_GPH1(5))) {
		if (atomic_read(&hpd_struct.state) == HPD_HI)
			goto out;
		atomic_set(&hpd_struct.state, HPD_HI);
	} else {
		if (atomic_read(&hpd_struct.state) == HPD_LO)
			goto out;
		atomic_set(&hpd_struct.state, HPD_LO);
	}
	
	if(atomic_read(&hpd_struct.state)){
		set_irq_type(IRQ_EINT13, IRQ_TYPE_LEVEL_LOW);
	}else{
		set_irq_type(IRQ_EINT13, IRQ_TYPE_LEVEL_HIGH);
	}

	/* Send UEvent for HPD - added by jyg1004 */
	schedule_work(&hpd_work);

	spin_unlock_irq(&hpd_struct.lock);

	HPDIFPRINTK("hpd_status = %d\n", atomic_read(&hpd_struct.state));
	return IRQ_HANDLED;
out:
	spin_unlock_irq(&hpd_struct.lock);

	return IRQ_HANDLED;
#else
	u8 flag;
	int ret = IRQ_HANDLED;
	
	/* read flag register */
	flag = s5p_hdmi_get_interrupts();

	/* is this our interrupt? */

	if (!(flag & (1 << HDMI_IRQ_HPD_PLUG | 1 << HDMI_IRQ_HPD_UNPLUG))) {
		ret = IRQ_NONE;
		goto out;
	}

	/* workaround: ignore HPD IRQ caused by reseting HDCP engine */
	if (s5p_hdmi_get_swhpd_status()) {
		s5p_hdmi_swhpd_disable();
		/* clear pending bit */
		s5p_hdmi_clear_pending(HDMI_IRQ_HPD_UNPLUG);
		s5p_hdmi_clear_pending(HDMI_IRQ_HPD_PLUG);
		ret = IRQ_HANDLED;
		goto out;
	}

	if (flag == (1 << HDMI_IRQ_HPD_PLUG | 1 << HDMI_IRQ_HPD_UNPLUG)) {
		HPDIFPRINTK("HPD_HI && HPD_LO\n");

		if (last_hpd_state == HPD_HI && s5p_hdmi_get_hpd_status())
			//if ( last_hpd_state == HPD_HI )
			flag = 1 << HDMI_IRQ_HPD_UNPLUG;
		else
			flag = 1 << HDMI_IRQ_HPD_PLUG;
	}

	if (flag & (1 << HDMI_IRQ_HPD_PLUG)) {
		HPDIFPRINTK("HPD_HI\n");
		/* clear pending bit */
		s5p_hdmi_clear_pending(HDMI_IRQ_HPD_PLUG);
		s5p_hdmi_clear_pending(HDMI_IRQ_HPD_UNPLUG);
		atomic_set(&hpd_struct.state, HPD_HI);
		// workaround: enable HDMI_IRQ_HPD_UNPLUG interrupt
		s5p_hdmi_disable_interrupts(HDMI_IRQ_HPD_PLUG);
		s5p_hdmi_enable_interrupts(HDMI_IRQ_HPD_UNPLUG);		
		last_hpd_state = HPD_HI;
		wake_up_interruptible(&hpd_struct.waitq);
	} else if (flag & (1 << HDMI_IRQ_HPD_UNPLUG)) {
		HPDIFPRINTK("HPD_LO\n");
		/* clear pending bit */
		s5p_hdmi_clear_pending(HDMI_IRQ_HPD_PLUG);
		s5p_hdmi_clear_pending(HDMI_IRQ_HPD_UNPLUG);
		atomic_set(&hpd_struct.state, HPD_LO);
		// workaround: disable HDMI_IRQ_HPD_UNPLUG interrupt
		last_hpd_state = HPD_LO;
		s5p_hdmi_disable_interrupts(HDMI_IRQ_HPD_UNPLUG);
		s5p_hdmi_enable_interrupts(HDMI_IRQ_HPD_PLUG);
		wake_up_interruptible(&hpd_struct.waitq);
	}

out:
	return IRQ_HANDLED;

#endif
}
Ejemplo n.º 22
0
static int ams397g201_probe(struct device *dev)
{
    int ret = 0;
    struct regulator *r_lcd_1_8v, *r_lcd_3_0v, *r_lcd_1_1v;

   lcd.bl_dev =backlight_device_register("s5p_bl",dev,&lcd,&s5p_bl_ops, NULL);
   lcd.bl_dev->props.max_brightness = 255;
   
   SetLDIEnabledFlag(1);

   //For ESD test panel error
   setup_timer(&polling_timer, polling_ESD_timer_func, 0);
   mod_timer(&polling_timer,
   	jiffies + msecs_to_jiffies(5000));


#ifdef GAMMASET_CONTROL //for 1.9/2.2 gamma control from platform
	gammaset_class = class_create(THIS_MODULE, "gammaset");
	if (IS_ERR(gammaset_class))
		pr_err("Failed to create class(gammaset_class)!\n");

	switch_gammaset_dev = device_create(gammaset_class, NULL, 0, NULL, "switch_gammaset");
	if (IS_ERR(switch_gammaset_dev))
		pr_err("Failed to create device(switch_gammaset_dev)!\n");

	if (device_create_file(switch_gammaset_dev, &dev_attr_gammaset_file_cmd) < 0)
		pr_err("Failed to create device file(%s)!\n", dev_attr_gammaset_file_cmd.attr.name);

	if (device_create_file(switch_gammaset_dev, &dev_attr_lcd_update) < 0)
		pr_err("Failed to create device file(%s)!\n", dev_attr_lcd_update);

#endif

#ifdef ACL_ENABLE //ACL On,Off
	acl_class = class_create(THIS_MODULE, "aclset");
	if (IS_ERR(acl_class))
		pr_err("Failed to create class(acl_class)!\n");

	switch_aclset_dev = device_create(acl_class, NULL, 0, NULL, "switch_aclset");
	if (IS_ERR(switch_aclset_dev))
		pr_err("Failed to create device(switch_aclset_dev)!\n");

	if (device_create_file(switch_aclset_dev, &dev_attr_aclset_file_cmd) < 0)
		pr_err("Failed to create device file(%s)!\n", dev_attr_aclset_file_cmd.attr.name);
#endif   

   
#if 1		
        //TE interrupt pin ( GPF0_1 /GPF0_INT[1] ) enable filter
        s3c_gpio_int_flt(S5PV210_GPA0(0),1);
#define IRQ_TE_INT (IRQ_EINT_GROUP10_BASE+1) /* F0_1 */
	/* irq for TE signal *///sehun_test
	if (request_irq(/*S3C_GPIOINT(F0,1)*/IRQ_TE_INT, ams397g201_te_interrupt, IRQF_TRIGGER_RISING | IRQF_SHARED,
		    "te_signal", dev)) {
		dev_err(dev, "request_irq failed.\n");
		goto err_te_irq;
	}	

	#if 1
		/* irq for ESD signal */
		s3c_gpio_cfgpin(S5PV210_GPH1(2), S3C_GPIO_SFN(0xFF));
		s3c_gpio_setpull(S5PV210_GPH1(2), S3C_GPIO_PULL_UP);

		set_irq_type(LCD_ESD_INT, IRQ_TYPE_EDGE_RISING);
	        if( (ret = request_irq(LCD_ESD_INT, ams397g201_esd_irq_handler,IRQF_DISABLED , "LCD_ESD", NULL)) < 0 )
	        {
	            printk("%s, request_irq failed %d, ret= %d\n",__FUNCTION__, LCD_ESD_INT, ret );
	        }

		 disable_irq( LCD_ESD_INT);
		 mdelay(10);
		 //enable_irq( LCD_ESD_INT);
	 #endif
#endif
	r_lcd_1_8v = regulator_get(dev, "vlcd");
	if (IS_ERR(r_lcd_1_8v)) {
		dev_err(dev, "failed to get regulator vlcd.\n");
		return -EINVAL;
	}

	r_lcd_1_1v = regulator_get(dev, "VMIPI_1.8V");
	if (IS_ERR(r_lcd_1_1v)) {
		dev_err(dev, "failed to get regulator VMIPI_1.8V.\n");
		return -EINVAL;
	}

	regulator_enable(r_lcd_1_1v);

	r_lcd_1_1v = regulator_get(dev, "VMIPI_1.1V");
	if (IS_ERR(r_lcd_1_1v)) {
		dev_err(dev, "failed to get regulator VMIPI_1.1V.\n");
		return -EINVAL;
	}
	regulator_enable(r_lcd_1_1v);

#if 0
	ret = regulator_set_voltage(r_lcd_1_8v, 1800000, 1800000);
	if(ret != 0) {
		printk(KERN_ERR "%s: Cannot set VLCD_1.8V\n", __func__);
		return -EINVAL;
	}

	ret = regulator_enable(r_lcd_1_8v);
	if (ret < 0) {
		printk(KERN_ERR "failed to enable regulator VLCD_1_8v.\n");
		return ret;
	}
#endif
	r_lcd_3_0v = regulator_get(dev, "vcc_lcd");
	if (IS_ERR(r_lcd_3_0v)) {
		dev_err(dev, "failed to get regulator vcc_lcd.\n");
		return -EINVAL;
	}

#if 0
	ret = regulator_set_voltage(r_lcd_3_0v, 3000000, 3000000);
	if(ret != 0) {
		printk(KERN_ERR "%s: Cannot set VLCD_3.0V\n", __func__);
		return -EINVAL;
	}

	ret = regulator_enable(r_lcd_3_0v);
	if (ret < 0) {
		printk(KERN_ERR "failed to enable regulator VLCD_3_0v.\n");
		return ret;
	}
#endif
#if 0 //@@
	/* lcd power on */
	if (ddi_pd->lcd_power_on)
		ddi_pd->lcd_power_on((void *) dev, 1);
	else
		dev_warn(dev, "lcd_power_on func is null.\n");

	mdelay(60);

	/* lcd reset */
	if (ddi_pd->lcd_reset)
		ddi_pd->lcd_reset();
	else
		dev_warn(dev, "lcd_reset func is null.\n");
#endif
	dev_info(dev, "ams397g201 lcd panel driver based on mipi-dsi has been probed.\n");

err_te_irq:

	return 0;
}
Ejemplo n.º 23
0
			.ngpio	= S5PV210_GPIO_G3_NR,
			.label	= "GPG3",
		},
	}, {
		.base	= S5PV210_GPH0_BASE,
		.config	= &gpio_cfg_noint,
		.chip	= {
			.base	= S5PV210_GPH0(0),
			.ngpio	= S5PV210_GPIO_H0_NR,
			.label	= "GPH0",
		},
	}, {
		.base	= S5PV210_GPH1_BASE,
		.config	= &gpio_cfg_noint,
		.chip	= {
			.base	= S5PV210_GPH1(0),
			.ngpio	= S5PV210_GPIO_H1_NR,
			.label	= "GPH1",
		},
	}, {
		.base	= S5PV210_GPH2_BASE,
		.config	= &gpio_cfg_noint,
		.chip	= {
			.base	= S5PV210_GPH2(0),
			.ngpio	= S5PV210_GPIO_H2_NR,
			.label	= "GPH2",
		},
	}, {
		.base	= S5PV210_GPH3_BASE,
		.config	= &gpio_cfg_noint,
		.chip	= {
Ejemplo n.º 24
0
static int s5p_cec_probe(struct platform_device *pdev)
{
	struct s5p_platform_cec *pdata;
	u8 *buffer;
	int irq_num;
	int ret;

	/*
	 * CEC GPIO number is changed.
	 */
	#if 0
	s3c_gpio_cfgpin(S5PV210_GPH1(4), S3C_GPIO_SFN(0x4));
	s3c_gpio_setpull(S5PV210_GPH1(4), S3C_GPIO_PULL_NONE);
	#endif
	pdata = to_tvout_plat(&pdev->dev);

	if (pdata->cfg_gpio)
		pdata->cfg_gpio(pdev);


	/* get ioremap addr */
	s5p_cec_mem_probe(pdev);

	if (misc_register(&cec_misc_device)) {
		printk(KERN_WARNING " Couldn't register device 10, %d.\n",
			CEC_MINOR);

		return -EBUSY;
	}

	irq_num = platform_get_irq(pdev, 0);

	if (irq_num < 0) {
		printk(KERN_ERR  "failed to get %s irq resource\n", "cec");
		ret = -ENOENT;

		return ret;
	}

	ret = request_irq(irq_num, s5p_cec_irq_handler, IRQF_DISABLED,
		pdev->name, &pdev->id);

	if (ret != 0) {
		printk(KERN_ERR  "failed to install %s irq (%d)\n", "cec", ret);

		return ret;
	}

	init_waitqueue_head(&cec_rx_struct.waitq);
	spin_lock_init(&cec_rx_struct.lock);
	init_waitqueue_head(&cec_tx_struct.waitq);

	buffer = kmalloc(CEC_TX_BUFF_SIZE, GFP_KERNEL);

	if (!buffer) {
		printk(KERN_ERR " kmalloc() failed!\n");
		misc_deregister(&cec_misc_device);

		return -EIO;
	}

	cec_rx_struct.buffer = buffer;

	cec_rx_struct.size   = 0;
	TV_CLK_GET_WITH_ERR_CHECK(hdmi_cec_clk, pdev, "hdmicec");


	return 0;
}
Ejemplo n.º 25
0
	{ MAX8698_BUCK3, &mini210_buck3_data },
};

static struct max8698_platform_data mini210_max8698_pdata = {
	.num_regulators	= ARRAY_SIZE(mini210_regulators),
	.regulators		= mini210_regulators,

	/* 1GHz default voltage */
	.dvsarm1		= 0xa,  /* 1.25v */
	.dvsarm2		= 0x9,  /* 1.20V */
	.dvsarm3		= 0x6,  /* 1.05V */
	.dvsarm4		= 0x4,  /* 0.95V */
	.dvsint1		= 0x7,  /* 1.10v */
	.dvsint2		= 0x5,  /* 1.00V */

	.set1			= S5PV210_GPH1(6),
	.set2			= S5PV210_GPH1(7),
	.set3			= S5PV210_GPH0(4),
};
#endif

#if defined(CONFIG_S5PV210_SETUP_IDE)
static struct s3c_ide_platdata mini210_ide_pdata __initdata = {
	.setup_gpio		= s5pv210_ide_setup_gpio,
};
#endif

#ifdef CONFIG_KEYBOARD_GPIO
static struct gpio_keys_button gpio_buttons[] = {
	{
		.gpio		= S5PV210_GPH2(0),
Ejemplo n.º 26
0
static int __init s5p_hpd_probe(struct platform_device *pdev)
{
	if (misc_register(&hpd_misc_device)) {
		printk(KERN_WARNING " Couldn't register device 10, %d.\n",
			HPD_MINOR);
		return -EBUSY;
	}

	init_waitqueue_head(&hpd_struct.waitq);

	spin_lock_init(&hpd_struct.lock);

	atomic_set(&hpd_struct.state, -1);

	atomic_set(&hdmi_status, HDMI_OFF);

	s3c_gpio_cfgpin(S5PV210_GPH1(5), S3C_GPIO_SFN(0xf));
	s3c_gpio_setpull(S5PV210_GPH1(5), S3C_GPIO_PULL_DOWN);
	writel(readl(S5PV210_GPH1DRV)|0x3<<10, S5PV210_GPH1DRV);

// by pjlee : Interrupt Signal Change
#ifdef CONFIG_MACH_MANGO210_EVT0
	if (!gpio_get_value(S5PV210_GPH1(5))) {
#else
	if (gpio_get_value(S5PV210_GPH1(5))) {
#endif
		atomic_set(&hpd_struct.state, HPD_HI);
		last_hpd_state = HPD_HI;
	} else {
		atomic_set(&hpd_struct.state, HPD_LO);
		last_hpd_state = HPD_LO;
	}

	set_irq_type(IRQ_EINT13, IRQ_TYPE_EDGE_BOTH);

	if (request_irq(IRQ_EINT13, s5p_hpd_irq_handler, IRQF_DISABLED,
		"hpd", s5p_hpd_irq_handler)) {
		printk(KERN_ERR  "failed to install %s irq\n", "hpd");
		misc_deregister(&hpd_misc_device);
		return -EIO;
	}

	s5p_hdmi_register_isr(s5p_hpd_irq_handler, (u8)HDMI_IRQ_HPD_PLUG);
	s5p_hdmi_register_isr(s5p_hpd_irq_handler, (u8)HDMI_IRQ_HPD_UNPLUG);

	return 0;
}

/*
 *  Remove
 */
static int s5p_hpd_remove(struct platform_device *pdev)
{
	return 0;
}


#ifdef CONFIG_PM
/*
 *  Suspend
 */
int s5p_hpd_suspend(struct platform_device *dev, pm_message_t state)
{
	return 0;
}

/*
 *  Resume
 */
int s5p_hpd_resume(struct platform_device *dev)
{
	return 0;
}
#else
#define s5p_hpd_suspend NULL
#define s5p_hpd_resume NULL
#endif

static struct platform_driver s5p_hpd_driver = {
	.probe		= s5p_hpd_probe,
	.remove		= s5p_hpd_remove,
	.suspend	= s5p_hpd_suspend,
	.resume		= s5p_hpd_resume,
	.driver		= {
		.name	= "s5p-hpd",
		.owner	= THIS_MODULE,
	},
};

static char banner[] __initdata =
	"S5PC11X HPD Driver, (c) 2009 Samsung Electronics\n";

int __init s5p_hpd_init(void)
{
	int ret;

	printk(banner);

	ret = platform_driver_register(&s5p_hpd_driver);

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

	return 0;
}
Ejemplo n.º 27
0
	{ MAX8698_BUCK2, &smdkv210_buck2_data },
	{ MAX8698_BUCK3, &smdkv210_buck3_data },
};

static struct max8698_platform_data smdkv210_max8698_pdata = {
	.num_regulators = ARRAY_SIZE(smdkv210_regulators),
	.regulators     = smdkv210_regulators,

	/* 1GHz default voltage */
	.dvsarm1        = 0xa,  /* 1.25v */
	.dvsarm2        = 0x9,  /* 1.20V */
	.dvsarm3        = 0x6,  /* 1.05V */
	.dvsarm4        = 0x4,  /* 0.95V */
	.dvsint1        = 0x7,  /* 1.10v */
	.dvsint2        = 0x5,  /* 1.00V */
	.set1       = S5PV210_GPH1(6),
	.set2       = S5PV210_GPH1(7),
	.set3       = S5PV210_GPH0(4),
};
#endif

static struct s3c_ide_platdata smdkv210_ide_pdata __initdata = {
	.setup_gpio	= s5pv210_ide_setup_gpio,
};

static uint32_t smdkv210_keymap[] __initdata = {
	/* KEY(row, col, keycode) */
	KEY(0, 3, KEY_1), KEY(0, 4, KEY_2), KEY(0, 5, KEY_3),
	KEY(0, 6, KEY_4), KEY(0, 7, KEY_5),
	KEY(1, 3, KEY_A), KEY(1, 4, KEY_B), KEY(1, 5, KEY_C),
	KEY(1, 6, KEY_D), KEY(1, 7, KEY_E), KEY(7, 1, KEY_LEFTBRACE)
Ejemplo n.º 28
0
static int __init s5p_cec_probe(struct platform_device *pdev)
{
	u8 *buffer;
	int irq_num;
	int ret = 0;

	s3c_gpio_cfgpin(S5PV210_GPH1(4), S3C_GPIO_SFN(0x4));
	s3c_gpio_setpull(S5PV210_GPH1(4), S3C_GPIO_PULL_NONE);

	/* get ioremap addr */
	ret = s5p_cec_probe_core(pdev);
	if (ret != 0) {
		pr_err("%s::s5p_cec_probe_core() fail\n", __func__);
		goto err_s5p_cec_probe_core;
	}

	if (misc_register(&cec_misc_device)) {
		pr_err("%s::Couldn't register device 10, %d.\n",
			__func__, CEC_MINOR);
		ret =  -EBUSY;
		goto err_misc_reg;
	}

	irq_num = platform_get_irq(pdev, 0);
	if (irq_num < 0) {
		pr_err("%s::failed to get %s irq resource\n",
			__func__, "cec");
		ret = -ENOENT;
		goto err_req_fw;
	}

	ret = request_irq(irq_num, s5p_cec_irq_handler, IRQF_DISABLED,
		pdev->name, &pdev->id);
	if (ret != 0) {
		pr_err("%s::failed to install %s irq (%d)\n",
			__func__, "cec", ret);
		goto err_req_fw;
	}

	init_waitqueue_head(&g_cec_rx_struct.waitq);
	spin_lock_init(&g_cec_rx_struct.lock);
	init_waitqueue_head(&g_cec_tx_struct.waitq);

	buffer = kmalloc(CEC_TX_BUFF_SIZE, GFP_KERNEL);
	if (!buffer) {
		pr_err("%s::kmalloc(CEC_TX_BUFF_SIZE %d) failed!\n",
			__func__, CEC_TX_BUFF_SIZE);

		ret = -EIO;
		goto err_kmalloc;
	}

	g_cec_rx_struct.buffer = buffer;
	g_cec_rx_struct.size   = 0;

	return 0;

err_kmalloc:
	free_irq(irq_num, NULL);
err_req_fw:
	misc_deregister(&cec_misc_device);
err_misc_reg:
	s5p_cec_release_core(pdev);
err_s5p_cec_probe_core:
	return ret;
}