Support newer kernel paths as well

This commit is contained in:
Pierre Pronchery 2011-03-10 19:27:06 +00:00
parent 2703193a6d
commit 83e274cc87

View File

@ -226,12 +226,20 @@ static int _event_mixer_set(PhonePlugin * plugin, char const * filename)
static int _event_power_on(PhonePlugin * plugin, gboolean power) static int _event_power_on(PhonePlugin * plugin, gboolean power)
{ {
int ret = 0; int ret = 0;
char const path[] = "/sys/bus/platform/drivers/neo1973-pm-gsm" char const path1[] = "/sys/bus/platform/drivers/gta02-pm-gsm"
"/gta02-pm-gsm.0/power_on";
char const path2[] = "/sys/bus/platform/drivers/neo1973-pm-gsm"
"/neo1973-pm-gsm.0/power_on"; "/neo1973-pm-gsm.0/power_on";
char const * path = path1;
int fd; int fd;
char buf[256]; char buf[256];
if((fd = open(path, O_WRONLY)) < 0) if((fd = open(path, O_WRONLY)) < 0)
{
path = path2;
fd = open(path, O_WRONLY);
}
if(fd < 0)
{ {
snprintf(buf, sizeof(buf), "%s: %s", path, strerror(errno)); snprintf(buf, sizeof(buf), "%s: %s", path, strerror(errno));
return plugin->helper->error(NULL, buf, 1); return plugin->helper->error(NULL, buf, 1);