From: Pavel Machek <pavel@ucw.cz>
To: Tony Lindgren <tony@atomide.com>
Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org,
kernel@collabora.com, Dan Williams <dcbw@redhat.com>,
linux-kernel@vger.kernel.org, Merlijn Wajer <merlijn@wizzup.org>,
Takashi Iwai <tiwai@suse.com>,
Liam Girdwood <lgirdwood@gmail.com>,
Rob Herring <robh+dt@kernel.org>, Mark Brown <broonie@kernel.org>,
Sebastian Reichel <sebastian.reichel@collabora.co.uk>,
linux-omap@vger.kernel.org, Lee Jones <lee.jones@linaro.org>
Subject: Re: omap4-droid4: voice call support was Re: [PATCHv5, 5/5] ARM: dts: omap4-droid4: add soundcard
Date: Fri, 30 Mar 2018 17:34:06 +0200 [thread overview]
Message-ID: <20180330153406.GA20218@amd> (raw)
In-Reply-To: <20180330152227.GU5700@atomide.com>
[-- Attachment #1.1: Type: text/plain, Size: 11139 bytes --]
Hi!
> > >> Great, good to hear that :)
> > >
> > > I also got ofonod to work, with rather crazy hacks. But I now have
> > > incoming/outgoing calls with GUI :-).
> >
> > Would you mind sharing those hacks - I would like to play around with
> > ofonod as well. Maybe I can help with a way forward.
>
> Yeah that would be fun to play with :)
Ok, I thought I should clean them up first, but hey...
sudo emacs /etc/udev/rules.d/55-modem.rules
KERNEL=="ttyUSB4", ENV{OFONO_DRIVER}="g1"
sudo udevadm trigger
And now, the crazy hack follows. Note I'm using AT interface -- which
is probably not good idea.
Anyway, network/signal strength is detected, and calls seem to work.
diff --git a/drivers/atmodem/sms.c b/drivers/atmodem/sms.c
index 68b89862..3a9f4bc0 100644
--- a/drivers/atmodem/sms.c
+++ b/drivers/atmodem/sms.c
@@ -440,6 +440,8 @@ static void at_cmt_notify(GAtResult *result, gpointer user_data)
if (data->vendor != OFONO_VENDOR_SIMCOM)
at_ack_delivery(sms);
+ return;
+
err:
ofono_error("Unable to parse CMT notification");
}
diff --git a/plugins/g1.c b/plugins/g1.c
index d915a565..dd4e735d 100644
--- a/plugins/g1.c
+++ b/plugins/g1.c
@@ -60,7 +60,8 @@ static void g1_debug(const char *str, void *user_data)
/* Detect hardware, and initialize if found */
static int g1_probe(struct ofono_modem *modem)
{
- DBG("");
+ DBG("probing G1");
+ DBG("probing G1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
return 0;
}
@@ -97,14 +98,21 @@ static int g1_enable(struct ofono_modem *modem)
DBG("");
+ DBG("enabling G1 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
+
device = ofono_modem_get_string(modem, "Device");
- if (device == NULL)
- return -EINVAL;
+ // if (device == NULL)
+ // return -EINVAL;
+ device = "/dev/ttyUSB4";
+
+ DBG("");
channel = g_at_tty_open(device, NULL);
if (channel == NULL)
return -EIO;
+ DBG("");
+
syntax = g_at_syntax_new_gsm_permissive();
chat = g_at_chat_new(channel, syntax);
g_io_channel_unref(channel);
@@ -116,11 +124,14 @@ static int g1_enable(struct ofono_modem *modem)
if (getenv("OFONO_AT_DEBUG"))
g_at_chat_set_debug(chat, g1_debug, "");
+ DBG("");
ofono_modem_set_data(modem, chat);
+ DBG("");
/* ensure modem is in a known state; verbose on, echo/quiet off */
g_at_chat_send(chat, "ATE0Q0V1", NULL, NULL, NULL, NULL);
+ DBG("");
/* power up modem */
g_at_chat_send(chat, "AT+CFUN=1", NULL, cfun_set_on_cb, modem, NULL);
@@ -191,18 +202,56 @@ static void g1_post_sim(struct ofono_modem *modem)
ofono_message_waiting_register(mw);
}
+static void g1_post_online(struct ofono_modem *modem)
+{
+ DBG();
+}
+
+static void set_online_cb(gboolean ok, GAtResult *result, gpointer user_data)
+{
+ struct ofono_modem *modem = user_data;
+ GAtChat *chat = ofono_modem_get_data(modem);
+
+ DBG("");
+
+ g_at_chat_unref(chat);
+ ofono_modem_set_data(modem, NULL);
+
+ // if (ok)
+ // ofono_modem_set_online(modem, TRUE);
+}
+
+static void g1_set_online(struct ofono_modem *modem, ofono_bool_t online,
+ ofono_modem_online_cb_t cb, void *user_data)
+{
+ GAtChat *chat = ofono_modem_get_data(modem);
+ char const *command = online ? "AT+CFUN=1" : "AT+CFUN=4";
+
+ DBG("modem %p %s", modem, online ? "online" : "offline");
+
+ if (g_at_chat_send(chat, command, NULL,
+ set_online_cb, modem, NULL) > 0)
+ return;
+
+ //CALLBACK_WITH_FAILURE(cb, cbd->data);
+
+}
+
static struct ofono_modem_driver g1_driver = {
.name = "g1",
.probe = g1_probe,
.remove = g1_remove,
.enable = g1_enable,
.disable = g1_disable,
+ // .set_online = g1_set_online,
.pre_sim = g1_pre_sim,
.post_sim = g1_post_sim,
+ .post_online = g1_post_online,
};
static int g1_init(void)
{
+ DBG("g1_init!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
return ofono_modem_driver_register(&g1_driver);
}
diff --git a/plugins/udevng.c b/plugins/udevng.c
index ff5d41af..3e0cdf81 100644
--- a/plugins/udevng.c
+++ b/plugins/udevng.c
@@ -1250,6 +1250,7 @@ static struct {
{ "cinterion", setup_serial_modem },
{ "nokiacdma", setup_serial_modem },
{ "sim900", setup_serial_modem },
+ { "g1", setup_serial_modem },
{ "wavecom", setup_wavecom },
{ "tc65", setup_tc65 },
{ "ehs6", setup_ehs6 },
@@ -1407,7 +1408,7 @@ static void add_serial_device(struct udev_device *dev)
mdev = get_serial_modem_device(dev);
if (!mdev) {
- DBG("Device is missing required OFONO_DRIVER property");
+ //DBG("Device %s %s is missing required OFONO_DRIVER property", udev_device_get_devpath(mdev), udev_device_get_syspath(mdev));
return;
}
@@ -1419,6 +1420,9 @@ static void add_serial_device(struct udev_device *dev)
devnode = udev_device_get_devnode(dev);
+ DBG("Got OFONO_DRIVER!!!! driver %s path %s\n", driver, devpath);
+
+
if (!syspath || !devpath)
return;
@@ -1578,8 +1582,6 @@ static struct {
{ "mbm", "cdc_ether", "0930" },
{ "mbm", "cdc_ncm", "0930" },
{ "hso", "hso" },
- { "gobi", "qmi_wwan" },
- { "gobi", "qcserial" },
{ "sierra", "qmi_wwan", "1199" },
{ "sierra", "qcserial", "1199" },
{ "sierra", "sierra" },
@@ -1602,6 +1604,8 @@ static struct {
{ "telit", "cdc_acm", "1bc7", "0021" },
{ "telitqmi", "qmi_wwan", "1bc7", "1201" },
{ "telitqmi", "option", "1bc7", "1201" },
+ { "telitqmi", "qmi_wwan", "22b8", "2a70" },
+ { "telitqmi", "option", "22b8", "2a70" },
{ "nokia", "option", "0421", "060e" },
{ "nokia", "option", "0421", "0623" },
{ "samsung", "option", "04e8", "6889" },
@@ -1717,10 +1721,12 @@ static void check_device(struct udev_device *device)
return;
}
+#if 0
if ((g_str_equal(bus, "usb") == TRUE) ||
(g_str_equal(bus, "usbmisc") == TRUE))
check_usb_device(device);
else
+#endif
add_serial_device(device);
}
@@ -1746,17 +1752,20 @@ static gboolean create_modem(gpointer key, gpointer value, gpointer user_data)
return TRUE;
for (i = 0; driver_list[i].name; i++) {
+ DBG("comparing %s %s", driver_list[i].name, modem->driver);
if (g_str_equal(driver_list[i].name, modem->driver) == FALSE)
continue;
- if (driver_list[i].setup(modem) == TRUE) {
+ /* if (driver_list[i].setup(modem) == TRUE) */ {
ofono_modem_set_string(modem->modem, "SystemPath",
syspath);
ofono_modem_register(modem->modem);
+ DBG("create modem is okay?");
return FALSE;
}
}
+ DBG("create modem is maybe not okay?");
return TRUE;
}
@@ -1796,6 +1805,7 @@ static void enumerate_devices(struct udev *context)
udev_enumerate_unref(enumerate);
g_hash_table_foreach_remove(modem_list, create_modem, NULL);
+ DBG("Enumerate devices ok?");
}
static struct udev *udev_ctx;
@@ -1811,6 +1821,8 @@ static gboolean check_modem_list(gpointer user_data)
g_hash_table_foreach_remove(modem_list, create_modem, NULL);
+ DBG("Check modem list ok?");
+
return FALSE;
}
@@ -1820,6 +1832,8 @@ static gboolean udev_event(GIOChannel *channel, GIOCondition cond,
struct udev_device *device;
const char *action;
+ DBG("udev event");
+
if (cond & (G_IO_ERR | G_IO_HUP | G_IO_NVAL)) {
ofono_warn("Error with udev monitor channel");
udev_watch = 0;
@@ -1838,11 +1852,14 @@ static gboolean udev_event(GIOChannel *channel, GIOCondition cond,
if (udev_delay > 0)
g_source_remove(udev_delay);
+ DBG("udev event add -> check");
check_device(device);
udev_delay = g_timeout_add_seconds(1, check_modem_list, NULL);
- } else if (g_str_equal(action, "remove") == TRUE)
+ } else if (g_str_equal(action, "remove") == TRUE) {
+ DBG("udev event remove -> remove");
remove_device(device);
+ }
udev_device_unref(device);
@@ -1892,8 +1909,10 @@ static int detect_init(void)
return -EIO;
}
+ ofono_warn("detect_init...");
modem_list = g_hash_table_new_full(g_str_hash, g_str_equal,
NULL, destroy_modem);
+ ofono_warn("detect_init 2...");
udev_monitor_filter_add_match_subsystem_devtype(udev_mon, "tty", NULL);
udev_monitor_filter_add_match_subsystem_devtype(udev_mon, "usb", NULL);
diff --git a/src/modem.c b/src/modem.c
index 0cee861f..d8dde772 100644
--- a/src/modem.c
+++ b/src/modem.c
@@ -603,12 +603,14 @@ static gboolean modem_has_sim(struct ofono_modem *modem)
static gboolean modem_is_always_online(struct ofono_modem *modem)
{
+ DBG();
if (modem->driver->set_online == NULL)
return TRUE;
if (ofono_modem_get_boolean(modem, "AlwaysOnline") == TRUE)
return TRUE;
+ DBG("not always");
return FALSE;
}
@@ -720,8 +722,10 @@ static void sim_state_watch(enum ofono_sim_state new_state, void *user)
modem_change_state(modem, MODEM_STATE_OFFLINE);
/* Modem is always online, proceed to online state. */
- if (modem_is_always_online(modem) == TRUE)
+ if (modem_is_always_online(modem) == TRUE) {
set_online(modem, TRUE);
+ modem->online = TRUE;
+ }
if (modem->online == TRUE)
modem_change_state(modem, MODEM_STATE_ONLINE);
@@ -1882,13 +1886,17 @@ struct ofono_modem *ofono_modem_create(const char *name, const char *type)
else
snprintf(path, sizeof(path), "/%s", name);
- if (!dbus_validate_path(path, NULL))
+ if (!dbus_validate_path(path, NULL)) {
+ DBG("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!bad dbus path");
return NULL;
+ }
modem = g_try_new0(struct ofono_modem, 1);
- if (modem == NULL)
+ if (modem == NULL) {
+ DBG("!!!out of memory?!");
return modem;
+ }
modem->path = g_strdup(path);
modem->driver_type = g_strdup(type);
@@ -1900,6 +1908,7 @@ struct ofono_modem *ofono_modem_create(const char *name, const char *type)
if (name == NULL)
next_modem_id += 1;
+ DBG("Created new modem, path %s", path);
return modem;
}
diff --git a/src/network.c b/src/network.c
index ae3175d4..700183c0 100644
--- a/src/network.c
+++ b/src/network.c
@@ -980,6 +980,7 @@ static DBusMessage *network_scan(DBusConnection *conn,
{
struct ofono_netreg *netreg = data;
+ DBG();
if (netreg->mode == NETWORK_REGISTRATION_MODE_AUTO_ONLY)
return __ofono_error_access_denied(msg);
@@ -991,6 +992,7 @@ static DBusMessage *network_scan(DBusConnection *conn,
netreg->pending = dbus_message_ref(msg);
+ DBG();
netreg->driver->list_operators(netreg, operator_list_callback, netreg);
return NULL;
diff --git a/src/voicecall.c b/src/voicecall.c
index e4f6a4c0..2c637e58 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -1492,6 +1492,7 @@ static int voicecall_dial(struct ofono_voicecall *vc, const char *number,
struct ofono_modem *modem = __ofono_atom_get_modem(vc->atom);
struct ofono_phone_number ph;
+ DBG("");
if (g_slist_length(vc->call_list) >= MAX_VOICE_CALLS)
return -EPERM;
--
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
next prev parent reply other threads:[~2018-03-30 15:34 UTC|newest]
Thread overview: 111+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-02-23 20:02 [PATCHv5 0/5] Motorola Droid 4 Audio Support Sebastian Reichel
2018-02-23 20:02 ` [PATCHv5 1/5] dt-bindings: mfd: motorola-cpcap: document audio-codec Sebastian Reichel
2018-02-26 10:08 ` Mark Brown
2018-03-02 19:07 ` Rob Herring
2018-03-07 16:30 ` Lee Jones
2018-02-23 20:02 ` [PATCHv5 2/5] ASoC: codec: cpcap: new codec Sebastian Reichel
2018-02-26 1:36 ` [alsa-devel] " kbuild test robot
2018-02-27 11:03 ` Mark Brown
2018-02-28 11:06 ` Applied "ASoC: cpcap: new codec" to the asoc tree Mark Brown
2018-02-23 20:02 ` [PATCHv5 3/5] mfd: motorola-cpcap: Add audio-codec support Sebastian Reichel
2018-03-07 16:32 ` Lee Jones
2018-03-08 9:46 ` Sebastian Reichel
2018-03-08 9:53 ` Lee Jones
2018-03-08 10:27 ` Sebastian Reichel
2018-03-08 10:48 ` Lee Jones
2018-03-08 11:25 ` Mark Brown
2018-03-09 8:34 ` Lee Jones
2018-03-09 11:19 ` Sebastian Reichel
2018-03-09 12:40 ` Mark Brown
2018-03-09 15:11 ` Tony Lindgren
2018-03-09 16:48 ` Sebastian Reichel
2018-03-08 12:54 ` Sebastian Reichel
2018-03-08 17:07 ` Tony Lindgren
2018-03-09 11:29 ` Sebastian Reichel
2018-03-12 9:08 ` Lee Jones
2018-02-23 20:02 ` [PATCHv5 4/5] ARM: dts: motorola-cpcap-mapphone: add audio-codec Sebastian Reichel
2018-02-23 20:02 ` [PATCHv5 5/5] ARM: dts: omap4-droid4: add soundcard Sebastian Reichel
2018-03-22 20:48 ` [PATCHv5, " Pavel Machek
2018-03-22 23:48 ` [PATCHv5,5/5] " Sebastian Reichel
2018-03-23 10:09 ` [PATCHv5, 5/5] " Pavel Machek
2018-03-23 10:30 ` Sebastian Reichel
2018-03-23 11:06 ` Pavel Machek
2018-03-23 11:08 ` Pavel Machek
2018-03-23 14:09 ` [PATCHv5,5/5] " Pavel Machek
2018-03-23 14:11 ` [PATCHv5, 5/5] " Pavel Machek
2018-03-26 14:16 ` omap4-droid4: voice call support was Re: [PATCHv5,5/5] " Pavel Machek
2018-03-26 15:58 ` Sebastian Reichel
2018-03-26 20:31 ` Pavel Machek
2018-03-26 23:10 ` Sebastian Reichel
2018-03-27 20:41 ` omap4-droid4: voice call support was Re: [PATCHv5, 5/5] " Pavel Machek
2018-03-27 20:51 ` omap4-droid4: voice call support was Re: [PATCHv5,5/5] " Tony Lindgren
2018-03-27 12:14 ` omap4-droid4: voice call support was Re: [PATCHv5, 5/5] " Mark Brown
2018-03-27 22:22 ` Sebastian Reichel
2018-03-28 2:29 ` Mark Brown
2018-03-28 14:02 ` Sebastian Reichel
2018-03-29 1:45 ` omap4-droid4: voice call support was Re: [PATCHv5,5/5] " Tony Lindgren
2018-03-29 13:36 ` Sebastian Reichel
2018-03-29 13:59 ` Tony Lindgren
2018-03-29 15:46 ` Sebastian Reichel
2018-03-29 16:06 ` Tony Lindgren
2018-03-30 10:57 ` omap4-droid4: voice call support was Re: [PATCHv5, 5/5] " Sebastian Reichel
2018-03-30 22:31 ` omap4-droid4: voice call support was Re: [PATCHv5,5/5] " Pavel Machek
2018-03-29 16:37 ` Pavel Machek
2018-03-29 16:41 ` Tony Lindgren
2018-03-29 18:40 ` omap4-droid4: voice call support was Re: [PATCHv5, 5/5] " Pavel Machek
2018-03-29 21:56 ` omap4-droid4: voice call support was Re: [PATCHv5,5/5] " Tony Lindgren
2018-03-30 10:37 ` Pavel Machek
2018-03-30 13:07 ` Merlijn Wajer
2018-03-30 15:22 ` Tony Lindgren
2018-03-30 15:25 ` omap4-droid4: voice call support was Re: [PATCHv5, 5/5] " Michael Nazzareno Trimarchi
2018-03-30 15:44 ` Tony Lindgren
2018-03-30 17:46 ` [alsa-devel] " Tony Lindgren
2018-03-30 15:34 ` Pavel Machek [this message]
2018-03-30 17:50 ` omap4-droid4: voice call support was Re: [PATCHv5,5/5] " Pavel Machek
2018-03-30 18:01 ` omap4-droid4: voice call support was Re: [PATCHv5, 5/5] " Pavel Machek
2018-03-30 20:46 ` omap4-droid4: voice call support was Re: [PATCHv5,5/5] " Pavel Machek
2018-03-29 14:09 ` Pavel Machek
2018-03-29 14:21 ` Tony Lindgren
2018-03-29 16:08 ` omap4-droid4: voice call support was Re: [PATCHv5, 5/5] " Pavel Machek
2018-03-29 16:34 ` Tony Lindgren
2018-03-29 18:05 ` Pavel Machek
2018-03-29 21:58 ` Tony Lindgren
2018-04-01 23:17 ` Tony Lindgren
2018-03-31 14:55 ` call/normal switch was Re: omap4-droid4: voice call support was Pavel Machek
2018-03-31 18:19 ` Tony Lindgren
2018-03-31 19:19 ` Pavel Machek
2018-03-31 19:46 ` Pavel Machek
2018-03-31 19:55 ` Pavel Machek
2018-03-31 23:43 ` Tony Lindgren
2018-04-01 6:48 ` Pavel Machek
2018-04-01 13:18 ` Pavel Machek
2018-04-01 15:36 ` Tony Lindgren
2018-04-01 17:30 ` Tony Lindgren
2018-04-02 15:50 ` Dan Williams
2018-04-02 15:57 ` Tony Lindgren
2018-04-03 15:04 ` Tony Lindgren
2018-04-03 15:50 ` Pavel Machek
2018-04-03 19:44 ` Tony Lindgren
2018-04-06 12:04 ` Pavel Machek
2018-04-06 12:23 ` Merlijn Wajer
2018-04-06 12:45 ` Pavel Machek
2018-04-06 22:02 ` Pavel Machek
2018-04-07 8:10 ` simultaneous voice/data works (was Re: call/normal switch was Re: omap4-droid4: voice call support was) Pavel Machek
2018-04-07 12:22 ` Pavel Machek
2018-04-08 2:44 ` Dan Williams
2018-04-08 7:41 ` Pavel Machek
2018-04-09 3:15 ` Dan Williams
2018-04-09 14:08 ` Tony Lindgren
2018-04-09 15:53 ` Dan Williams
2018-04-09 20:21 ` Pavel Machek
2018-04-10 10:58 ` Pavel Machek
2018-04-10 13:50 ` Tony Lindgren
2018-04-11 11:43 ` Pavel Machek
2018-04-03 22:11 ` call/normal switch was Re: omap4-droid4: voice call support was Pavel Machek
2018-03-31 19:46 ` Tony Lindgren
2018-04-02 15:06 ` omap4-droid4: voice call support was Re: [PATCHv5, 5/5] ARM: dts: omap4-droid4: add soundcard Mark Brown
2018-03-28 9:00 ` omap4-droid4: voice call support was Re: [PATCHv5,5/5] " Pavel Machek
2018-03-28 9:36 ` omap4-droid4: voice call support was Re: [PATCHv5, 5/5] " Pavel Machek
2018-04-03 8:52 ` [PATCHv5,5/5] " Pavel Machek
2018-02-23 22:24 ` [PATCHv5 0/5] Motorola Droid 4 Audio Support Tony Lindgren
2018-03-02 20:57 ` Tony Lindgren
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=20180330153406.GA20218@amd \
--to=pavel@ucw.cz \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=dcbw@redhat.com \
--cc=devicetree@vger.kernel.org \
--cc=kernel@collabora.com \
--cc=lee.jones@linaro.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=merlijn@wizzup.org \
--cc=robh+dt@kernel.org \
--cc=sebastian.reichel@collabora.co.uk \
--cc=tiwai@suse.com \
--cc=tony@atomide.com \
/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;
as well as URLs for NNTP newsgroup(s).