logo

Question

Enable I2C2

posted in IGEPv2
Wednesday, July 06 2016, 05:22 PM
alvarez
alvarez
Offline
0
Hello,
I want to enable I2C2 of J990.
I have comment in /boot/Igep.ini buddy = igep0022 cause i need gpio136 and gpio157 as input ( i think is used as reset for igepv2 expansion ).
How i can enabling I2c2?

Thanx!!!
Responses (5)
  • Accepted Answer

    Thursday, July 07 2016, 12:43 PM - #permalink
    0
    Hi alvarez,

    IGEP0022 configures I2C2 bus at this line:
    http://git.isee.biz/?p=pub/scm/linux-omap-2.6.git;a=blob;f=arch/arm/mach-omap2/exp-igep0022.c;h=475228832412c99a0a52a4652518279a59b87d0c;hb=refs/heads/linux-2.6.37.y#l121
    Add this into igep0020 or custom expansion board file

    Cheers!
    The reply is currently minimized Show
  • Accepted Answer

    alvarez
    alvarez
    Offline
    Monday, July 11 2016, 04:16 PM - #permalink
    0
    Thanks Pau,
    I decide to custom expansion board file for my project.
    I explain my requeriments:
    - IgepV2 wifi version
    -I2C 2
    -SPI 4 (CS 0).
    -2 GPIO (gpio136 and gpio157).

    I make a custom board file(igep0090.c), compile,copy /boot/zImage and update modules.
    I have i2c and gpio enable but no spi ( /dev/spidev4.0 not found only /dev/spidev2.0)

    Here is igep0090.c:


    /* exp_igep0090 -> Igepv2_Edishield*/
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include 
    #include "mux.h"
    #include "board-igep00x0.h"
    
    #ifdef CONFIG_OMAP_MUX
    static struct omap_board_mux igep0090_mux[] __initdata = {
    
    	OMAP3_MUX(I2C2_SCL, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
    	OMAP3_MUX(I2C2_SDA, OMAP_MUX_MODE0 | OMAP_PIN_INPUT),
    
           OMAP3_MUX(MCBSP1_CLKR, OMAP_MUX_MODE1 | OMAP_PIN_OUTPUT),
           OMAP3_MUX(MCBSP1_DR, OMAP_MUX_MODE1 | OMAP_PIN_INPUT),
           OMAP3_MUX(MCBSP1_DX, OMAP_MUX_MODE1 | OMAP_PIN_INPUT),
           OMAP3_MUX(MCBSP1_FSX, OMAP_MUX_MODE1 | OMAP_PIN_INPUT),
    
    	{ .reg_offset = OMAP_MUX_TERMINATOR },
    };
    #else
    #define ex-igep0090_mux	NULL
    #endif
    
    
    static struct spi_board_info igep2_spidev_board_info4 __initdata = {
        .modalias	= "spidev",
        .bus_num	= 4,
        .chip_select	= 0,
        .max_speed_hz	= 20000000,
        .mode		= SPI_MODE_0,
    };
    
    void __init igep0090_init(void) {
    
    	pr_info("Initializing expansion board ... \n");
    	mux_partition = omap_mux_get("core");
    
            /*Register i2c devices
            omap_register_i2c_bus(2, 400, NULL, 0);
    
            /*Register spidev devices*/
            spi_register_board_info(&igep2_spidev_board_info4, 1);    
    }
    



    Thanks.
    The reply is currently minimized Show
  • Accepted Answer

    alvarez
    alvarez
    Offline
    Monday, July 11 2016, 04:20 PM - #permalink
    0
    Ooops! includes don't shown

    #include
    #include
    #include
    #include
    #include
    #include
    #include

    #include
    #include

    #include
    #include

    #include "mux.h"
    #include "board-igep00x0.h"
    The reply is currently minimized Show
  • Accepted Answer

    alvarez
    alvarez
    Offline
    Monday, July 11 2016, 04:24 PM - #permalink
    0
    I delete some signal for shown includes

    #include linux/kernel.h
    #include linux/init.h
    #include linux/platform_device.h
    #include linux/err.h
    #include linux/module.h
    #include linux/device.h
    #include linux/spi/spi.h
    #include asm/mach-types.h
    #include asm/mach/arch.h

    #include plat/board.h
    #include plat/common.h

    #include "mux.h"
    #include board-igep00x0.h
    The reply is currently minimized Show
  • Accepted Answer

    Tuesday, July 12 2016, 10:02 AM - #permalink
    0
    Hi alvarez,

    Do a patch file with all your kernel modifications and add your igep.ini file too

    Finally compress to a zip to test your code

    Cheers!
    The reply is currently minimized Show
Your Reply

SUPPORT


This email address is being protected from spambots. You need JavaScript enabled to view it.
This email address is being protected from spambots. You need JavaScript enabled to view it.
IGEP Community Wiki
IGEP Community Forum
IGEP Community Online Chat