hal: Branch 'master'
David Zeuthen
david at kemper.freedesktop.org
Sun Sep 24 15:18:52 PDT 2006
configure.in | 19 +++++++++++++++++++
fdi/information/10freedesktop/Makefile.am | 13 ++++++-------
fdi/policy/10osvendor/Makefile.am | 5 +++++
hald/dummy/osspec.c | 18 ++++++++++++++++++
hald/linux/addons/Makefile.am | 9 +++------
5 files changed, 51 insertions(+), 13 deletions(-)
New commits:
diff-tree a43bc29b085761598560458cc076882d50bbd23a (from a42c74fa0ce589f3a03f6274f19df63ec40c23b1)
Author: David Zeuthen <davidz at redhat.com>
Date: Sun Sep 24 18:18:22 2006 -0400
make usb csr support optional
This is part of a larger effort to make HAL better support embedded systems.
diff --git a/configure.in b/configure.in
index 61841f0..4ebeacc 100644
--- a/configure.in
+++ b/configure.in
@@ -514,6 +514,24 @@ elif test "x$with_cpufreq" = "x" ; then
fi
AM_CONDITIONAL(BUILD_CPUFREQ, test x$BUILD_CPUFREQ = xyes)
+dnl USB CSR (battery reading of power)
+AC_ARG_WITH(usb-csr, [ --with-usb-csr Whether to build addon for wireless USB mice (auto)])
+BUILD_USBCSR=no
+if test "x$with_cpufreq" = "xyes" ; then
+ BUILD_USBCSR=yes
+elif test "x$with_cpufreq" = "x" ; then
+ if test "$HAVE_LIBUSB" != "false" ; then
+ case "${HALD_BACKEND}" in
+ linux)
+ BUILD_USBCSR=yes
+ ;;
+ *)
+ ;;
+ esac
+ fi
+fi
+AM_CONDITIONAL(BUILD_USBCSR, test x$BUILD_USBCSR = xyes)
+
dnl
dnl SUBSETTING END
@@ -602,6 +620,7 @@ echo "
Macbook Pro utils: ${BUILD_MACBOOKPRO} (Linux only, x86 only, requires libpci)
CPU frequency scaling: ${BUILD_CPUFREQ} (Linux only)
+ USB wireless mouse power: ${BUILD_USBCSR} (Linux only, requires libusb)
Maintainer mode: ${USE_MAINTAINER_MODE}
Building verbose mode: ${enable_verbose_mode}
diff --git a/fdi/information/10freedesktop/10-wireless-mice.fdi b/fdi/information/10freedesktop/10-wireless-mice.fdi
deleted file mode 100644
index 4a7f3ed..0000000
--- a/fdi/information/10freedesktop/10-wireless-mice.fdi
+++ /dev/null
@@ -1,127 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<deviceinfo version="0.2">
- <device>
- <match key="info.bus" string="usb_device">
- <match key="usb_device.vendor_id" int="0x046d"> <!-- Logitech, Inc. -->
-
- <!-- Receiver for MX1000 Laser -->
- <match key="usb_device.product_id" int="0xc50e">
- <append key="info.addons" type="strlist">hald-addon-usb-csr</append>
- <merge key="info.product" type="string">MX1000 Laser Mouse</merge>
- <merge key="battery.type" type="string">mouse</merge>
- <merge key="battery.is_rechargeable" type="bool">true</merge>
- <!-- proprietary properties defining the behavior -->
- <merge key="battery.csr.has_res" type="bool">false</merge>
- <merge key="battery.csr.has_sms" type="bool">false</merge>
- <merge key="battery.csr.is_dual" type="bool">false</merge>
- </match>
-
- <!-- Receiver for Cordless Click! -->
- <match key="usb_device.product_id" int="0xc510">
- <append key="info.addons" type="strlist">hald-addon-usb-csr</append>
- <merge key="info.product" type="string">Cordless Click Mouse</merge>
- <merge key="battery.type" type="string">mouse</merge>
- <!-- proprietary properties defining the behavior -->
- <merge key="battery.csr.has_res" type="bool">false</merge>
- <merge key="battery.csr.has_sms" type="bool">false</merge>
- <merge key="battery.csr.is_dual" type="bool">false</merge>
- </match>
-
- <!-- Receiver for Cordless Keyboard + Mouse combo -->
- <match key="usb_device.product_id" int="0xc512">
- <append key="info.addons" type="strlist">hald-addon-usb-csr</append>
- <merge key="info.product" type="string">Cordless Keyboard+Mouse Receiver</merge>
- <merge key="battery.type" type="string">keyboard</merge>
- <!-- proprietary properties defining the behavior -->
- <merge key="battery.csr.has_res" type="bool">false</merge>
- <merge key="battery.csr.has_sms" type="bool">false</merge>
- <merge key="battery.csr.is_dual" type="bool">false</merge>
- </match>
-
- <!-- Logitech, Inc. Cordless Mouse+Keyboard Receiver -->
- <match key="usb_device.product_id" int="0xc505">
- <append key="info.addons" type="strlist">hald-addon-usb-csr</append>
- <merge key="info.product" type="string">Cordless Mouse+Keyboard Receiver</merge>
- <merge key="battery.type" type="string">keyboard</merge>
- <!-- proprietary properties defining the behavior -->
- <merge key="battery.csr.has_res" type="bool">false</merge>
- <merge key="battery.csr.has_sms" type="bool">false</merge>
- <merge key="battery.csr.is_dual" type="bool">false</merge>
- </match>
-
- <!-- Mouse Receiver -->
- <match key="usb_device.product_id" int="0xc501">
- <append key="info.addons" type="strlist">hald-addon-usb-csr</append>
- <merge key="info.product" type="string">Mouse Receiver</merge>
- <merge key="battery.type" type="string">mouse</merge>
- <merge key="battery.is_rechargeable" type="bool">true</merge>
- <!-- proprietary properties defining the behavior -->
- <merge key="battery.csr.has_res" type="bool">false</merge>
- <merge key="battery.csr.has_sms" type="bool">false</merge>
- <merge key="battery.csr.is_dual" type="bool">false</merge>
- </match>
-
- <!-- Dual Receiver -->
- <match key="usb_device.product_id" int="0xc502">
- <append key="info.addons" type="strlist">hald-addon-usb-csr</append>
- <merge key="info.product" type="string">Logitech Dual Receiver</merge>
- <merge key="battery.type" type="string">mouse</merge>
- <merge key="battery.is_rechargeable" type="bool">true</merge>
- <!-- proprietary properties defining the behavior -->
- <merge key="battery.csr.has_res" type="bool">false</merge>
- <merge key="battery.csr.has_sms" type="bool">false</merge>
- <merge key="battery.csr.is_dual" type="bool">true</merge>
- </match>
-
- <!-- Receiver for Cordless Freedom Optical -->
- <match key="usb_device.product_id" int="0xc504">
- <append key="info.addons" type="strlist">hald-addon-usb-csr</append>
- <merge key="info.product" type="string">Cordless Freedom Optical Mouse</merge>
- <merge key="battery.type" type="string">mouse</merge>
- <merge key="battery.is_rechargeable" type="bool">true</merge>
- <!-- proprietary properties defining the behavior -->
- <merge key="battery.csr.has_res" type="bool">false</merge>
- <merge key="battery.csr.has_sms" type="bool">false</merge>
- <merge key="battery.csr.is_dual" type="bool">true</merge>
- </match>
-
- <!-- Receiver for MX700 Optical Mouse -->
- <match key="usb_device.product_id" int="0xc506">
- <append key="info.addons" type="strlist">hald-addon-usb-csr</append>
- <merge key="info.product" type="string">MX700 Optical Mouse</merge>
- <merge key="battery.type" type="string">mouse</merge>
- <merge key="battery.is_rechargeable" type="bool">true</merge>
- <!-- proprietary properties defining the behavior -->
- <merge key="battery.csr.has_res" type="bool">false</merge>
- <merge key="battery.csr.has_sms" type="bool">true</merge>
- <merge key="battery.csr.is_dual" type="bool">false</merge>
- </match>
-
- <!-- Receiver for Cordless Optical TrackMan -->
- <match key="usb_device.product_id" int="0xc508">
- <append key="info.addons" type="strlist">hald-addon-usb-csr</append>
- <merge key="info.product" type="string">Cordless Optical TrackMan</merge>
- <merge key="battery.type" type="string">mouse</merge>
- <merge key="battery.is_rechargeable" type="bool">true</merge>
- <!-- proprietary properties defining the behavior -->
- <merge key="battery.csr.has_res" type="bool">false</merge>
- <merge key="battery.csr.has_sms" type="bool">true</merge>
- <merge key="battery.csr.is_dual" type="bool">false</merge>
- </match>
-
- <!-- Receiver for Cordless Presenter -->
- <match key="usb_device.product_id" int="0xc702">
- <append key="info.addons" type="strlist">hald-addon-usb-csr</append>
- <merge key="info.product" type="string">Cordless Presenter</merge>
- <merge key="battery.type" type="string">mouse</merge>
- <merge key="battery.is_rechargeable" type="bool">true</merge>
- <!-- proprietary properties defining the behavior -->
- <merge key="battery.csr.has_res" type="bool">false</merge>
- <merge key="battery.csr.has_sms" type="bool">false</merge>
- <merge key="battery.csr.is_dual" type="bool">false</merge>
- </match>
-
- </match>
- </match>
- </device>
-</deviceinfo>
diff --git a/fdi/information/10freedesktop/Makefile.am b/fdi/information/10freedesktop/Makefile.am
index 031e1e5..e77f17a 100644
--- a/fdi/information/10freedesktop/Makefile.am
+++ b/fdi/information/10freedesktop/Makefile.am
@@ -4,7 +4,6 @@ fdidir = $(datadir)/hal/fdi/information/
dist_fdi_DATA = 10-usb-card-readers.fdi \
10-usb-music-players.fdi \
10-usb-zip-drives.fdi \
- 10-wireless-mice.fdi \
10-camera-ptp.fdi \
10-usb-pda.fdi \
10-cd-dvd-burner.fdi
@@ -15,12 +14,12 @@ check:
xmllint --noout --dtdvalid $(top_srcdir)/fdi/fdi.dtd $(srcdir)/$$f 2> xmllint.error; \
if test -s xmllint.error; \
then \
- echo failed; \
- cat xmllint.error; \
- rm -f xmllint.error; \
- exit 1; \
+ echo failed; \
+ cat xmllint.error; \
+ rm -f xmllint.error; \
+ exit 1; \
else \
- echo ok; \
- rm -f xmllint.error; \
+ echo ok; \
+ rm -f xmllint.error; \
fi; \
done;
diff --git a/fdi/policy/10osvendor/10-usbcsr-mice.fdi b/fdi/policy/10osvendor/10-usbcsr-mice.fdi
new file mode 100644
index 0000000..4a7f3ed
--- /dev/null
+++ b/fdi/policy/10osvendor/10-usbcsr-mice.fdi
@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<deviceinfo version="0.2">
+ <device>
+ <match key="info.bus" string="usb_device">
+ <match key="usb_device.vendor_id" int="0x046d"> <!-- Logitech, Inc. -->
+
+ <!-- Receiver for MX1000 Laser -->
+ <match key="usb_device.product_id" int="0xc50e">
+ <append key="info.addons" type="strlist">hald-addon-usb-csr</append>
+ <merge key="info.product" type="string">MX1000 Laser Mouse</merge>
+ <merge key="battery.type" type="string">mouse</merge>
+ <merge key="battery.is_rechargeable" type="bool">true</merge>
+ <!-- proprietary properties defining the behavior -->
+ <merge key="battery.csr.has_res" type="bool">false</merge>
+ <merge key="battery.csr.has_sms" type="bool">false</merge>
+ <merge key="battery.csr.is_dual" type="bool">false</merge>
+ </match>
+
+ <!-- Receiver for Cordless Click! -->
+ <match key="usb_device.product_id" int="0xc510">
+ <append key="info.addons" type="strlist">hald-addon-usb-csr</append>
+ <merge key="info.product" type="string">Cordless Click Mouse</merge>
+ <merge key="battery.type" type="string">mouse</merge>
+ <!-- proprietary properties defining the behavior -->
+ <merge key="battery.csr.has_res" type="bool">false</merge>
+ <merge key="battery.csr.has_sms" type="bool">false</merge>
+ <merge key="battery.csr.is_dual" type="bool">false</merge>
+ </match>
+
+ <!-- Receiver for Cordless Keyboard + Mouse combo -->
+ <match key="usb_device.product_id" int="0xc512">
+ <append key="info.addons" type="strlist">hald-addon-usb-csr</append>
+ <merge key="info.product" type="string">Cordless Keyboard+Mouse Receiver</merge>
+ <merge key="battery.type" type="string">keyboard</merge>
+ <!-- proprietary properties defining the behavior -->
+ <merge key="battery.csr.has_res" type="bool">false</merge>
+ <merge key="battery.csr.has_sms" type="bool">false</merge>
+ <merge key="battery.csr.is_dual" type="bool">false</merge>
+ </match>
+
+ <!-- Logitech, Inc. Cordless Mouse+Keyboard Receiver -->
+ <match key="usb_device.product_id" int="0xc505">
+ <append key="info.addons" type="strlist">hald-addon-usb-csr</append>
+ <merge key="info.product" type="string">Cordless Mouse+Keyboard Receiver</merge>
+ <merge key="battery.type" type="string">keyboard</merge>
+ <!-- proprietary properties defining the behavior -->
+ <merge key="battery.csr.has_res" type="bool">false</merge>
+ <merge key="battery.csr.has_sms" type="bool">false</merge>
+ <merge key="battery.csr.is_dual" type="bool">false</merge>
+ </match>
+
+ <!-- Mouse Receiver -->
+ <match key="usb_device.product_id" int="0xc501">
+ <append key="info.addons" type="strlist">hald-addon-usb-csr</append>
+ <merge key="info.product" type="string">Mouse Receiver</merge>
+ <merge key="battery.type" type="string">mouse</merge>
+ <merge key="battery.is_rechargeable" type="bool">true</merge>
+ <!-- proprietary properties defining the behavior -->
+ <merge key="battery.csr.has_res" type="bool">false</merge>
+ <merge key="battery.csr.has_sms" type="bool">false</merge>
+ <merge key="battery.csr.is_dual" type="bool">false</merge>
+ </match>
+
+ <!-- Dual Receiver -->
+ <match key="usb_device.product_id" int="0xc502">
+ <append key="info.addons" type="strlist">hald-addon-usb-csr</append>
+ <merge key="info.product" type="string">Logitech Dual Receiver</merge>
+ <merge key="battery.type" type="string">mouse</merge>
+ <merge key="battery.is_rechargeable" type="bool">true</merge>
+ <!-- proprietary properties defining the behavior -->
+ <merge key="battery.csr.has_res" type="bool">false</merge>
+ <merge key="battery.csr.has_sms" type="bool">false</merge>
+ <merge key="battery.csr.is_dual" type="bool">true</merge>
+ </match>
+
+ <!-- Receiver for Cordless Freedom Optical -->
+ <match key="usb_device.product_id" int="0xc504">
+ <append key="info.addons" type="strlist">hald-addon-usb-csr</append>
+ <merge key="info.product" type="string">Cordless Freedom Optical Mouse</merge>
+ <merge key="battery.type" type="string">mouse</merge>
+ <merge key="battery.is_rechargeable" type="bool">true</merge>
+ <!-- proprietary properties defining the behavior -->
+ <merge key="battery.csr.has_res" type="bool">false</merge>
+ <merge key="battery.csr.has_sms" type="bool">false</merge>
+ <merge key="battery.csr.is_dual" type="bool">true</merge>
+ </match>
+
+ <!-- Receiver for MX700 Optical Mouse -->
+ <match key="usb_device.product_id" int="0xc506">
+ <append key="info.addons" type="strlist">hald-addon-usb-csr</append>
+ <merge key="info.product" type="string">MX700 Optical Mouse</merge>
+ <merge key="battery.type" type="string">mouse</merge>
+ <merge key="battery.is_rechargeable" type="bool">true</merge>
+ <!-- proprietary properties defining the behavior -->
+ <merge key="battery.csr.has_res" type="bool">false</merge>
+ <merge key="battery.csr.has_sms" type="bool">true</merge>
+ <merge key="battery.csr.is_dual" type="bool">false</merge>
+ </match>
+
+ <!-- Receiver for Cordless Optical TrackMan -->
+ <match key="usb_device.product_id" int="0xc508">
+ <append key="info.addons" type="strlist">hald-addon-usb-csr</append>
+ <merge key="info.product" type="string">Cordless Optical TrackMan</merge>
+ <merge key="battery.type" type="string">mouse</merge>
+ <merge key="battery.is_rechargeable" type="bool">true</merge>
+ <!-- proprietary properties defining the behavior -->
+ <merge key="battery.csr.has_res" type="bool">false</merge>
+ <merge key="battery.csr.has_sms" type="bool">true</merge>
+ <merge key="battery.csr.is_dual" type="bool">false</merge>
+ </match>
+
+ <!-- Receiver for Cordless Presenter -->
+ <match key="usb_device.product_id" int="0xc702">
+ <append key="info.addons" type="strlist">hald-addon-usb-csr</append>
+ <merge key="info.product" type="string">Cordless Presenter</merge>
+ <merge key="battery.type" type="string">mouse</merge>
+ <merge key="battery.is_rechargeable" type="bool">true</merge>
+ <!-- proprietary properties defining the behavior -->
+ <merge key="battery.csr.has_res" type="bool">false</merge>
+ <merge key="battery.csr.has_sms" type="bool">false</merge>
+ <merge key="battery.csr.is_dual" type="bool">false</merge>
+ </match>
+
+ </match>
+ </match>
+ </device>
+</deviceinfo>
diff --git a/fdi/policy/10osvendor/Makefile.am b/fdi/policy/10osvendor/Makefile.am
index 2454c3b..39c8507 100644
--- a/fdi/policy/10osvendor/Makefile.am
+++ b/fdi/policy/10osvendor/Makefile.am
@@ -12,10 +12,15 @@ dist_fdi_DATA = \
if BUILD_MACBOOKPRO
dist_fdi_DATA += 10-macbookpro-utils.fdi
endif
+
if BUILD_CPUFREQ
dist_fdi_DATA += 10-cpufreq.fdi
endif
+if BUILD_USBCSR
+dist_fdi_DATA += 10-usbcsr-mice.fdi
+endif
+
check:
for f in $(dist_fdi_DATA); do \
echo -n "Validate XML in $$f : "; \
diff --git a/hald/dummy/osspec.c b/hald/dummy/osspec.c
index e20141e..74165ec 100644
--- a/hald/dummy/osspec.c
+++ b/hald/dummy/osspec.c
@@ -79,3 +79,21 @@ osspec_filter_function (DBusConnection *
{
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}
+
+gboolean
+osspec_device_rescan (HalDevice *d)
+{
+ return FALSE;
+}
+
+gboolean
+osspec_device_reprobe (HalDevice *d)
+{
+ return FALSE;
+}
+
+void
+osspec_refresh_mount_state_for_block_device (HalDevice *d)
+{
+}
+
diff --git a/hald/linux/addons/Makefile.am b/hald/linux/addons/Makefile.am
index 90fef2f..943fafb 100644
--- a/hald/linux/addons/Makefile.am
+++ b/hald/linux/addons/Makefile.am
@@ -30,8 +30,10 @@ hald_addon_cpufreq_SOURCES = addon-cpufr
hald_addon_cpufreq_LDADD = $(top_builddir)/libhal/libhal.la @GLIB_LIBS@ @POLKIT_LIBS@
endif
-if HAVE_LIBUSB
+if BUILD_USBCSR
libexec_PROGRAMS += hald-addon-usb-csr
+hald_addon_usb_csr_SOURCES = addon-usb-csr.c ../../logger.c ../../util_helper.c
+hald_addon_usb_csr_LDADD = $(top_builddir)/libhal/libhal.la -lusb @GLIB_LIBS@
endif
endif
@@ -52,8 +54,3 @@ hald_addon_pmu_LDADD = $(top_builddir)/l
hald_addon_storage_SOURCES = addon-storage.c ../../logger.c ../../util_helper.c
hald_addon_storage_LDADD = $(top_builddir)/libhal/libhal.la
-
-if HAVE_LIBUSB
-hald_addon_usb_csr_SOURCES = addon-usb-csr.c ../../logger.c ../../util_helper.c
-hald_addon_usb_csr_LDADD = $(top_builddir)/libhal/libhal.la -lusb @GLIB_LIBS@
-endif
More information about the hal-commit
mailing list