Linux driver 板級檔案跟蹤一般方法

來源:互聯網
上載者:User

標籤:

/*********************************************************************************** *                      Linux driver 板級檔案跟蹤一般方法 *  聲明: *      1. 這是本人使用vim+ctags最常用的跟蹤方法,也是唯一的方法;  :) *      2. 本人已經在跟蹤線上標註了跟蹤序號,也就是先後循序; *      3. 就目前而言,這種方法貌似是通用的; *      4. 這個例子僅僅是簡單的示範,並沒有全部展開,如果想要進一步跟蹤, *          繼續跟就行了。 *      5. 原始碼來自:myzr_android4_2_2_1_1_0.tar.bz2 * *                                    2015-6-12 晴 深圳 南山平山村 曾劍鋒 **********************************************************************************/cat arch/arm/mach-mx6/board-mx6q_sabresd.c......#define SABRESD_POWER_OFF   IMX_GPIO_NR(3, 29)          <--------------------------+......                                                                             |                                                                                   |#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)          |#define GPIO_BUTTON(gpio_num, ev_code, act_low, descr, wake, debounce)  \ <------+ |{                               \                                                | |    .gpio       = gpio_num,             \                                        | |    .type       = EV_KEY,               \                                        | |    .code       = ev_code,              \                                        | |    .active_low = act_low,              \                                        | |    .desc       = "btn " descr,             \                                    | |    .wakeup     = wake,                 \                                        ^ |    .debounce_interval = debounce,              \                                | |}                                                                                | |                                                                                 | |static struct gpio_keys_button new_sabresd_buttons[] = {        <-----<-------+  | |    //GPIO_BUTTON(SABRESD_VOLUME_UP, KEY_VOLUMEUP, 1, "volume-up", 0, 1),     |  | |    //GPIO_BUTTON(SABRESD_VOLUME_DN, KEY_VOLUMEDOWN, 1, "volume-down", 0, 1), |  | |    GPIO_BUTTON(SABRESD_POWER_OFF, KEY_POWER, 1, "power-key", 1, 1), --6->----*--+ |};                    ^-----------------------7-------------------------------*----+                                                                              |static struct gpio_keys_platform_data new_sabresd_button_data = {  <-------+  |    .buttons    = new_sabresd_buttons,       >-------5----->---------------*--+    .nbuttons   = ARRAY_SIZE(new_sabresd_buttons),                         |};                                                                         |                                                                           |static struct platform_device sabresd_button_device = { <--+               |    .name           = "gpio-keys",                         |               |    .id             = -1,                                  |               ^    .num_resources  = 0,                                   |               |};                                                         |               |                                                           |               |static void __init imx6q_add_device_buttons(void)    <-----*-------+       |{                                                          |       |       |    platform_device_add_data(&sabresd_button_device,  >--3-+       |       |                &new_sabresd_button_data,                          |       |                sizeof(new_sabresd_button_data));   >---4----------*-------+                                                                   |    platform_device_register(&sabresd_button_device);              |}                                                                  |                                                                   |                                                                   |......                                                             ^/*!                                                                | * Board specific initialization.                                  | */                                                                |static void __init mx6_sabresd_board_init(void)   <------------<---*--------<-----+{                                                                  |              |    ......                                                         |              |    imx6q_add_device_buttons(); ------>-------2------>-------------+              |    ......                                                                        |}                                                                                 |                                                                                  |......                                                                            |/*                                                                                ^ * initialize __mach_desc_MX6Q_SABRESD data structure.                            | */                                                                               |MACHINE_START(MX6Q_SABRESD, "Freescale i.MX 6Quad/DualLite/Solo Sabre-SD Board")  |    /* Maintainer: Freescale Semiconductor, Inc. */                               |    .boot_params = MX6_PHYS_OFFSET + 0x100,                                       |    .fixup = fixup_mxc_board,                                                     |    .map_io = mx6_map_io,                                                         |    .init_irq = mx6_init_irq,                                                     |    .init_machine = mx6_sabresd_board_init,  ----->-------1------>------->--------+    .timer = &mx6_sabresd_timer,    .reserve = mx6q_sabresd_reserve,MACHINE_END

 

Linux driver 板級檔案跟蹤一般方法

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.