summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2013-03-13 13:01:55 -0500
committerDenis Kenzior <denkenz@gmail.com>2013-03-18 13:42:46 -0500
commitd081e3d5ea6e51070b0ae8e54ae866eb5d81b590 (patch)
treed79ed683c3e3c55a91be1bcbc8539995b0df5f0c
parent46f95f0d4f381a50947301790160677bfad0d747 (diff)
downloadofono-d081e3d5ea6e51070b0ae8e54ae866eb5d81b590.tar.bz2
handsfree-audio: Add card driver registration
-rw-r--r--src/handsfree-audio.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/handsfree-audio.c b/src/handsfree-audio.c
index 73c61830..d963f509 100644
--- a/src/handsfree-audio.c
+++ b/src/handsfree-audio.c
@@ -66,6 +66,7 @@ static struct agent *agent = NULL;
static int ref_count = 0;
static GSList *card_list = 0;
static guint sco_watch = 0;
+static GSList *drivers = 0;
static void send_new_connection(const char *card, int fd)
{
@@ -534,6 +535,27 @@ static const GDBusSignalTable am_signals[] = {
{ }
};
+int ofono_handsfree_card_driver_register(
+ const struct ofono_handsfree_card_driver *d)
+{
+ DBG("driver: %p", d);
+
+ if (d->probe == NULL)
+ return -EINVAL;
+
+ drivers = g_slist_prepend(drivers, (void *) d);
+
+ return 0;
+}
+
+void ofono_handsfree_card_driver_unregister(
+ const struct ofono_handsfree_card_driver *d)
+{
+ DBG("driver: %p", d);
+
+ drivers = g_slist_remove(drivers, (void *) d);
+}
+
void ofono_handsfree_audio_ref(void)
{
ref_count += 1;