On Tue, 2004-10-12 at 13:16, Lothar Wassmann wrote:
> Hi Ian,
>
> > The patches are missing the definition of struct ohci_chip_info. I can't
> > do hw reset or stop/start the clock with my h/w so I just commented them
> > out for now.
> >
> I defined it like this:
> struct ohci_chip_info {
> void (*hw_reset) (int devid, int set);
> void (*clock_enable) (int devid);
> void (*clock_disable) (int devid);
> };
> Since this needs to be shared with the platform specific code it
> should should probably be defined in include/asm/arch/ rather than in
> some usb include file. This also gives the opportunity to pass
> parameters that differ between platforms to the driver.
Or perhaps in include/linux somewhere since it isn't really arch
specific?
> > The attached usb-ohci-isp1362-chipid makes the code in chip_probe aware
> > of the 116x HCCHIPID value by looking for the correct value based on
> > CHIP_TYPE. Long term it might be good to select CHIP_TYPE based on the
> > magic value to save hard coding it.
> >
> I'm missing this attachment.
Doh! Here you go
Ian.
--
Ian Campbell, Senior Design Engineer
Web: http://www.arcom.com
Arcom, Clifton Road, Direct: +44 (0)1223 403 465
Cambridge CB1 7EA, United Kingdom Phone: +44 (0)1223 411 200
Index: 2.6-bk/drivers/usb/host/ohci-isp1362.c
===================================================================
--- 2.6-bk.orig/drivers/usb/host/ohci-isp1362.c 2004-10-12 10:00:58.000000000 +0100
+++ 2.6-bk/drivers/usb/host/ohci-isp1362.c 2004-10-12 10:56:55.139355346 +0100
@@ -115,7 +115,7 @@
}
val = isp1362_read_reg16(dev, HCCHIPID);
- if ((val & HCCHIPID_MASK) != HCCHIPID_ISP1362_MAGIC) {
+ if ((val & HCCHIPID_MASK) != HCCHIPID_MAGIC) {
printk(KERN_WARNING "%s: Invalid chip ID %04x\n", __FUNCTION__, val);
return -ENODEV;
} else {
Index: 2.6-bk/drivers/usb/host/ohci-isp1362.h
===================================================================
--- 2.6-bk.orig/drivers/usb/host/ohci-isp1362.h 2004-10-12 10:54:06.077124292 +0100
+++ 2.6-bk/drivers/usb/host/ohci-isp1362.h 2004-10-12 10:59:20.883896859 +0100
@@ -282,6 +283,14 @@
#define CAN_USE_32BIT ?
#endif
+#if CHIP_TYPE == CHIP_TYPE_ISP1362
+#define HCCHIPID_MAGIC HCCHIPID_ISP1362_MAGIC
+#elif CHIP_TYPE == CHIP_TYPE_ISP116x
+#define HCCHIPID_MAGIC HCCHIPID_ISP116x_MAGIC
+#else
+#error "Unknown CHIP_TYPE"
+#endif
+
#define ohci_to_hcd(ohci) (&(ohci)->hcd)
#define hcd_to_isp1362_dev(hcd) ((struct hc_isp1362_dev *)dev_get_drvdata(hcd->self.controller))
#define ohci_to_isp1362_dev(ohci) ((struct hc_isp1362_dev *)dev_get_drvdata(ohci->hcd.self.controller))