Problem in enabling driver

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in enabling driver

Jump to solution
468 Views
vinothkumars
Senior Contributor III

Dear NXP,

 

I needs to enable CONFIG_USB_VIDEO (uvcvideo.ko) depends on CONFIG_USB (usbcore.ko)

But from Kconfig I come to know to build CONFIG_USB we needs to select M.

But for CONFIG_USB_VIDEO I needs to select CONFIG_USB as Y.

So, After Clean build, I got build error because I needs to select the CONFIG_USB as M

from AOSP/source/vendor/nxp-opensource/kernel_imx/drivers/usb/Kconfig

config USB
tristate "Support for Host-side USB"
depends on USB_ARCH_HAS_HCD
select USB_COMMON
select NLS # for UTF-8 strings
---help---
Universal Serial Bus (USB) is a specification for a serial bus
subsystem which offers higher speeds and more features than the
traditional PC serial port. The bus supplies power to peripherals
and allows for hot swapping. Up to 127 USB peripherals can be
connected to a single USB host in a tree structure.

The USB host is the root of the tree, the peripherals are the
leaves and the inner nodes are special USB devices called hubs.
Most PCs now have USB host ports, used to connect peripherals
such as scanners, keyboards, mice, modems, cameras, disks,
flash memory, network links, and printers to the PC.

Say Y here if your computer has a host-side USB port and you want
to use USB devices. You then need to say Y to at least one of the
Host Controller Driver (HCD) options below. Choose a USB 1.1
controller, such as "UHCI HCD support" or "OHCI HCD support",
and "EHCI HCD (USB 2.0) support" except for older systems that
do not have USB 2.0 support. It doesn't normally hurt to select
them all if you are not certain.

If your system has a device-side USB port, used in the peripheral
side of the USB protocol, see the "USB Gadget" framework instead.

After choosing your HCD, then select drivers for the USB peripherals
you'll be using. You may want to check out the information provided
in <file:Documentation/usb/> and especially the links given in
<file:Documentation/usb/usb-help.txt>.

To compile this driver as a module, choose M here: the
module will be called usbcore.

Build error, if I select as (CONFIG_USB_VIDEO depends on CONFIG_USB)

cp: cannot stat 'out/target/product/mek_8q/obj/KERNEL_OBJ/drivers/usb/core/usbcore.ko': No such file or directory

Thanks & Regards,

VinothS,

Regards,
Vinothkumar Sekar
1 Solution
150 Views
vinothkumars
Senior Contributor III

Hi,

I resolve this build error,

--- a/imx8q/mek_8q/BoardConfig.mk
+++ b/imx8q/mek_8q/BoardConfig.mk
@@ -74,7 +74,6 @@ BOARD_VENDOR_KERNEL_MODULES += \
$(KERNEL_OUT)/drivers/usb/chipidea/ci_hdrc.ko \
$(KERNEL_OUT)/drivers/usb/chipidea/ci_hdrc_imx.ko \
$(KERNEL_OUT)/drivers/usb/chipidea/usbmisc_imx.ko \
- $(KERNEL_OUT)/drivers/usb/core/usbcore.ko \
$(KERNEL_OUT)/drivers/usb/host/xhci-hcd.ko \
$(KERNEL_OUT)/drivers/usb/host/ehci-hcd.ko \
$(KERNEL_OUT)/drivers/usb/storage/usb-storage.ko \

Thanks & Regards,

VinothS,

Regards,
Vinothkumar Sekar

View solution in original post

0 Kudos
17 Replies
151 Views
vinothkumars
Senior Contributor III

Hi,

I resolve this build error,

--- a/imx8q/mek_8q/BoardConfig.mk
+++ b/imx8q/mek_8q/BoardConfig.mk
@@ -74,7 +74,6 @@ BOARD_VENDOR_KERNEL_MODULES += \
$(KERNEL_OUT)/drivers/usb/chipidea/ci_hdrc.ko \
$(KERNEL_OUT)/drivers/usb/chipidea/ci_hdrc_imx.ko \
$(KERNEL_OUT)/drivers/usb/chipidea/usbmisc_imx.ko \
- $(KERNEL_OUT)/drivers/usb/core/usbcore.ko \
$(KERNEL_OUT)/drivers/usb/host/xhci-hcd.ko \
$(KERNEL_OUT)/drivers/usb/host/ehci-hcd.ko \
$(KERNEL_OUT)/drivers/usb/storage/usb-storage.ko \

Thanks & Regards,

VinothS,

Regards,
Vinothkumar Sekar

View solution in original post

0 Kudos
150 Views
karangajjar
Senior Contributor II

Hi vinothkumar s,

We were building just the kernel part. We are glad that you resolved your issue.

Let us know in case of any concerns.

Regards,

Karan Gajjar

0 Kudos
150 Views
vinothkumars
Senior Contributor III

Thank you Karan for your support. Have A Nice Day !

VinothS,

Regards,
Vinothkumar Sekar
150 Views
karangajjar
Senior Contributor II

Hi vinothkumar s,

Can you please let us know the android version for which you are trying to build the usb video driver?

Because we tried in Android 9 and we were able to build CONFIG_USB(=y) and CONFIG_USB_VIDEO_CLASS(=y).

Regards,

Karan Gajjar

0 Kudos
150 Views
vinothkumars
Senior Contributor III

Thank you Karan,

I am also working on Android 9 (Android 9 Automotive - android_car_defconfig). Will you please share your defconfig file.

Thanks & Regards,

VinothS,

Regards,
Vinothkumar Sekar
0 Kudos
150 Views
karangajjar
Senior Contributor II

Hi vinothkumar s,

Please find attached android_defconfig. Let us also try with android_car_defconfig.

Regards,

Karan Gajjar

0 Kudos
150 Views
vinothkumars
Senior Contributor III

Default it's build as module. So, if I enabled for the CONFIG_USB_VIDEO_CLASS giving error.

Do you know how to avoid module copy in build ?

(or) Do you have any idea know which file is this ?

cp: cannot stat 'out/target/product/mek_8q/obj/KERNEL_OBJ/drivers/usb/core/usbcore.ko': No such file or directory

Thanks & Regards,

VinothS,

Regards,
Vinothkumar Sekar
0 Kudos
150 Views
karangajjar
Senior Contributor II

Hi vinothkumar s,

I think the above reply will solve your below query:

cp: cannot stat 'out/target/product/mek_8q/obj/KERNEL_OBJ/drivers/usb/core/usbcore.ko': No such file or directory

Please check in below location:

./drivers/usb/core/usbcore.ko

./drivers/media/usb/uvc/uvcvideo.ko

 

Regards,

Karan Gajjar

0 Kudos
150 Views
vinothkumars
Senior Contributor III

Thank you Karan.

Will you please share your android_car_defconfig file.

Please verify my steps also.

=>make android_car_defconfig

enable USB_VIDEO_CLASS 

=>cp .config to arch/arm64/config/android_car_defconfig

I am using,

lunch 36 (36. mek_8q_car-userdebug)

Thanks & Regards,

VinothS

Regards,
Vinothkumar Sekar
0 Kudos
150 Views
karangajjar
Senior Contributor II

Hi vinothkumar s,

Please find attached config in which I enabled usb_video.

Please follow below steps instead of manually copying the config file:

make android_car_defconfig

make menuconfig

enable usb_video_class

save and exit

And then as mentioned in Android user guide compile the kernel:

make KCFLAGS=-mno-android

You will find the reuired *.ko file in the kernel driver source folder.

Regards,

Karan Gajjar

150 Views
vinothkumars
Senior Contributor III

But, here I got some problem,

When I build as module (uvcvideo.ko), this is not copy to

out/target/product/mek_8q/vendor/lib/modules/

Do you know which file do I needs to configure to copy,

cp out/target/product/mek_8q/obj/KERNEL_OBJ/drivers/usb/core/uvcvideo.ko to

out/target/product/mek_8q/vendor/lib/modules/

Thanks & Regards,

VinothS,

Regards,
Vinothkumar Sekar
0 Kudos
150 Views
karangajjar
Senior Contributor II

Hi vinothkumar s

We enabled usb=y and usb_video=y in android_car_defconfig and were able to compile the kernel successfully.

Please find the attached config file.

0 Kudos
150 Views
vinothkumars
Senior Contributor III

Thank you Karan,

Did you done full build ?

I got this error from full build only.

Thanks & Regards,

VinothS,

Regards,
Vinothkumar Sekar
0 Kudos
150 Views
vinothkumars
Senior Contributor III

Thank you Karan for your input.

When I try to build as modules. I did not get any error.

+ CONFIG_USB_VIDEO_CLASS=m

+ CONFIG_USB=m

Thanks & Regards,

VinothS,

Regards,
Vinothkumar Sekar
0 Kudos
150 Views
vinothkumars
Senior Contributor III

Thank you Karan,

Regards,

VinothS,

Regards,
Vinothkumar Sekar
0 Kudos
150 Views
vinothkumars
Senior Contributor III

Thank you Karan,

I checked your file.

I don't know, How this is possible to set CONFIG_USB_VIDEO_CLASS(=y) without CONFIG_USB ?

 

Thanks & Regards,

VinothS.

Regards,
Vinothkumar Sekar
0 Kudos
150 Views
karangajjar
Senior Contributor II

Hi vinothkumar s,

We tried with andoird_car_defconfig and were able to get usbcore.ko and uvcvideo.ko. However, they are installed in the same driver directory. Example:
./drivers/usb/core/usbcore.ko

./drivers/media/usb/uvc/uvcvideo.ko

And, for android_defconfig, following is the output of menuconfig usb_video:

Symbol: USB_VIDEO_CLASS [=y] │
│ Type : tristate │
│ Prompt: USB Video Class (UVC) │
│ Location: │
│ -> Device Drivers │
│ -> Multimedia support (MEDIA_SUPPORT [=y]) │
│ (1) -> Media USB Adapters (MEDIA_USB_SUPPORT [=y]) │
│ Defined at drivers/media/usb/uvc/Kconfig:1 │
│ Depends on: USB [=y] && MEDIA_SUPPORT [=y] && MEDIA_USB_SUPPORT [=y] && MEDIA_CAMERA_SUPPORT [=y] && VIDEO_V4L2 [=y]
│ Selects: VIDEOBUF2_VMALLOC [=y]

Regards,

Karan Gajjar

0 Kudos