Commit Graph

185 Commits

Author SHA1 Message Date
Arnaud Ferraris
73e16f7699 meson.build: release version 0.3.0 0.3.0 2021-04-09 11:29:26 +02:00
Arnaud Ferraris
3d21b0fc9e Merge branch 'direct-udev' into 'master'
udev: use the udev rules directly to set attr

See merge request mobian1/devices/eg25-manager!12
2021-04-09 09:23:51 +00:00
Bhushan Shah
0d46f42d78 udev: match only USB device and not USB interfaces
Interfaces can not have a power control, only usb devices.
2021-04-09 14:39:53 +05:30
Arnaud Ferraris
1fd9d7d634 Merge branch 'no-urc-cache' into 'master'
config: drop URC cache

Closes #9

See merge request mobian1/devices/eg25-manager!14
2021-04-09 09:08:22 +00:00
Dylan Van Assche
d665ea9639 config: drop URC cache
In some internal discussions between me,
the ModemManager maintainer and a Quectel engineer,
the URC cache we use is unnecessary.
I did some testing and removed the URC cache
from the configs and it works reliable without affecting
the functionality.
2021-04-09 10:35:27 +02:00
Arnaud Ferraris
68e4b2c5b4 Merge branch 'sfos' into 'master'
Allow to build without mmglib

See merge request mobian1/devices/eg25-manager!13
2021-04-09 07:53:32 +00:00
Adam Pigg
dfeab4c79b Re-order mmglib checking as per suggestion 2021-04-09 08:44:17 +01:00
Adam Pigg
40136c2a52 Allow to build without mmglib 2021-04-05 17:11:17 +01:00
Bhushan Shah
84a0ae603d udev: use the udev rules directly to set attr
We don't need complicated script for this, we can just set required
attributes using udev rules.
2021-03-26 13:56:37 +05:30
Arnaud Ferraris
ea19b0271c Merge branch 'master' into 'master'
Add a 100ms delay before PWRKEY sequence

See merge request mobian1/devices/eg25-manager!11
2021-03-17 21:37:53 +00:00
Djhg2000
528fe7e07c Add a 100ms delay before PWRKEY sequence
This brings the power on sequence in line with the EG25-G Hardware Design
datasheet, which states we need to wait at least 30 ms after VBAT becomes stable
before pulling PWRKEY low (first action of the power on sequene).

After this change the sequence becomes as follows:
- Set RESET_N high
- Wait 60 ms (double 30 ms)
- Execute PWRKEY sequence

60 ms was choosen because we don't know when VBAT becomes stable, but it should
be much less than an additional 30 ms. Empirical evidence suggests PinePhone
units with a healthy battery do not see serious side effects from not doing
this, while the modem will fail to boot and/or throw random errors on boot with
a worn out battery.
2021-03-17 19:11:36 +01:00
Arnaud Ferraris
bd5b5a5cf8 Merge branch 'ofono' into 'master'
add ofono-iface

See merge request mobian1/devices/eg25-manager!6
2021-03-15 10:24:35 +00:00
Arnaud Ferraris
ef707c9a33 Merge branch 'qurccfg_all' into 'master'
Set URC config to 'all' instead of 'usbat'

See merge request mobian1/devices/eg25-manager!10
2021-03-15 10:21:25 +00:00
Bhushan Shah
2e7a5a696b ofono-iface: add spdx copyright info 2021-03-15 12:30:16 +05:30
Bhushan Shah
52488d2e2a suspend: if we are using ofono, mark modem as resumed immediately 2021-03-15 12:30:16 +05:30
Bhushan Shah
032bd4651c at: if we are using ofono, don't query modem manager for state 2021-03-15 12:30:16 +05:30
Bhushan Shah
060dc9ae32 src: watch ofono service for new modem
If system is using ofono, use ofono dbus service to figure out the
modem's USB id.
2021-03-15 12:30:16 +05:30
Oliver Smith
dcb1a9a050 src: add ofono-iface
Start work on new ofono interface. So far, this detects ofono on dbus
and complains if both mm and ofono are running.
2021-03-15 12:29:08 +05:30
Biktor
04eed2496d Set URC config to 'all' instead of 'usbat'
dquote> When using a custom kernel, if this setting is set to 'usbat' only, no RING urc is reported on any interface. Changing QURCCFG to 'all' makes the modem report RINGs on all supported interfaces, making receiving calls possible when using a custom firmware
2021-02-24 12:32:46 +01:00
Arnaud Ferraris
3d076e8bc8 README: add details about config files 0.2.1 2021-02-21 16:40:36 +01:00
Arnaud Ferraris
2e7bf44f2d Merge branch 'at-value-expected-switched' into 'master'
at: fix argument order

See merge request mobian1/devices/eg25-manager!9
2021-02-21 15:37:36 +00:00
Dylan Van Assche
3bf2d785bb at: fix argument order
'expected' and 'value' parts of the AT command were switched.
2021-02-21 16:27:30 +01:00
Arnaud Ferraris
9e40ae11d6 data: add AT command reporting firmware version
Fixes #7
2021-02-20 20:12:21 +01:00
Arnaud Ferraris
11c9cee111 meson.build: release version 0.2.0 0.2.0 2021-02-20 17:18:25 +01:00
Arnaud Ferraris
89ce52f709 Merge branch 'config' into 'master'
Implement config file

Closes #6

See merge request mobian1/devices/eg25-manager!8
2021-02-20 16:16:45 +00:00
Arnaud Ferraris
8a41a3203b data: add config files for all pinephone versions 2021-02-20 17:11:56 +01:00
Arnaud Ferraris
042de572ea at: parse config file
The AT commands list for each stage is now configured per-device, as 
well as the UART port to be used.

As this list can be changed by the user, there is no more need for a 
special GNSS-related option
2021-02-20 17:10:43 +01:00
Arnaud Ferraris
cfbbbd0167 gpio: parse config file
The GPIO numbers are now moved to the config file instead of being 
hardcoded.
2021-02-20 17:10:43 +01:00
Arnaud Ferraris
f276d9cf9e suspend: make timeouts configurable
Instead of fixed values, the modem boot timeout and recovery timeout are now
(optional) config values.
2021-02-20 17:10:01 +01:00
Arnaud Ferraris
433982e4f7 manager: parse config file
The need to use libusb to check for the modem state on startup now 
depends on a config option, instead of the device type. The USB PID and 
VID are moved to config as well.
2021-02-20 17:04:49 +01:00
Arnaud Ferraris
d9256251fd src: implement config file lookup and initial parsing
This commit prepares the use of device-specific configuration files. 
These files should be named after the device-tree `compatible` string 
with the `toml` extension.

`eg25-manager` will search for config files in 
`<prefix>/etc/eg25-manager` first (or `/etc/eg25-manager` if prefix is 
`/usr`), then in `<prefix>/share/eg25-manager`.
2021-02-20 17:04:49 +01:00
Arnaud Ferraris
c92746e875 src: add TOML parser 2021-02-20 17:04:49 +01:00
Arnaud Ferraris
19d00bee3b manager: make sure we don't block suspend when rebooting the modem 2021-02-20 17:04:38 +01:00
Arnaud Ferraris
b929c6a380 src: minor cleanups and cosmetic fixes 2021-02-20 17:01:17 +01:00
Arnaud Ferraris
4962fcd13e Merge branch 'sleep-inhibit' into 'master'
suspend: add boot timer

See merge request mobian1/devices/eg25-manager!7
2021-02-20 15:49:40 +00:00
Dylan Van Assche
b8d269cf2f suspend: add boot timer
The EG25 modem needs at least 2 minutes after indicating 'RDY'
to be fully operational. If the modem is suspended before that,
calls or texts may not be seen by the userspace.
This mostly occurs when a full reboot or poweroff/poweron
sequence of the phone is performed.

:
2021-02-17 21:05:58 +01:00
Arnaud Ferraris
4ff727a7d4 udev: install using meson 2021-02-16 23:48:35 +01:00
Arnaud Ferraris
7765e6c541 udev: rename configure script 2021-02-16 23:47:29 +01:00
Arnaud Ferraris
94cbd03921 udev: rules: fix wrong ENV match and pass devpath to script 2021-02-16 23:45:25 +01:00
Arnaud Ferraris
4c832a00dc configure-usb-modem: make more generic 2021-02-16 23:44:42 +01:00
Arnaud Ferraris
ded092ef04 Merge branch 'avoid-modem-resets' into 'master'
udev: add udev rule to configure modem USB

See merge request mobian1/devices/eg25-manager!5
2021-02-16 19:09:59 +00:00
Dylan Van Assche
235eff02ac udev: add udev rule to configure modem USB
Quectel advises to configure the USB autosuspend feature as:
- power/control: auto
- power/autosuspend_delay_ms: 3000

Futhermore, the following settings are also needed:
- power/wakeup: enabled
- power/persist: 0
- avoid_reset_quirk: 1
2021-02-16 07:12:01 +01:00
Arnaud Ferraris
3bb6e15de0 mm-iface: keep watching bus if MM vanishes 2021-01-25 23:55:57 +01:00
Arnaud Ferraris
692f9134f8 suspend: handle case when MM doesn't manage suspend/resume 2021-01-23 11:14:41 +01:00
Arnaud Ferraris
31133affa0 meson.build: release version 0.1.2 0.1.2 2021-01-14 00:07:15 +01:00
Arnaud Ferraris
79974bc9ee manager: don't manage the GNSS by default 2021-01-14 00:06:55 +01:00
Arnaud Ferraris
150ff67e7b udev: only check if modem USB ID is set 2021-01-13 23:46:38 +01:00
Arnaud Ferraris
c2e83f15a6 manager: improve error checking in modem_reset() 2020-12-30 17:31:44 +01:00
Arnaud Ferraris
cb5220a1b8 at: reduce delay between retries
There's no reason we should wait 3s before retrying a failed AT command. 
This can even cause issues with suspend inhibition: 3 retries of a 
failed command would take 9s, while logind ignores the inhibitor after 
only 5s.

Reducing the delay to 500ms should be enough and wouldn't interfere with 
suspend inhibition.

Fixes #3
2020-12-30 16:28:39 +01:00
Arnaud Ferraris
abc05e86e5 manager: only toggle GPIOs for suspend after executing all AT commands 2020-12-30 16:20:32 +01:00