]>
git.zerfleddert.de Git - ms2-kexec/blob - headphone_cons.c
edf8d165cd53415ead347121d4b0b66db52b1baf
2 * Provide kernel console on headphone jack
5 #include <linux/module.h>
6 #include <linux/gpio_mapping.h>
7 #include <linux/gpio.h>
10 * int add_preferred_console(char *name, int idx, char *options)
11 * c0069208 T add_preferred_console
14 static int (*add_preferred_console
)(char *, int, char*) = (int (*)(char*, int, char*))0xc0069208;
16 static int __init
headphone_cons_init(void)
20 /* Get the headset switch gpio number from devtree */
21 hs_switch
= get_gpio_by_name("headset_uart_switch");
25 /* configure headset switch gpio as output and
26 direction based on devtree setting */
27 gpio_request(hs_switch
, "mapphone audio headset uart switch");
29 /* route kernel uart out headset jack */
30 gpio_direction_output(hs_switch
, 0);
32 add_preferred_console("ttyS", 1, "115200");
36 module_init(headphone_cons_init
);
38 MODULE_LICENSE("GPL");
39 MODULE_AUTHOR("Michael Gernoth <michael@gernoth.net>");