added support for 2.6.28 kernel

git-svn-id: http://www.neo1973-germany.de/svn@234 46df4e5c-bc4e-4628-a0fc-830ba316316d
This commit is contained in:
Paulus 2009-01-21 14:57:53 +00:00
parent 8e3042ad4e
commit dc6ada12da
2 changed files with 13 additions and 4 deletions

View file

@ -50,10 +50,17 @@ ee.callback_resize = resize_cb
class PyBatclass:
def __init__(self, edje_obj):
self.filePower = os.open( "/sys/devices/platform/s3c2440-i2c/i2c-adapter/i2c-0/0-0073/force_usb_limit_dangerous", os.O_RDWR )
self.filePowerread = os.open( "/sys/devices/platform/s3c2440-i2c/i2c-adapter/i2c-0/0-0073/usb_curlim", os.O_RDONLY )
self.system = os.uname()[2][0:6]
if self.system == "2.6.27":
self.filePowerpath = "/sys/devices/platform/s3c2440-i2c/i2c-adapter/i2c-0/0-0073/"
self.filehostmodepath = "/sys/devices/platform/s3c2410-ohci/"
elif self.system == "2.6.28":
self.filePowerpath = "/sys/devices/platform/s3c2440-i2c/i2c-adapter:i2c-0/0-0073/pcf50633-mbc/"
self.filehostmodepath = "/sys/class/i2c-adapter/i2c-0/0-0073/neo1973-pm-host.0/"
self.filePower = os.open( self.filePowerpath+"force_usb_limit_dangerous", os.O_RDWR )
self.filePowerread = os.open( self.filePowerpath+"usb_curlim", os.O_RDONLY )
self.fileusbmode = open( "/sys/devices/platform/s3c2410-ohci/usb_mode", "r+" )
self.filehostmode = os.open( "/sys/devices/platform/neo1973-pm-host.0/hostmode", os.O_RDWR )
self.filehostmode = os.open( self.filehostmodepath+"hostmode", os.O_RDWR )
self.mode = self.fileusbmode.readline()
self.power = str(os.read(self.filePowerread, 4))
self.mode = self.mode.split()[0]

View file

@ -20,4 +20,6 @@ Example:
TODO:
-change write to /sys/files to dbus, when available
-fix dbus
-fix dbus
21.01.2009: added support for 2.6.28 kernel