Changeset 4302


Ignore:
Timestamp:
04/03/08 06:21:21 (5 years ago)
Author:
erin_yueh
Message:

openmoko-panel-bt: update BT power_on and reset path name (Erin Yueh)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/target/OM-2007.2/panel-plugins/openmoko-panel-bt/src/openmoko-panel-bt.c

    r4197 r4302  
    2323#include <stdio.h> 
    2424 
    25 #define BT_POWERON_FILENAME "/sys/class/i2c-dev/i2c-0/device/0-0008/gta01-pm-bt.0/power_on" 
    26 #define BT_POWERON_FILENAME2 "/sys/class/i2c-dev/i2c-0/device/0-0008/neo1973-pm-bt.0/power_on" 
     25#define BT_POWERON_FILENAME "/sys/devices/platform/s3c2440-i2c/i2c-adapter/i2c-0/0-0073/neo1973-pm-bt.0/power_on" 
     26#define BT_RESET_FILENAME "/sys/devices/platform/s3c2440-i2c/i2c-adapter/i2c-0/0-0073/neo1973-pm-bt.0/reset" 
    2727 
    2828typedef struct { 
     
    3737  int val; 
    3838 
    39   if (f == NULL) f = fopen(BT_POWERON_FILENAME2, "r+"); 
    4039  if (f == NULL) return -1; 
    4140 
     
    5049  FILE * f = fopen(BT_POWERON_FILENAME, "w"); 
    5150 
    52   if (f == NULL) f = fopen(BT_POWERON_FILENAME2, "w"); 
     51  if (f == NULL) return -1; 
     52 
     53  fprintf(f, "%i\n", val); 
     54 
     55  fclose(f); 
     56 
     57  return val; 
     58} 
     59 
     60static int 
     61reset_bt_power(int val) 
     62{ 
     63  FILE * f = fopen(BT_RESET_FILENAME, "w"); 
     64 
    5365  if (f == NULL) return -1; 
    5466 
     
    7789 
    7890    ret = set_bt_power(1); 
     91    ret = reset_bt_power(0); 
    7992    mb_panel_update(applet, 1); 
    8093    nn = notify_notification_new ("Bluetooth turned on", NULL, NULL, NULL); 
Note: See TracChangeset for help on using the changeset viewer.