Exemplo n.º 1
0
static int bfin_lq035_fb_open(struct fb_info *info, int user)
{
	unsigned long flags;

	spin_lock_irqsave(&bfin_lq035_lock, flags);
	lq035_open_cnt++;
	spin_unlock_irqrestore(&bfin_lq035_lock, flags);

	if (lq035_open_cnt <= 1) {
		bfin_write_PPI_CONTROL(0);
		SSYNC();

		set_vcomm();
		config_dma();
		config_ppi();

		/* start dma */
		enable_dma(CH_PPI);
		SSYNC();
		bfin_write_PPI_CONTROL(bfin_read_PPI_CONTROL() | PORT_EN);
		SSYNC();

		if (!t_conf_done) {
			config_timers();
			start_timers();
		}
		/* gpio_set_value(MOD,1); */
	}

	return 0;
}
Exemplo n.º 2
0
static int tx09_fb_open(struct fb_info *info, int user)
{
	unsigned long flags;

	pr_debug("%s\n", __func__);

	spin_lock_irqsave(&tx09_lock, flags);
	tx09_open_cnt++;	/* increase counter */
	spin_unlock_irqrestore(&tx09_lock, flags);

	if (tx09_open_cnt <= 1) {	/* opened the first time */

		/* stop PPI */
		WRITE_PPI_CONTROL(0);
		SSYNC();

		/* configure dma stuff */
		config_dma();

		config_ppi();

		/* start dma */
		enable_dma(CH_PPI);
		SSYNC();

		/* start PPI */
		WRITE_PPI_CONTROL(READ_PPI_CONTROL() | PORT_EN);
		SSYNC();

		if (!t_conf_done)
			config_timers();

		start_timers();
	}

	return 0;
}