Esempio n. 1
0
static int
omap_wdt_release(struct inode *inode, struct file *file)
{
    /*
     *      Shut off the timer.
     *      Lock it in if it's a module and we defined ...NOWAYOUT
     */
#ifndef CONFIG_WATCHDOG_NOWAYOUT
    outw(0xf5, OMAP1510_WATCHDOG_BASE + 8); /* timer mode */
    outw(0xa0, OMAP1510_WATCHDOG_BASE + 8); /* timer mode */
    ck_disable(mpuwd_ck);
#endif
    omap_wdt_users = 0;
    return 0;
}
Esempio n. 2
0
//-------------------------------------------------------------------
//
// i2c test 
//
//-------------------------------------------------------------------
int test_i2cmst(void)
{
  	unsigned short data16;
	int rc=0;
	printf("Start I2C master test.\n");
	ck_disable(3);
	i2c_init();
	/* Reset device */
	data16 = CD_RST;
	rc = i2c_write(SLVADDR, &data16, 2);
	if(rc!=2) {
		printf("I2C write failed, returned %d.\n", rc);
	}
	/* Left & right line in mute */
	//data16 = CD_LLI | LLI_LINMUTE | LLI_LRINBOTH; 
	//i2c_write(SLVADDR, &data16, 2);
	/* Side tone mode of mic */
	data16 = CD_AAPC|AAPC_SIDETONE;
	rc = i2c_write(SLVADDR, &data16, 2);
	if(rc!=2) {
		printf("I2C write failed, returned %d.\n", rc);
	}
	/* Set headphone output volume */
	//data16 = CD_LHO|LHO_LRHPBOTH|0x7F;
	//rc = i2c_write(SLVADDR, &data16, 2);
	/* Power down line input, crystal oscillator, clock output */
	data16 = CD_PDCT | PDCT_LINEINPD | PDCT_OSCPD ;//| PDCT_CLKOUTPD;
	rc = i2c_write(SLVADDR, &data16, 2);
	if(rc!=2) {
		printf("I2C write failed, returned %d.\n", rc);
	}
	/* Clock output divide by 2 */
	data16 = CD_SCT|SCT_CLKODIV2;
	rc = i2c_write(SLVADDR, &data16, 2);
	if(rc!=2) {
		printf("I2C write failed, returned %d.\n", rc);
	}
	/* Activate codec device */
	data16 = CD_ACT|ACT_EN;
	rc = i2c_write(SLVADDR, &data16, 2);
	if(rc!=2) {
		printf("I2C write failed, returned %d.\n", rc);
	}
	ck_enable(3);
  printf("End I2C master test.\n");
	return 0;
}