diff --git a/config/dyn-modes/host_mode_jolla.ini b/config/dyn-modes/host_mode_jolla.ini new file mode 100644 index 0000000..888b416 --- /dev/null +++ b/config/dyn-modes/host_mode_jolla.ini @@ -0,0 +1,8 @@ +[mode] +name = host_mode +module = none + +[options] +sysfs_path = /sys/class/power_supply/usb/scope +sysfs_value = 1 +sysfs_reset_value = 2 diff --git a/rpm/usb-moded.spec b/rpm/usb-moded.spec index 2d0ee60..8f2bfd3 100644 --- a/rpm/usb-moded.spec +++ b/rpm/usb-moded.spec @@ -180,6 +180,19 @@ system bus. This package contains the android at modem port mode config. +%package host-mode-jolla +Summary: USB mode controller - host mode switch for Jolla +Group: Config + +%description host-mode-jolla +Usb_moded is a daemon to control the USB states. For this +it loads unloads the relevant usb gadget modules, keeps track +of the filesystem(s) and notifies about changes on the DBUS +system bus. + +This package contains the config to switch the first Jolla phone +in host mode. + %package defaults Summary: USB mode controller - default configuration Group: Config @@ -363,3 +376,7 @@ systemctl daemon-reload || : %defattr(-,root,root,-) %{_sysconfdir}/usb-moded/dyn-modes/mass_storage_android.ini %{_sysconfdir}/usb-moded/mass-storage-jolla.ini + +%files host-mode-jolla +%defattr(-,root,root,-) +%{_sysconfdir}/usb-moded/dyn-modes/host_mode_jolla.ini diff --git a/src/usb_moded-modes.h b/src/usb_moded-modes.h index 9bdbafd..9067ebc 100644 --- a/src/usb_moded-modes.h +++ b/src/usb_moded-modes.h @@ -29,4 +29,5 @@ #define MODE_DEVELOPER "developer_mode" #define MODE_MTP "mtp_mode" #define MODE_CHARGER "dedicated_charger" +#define MODE_HOST "host_mode" #define MODE_CONNECTION_SHARING "connection_charing"