Find the answer to your Linux question:
Results 1 to 2 of 2
Hi... embedded ystem specs: see below. also: # lsmod | grep i2c i2c_scmi 3811 0 i2c_algo_bit 4197 0 i2c_dev 6118 0 i2c_isch 5815 0 i2c_core 21328 4 i2c_scmi,i2c_algo_bit,i2c_dev,i2c_isch problem: no ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2011
    Posts
    4

    smbus & intel SCH US15W


    Hi...

    embedded ystem specs: see below.

    also:

    # lsmod | grep i2c
    i2c_scmi 3811 0
    i2c_algo_bit 4197 0
    i2c_dev 6118 0
    i2c_isch 5815 0
    i2c_core 21328 4 i2c_scmi,i2c_algo_bit,i2c_dev,i2c_isch


    problem: no /dev/i2c-0 present

    question: how to use user space i2c/SMBus when I cannot open + utilize devices on the smbus?

    for example: smbus_fd = oepn("/dev/i2c-o", O_RDWR) cannot be done since '/dev/i2c-o' does not exists nor is it attached to the i2c-bus (see tree below). Thanks

    ------------------------------------


    # tree /sys/bus/i2c
    /sys/bus/i2c
    ├── devices
    ├── drivers
    │** ├── dev_driver
    │** │** ├── bind
    │** │** ├── module -> ../../../../module/i2c_dev
    │** │** ├── uevent
    │** │** └── unbind
    │** └── dummy
    │** ├── bind
    │** ├── module -> ../../../../module/i2c_core
    │** ├── uevent
    │** └── unbind
    ├── drivers_autoprobe
    ├── drivers_probe
    └── uevent




    -------------------
    System: Host Kernel 2.6.35.10-74.fc14.i686 i686 (32 bit) Distro Fedora release 14 (Laughlin)
    CPU: Single core Intel Atom Z530 (-HT-) cache 512 KB flags (nx sse sse2 sse3 ssse3 vmx) bmips 3192.23
    Clock Speeds: (1) 800.00 MHz (2) 800.00 MHz
    Graphics: Card Intel System Controller Hub (SCH Poulsbo) Graphics Controller X.org 1.9.3 Res: 179x61 Gfx Data: N/A for root out of X
    Audio: Card Intel System Controller Hub (SCH Poulsbo) HD Audio Controller driver HDA Intel BusID: 00:1b.0
    Sound: Advanced Linux Sound Architecture Version 1.0.23
    Network: Card Intel 82572EI Gigabit Ethernet Controller (Copper) driver e1000e v: 1.0.2-k4 at port 2000 BusID: 04:00.0
    Disks: HDD Total Size: 20.0GB (23.4% used) 1: /dev/sda TOSHIBA_MK2018GA 20.0GB
    Partition: ID:/ size: 15G used: 4.4G (32%) fs: ext4
    Info: Processes 99 Uptime 2:45 Memory 70.0/995.6MB Runlevel 3 Client Shell inxi 1.4.23

  2. #2
    Just Joined!
    Join Date
    Feb 2011
    Posts
    4

    more information...

    I have figured out a few things...

    1. the intel SCH US15W document has pertinent smbus information here:

    download.intel.com/design/chipsets/embedded/datashts/319537.pdf

    2. page 354 of document specifies PCI vendor id + dev identification, then the base register for SMBus (= 0x040)

    3. the i2c-isch is a platform driver, can only be one of these alive at the time,

    - my understanding is that this platform driver needs a platform device that uses the SMBus.

    4. create a platform device, where you basically instantiate a pci driver, request the pci region to get the SMBus base address, put this in a platform resource, allocate a platform device, add the resource to the allocated device, and then add the platform device

    hmd_i2c_resource[0].start = hmd_smba;
    hmd_i2c_resource[0].end = hmd_smba + 64;

    hmd_pdev = platform_device_alloc("isch_smbus", -1);
    // -----------------------------------------------------------------------
    if (hmd_pdev)
    { // -----------
    err = platform_device_add_resources( hmd_pdev, hmd_i2c_resource, ARRAY_SIZE(hmd_i2c_resource) );
    // -----------
    if (err == 0)
    { // ---------------------------------------------[ platform device ]
    err = platform_device_add(hmd_pdev);
    } // ----------------------------------------------------------------
    }

    5. after the platform device has been added, the i2c-isch probe function will be called, and a device registered such that now I have:

    # tree /sys/bus/i2c
    /sys/bus/i2c
    ├── devices
    │ └── i2c-0 -> ../../../devices/platform/isch_smbus/i2c-0
    ├── drivers
    │ ├── dummy
    │ │ ├── bind
    │ │ ├── module -> ../../../../module/i2c_core
    │ │ ├── uevent
    │ │ └── unbind
    │ └── gse_hmd
    │ ├── bind
    │ ├── module -> ../../../../module/gse_hmd
    │ ├── uevent
    │ └── unbind
    ├── drivers_autoprobe
    ├── drivers_probe
    └── uevent

    6. now what? How do I use this device now? How do I access the SMBus?

    - it seems that I have to create a smbus client, but I cannot get the i2c_adapter struct populated...

    struct i2c_adapter *my_i2c_adap;

    - also, there is no new i2c device created in /dev

    - where do I go from here?


    Is this not the proper forum to ask these questions? Any suggestions?

    Thanks.

    Regards...

    Miguel.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •