Advertisement
techmik

new vs old led

Aug 27th, 2011
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 4.51 KB | None | 0 0
  1.  
  2. 3a4
  3. >  * Copyright 2011, Michael Richter (alias neldar)
  4. 43c44
  5. < #ifdef CONFIG_KEYPAD_CYPRESS_TOUCH_BLN
  6. ---
  7. > #ifdef CONFIG_KEYPAD_CYPRESS_TOUCH_USE_BLN
  8. 48c49
  9. < bool bln_notification_ongoing= false; // indicates ongoing LED Notification
  10. ---
  11. > bool BacklightNotification_ongoing= false; // indicates ongoing LED Notification
  12. 50c51
  13. < struct cypress_touchkey_devdata *bln_devdata; // keep a reference to the devdata
  14. ---
  15. > struct cypress_touchkey_devdata *blndevdata; // keep a reference to the devdata
  16. 69c70
  17. <   int retry = 2;
  18. ---
  19. >   int retry = 5;
  20. 78d78
  21. <       if (!retry--) {
  22. 79a80
  23. >       if (!retry--)
  24. 81d81
  25. <         }
  26. 93d92
  27. <     unsigned long flags;
  28. 100d98
  29. <       if (!retry--) {
  30. 101a100
  31. >       if (!retry--)
  32. 103d101
  33. <         }
  34. 202a201,202
  35. >       dev_dbg(&devdata->client->dev, "%s: ignoring spurious boot "
  36. >                   "interrupt\n", __func__);
  37. 222c222,223
  38. < #ifdef CONFIG_KEYPAD_CYPRESS_TOUCH_BLN
  39. ---
  40. >
  41. > #ifdef CONFIG_KEYPAD_CYPRESS_TOUCH_USE_BLN
  42. 227c228
  43. <   if(!bln_notification_ongoing)
  44. ---
  45. >   if(!BacklightNotification_ongoing)
  46. 253c254,264
  47. < #ifdef CONFIG_KEYPAD_CYPRESS_TOUCH_BLN
  48. ---
  49. > static void touchkey_power_on(void){
  50. >   blndevdata->pdata->touchkey_onoff(TOUCHKEY_ON);
  51. >   mdelay(50);
  52. > }
  53. >
  54. > static void touchkey_power_off(void){
  55. >   blndevdata->pdata->touchkey_onoff(TOUCHKEY_OFF);
  56. >   mdelay(30);
  57. > }
  58. >
  59. > #ifdef CONFIG_KEYPAD_CYPRESS_TOUCH_USE_BLN
  60. 257c268
  61. <   i2c_touchkey_write_byte(bln_devdata, bln_devdata->backlight_on);
  62. ---
  63. >   i2c_touchkey_write_byte(blndevdata, blndevdata->backlight_on);
  64. 261c272
  65. <   i2c_touchkey_write_byte(bln_devdata, bln_devdata->backlight_off);
  66. ---
  67. >   i2c_touchkey_write_byte(blndevdata, blndevdata->backlight_off);
  68. 267,270c278
  69. <       pr_info("%s: bln interface enabled\n", __FUNCTION__); //remove me
  70. <      
  71. <       if (bln_devdata->is_powering_on){
  72. <       pr_info("%s: not in touchmode\n", __FUNCTION__); //remove me
  73. ---
  74. >       if (blndevdata->is_powering_on){
  75. 272c280,283
  76. <           bln_notification_ongoing = true;
  77. ---
  78. >           BacklightNotification_ongoing = true;
  79. >
  80. >           /* reconfigure gpio for sleep mode */
  81. >           blndevdata->pdata->touchkey_sleep_onoff(TOUCHKEY_ON);
  82. 280,281c291
  83. <           pr_info("%s: enable vdd\n", __FUNCTION__); //remove me
  84. <           bln_devdata->pdata->touchkey_onoff(TOUCHKEY_ON);
  85. ---
  86. >           blndevdata->pdata->touchkey_onoff(TOUCHKEY_ON);
  87. 284d293
  88. <           pr_info("%s: enable lights\n", __FUNCTION__); //remove me
  89. 299a309,314
  90. >   /*
  91. >    * reconfigure gpio for sleep mode, this has to be done
  92. >    * independently from the power status
  93. >    */
  94. >   blndevdata->pdata->touchkey_sleep_onoff(TOUCHKEY_OFF);
  95. >
  96. 301c316
  97. <   if (bln_devdata->is_powering_on){
  98. ---
  99. >   if (blndevdata->is_powering_on){
  100. 302a318,326
  101. >
  102. >       #if 0
  103. >       /*
  104. >        * power off the touchkey controller
  105. >        * This is actually not needed, the early_suspend function
  106. >        * should take care of powering off the touchkey controller
  107. >        */
  108. >       blndevdata->pdata->touchkey_onoff(TOUCHKEY_OFF);
  109. >       #endif
  110. 306c330
  111. <   bln_notification_ongoing = false;
  112. ---
  113. >   BacklightNotification_ongoing = false;
  114. 327c351
  115. <               if (bln_notification_ongoing)
  116. ---
  117. >               if (BacklightNotification_ongoing)
  118. 341c365
  119. <   return sprintf(buf,"%u\n", (bln_notification_ongoing ? 1 : 0));
  120. ---
  121. >   return sprintf(buf,"%u\n", (BacklightNotification_ongoing ? 1 : 0));
  122. 375c399
  123. <           if (bln_notification_ongoing){
  124. ---
  125. >           if (BacklightNotification_ongoing){
  126. 405c429
  127. < static struct attribute *bln_interface_attributes[] = {
  128. ---
  129. > static struct attribute *bln_notification_attributes[] = {
  130. 413,414c437,438
  131. < static struct attribute_group bln_interface_attributes_group = {
  132. <       .attrs  = bln_interface_attributes,
  133. ---
  134. > static struct attribute_group bln_notification_group = {
  135. >       .attrs  = bln_notification_attributes,
  136. 529c553
  137. < #ifdef CONFIG_KEYPAD_CYPRESS_TOUCH_BLN
  138. ---
  139. > #ifdef CONFIG_KEYPAD_CYPRESS_TOUCH_USE_BLN
  140. 537c561
  141. <        *  misc driver does not give access to it (or i missed that somewhere)
  142. ---
  143. >        *  misc driver does not give access to it (or i did miss that somewhere)
  144. 539c563
  145. <       bln_devdata = devdata;
  146. ---
  147. >       blndevdata = devdata;
  148. 542c566
  149. <       if (sysfs_create_group(&backlightnotification_device.this_device->kobj, &bln_interface_attributes_group) < 0)
  150. ---
  151. >       if (sysfs_create_group(&backlightnotification_device.this_device->kobj, &bln_notification_group) < 0)
  152. 568a593
  153. > /*    dev_err(&client->dev, "%s: i2c_touchkey_remove\n", __func__);*/
  154. 570c595
  155. < #ifdef CONFIG_KEYPAD_CYPRESS_TOUCH_BLN
  156. ---
  157. > #ifdef CONFIG_KEYPAD_CYPRESS_TOUCH_USE_BLN
  158. 574d598
  159. <   dev_err(&client->dev, "%s: i2c_touchkey_remove\n", __func__);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement