Skip to content

Commit

Permalink
release 0.34 ready for shipping.
Browse files Browse the repository at this point in the history
Signed-off-by: Philippe De Swert <phdeswer@lumi.maa>
  • Loading branch information
Philippe De Swert committed Apr 8, 2011
1 parent b2686cc commit 2582564
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 7 deletions.
3 changes: 1 addition & 2 deletions debian/changelog
@@ -1,8 +1,7 @@
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
Expand Down
26 changes: 22 additions & 4 deletions src/usb_moded-udev.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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
{
Expand Down
2 changes: 1 addition & 1 deletion src/usb_moded.c
Expand Up @@ -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());
Expand Down

0 comments on commit 2582564

Please sign in to comment.