public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Mario Limonciello <mario_limonciello@dell.com>
To: "linux-bluetooth@vger.kernel.org" <linux-bluetooth@vger.kernel.org>
Subject: Re: [PATCH] Run hid2hci after resuming from suspend
Date: Thu, 23 Oct 2008 11:29:48 -0500	[thread overview]
Message-ID: <4900A67C.2050803@dell.com> (raw)
In-Reply-To: <1224737041.9386.160.camel@californication>


[-- Attachment #1.1: Type: text/plain, Size: 506 bytes --]

Hi Marcel:

Marcel Holtmann wrote:
> Hi Mario,
>
> we should not install multiple scripts. Lets only install one "bluez"
> file for pm-utils. So no need for a hid2hci specific script.
>
> Regards
>
> Marcel
>   
Attached is an updated patch that will install this as "48bluez" for
pm-utils.  Of course the only thing in it right now is hid2hci, but
should that need to change, it's easy to add more.

Regards
-- 
Mario Limonciello
*Dell | Linux Engineering*
mario_limonciello@dell.com

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: hid2hci_pm-utils.patch --]
[-- Type: text/x-patch; name="hid2hci_pm-utils.patch", Size: 3360 bytes --]

diff -Nur -x '*.orig' -x '*~' bluez-4.12/scripts/bluetooth.pm-utils bluez-4.12.new/scripts/bluetooth.pm-utils
--- bluez-4.12/scripts/bluetooth.pm-utils	1969-12-31 18:00:00.000000000 -0600
+++ bluez-4.12.new/scripts/bluetooth.pm-utils	2008-10-23 09:24:48.000000000 -0500
@@ -0,0 +1,24 @@
+#!/bin/sh
+# Switch all devices that were in a HID mode to HCI mode
+# after a resume
+
+. "${PM_FUNCTIONS}"
+
+[ -f /etc/default/bluetooth ] || exit $NA
+
+. /etc/default/bluetooth
+
+hid2hci()
+{
+	if [ "$HID2HCI_ENABLED" = "1" ] && [ -x /usr/sbin/hid2hci ]; then
+		/usr/sbin/hid2hci --tohci
+        fi
+}
+
+case "$1" in
+	thaw|resume)
+		hid2hci
+		;;
+	*) exit $NA
+		;;
+esac
diff -Nur -x '*.orig' -x '*~' bluez-4.12/scripts/Makefile.am bluez-4.12.new/scripts/Makefile.am
--- bluez-4.12/scripts/Makefile.am	2008-10-07 13:28:29.000000000 -0500
+++ bluez-4.12.new/scripts/Makefile.am	2008-10-23 09:37:16.000000000 -0500
@@ -9,7 +9,7 @@
 udev_SCRIPTS = bluetooth_serial
 endif
 
-EXTRA_DIST = bluetooth.rules bluetooth_serial bluetooth.init bluetooth.default
+EXTRA_DIST = bluetooth.rules bluetooth_serial bluetooth.init bluetooth.default bluetooth.pm-utils
 
 MAINTAINERCLEANFILES = Makefile.in
 
@@ -24,3 +24,10 @@
 	@rm -f $(DESTDIR)$(sysconfdir)/init.d/bluetooth
 	@rm -f $(DESTDIR)$(sysconfdir)/default/bluetooth
 endif
+
+install-data-pm:
+	$(mkinstalldirs) $(DESTDIR)/$(libexecdir)/pm-utils/sleep.d
+	$(INSTALL) -D -m 744 $(srcdir)/bluetooth.pm-utils $(DESTDIR)$(libexecdir)/pm-utils/sleep.d/48bluez
+
+uninstall-pm:
+	@rm -f $(DESTDIR)$(libexecdir)/pm-utils/sleep.d/48bluez
diff -Nur -x '*.orig' -x '*~' bluez-4.12/scripts/Makefile.in bluez-4.12.new/scripts/Makefile.in
--- bluez-4.12/scripts/Makefile.in	2008-10-07 13:28:29.000000000 -0500
+++ bluez-4.12.new/scripts/Makefile.in	2008-10-23 09:38:54.000000000 -0500
@@ -192,7 +192,7 @@
 @PCMCIARULES_TRUE@rules_DATA = bluetooth.rules
 @PCMCIARULES_TRUE@udevdir = $(libexecdir)/udev
 @PCMCIARULES_TRUE@udev_SCRIPTS = bluetooth_serial
-EXTRA_DIST = bluetooth.rules bluetooth_serial bluetooth.init bluetooth.default
+EXTRA_DIST = bluetooth.rules bluetooth_serial bluetooth.init bluetooth.default hid2hci.pm-utils
 MAINTAINERCLEANFILES = Makefile.in
 all: all-am
 
@@ -335,6 +335,8 @@
 	-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
 @INITSCRIPTS_FALSE@uninstall-local:
 @INITSCRIPTS_FALSE@install-data-local:
+uninstall-pm:
+install-data-pm:
 clean: clean-am
 
 clean-am: clean-generic clean-libtool mostlyclean-am
@@ -354,7 +356,7 @@
 info-am:
 
 install-data-am: install-data-local install-rulesDATA \
-	install-udevSCRIPTS
+	install-udevSCRIPTS install-data-pm
 
 install-dvi: install-dvi-am
 
@@ -416,6 +418,13 @@
 @INITSCRIPTS_TRUE@uninstall-local:
 @INITSCRIPTS_TRUE@	@rm -f $(DESTDIR)$(sysconfdir)/init.d/bluetooth
 @INITSCRIPTS_TRUE@	@rm -f $(DESTDIR)$(sysconfdir)/default/bluetooth
+
+install-data-pm:
+	$(mkinstalldirs) $(DESTDIR)/$(libexecdir)/pm-utils/sleep.d
+	$(INSTALL) -D -m 744 $(srcdir)/bluetooth.pm-utils $(DESTDIR)$(libexecdir)/pm-utils/sleep.d/48bluez
+
+uninstall-pm:
+	@rm -f $(DESTDIR)$(libexecdir)/pm-utils/sleep.d/48bluez
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 260 bytes --]

  reply	other threads:[~2008-10-23 16:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-22 20:54 [PATCH] Run hid2hci after resuming from suspend Mario Limonciello
2008-10-23  4:44 ` Marcel Holtmann
2008-10-23 16:29   ` Mario Limonciello [this message]
2008-10-24  8:06     ` Bastien Nocera

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4900A67C.2050803@dell.com \
    --to=mario_limonciello@dell.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox