> -----Original Message----- > From: Chen Peter-B29397 > Sent: Thursday, February 16, 2012 2:35 PM > To: Mehresh Ramneek-B31383 > Cc: linux-usb@xxxxxxxxxxxxxxx; Li Yang-R58472 > Subject: RE: [PATCH][v4]fsl/usb:Add controller version based ULPI and > UTMI phy support > > > > > > > > > > > > > /home/b29397/work/code/git/linus/linux- > > > > > 2.6/drivers/usb/gadget/fsl_udc_core.c: In function > > > > 'dr_controller_setup': > > > > > /home/b29397/work/code/git/linus/linux- > > > > > 2.6/drivers/usb/gadget/fsl_udc_core.c:269: error: 'ctrl' > > > > > undeclared (first use in this function) > > > > > /home/b29397/work/code/git/linus/linux- > > > > > 2.6/drivers/usb/gadget/fsl_udc_core.c:269: error: (Each > > > > > undeclared identifier is reported only once > > > > > /home/b29397/work/code/git/linus/linux- > > > > > 2.6/drivers/usb/gadget/fsl_udc_core.c:269: error: for each > > > > > function it appears in.) > > > > > /home/b29397/work/code/git/linus/linux- > > > > > 2.6/drivers/usb/gadget/fsl_udc_core.c:269: error: 'usb_sys_regs' > > > > > undeclared (first use in this function) > > > > > make[4]: *** [drivers/usb/gadget/fsl_udc_core.o] Error 1 > > > > > make[3]: *** [drivers/usb/gadget] Error 2 > > > > > > > > > These will come since there are IMX SOC based macros which are > > > > excluding ctrl and usb_sys_regs for IMX platforms with > > CONFIG_ARCH_MXC > > > > macro > > > > > > > > The only way to resolve this is that USB controller version of IMX > > can > > > > be added in some IMX configuration/platform file, and > > > > CONFIG_ARCH_MXC is removed from USB gadget driver file...we should > > > > refrain from including SOC based macros in IP driver files > > > > > > > > Can you or someone from IMX team support this...I'm not too > > > > familiar with IMX platform > > > > > > > > > > The current problem is usb_sys_regs has not defined at i.mx > > > platform, > > not > > > related your USB controller version code. > > > Temp way: > > > Use pdata->have_sysif_regs to judge where the usb_sys_regs can be > > > accessed, and keep as much as access usb_sys_regs code to a function > > > to keep code clean. > > > Long way: > > > Does usb_sys_regs are related to PHY? Move all PHY related operation > > out > > > of controller file, as PHY is platform related. In fact, i.mx has > > similar > > > PHY registers, currently, we put it at arch code, but it needs to > > > move > > to > > > PHY driver in future. > > > > > > > > > BR, > > > Peter > > > > > First of all I do not understand why CONFIG_ARCH_MXC macro is being > > used inside FSL USB Gadget driver file ? > > > > There is an active effort going on in community at various levels to > > remove SOC based MACROS from IP driver files.....Why are we not > > talking about someone cleaning IMX macro from this driver file ? > > > Please post a patch to get rid of MACROS, like CONFIG_ARCH_MXC, > CONFIG_PPC32, etc. > I can help test at i.mx. > I see 2 issues here: 1. Device-tree not being used for IMX platforms 2. sysif_regs not defined for IMX platforms For the first issue, I can replace CONFIG_ARCH_MXC macro with usb_get_ver_info() returning some standard error value for nonDT platforms For the second issue, we can replace CONFIG_ARCH_MXC macro with if (pdata->have_sysif_regs) for IMX platforms Is it possible to define pdata->have_sysif_regs = 0 for IMX platforms ?? Regards, Ramneek > > > Instead of using CONFIG_ARCH_MXC macro, usb_get_ver_info() can be used > > to shield this code for IMX based platforms...as discussed previously, > > this function returns 0 for IMX platforms... > > > Your code is ok, the problem is your code uses the structure which is not > defined at i.mx platform. > > > Regards, > > Ramneek > > -- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html