Hi Ashutosh, I think the problem is that the gadget support is broken in our 2.6.27 kernel. However, I do know it is working in 2.6.29. I believe if you do the following:
- backport the latest drivers/usb/gadget/android.c from 2.6.29 back to 2.6.27 - backport the following commit from 2.6.29 to to 2.6.27: commit f9335f6d0cfa5b8fc2a10c2a63ebcd42efbf99cb Author: Mike Lockwood <[email protected]> Date: Fri Feb 20 15:56:06 2009 -0500 [ARM] msm: htc: Clean up USB support in trout and sapphire board files Signed-off-by: Mike Lockwood <[email protected]> - Finally, configure your kernel with the USB function support disabled and the following gadget features enabled: CONFIG_USB_GADGET=y CONFIG_USB_GADGET_VBUS_DRAW=500 CONFIG_USB_GADGET_SELECTED=y CONFIG_USB_GADGET_MSM_72K=y CONFIG_USB_MSM_72K=y CONFIG_USB_GADGET_DUALSPEED=y CONFIG_USB_ANDROID=y I'm not sure how easy this will be to do the backporting, but it should be possible. Mike On Mon, Jul 13, 2009 at 7:02 AM, Ashutosh<[email protected]> wrote: > > (especially to Mike Lockwood) > > If I want to have gadgetfs support at ADP1 and have adb working, how > do I need to to configure kernel and compile? > > I have tried many things including using 'CONFIG_USB_ANDROID=y' and > 'CONFIG_USB_FUNCTION is not set' but nothing worked. To compile this > configuration I had to make some modification in some of the files. > List is as below -- > > 1) In arch/arm/mach-msm/include/mach/board_htc.h (Reason: Type of > t_usb_status_notifier was not visible) > > 58 //#if defined(CONFIG_USB_FUNCTION_MSM_HSUSB) > > 68 //#endif > > 2) In arch/arm/mach-msm/htc_battery.c (Reason: Definition of > usb_register_notifier() was not known. Its defintion is in drivers/usb/ > function/msm_hsusb.c) > > 793 // usb_register_notifier(&usb_status_notifier); > > I am able to boot this image on ADP1 but when I connect it to my PC > via USB it reboots. > > > > On Jul 10, 7:05 pm, Ashutosh <[email protected]> wrote: >> Hello Everybody, >> >> I wanted to put support for gadgetfs support on ADP1. >> >> I have downloaded android-1.5r2. >> >> My local_manifest.xml is -- >> >> <?xml version="1.0" encoding="UTF-8"?> >> <manifest> >> <remove-project name="kernel/common"/> >> <project path="kernel" name="kernel/msm" revision="refs/heads/ >> android-msm-2.6.27"/> >> <project path="vendor/htc/dream" name="platform/vendor/htc/dream" >> revision="cupcake"/> >> <project path="hardware/msm7k" name="platform/hardware/msm7k" >> revision="refs/heads/master"/> >> </manifest> >> >> I have copied arch/arm/configs/msm_defconfig as .config in mydroid/ >> kernel. >> >> I made changes in .config to support gadgetfs. >> >> As Mike has suggested >> athttp://groups.google.com/group/android-platform/browse_thread/thread/... >> , I have disabled CONFIG_USB_FUNCTION and enabled CONFIG_USB_GADGET >> and CONFIG_USB_GADGET_MSM_72K. >> >> After configuring kernel, GADGET and USB_FUNCTION configuration looks >> like below -- >> >> CONFIG_USB_GADGET=y >> CONFIG_USB_GADGET_SELECTED=y >> CONFIG_USB_GADGET_MSM_72K=y >> CONFIG_USB_MSM_72K=y >> CONFIG_USB_GADGET_DUALSPEED=y >> CONFIG_USB_GADGETFS=y >> >> # >> # USB Function Support >> # >> # CONFIG_USB_FUNCTION is not set >> >> Now I try to compile kernel and get below error -- >> >> arch/arm/mach-msm/htc_battery.c:187: error: variable >> 'usb_status_notifier' has initializer but incomplete type >> arch/arm/mach-msm/htc_battery.c:188: error: unknown field 'name' >> specified in initializer >> arch/arm/mach-msm/htc_battery.c:188: warning: excess elements in >> struct initializer >> arch/arm/mach-msm/htc_battery.c:188: warning: (near initialization for >> 'usb_status_notifier') >> arch/arm/mach-msm/htc_battery.c:189: error: unknown field 'func' >> specified in initializer >> arch/arm/mach-msm/htc_battery.c:189: warning: excess elements in >> struct initializer >> arch/arm/mach-msm/htc_battery.c:189: warning: (near initialization for >> 'usb_status_notifier') >> arch/arm/mach-msm/htc_battery.c: In function 'htc_battery_init': >> arch/arm/mach-msm/htc_battery.c:793: error: implicit declaration of >> function 'usb_register_notifier' >> >> I looked for declaration of t_usb_status_notifier and found it in arch/ >> arm/mach-msm/include/mach/board_htc.h, but this will be visible only >> when CONFIG_USB_FUNCTION_MSM_HSUSB is defined. Since we have disabled >> CONFIG_USB_FUNCTION, none of the CONFIG_USB_FUNCTION* are set. >> >> I have tried enabling CONFIG_USB_FUNCTION and >> CONFIG_USB_FUNCTION_MSM_HSUSB but that gave many multiple definition >> error. >> >> Please suggest how do I go about it? >> >> Thanks > > > -- Mike Lockwood Google android team --~--~---------~--~----~------------~-------~--~----~ unsubscribe: [email protected] website: http://groups.google.com/group/android-kernel -~----------~----~----~----~------~----~------~--~---
