Advertisement
Guest User

Untitled

a guest
Apr 21st, 2014
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.67 KB | None | 0 0
  1. nclude <linux/kernel.h>
  2. #include <linux/module.h>
  3. #include <linux/fs.h>
  4.  
  5. #include <linux/i2c.h>
  6. #include <linux/interrupt.h>
  7.  
  8. #define SUCCESS 0
  9. #define mbedID 0x01
  10.  
  11. int init_module(void);
  12. void cleanup_module(void);
  13.  
  14. static const struct i2c_board_info rasp_i2c_devices[] = {
  15. { "mbed", mbedID },
  16. };
  17.  
  18. /*
  19. * * This function is called when the module is loaded
  20. * */
  21. int init_module(void)
  22. {
  23. /* give major number 0 to get dynamic major number */
  24.  
  25. /*
  26. * register your mbed on the I2C bus
  27. */
  28. i2c_register_board_info(0,rasp_i2c_devices,
  29. ARRAY_SIZE(rasp_i2c_devices));
  30. return SUCCESS;
  31. }
  32. void cleanup_module(void)
  33. {
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement