pastebin - collaborative debugging tool
eckelmann.kpaste.net RSS


check osci flag
Posted by Anonymous on Mon 11th Mar 2019 16:05
raw | new post

  1. diff --git a/arch/arm/boards/eag-mx25/board.c b/arch/arm/boards/eag-mx25/board.c
  2. index f581454c1a8f..beb45c01768d 100644
  3. --- a/arch/arm/boards/eag-mx25/board.c
  4. +++ b/arch/arm/boards/eag-mx25/board.c
  5. @@ -11,6 +11,7 @@
  6.  #include <mach/imxfb.h>
  7.  #include <mach/devices-imx25.h>
  8.  #include <gpio.h>
  9. +#include <i2c/i2c.h>
  10.  
  11.  static int imx25_eag_pmic_init(void)
  12.  {
  13. @@ -27,6 +28,33 @@ static int imx25_eag_pmic_init(void)
  14.  }
  15.  late_initcall(imx25_eag_pmic_init);
  16.  
  17. +static int imx25_eag_check_osci_stop(void)
  18. +{
  19. +   int ret=0;
  20. +   struct i2c_adapter *adapter = NULL;
  21. +   struct i2c_client client;
  22. +   u8 buf;
  23. +
  24. +   adapter = i2c_get_adapter(0);
  25. +   if (!adapter) {
  26. +       return -ENODEV;
  27. +   }
  28. +
  29. +   client.adapter = adapter;
  30. +   client.addr = 0x51;
  31. +
  32. +   ret = i2c_read_reg(&client, 0x02, &buf, 1);
  33. +   if (ret == 1) {
  34. +       if( buf & 0x80 ){
  35. +           printf("Osci stop bit is set\n");
  36. +           return 1;
  37. +       }
  38. +   }
  39. +
  40. +   return 0;
  41. +}
  42. +late_initcall(imx25_eag_check_osci_stop);
  43. +
  44.  static const iomux_v3_cfg_t imx25_eag_ci4000_lcdc_pins[] = {
  45.     MX25_PAD_LD0__LD0,
  46.     MX25_PAD_LD1__LD1,

Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:

To highlight particular lines, prefix each line with {%HIGHLIGHT}





All content is user-submitted.
The administrators of this site (kpaste.net) are not responsible for their content.
Abuse reports should be emailed to us at