/* Returns 1 if an ECP port is found, and 0 otherwise. This function actually checks if an Extended Control Register seems to be present. On successful return, the port is placed in SPP mode.  */
static __init unsigned int parport_ip32_ecp_supported(struct parport *p)
/* Returns 1 if an ECP port is found, and 0 otherwise. This function actually checks if an Extended Control Register seems to be present. On successful return, the port is placed in SPP mode.  */
static __init unsigned int parport_ip32_ecp_supported(struct parport *p)
{
	struct parport_ip32_private * const priv = p->physport->private_data;
	unsigned int ecr;
	ecr = ECR_MODE_PS2 | ECR_nERRINTR | ECR_SERVINTR;
	writeb(ecr, priv->regs.ecr);
	if (readb(priv->regs.ecr) != (ecr | ECR_F_EMPTY))
		goto fail;
	pr_probe(p, "Found working ECR register\n");
	parport_ip32_set_mode(p, ECR_MODE_SPP);
	parport_ip32_write_control(p, DCR_SELECT | DCR_nINIT);
	return 1;
fail:
	pr_probe(p, "ECR register not found\n");
	return 0;
}