max3421_set_address(struct usb_hcd *hcd, struct usb_device *dev, int epnum)
{
	int rcvtog, sndtog;
	u8 hctl;

	/* setup new endpoint's toggle bits: */
	rcvtog = usb_gettoggle(dev, epnum, 0);
	sndtog = usb_gettoggle(dev, epnum, 1);
	hctl = (BIT(rcvtog + MAX3421_HCTL_RCVTOG0_BIT) |
		BIT(sndtog + MAX3421_HCTL_SNDTOG0_BIT));

	spi_wr8(hcd, MAX3421_REG_HCTL, hctl);

	/*
	 * Note: devnum for one and the same device can change during
	 * address-assignment so it's best to just always load the
	 * address whenever the end-point changed/was forced.
	 */
	spi_wr8(hcd, MAX3421_REG_PERADDR, dev->devnum);
}
max3421_set_address(struct usb_hcd *hcd, struct usb_device *dev, int epnum)
{
	int rcvtog, sndtog;
	u8 hctl;

	 
	rcvtog = usb_gettoggle(dev, epnum, 0);
	sndtog = usb_gettoggle(dev, epnum, 1);
	hctl = (BIT(rcvtog + MAX3421_HCTL_RCVTOG0_BIT) |
		BIT(sndtog + MAX3421_HCTL_SNDTOG0_BIT));

	spi_wr8(hcd, MAX3421_REG_HCTL, hctl);

	 
	spi_wr8(hcd, MAX3421_REG_PERADDR, dev->devnum);
}