summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-09-29 02:12:41 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-09-29 02:12:41 -0500
commitd2480b90f5528c62411c261f53f8583376ce7c8d (patch)
tree4039ac0f1ed9dbf94a2159f41bf69f6f6ad8703a
parentb1346b88ce95979e0cd513d00e5d8d44fa81f714 (diff)
downloadtdelibs-d2480b90.tar.gz
tdelibs-d2480b90.zip
Fix pictbridge camera detection
Add new device matching rules
-rw-r--r--tdecore/tdehardwaredevices.cpp45
1 files changed, 39 insertions, 6 deletions
diff --git a/tdecore/tdehardwaredevices.cpp b/tdecore/tdehardwaredevices.cpp
index 6b9082b22..466815560 100644
--- a/tdecore/tdehardwaredevices.cpp
+++ b/tdecore/tdehardwaredevices.cpp
@@ -3190,6 +3190,10 @@ TDEGenericDevice* TDEHardwareDevices::classifyUnknownDevice(udev_device* dev, TD
else if (devicesubsystem == "usb-serial") {
if (!device) device = new TDEGenericDevice(TDEGenericDeviceType::Serial);
}
+ else if ((devicesubsystem == "spi_master")
+ || (devicesubsystem == "spidev")) {
+ if (!device) device = new TDEGenericDevice(TDEGenericDeviceType::Serial);
+ }
else if (devicesubsystem == "thermal") {
// FIXME
// Figure out a way to differentiate between ThermalControl (fans and coolers) and ThermalSensor types
@@ -3264,6 +3268,12 @@ TDEGenericDevice* TDEHardwareDevices::classifyUnknownDevice(udev_device* dev, TD
if (!device) device = new TDEGenericDevice(TDEGenericDeviceType::Platform);
}
}
+ if (devicesubsystem == "mmc_host") {
+ if (!device) device = new TDEGenericDevice(TDEGenericDeviceType::StorageController);
+ }
+ if (devicesubsystem == "mmc") {
+ if (!device) device = new TDEGenericDevice(TDEGenericDeviceType::Platform);
+ }
if ((devicesubsystem == "event_source")
|| (devicesubsystem == "rtc")) {
if (!device) device = new TDEGenericDevice(TDEGenericDeviceType::Mainboard);
@@ -3393,16 +3403,39 @@ TDEGenericDevice* TDEHardwareDevices::classifyUnknownDevice(udev_device* dev, TD
// Last ditch attempt at classification
// Likely inaccurate and sweeping
if ((devicesubsystem == "usb")
+ || (devicesubsystem == "usb_device")
|| (devicesubsystem == "usbmon")) {
+ // Get USB interface class for further classification
+ int usbInterfaceClass = -1;
+ {
+ TQFile ifaceprotofile(current_path + "/bInterfaceClass");
+ if (ifaceprotofile.open(IO_ReadOnly)) {
+ TQTextStream stream( &ifaceprotofile );
+ usbInterfaceClass = stream.readLine().toUInt();
+ ifaceprotofile.close();
+ }
+ }
+ // Get USB interface subclass for further classification
+ int usbInterfaceSubClass = -1;
+ {
+ TQFile ifaceprotofile(current_path + "/bInterfaceSubClass");
+ if (ifaceprotofile.open(IO_ReadOnly)) {
+ TQTextStream stream( &ifaceprotofile );
+ usbInterfaceSubClass = stream.readLine().toUInt();
+ ifaceprotofile.close();
+ }
+ }
// Get USB interface protocol for further classification
int usbInterfaceProtocol = -1;
- TQFile ifaceprotofile(current_path + "/bInterfaceProtocol");
- if (ifaceprotofile.open(IO_ReadOnly)) {
- TQTextStream stream( &ifaceprotofile );
- usbInterfaceProtocol = stream.readLine().toUInt();
- ifaceprotofile.close();
+ {
+ TQFile ifaceprotofile(current_path + "/bInterfaceProtocol");
+ if (ifaceprotofile.open(IO_ReadOnly)) {
+ TQTextStream stream( &ifaceprotofile );
+ usbInterfaceProtocol = stream.readLine().toUInt();
+ ifaceprotofile.close();
+ }
}
- if (usbInterfaceProtocol == 1) {
+ if ((usbInterfaceClass == 6) && (usbInterfaceSubClass == 1) && (usbInterfaceProtocol == 1)) {
// PictBridge
if (!device) {
device = new TDEStorageDevice(TDEGenericDeviceType::Disk);