Commit 2582564d authored by Philippe De Swert's avatar Philippe De Swert

release 0.34 ready for shipping.

Signed-off-by: default avatarPhilippe De Swert <phdeswer@lumi.maa>
parent b2686cc7
usb-moded (0.34) unstable; urgency=low
* Delay unloading a bit more (8s instead of 3). Fixes: NB#225492
* Fixes for USB autoplay. Fixes: NB#220474
* Added cdrom emulation support.
* Added cdrom emulation support. Fixes: NB#244861
* Added udev option for cable detection
-- Philippe De Swert <philippe.de-swert@nokia.com> Fri, 01 Apr 2011 13:22:51 +0300
......
......@@ -22,6 +22,8 @@ struct udev_device *dev;
/* static function definitions */
gpointer monitor_udev(gpointer data) __attribute__ ((noreturn));
/* TODO: write udev property parsing in seperate function to avoid code duplication */
gboolean hwal_init(void)
{
GThread * thread;
......@@ -66,8 +68,16 @@ gboolean hwal_init(void)
}
if(!strcmp(tmp, "1"))
{
if(!strcmp(udev_device_get_property_value(dev, "POWER_SUPPLY_TYPE"), "USB")||
!strcmp(udev_device_get_property_value(dev, "POWER_SUPPLY_TYPE"), "USB_CDP"))
/* power supply type might not exist */
tmp = udev_device_get_property_value(dev, "POWER_SUPPLY_TYPE");
if(!tmp)
{
/* power supply type might not exist also :( Send connected event but this will not be able
to discriminate between charger/cable */
log_warning("Fallback since cable detecion cannot be accurate. Will connect on any voltage on usb.\n");
set_usb_connected(TRUE);
}
if(!strcmp(tmp, "USB")||!strcmp(tmp, "USB_CDP"))
{
log_debug("UDEV:USB cable connected\n");
set_usb_connected(TRUE);
......@@ -108,12 +118,20 @@ gpointer monitor_udev(gpointer data)
{
log_debug("UDEV:power supply present\n");
/* POWER_SUPPLY_TYPE is USB if usb cable is connected, USB_CDP for charging hub or USB_DCP for charger */
if(!strcmp(udev_device_get_property_value(dev, "POWER_SUPPLY_TYPE"), "USB")||
!strcmp(udev_device_get_property_value(dev, "POWER_SUPPLY_TYPE"), "USB_CDP"))
tmp = udev_device_get_property_value(dev, "POWER_SUPPLY_TYPE");
if(!tmp)
{
/* power supply type might not exist also :( Send connected event but this will not be able
to discriminate between charger/cable */
log_warning("Fallback since cable detecion cannot be accurate. Will connect on any voltage on usb.\n");
set_usb_connected(TRUE);
}
if(!strcmp(tmp, "USB")||!strcmp(tmp, "USB_CDP"))
{
log_debug("UDEV:USB cable connected\n");
set_usb_connected(TRUE);
}
}
else
{
......
......@@ -116,7 +116,7 @@ void set_usb_connected(gboolean connected)
usb_moded_mode_cleanup(get_usb_module());
usb_moded_send_signal(USB_DISCONNECTED);
#ifdef NOKIA
timeout_source = g_timeout_add_seconds(10, usb_module_timeout_cleanup, NULL);
timeout_source = g_timeout_add_seconds(5, usb_module_timeout_cleanup, NULL);
#else
/* unload modules and general cleanup */
usb_moded_module_cleanup(get_usb_module());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment