Esempio n. 1
0
static void start_timers(void)
{
	unsigned long flags;

	local_irq_save(flags);

#ifdef CONFIG_BFIN561_BLUETECHNIX_CM
	bfin_write_TMRS4_ENABLE((1 << (TIMER_HSYNC - 8)) |
				(1 << (TIMER_DTMG - 8)));
	bfin_write_TMRS8_ENABLE(1 << TIMER_VSYNC);
	SSYNC();
	bfin_write_TMRS8_ENABLE(1 << TIMER_DCLK);
#else
	bfin_write_TIMER_ENABLE((1 << TIMER_HSYNC) | (1 << TIMER_DTMG) |
				(1 << TIMER_VSYNC));
	SSYNC();
	bfin_write_TIMER_ENABLE(1 << TIMER_DCLK);
#endif
	SSYNC();
	mdelay(50);
	gpio_set_value(PCI_PIN, 1);
	SSYNC();
#ifdef CONFIG_BFIN561_BLUETECHNIX_CM
	bfin_write_TMRS8_ENABLE(1 << TIMER_BACKLIGHT);
#else
	bfin_write_TIMER_ENABLE(1 << TIMER_BACKLIGHT);
#endif
	SSYNC();

	local_irq_restore(flags);
}
Esempio n. 2
0
static void set_backlight(int val)
{
	unsigned long timer_period;

	pr_debug("%s to %d\n", __func__, val);

	if (val < 0)
		val = 0;
	if (val > MAX_BRIGHTNESS)
		val = MAX_BRIGHTNESS;

	current_brightness = val;

#ifdef CONFIG_BFIN561_BLUETECHNIX_CM
	bfin_write_TMRS8_DISABLE(1 << TIMER_BACKLIGHT);
#else
	bfin_write_TIMER_DISABLE(1 << TIMER_BACKLIGHT);
#endif
	SSYNC();

	timer_period = get_sclk() / 100000;
	BFIN_WRITE(TIMER_BACKLIGHT, WIDTH) ((timer_period * val) / 100);

#ifdef CONFIG_BFIN561_BLUETECHNIX_CM
	bfin_write_TMRS8_ENABLE(1 << TIMER_BACKLIGHT);
#else
	bfin_write_TIMER_ENABLE(1 << TIMER_BACKLIGHT);
#endif

	SSYNC();
}
Esempio n. 3
0
static void start_timers(void) /* CHECK with HW */
{
	unsigned long flags;

	local_irq_save(flags);

	bfin_write_TIMER_ENABLE(TIMEN_REV);
	SSYNC();

	while (bfin_read_TIMER_REV_COUNTER() <= 11);
	bfin_write_TIMER_ENABLE(TIMEN_LP);
	SSYNC();

	while (bfin_read_TIMER_LP_COUNTER() < 3);
	bfin_write_TIMER_ENABLE(TIMEN_SP|TIMEN_SPS|TIMEN_PS_CLS);
	SSYNC();
	t_conf_done = 1;
	local_irq_restore(flags);
}
static void init_tlv320aic31(void)
{
	puts("Audio: setup TIMER0 to enable 16.384 MHz clock for tlv320aic31\n");
	peripheral_request(P_TMR0, "tlv320aic31 clock");
	bfin_write_TIMER0_CONFIG(0x020d);
	bfin_write_TIMER0_PERIOD(0x0008);
	bfin_write_TIMER0_WIDTH(0x0008/2);
	bfin_write_TIMER_ENABLE(bfin_read_TIMER_ENABLE() | 1);
	SSYNC();
	udelay(10000);

	puts("       resetting tlv320aic31\n");

	gpio_request(GPIO_PF2, "tlv320aic31");
	gpio_direction_output(GPIO_PF2, 0);
	udelay(10000);
	gpio_direction_output(GPIO_PF2, 1);
	udelay(10000);
	gpio_free(GPIO_PF2);
}