You are not logged in.

#1 2013-06-27 08:36:53

Mhyperbolic
Member
Registered: 2012-11-18
Posts: 30

[SOLVED] Add simple kernel patch (usbquirks.h)

Hello people,

I want to add a simple patch to my kernel, more specifically to usbquirks.h.
I want this to make a MEDI keyboard work properly with my machine.

What I want to add is:

{
        /* has ID 0x0110 when not in Advanced Driver mode */
        USB_DEVICE_VENDOR_SPEC(0x0582, 0x010f),
        .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
                /* .vendor_name = "Roland", */
                /* .product_name = "A-PRO", */
                .ifnum = 1,
                .type = QUIRK_MIDI_FIXED_ENDPOINT,
                .data = & (const struct snd_usb_midi_endpoint_info) {
                        .out_cables = 0x0003,
                        .in_cables  = 0x0007
                }
        }
}

I have some idea that I maybe need to recompile my kernel, or maybe I can just make a patch an apply it, but I have now idea how to go about it. Maybe there is a smarter way to do it?
I've tried looking around, but can't find any information on how to make a patch as such. Any help or pointers to help are appreciated.

Thanks!

MOD EDIT: Change title from 'closed' to 'solved' to avoid confusion

Last edited by fukawi2 (2013-06-27 22:57:22)

Offline

#2 2013-06-27 08:38:50

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: [SOLVED] Add simple kernel patch (usbquirks.h)

Moving to Programming and Scripting...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2013-06-27 08:51:33

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,688
Website

Re: [SOLVED] Add simple kernel patch (usbquirks.h)

Unless that can be compiled as a module, I believe you wil need to patch the file prior to a kernel build.  See the wiki article on ABS for more on how to do this if you do not know.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#4 2013-06-27 09:00:33

Mhyperbolic
Member
Registered: 2012-11-18
Posts: 30

Re: [SOLVED] Add simple kernel patch (usbquirks.h)

graysky wrote:

Unless that can be compiled as a module, I believe you wil need to patch the file prior to a kernel build.  See the wiki article on ABS for more on how to do this if you do not know.

I'm reading up on ABS now.

As regard to the module approach; how would I find out if I can compile it as a module?

Offline

#5 2013-06-27 10:23:23

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [SOLVED] Add simple kernel patch (usbquirks.h)

Where are you getting your information? There is no file called 'usbquirks.h' in the current kernel's source.

Offline

#6 2013-06-27 11:04:38

Mhyperbolic
Member
Registered: 2012-11-18
Posts: 30

Re: [SOLVED] Add simple kernel patch (usbquirks.h)

tomk wrote:

Where are you getting your information? There is no file called 'usbquirks.h' in the current kernel's source.


http://linux-audio.4202.n7.nabble.com/Q … 23612.html

Offline

#7 2013-06-27 11:16:27

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,332
Website

Re: [SOLVED] Add simple kernel patch (usbquirks.h)

Well here's a classic X-Y problem.  That information is almost 3 years old.  The kernel has changed a little since then.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#8 2013-06-27 11:46:54

tomk
Forum Fellow
From: Ireland
Registered: 2004-07-21
Posts: 9,839

Re: [SOLVED] Add simple kernel patch (usbquirks.h)

Indeed.

Mhyperbolic, I recommend you start a new thread describing in detail the issue you are dealing with, what you have tried so far, the expected results, and the actual results.

<edit>I've now done what you failed to do roll - read your own link thoroughly. The last post says:

Try adding the following entry to sound/usb/quirks-table.h or usbquirks.h

(my emphasis)

If you had said that from the start, you'd have saved all of us some aggravation, because quirks-table.h does exist.

<edit-the-edit>Not only that, but it already includes the patch you want to add!! So it has nothing to do with the issue that you may or may not be experiencing and about which you have told us nothing.

Last edited by tomk (2013-06-27 12:04:49)

Offline

#9 2013-06-27 13:51:16

Mhyperbolic
Member
Registered: 2012-11-18
Posts: 30

Re: [SOLVED] Add simple kernel patch (usbquirks.h)

tomk wrote:

Indeed.

Mhyperbolic, I recommend you start a new thread describing in detail the issue you are dealing with, what you have tried so far, the expected results, and the actual results.

<edit>I've now done what you failed to do roll - read your own link thoroughly. The last post says:

Try adding the following entry to sound/usb/quirks-table.h or usbquirks.h

(my emphasis)

If you had said that from the start, you'd have saved all of us some aggravation, because quirks-table.h does exist.

<edit-the-edit>Not only that, but it already includes the patch you want to add!! So it has nothing to do with the issue that you may or may not be experiencing and about which you have told us nothing.

I see. I'm sorry, I didn't know where to look for quirks-table.h or usbquirks.h, and thus see weather the patch was already included. The linked site described my problem, and so I mistakenly thought I was the same problem with the kernel, and back then.

I will mark the thread closed, and start one with the actual problem.

Thanks for the clarification.

Offline

#10 2013-06-27 16:57:53

illusionist
Member
From: localhost
Registered: 2012-04-03
Posts: 498

Re: [SOLVED] Add simple kernel patch (usbquirks.h)

Please re-edit your title and mark it as [Solved] . I am not a moderator but as far as I know "closed" is used by internal system to close a thread for anymore replies.


  Never argue with stupid people,They will drag you down to their level and then beat you with experience.--Mark Twain
@github

Offline

#11 2013-06-27 17:08:15

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: [SOLVED] Add simple kernel patch (usbquirks.h)

illusionist wrote:

Please re-edit your title and mark it as [Solved] . I am not a moderator but as far as I know "closed" is used by internal system to close a thread for anymore replies.

That's right: https://wiki.archlinux.org/index.php/Fo … ow_to_Post

Finally, when a solution is found, mark your thread as solved by editing the first post and prepending the tag [SOLVED] to the title in the "Subject" field.
Note that you should avoid using [CLOSED], which is instead used by the system to mark a thread which is no longer accessible for new posts.

Offline

Board footer

Powered by FluxBB