Installing TechWell tw686x minipci express card

Hi Toradex

i bought MPX-6864 minipci express capture card to install on ixora link text
with these drivers link text
i wanna cross compile L4T with TechWell tw6864 driver
i know i have to make changes to kernel and kernel modules according to your previous help on cx25858 link text

but above changes is according to cx25858 and tw686x is different . would you please help me about patch files?

Thank you

HI @toradexvision

Thanks for writing to the Toradex Community!

but above changes is according to cx25858 and tw686x is different . would you please help me about patch files?

What changes have you done?

Could you check out the kernel branch toradex_tk1_l4t_r21.7 and integrate your changes there and check if the driver is compiling and share any compilation log?

Thanks and best regards,
Jaski

Hi Jaski.tx

i copy driver folder link text in linux-toradex/drivers/media/pci
and add this line CONFIG_VIDEO_TW686X=m into the linux-toradex/drivers/media/pci/apalis-tk1_defconfig

and also add this line obj-$(CONFIG_VIDEO_TW686X) += tw686x
into linux-toradex/drivers/media/pci/Makefile

but unfortunately above driver has not any Kconfig file ,to address it in
/drivers/media/pci/Kconfig
at lost when i cross compile linux kernel with tw646x driver , tw686x.ko not generated in driver/media/pci
would you please help me about this
Best Regards

That thing should actually be supported in mainline Linux kernel starting with 4.6.

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit?id=704a84ccdbf19fdce9adfda0b936dfdcac52fa49

You could try just cherry-picking that one, I guess.

Hi Marcel

i used your suggested driver link text instead of the MPX-6864 company suggested driver
and i got thislink text log file
it seams built process is incomplete!!

would you please help me?

thank you

HI @toradexvision

Could you follow up the suggestion of @marcel.tx? I think, this would be easier since this driver is already integrated in the kernel 4.6. Further could you sent us the changes you have done ( git diff )?

Thanks and best regards,
Jaski

Hi

i used kernel 4.6 tw686x driver according to your suggestion but unfortunately
linux built process remained unfinished link text

i know i have to add some configuration in apalis-tk1_defconfig file according to this link link text then i made following changes to apalis-tk1_defconfig link text
and also i applied these changes in driver folder link text

it seems apalis-tk1_defconfig file Configuration is not valid and led to the unfinished built process of linux kernel would you please help me about this?

best regards

Hi
i tried again to build linux kernel with tw686x driver but i encountered this error

In file included from drivers/media/pci/tw686x/tw686x-video.c:21:
drivers/media/pci/tw686x/tw686x.h:18:10: fatal error: media/videobuf2-v4l2.h: No such file or directory
 #include <media/videobuf2-v4l2.h>
          ^~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
In file included from drivers/media/pci/tw686x/tw686x-audio.c:26:
drivers/media/pci/tw686x/tw686x.h:18:10: fatal error: media/videobuf2-v4l2.h: No such file or directory
 #include <media/videobuf2-v4l2.h>

and when i copy videobuf2-v4l2.h from kernel 4.6 source inside the toradex linux build directory i encountered new errors again

drivers/media/pci/tw686x/tw686x-video.c: In function ‘tw686x_video_init’:
drivers/media/pci/tw686x/tw686x-video.c:1226:12: error: ‘struct vb2_queue’ has no member named ‘timestamp_flags’; did you mean ‘timestamp_type’?
   vc->vidq.timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
            ^~~~~~~~~~~~~~~
            timestamp_type
drivers/media/pci/tw686x/tw686x-video.c:1227:11: error: ‘struct vb2_queue’ has no member named ‘min_buffers_needed’
   vc->vidq.min_buffers_needed = 2;
           ^
drivers/media/pci/tw686x/tw686x-video.c:1231:11: error: ‘struct vb2_queue’ has no member named ‘dev’
   vc->vidq.dev = &dev->pci_dev->dev;
           ^
drivers/media/pci/tw686x/tw686x-video.c:1280:7: error: ‘struct video_device’ has no member named ‘device_caps’
   vdev->device_caps = V4L2_CAP_VIDEO_CAPTURE |
       ^~
drivers/media/pci/tw686x/tw686x-audio.c:287:2: error: implicit declaration of function ‘snd_pcm_set_managed_buffer_all’; did you mean ‘snd_pcm_set_runtime_buffer’? [-Werror=implicit-function-declaration]
  snd_pcm_set_managed_buffer_all(pcm,
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  snd_pcm_set_runtime_buffer
drivers/media/pci/tw686x/tw686x-video.c:1285:37: error: ‘VFL_TYPE_VIDEO’ undeclared (first use in this function); did you mean ‘VFL_TYPE_RADIO’?
   err = video_register_device(vdev, VFL_TYPE_VIDEO, -1);
                                     ^~~~~~~~~~~~~~
                                     VFL_TYPE_RADIO
drivers/media/pci/tw686x/tw686x-video.c:1285:37: note: each undeclared identifier is reported only once for each function it appears in
In file included from drivers/media/pci/tw686x/tw686x.h:11,
                 from drivers/media/pci/tw686x/tw686x-core.c:40:
drivers/media/pci/tw686x/tw686x-core.c: At top level:
drivers/media/pci/tw686x/tw686x-core.c:418:14: error: ‘PCI_VENDOR_ID_TECHWELL’ undeclared here (not in a function); did you mean ‘PCI_VENDOR_ID_ROCKWELL’?
   PCI_DEVICE(PCI_VENDOR_ID_TECHWELL, 0x6864),
              ^~~~~~~~~~~~~~~~~~~~~~
include/linux/pci.h:628:13: note: in definition of macro ‘PCI_DEVICE’
  .vendor = (vend), .device = (dev), \
             ^~~~
drivers/media/pci/tw686x/tw686x-audio.c: In function ‘tw686x_audio_init’:
drivers/media/pci/tw686x/tw686x-audio.c:370:8: error: implicit declaration of function ‘snd_card_new’; did you mean ‘snd_card_unref’? [-Werror=implicit-function-declaration]
  err = snd_card_new(&pci_dev->dev, SNDRV_DEFAULT_IDX1,
        ^~~~~~~~~~~~

it seems this driver is not compatible with toradex linux kernel

would you please help me ?

Thank you

Hi Toradex

would you please help me about tw686x driver compilation errors

Best Regards

toradexvision

HI @toradexvision

it seems this driver is not compatible with toradex linux kernel

The kernel is provided by Nvidia and has version 3.x. So if you need to integrate the driver from kernel 4.6, then you need to make some changes to the kernel till the compilation is successful. Kernel driver integration is outside of the scope of free support.

drivers/media/pci/tw686x/tw686x-video.c:1226:12: error: ‘struct vb2_queue’ has no member named ‘timestamp_flags’; did you mean ‘timestamp_type’?

You would need to compare the definition of the struct vb2_queue in both kernel code and take the one from kernel 4.6 over.

Best regards,
Jaski

Hi Jaski

i will try your solution and share my results to Toradex community .

thank you for everything and best regards

Hi

you are welcome.

Best regards,
Jaski