static int __init fintek_wdt_find()

in f71808e_wdt.c [537:603]


static int __init fintek_wdt_find(int sioaddr)
{
	enum chips type;
	u16 devid;
	int err = superio_enter(sioaddr);
	if (err)
		return err;

	devid = superio_inw(sioaddr, SIO_REG_MANID);
	if (devid != SIO_FINTEK_ID) {
		pr_debug("Not a Fintek device\n");
		err = -ENODEV;
		goto exit;
	}

	devid = force_id ? force_id : superio_inw(sioaddr, SIO_REG_DEVID);
	switch (devid) {
	case SIO_F71808_ID:
		type = f71808fg;
		break;
	case SIO_F71862_ID:
		type = f71862fg;
		break;
	case SIO_F71868_ID:
		type = f71868;
		break;
	case SIO_F71869_ID:
	case SIO_F71869A_ID:
		type = f71869;
		break;
	case SIO_F71882_ID:
		type = f71882fg;
		break;
	case SIO_F71889_ID:
		type = f71889fg;
		break;
	case SIO_F71858_ID:
		/* Confirmed (by datasheet) not to have a watchdog. */
		err = -ENODEV;
		goto exit;
	case SIO_F81803_ID:
		type = f81803;
		break;
	case SIO_F81865_ID:
		type = f81865;
		break;
	case SIO_F81866_ID:
		type = f81866;
		break;
	case SIO_F81966_ID:
		type = f81966;
		break;
	default:
		pr_info("Unrecognized Fintek device: %04x\n",
			(unsigned int)devid);
		err = -ENODEV;
		goto exit;
	}

	pr_info("Found %s watchdog chip, revision %d\n",
		fintek_wdt_names[type],
		(int)superio_inb(sioaddr, SIO_REG_DEVREV));

exit:
	superio_exit(sioaddr);
	return err ? err : type;
}