# kernel driver not compiling?

**URL:** <https://forums.developer.nvidia.com/t/kernel-driver-not-compiling/53997>\
**Category:** Jetson TK1\
**Created:** [October 6, 2017, 10:13am UTC](https://forums.developer.nvidia.com/t/kernel-driver-not-compiling/53997 "2017-10-06T10:13:46Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![garid3000](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@garid3000](https://forums.developer.nvidia.com/u/garid3000)\
**Post date:** [October 6, 2017, 10:13am UTC](https://forums.developer.nvidia.com/t/kernel-driver-not-compiling/53997/1 "2017-10-06T10:13:46Z")

</div>

Hi guys,

I am working on Tk1 based little bit modified board, And i need to add wm8978 audio driver,

although I added line CONFIG\_SND\_SOC\_WM8978=y to tegra12\_defconfig, wm8978.o didnt compiled. help me

---

<div class="post-metadata">

**Author:** ![linuxdev](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/linuxdev/32/10243_2.png) [@linuxdev](https://forums.developer.nvidia.com/u/linuxdev)\
**Post date:** [October 6, 2017, 4:19pm UTC](https://forums.developer.nvidia.com/t/kernel-driver-not-compiling/53997/2 "2017-10-06T16:19:16Z")

</div>

You’ll need to provide more information. Which kernel source did you use, what starting config did you use prior to the edit, and what was the compile command line you used? Was this a cross compile or compiled natively on a TK1?

---

<div class="post-metadata">

**Author:** ![garid3000](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@garid3000](https://forums.developer.nvidia.com/u/garid3000)\
**Post date:** [October 8, 2017, 8:04am UTC](https://forums.developer.nvidia.com/t/kernel-driver-not-compiling/53997/3 "2017-10-08T08:04:54Z")

</div>

These are my compiling commands, from it, you can see my compiler, config files.

export CROSS\_COMPILE=/usr/bin/arm-linux-gnueabi-  
export TEGRA\_KERNEL\_OUT=../dobu  
export ARCH=arm

make O=$TEGRA\_KERNEL\_OUT tegra12\_defconfig  
make O=$TEGRA\_KERNEL\_OUT zImage   
make O=$TEGRA\_KERNEL\_OUT dtbs

## I downloaded my kernel from Jetson Download Center (L4T Kernel Sources V21.5)

Since our modified board has wm8978 instead of rt5639, I have cleaned some rt5639 releted stuff from the kernel like:

- in tegra12\_defconfig, CONFIG\_SND\_SOC\_TEGRA\_RT5639=n (from y to n)
- in board-ardbeg.c,  
deleted following, and where it usues rt5639\_board\_info,..

## static struct i2c\_board\_info \_\_initdata rt5639\_board\_info = { I2C\_BOARD\_INFO(“rt5639”, 0x1c), }

I thought that,.. If I add following lines proper positions,

static struct i2c\_board\_info \_\_initdata wm8978\_board\_info = {  
I2C\_BOARD\_INFO(“wm8978”, 0x1a),  
}  
i2c\_register\_board\_info(0, &wm8978\_board\_info, 1);

and included line “CONFIG\_SND\_SOC\_WM8978=y” to tegra12\_defconfig will make my audio card work…

/P.s. I am new to kernel, and did I provide you enough information?/

---

<div class="post-metadata">

**Author:** ![linuxdev](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/linuxdev/32/10243_2.png) [@linuxdev](https://forums.developer.nvidia.com/u/linuxdev)\
**Post date:** [October 8, 2017, 7:56pm UTC](https://forums.developer.nvidia.com/t/kernel-driver-not-compiling/53997/4 "2017-10-08T19:56:38Z")

</div>

It looks like the basics are correct. Which cross compiler were you using? E.g.:

```auto
/usr/bin/arm-linux-gnueabi-gcc --version

```

When you made the edits to CONFIG\_ items, did you use something like “make menuconfig”, or did you edit the .config directly? I ask because sometimes there are dependencies and the GUI-based editors tend to work well with dependencies.

Can you post the relevant error (and perhaps a few lines before the error for context) from the build?

Also, if you do everything the same, except without any edits (purely a tegra12\_defconfig) does the kernel build correctly? If not, what error shows?

---

<div class="post-metadata">

**Author:** ![garid3000](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@garid3000](https://forums.developer.nvidia.com/u/garid3000)\
**Post date:** [October 9, 2017, 2:39am UTC](https://forums.developer.nvidia.com/t/kernel-driver-not-compiling/53997/5 "2017-10-09T02:39:44Z")

</div>

Thank you for your quick responses,

my compilers version: arm-linux-gnueabi-gcc (Ubuntu/Linaro 4.7.3-12ubuntu1) 4.7.3

Kernel as a whole it compiles without any error(whether tegra12\_config edited or not); however, problem is my specific driver(wm8978.c) didn’t become wm8978.o.

I guess you’re right about dependencies. I have edited config file directly, and I have never used GUI based menuconfig before…

where should I (as a beginner) read about menuconfig/xconfig or any other GUI baseds, and what other advices and recommendations you have?

---

<div class="post-metadata">

**Author:** ![garid3000](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@garid3000](https://forums.developer.nvidia.com/u/garid3000)\
**Post date:** [October 9, 2017, 9:23am UTC](https://forums.developer.nvidia.com/t/kernel-driver-not-compiling/53997/6 "2017-10-09T09:23:27Z")

</div>

I have tried make menuconfig a little bit, and loaded tegra12\_defconfig  
and when I searched 8978, following is shown to me.

│ Symbol: SND\_SOC\_WM8978 [=n] │  
│ Type : tristate │  
│ Defined at sound/soc/codecs/Kconfig:512 │  
│ Depends on: SOUND [=y] && !M68K && !UML && SND [=y] && SND\_SOC [=y] │  
│ Selected by: SND\_SOC\_ALL\_CODECS [=n] && SOUND [=y] && !M68K && !UML && SND [=y] && SND\_SOC [=y] && I2C [=y] || SND\_SIU\_MIGOR [=n] && SOUND [=y] && !M68K && !UML && SND [=y] && SND\_SOC [=y] && (S │

I guess according to it all necessary things are [Y], isn’t it?  
And also wm8978 doesn’t have location where I go there, and change it to [Y].  
??? what does it mean?

I am kinda lost.

---

<div class="post-metadata">

**Author:** ![linuxdev](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/linuxdev/32/10243_2.png) [@linuxdev](https://forums.developer.nvidia.com/u/linuxdev)\
**Post date:** [October 9, 2017, 4:37pm UTC](https://forums.developer.nvidia.com/t/kernel-driver-not-compiling/53997/7 "2017-10-09T16:37:24Z")

</div>

Typically the newest compiler isn’t needed, and the Documentation download even comes with a rather old compiler (crosstool-ng 4.8.2 was originally used, I think it is now 4.8.5), but 4.7 may actually be too old (I don’t know…4.7 may also work fine). Typically the Documentation download with the release has a “baggage” subdirectory with a recommended compiler, or else information on building the recommended compiler. I would not recommend building your own compiler unless have a particular need. Just beware that your compiler version might be slightly too old. Is this version from an Ubuntu 14.04 standard package (I’m using Fedora, I can’t look)?

The README file at the top level directory of the kernel source has a section “Alternative configuration commands are”. This also mentions the “O=” parameter useful for cross compiles, but the downloadable Documentation has more information on this. When you “make Image” or “make zImage” it produces a final file…when you use “make” with any of the config utilities it actually executes a config program you can use interactively.

One possibility as to what you missed from a direct edit:

```auto
SND_SOC_ALL_CODECS [=n]

```

Something else to consider is that when hand editing you may not know which parts can be built as a module, and which parts can only be built as an integrated kernel feature. If you wanted to build your driver as a module and it is only possible as an integrated feature, then hand editing as “=m” could result in an invalid feature.

I suggest you run “make nconfig”, then use the search feature and look for “SND\_SOC\_WM8978”. Look at the menu at the bottom of nconfig and note that you can enable seeing invisible features…if SND\_SOC\_WM8978 does not show up normally, perhaps it is because you have something else in need of enabling first.

Do be sure to always start with either tegra12\_defconfig target or (better yet) copy/gunzip of the “/proc/config.gz” to “.config”. Never forget to edit CONFIG\_LOCALVERSION to match the suffix you get from “uname -r”.

If it still fails post the error message and perhaps a few lines prior to the error.

---

<div class="post-metadata">

**Author:** ![garid3000](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@garid3000](https://forums.developer.nvidia.com/u/garid3000)\
**Post date:** [October 18, 2017, 4:58am UTC](https://forums.developer.nvidia.com/t/kernel-driver-not-compiling/53997/8 "2017-10-18T04:58:41Z")

</div>

Thank you linuxdev, It was a dependency related problem.

---

<div class="post-metadata">

**Author:** ![Calmcar-Bao](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/calmcar-bao/32/12894_2.png) [@Calmcar-Bao](https://forums.developer.nvidia.com/u/Calmcar-Bao)\
**Post date:** [February 24, 2018, 5:06am UTC](https://forums.developer.nvidia.com/t/kernel-driver-not-compiling/53997/9 "2018-02-24T05:06:50Z")

</div>

Is your wm8978 audio successful?

---

<div class="post-metadata">

**Author:** ![garid3000](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@garid3000](https://forums.developer.nvidia.com/u/garid3000)\
**Post date:** [February 24, 2018, 7:54am UTC](https://forums.developer.nvidia.com/t/kernel-driver-not-compiling/53997/10 "2018-02-24T07:54:33Z")

</div>

Almost yes. At least, I could audio files.

---

<div class="post-metadata">

**Author:** ![Calmcar-Bao](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/calmcar-bao/32/12894_2.png) [@Calmcar-Bao](https://forums.developer.nvidia.com/u/Calmcar-Bao)\
**Post date:** [February 24, 2018, 8:03am UTC](https://forums.developer.nvidia.com/t/kernel-driver-not-compiling/53997/11 "2018-02-24T08:03:54Z")

</div>

Can you help me? I use the TX2 wm8978 audio, I finished configuring, no error, but can not record and play music

---

<div class="post-metadata">

**Author:** ![Calmcar-Bao](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/calmcar-bao/32/12894_2.png) [@Calmcar-Bao](https://forums.developer.nvidia.com/u/Calmcar-Bao)\
**Post date:** [February 26, 2018, 9:48am UTC](https://forums.developer.nvidia.com/t/kernel-driver-not-compiling/53997/12 "2018-02-26T09:48:19Z")

</div>

Can you share your amixer configuration?

---

<div class="post-metadata">

**Author:** ![TomNVIDIA](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/tomnvidia/32/14181_2.png) [@TomNVIDIA](https://forums.developer.nvidia.com/u/TomNVIDIA)\
**Post date:** [October 18, 2021, 6:44pm UTC](https://forums.developer.nvidia.com/t/kernel-driver-not-compiling/53997/13 "2021-10-18T18:44:53Z")

</div>

Closed on October 18, 2021, 6:44pm UTC


