I2C Drive analysis of the Rockchip RK30 series--note that there is a big difference between the writing and the Samsung notation

Source: Internet
Author: User
Tags goto

Linux under a lot of devices are used to the I2C, so look at the driver of the I2C, although now understanding may still be human and material resources, but at least there are some basic concepts

Reference:

http://blog.csdn.net/ylyuanlu/article/details/6705942

http://blog.csdn.net/hongjiujing/article/details/4098547


Look at the I2C initialization process:


[CPP]  View plain copy print? Static int __init i2c_init (void)    {       int  retval;       leaves_debug_flag_driver_i2c_busses_i2c_i2c_core_function_enter        retval = bus_register (&i2c_bus_type);        if  (retval)            return  retval;   #ifdef  CONFIG_I2C_COMPAT       i2c_adapter_compat_class  = class_compat_register ("I2c-adapter");       if  (!i2c_adapter_ Compat_class)  {           retval = -ENOMEM;            goto bus_err;        }   #endif        printk ("Leaves before i2c_add_driver\n ");       retval = i2c_add_driver (&dummy_driver);        PRINTK ("leaves after i2c_add_driver\n");        if  (retval)            goto class_err;    #ifdef  CONFIG_I2C_DEV_RK29           init_ Completion (&i2c_dev_complete);   #endif        leaves_debug_flag_ driver_i2c_busses_i2c_i2c_core_function_exit       return 0;      class_err:   #ifdef  CONFIG_I2C_COMPAT       class_ Compat_unregister (i2c_adapter_compat_class);   bus_err:   #endif         bus_unregister (&i2c_bus_type);       LEAVES_DEBUG_FLAG_DRIVER_I2C _busses_i2c_i2c_core_function_exit       return retval;  }  

This function is mainly registered for the I2C bus

2,

This is for the Rockchip chip 30,661 Board initialization, registered 5 I2C devices [CPP] view plain copy print?   static void __init rk30_init_i2c (void) {PRINTK ("leaves Enter%s.\n", __function__);   #ifdef config_i2c0_rk30 Platform_device_register (&device_i2c0);   #endif #ifdef config_i2c1_rk30 platform_device_register (&DEVICE_I2C1); #endif &

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.