This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

pinmux configuration

Other Parts Discussed in Thread: AM1808

 

Hi

         I am using pinmux in am1808 expereminters kit.in da850.c we have  MUX_CFG(   ).i was trying to add one more column in that for enabling GP4[14], GP0[9],GP5[11].

        MUX_CFG(DA850, GPIO5_11,       11,     16,      15,     8,      false)                 
        MUX_CFG(DA850, GPIO4_14,       11,     16,      15,     8,      false)                 
        MUX_CFG(DA850, GPIO0_9,        11,     16,      15,     8,      false)          

  In the above configurations GP5[11] is working fine. how can we get the perameters in this call. can any one give small description about the perameters.

 

Thanks

Vasu Vallabhaneni

  • Hi Vasu,

    Look at the macro on "arch/arm/mach-davinci/mux.h" file then you can understand how those fields used.

    And ultimately all the definitions are mapping to structure number defined in davinci_da850_index enum. Then to mux_config structure fields, defined in "arch/arm/mach-davinci/include/mach/mux.h"

    Ex:  MUX_CFG(DA850, GPIO5_11,       11,     16,      15,     8,      false)  will result to

    [DA850_GPIO5_11] = { .name = "GPIO5_11", .debug = false, .mux_reg_name = "PINMUX11", .mux_reg = PINMUX(11), .mask_offset = 16, .mask = 15, .mode = 8} 

    PS: Please close earlier threads, if it answer to your questions

    Regards

    AnilKumar

    Please mark this Forum post as answered via the Verify Answer button below if it helps answer your question.  Thanks!

     

  • Hi Vasu

    I have the same problem with you. Can you get me some help or get me a piece of source code ?

  • Hi

    This info is already available in ti community.....the following procedure will give you exat results.

    Usually you must change the kernel to change the pinmux. Configuring the pinmux from userspace is not possible due to privilege problems. You might be able to do this from within a loadable module. Probably not as the pinmux functions and structures are not exported from the kernel. Note that some GPIOS might be used by other modules. GPIO5_11 is the same pin as EMA_A_11.

    You might be able to modify the pinmux registers directly. Tricky stuff with virtual address, privilege, lock registers and such.

    ----------------------------
    File: arch/arm/mach-davinci/da850.c
    ...
    static const struct mux_config da850_pins[] = {
    ...
        MUX_CFG(DA850, GPIO5_11,    11,    16,    15,    8,    false) //<--Add--
    #endif
    };
    ...

    ----------------------------
    File: arch/arm/mach-davinci/include/mach/mux.h
    ...
    enum davinci_da850_index {
    ...
        DA850_ECAP2_APWM2,

        DA850_GPIO5_11, //<--Add--
    };
    ...

    ----------------------------
    File: arch/arm/mach-davinci/board-da850-evm.c
    ...
    // Add these if you intend on using gpio_request(), etc. in
    // this file. Not required if you are using GPIO sysfs.
    // These are use 0 based numbering. Do no confuse with
    // the 1 based numbering in the TRM
    #define GPIO91_PIN        GPIO_TO_PIN(5, 11) //<--Add--
    ...
    static const short da850_my_gpio_pins[] = { //<--Add--
        DA850_GPIO5_11, //<--Add--
        -1 //<--Add--
    }; //<--Add--
    ...
    static __init void da850_evm_init(void)
    {
    ...
        ret = davinci_cfg_reg_list(da850_my_gpio_pins); //<--Add--
        if (ret) //<--Add--
            pr_warning("da850_evm_init: my gpio mux setup failed: %d\n", ret); //<--Add--

        /* initilaize usb module */
        da850_evm_usb_init();
    }

    Thanks

    Vasu Vallabhaneni

  • Hi Vasu

    I have solved my problem.

    Thank you very much!

    Regards

    He