summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/staging/greybus/fw-core.c13
-rw-r--r--drivers/staging/greybus/greybus_protocols.h1
-rw-r--r--drivers/staging/greybus/interface.c10
-rw-r--r--drivers/staging/greybus/interface.h1
4 files changed, 21 insertions, 4 deletions
diff --git a/drivers/staging/greybus/fw-core.c b/drivers/staging/greybus/fw-core.c
index 56296db..a7e4a8c 100644
--- a/drivers/staging/greybus/fw-core.c
+++ b/drivers/staging/greybus/fw-core.c
@@ -228,7 +228,9 @@ static int gb_fw_core_probe(struct gb_bundle *bundle,
greybus_set_drvdata(bundle, fw_core);
- gb_pm_runtime_put_autosuspend(bundle);
+ /* FIXME: Remove this after S2 Loader gets runtime PM support */
+ if (!(bundle->intf->quirks & GB_INTERFACE_QUIRK_NO_PM))
+ gb_pm_runtime_put_autosuspend(bundle);
return 0;
@@ -251,9 +253,12 @@ static void gb_fw_core_disconnect(struct gb_bundle *bundle)
struct gb_fw_core *fw_core = greybus_get_drvdata(bundle);
int ret;
- ret = gb_pm_runtime_get_sync(bundle);
- if (ret)
- gb_pm_runtime_get_noresume(bundle);
+ /* FIXME: Remove this after S2 Loader gets runtime PM support */
+ if (!(bundle->intf->quirks & GB_INTERFACE_QUIRK_NO_PM)) {
+ ret = gb_pm_runtime_get_sync(bundle);
+ if (ret)
+ gb_pm_runtime_get_noresume(bundle);
+ }
gb_fw_mgmt_connection_exit(fw_core->mgmt_connection);
gb_cap_connection_exit(fw_core->cap_connection);
diff --git a/drivers/staging/greybus/greybus_protocols.h b/drivers/staging/greybus/greybus_protocols.h
index c7fcb85..2de5aef 100644
--- a/drivers/staging/greybus/greybus_protocols.h
+++ b/drivers/staging/greybus/greybus_protocols.h
@@ -1145,6 +1145,7 @@ struct gb_svc_dme_peer_set_response {
#define GB_INIT_UNTRUSTED_SPI_BOOT_FINISHED 0x04
#define GB_INIT_BOOTROM_UNIPRO_BOOT_STARTED 0x06
#define GB_INIT_BOOTROM_FALLBACK_UNIPRO_BOOT_STARTED 0x09
+#define GB_INIT_S2_LOADER_BOOT_STARTED 0x0D
struct gb_svc_route_create_request {
__u8 intf1_id;
diff --git a/drivers/staging/greybus/interface.c b/drivers/staging/greybus/interface.c
index c20077a..faa6239 100644
--- a/drivers/staging/greybus/interface.c
+++ b/drivers/staging/greybus/interface.c
@@ -363,6 +363,7 @@ static int gb_interface_read_and_clear_init_status(struct gb_interface *intf)
{
struct gb_host_device *hd = intf->hd;
unsigned long bootrom_quirks;
+ unsigned long s2l_quirks;
int ret;
u32 value;
u16 attr;
@@ -413,13 +414,22 @@ static int gb_interface_read_and_clear_init_status(struct gb_interface *intf)
GB_INTERFACE_QUIRK_FORCED_DISABLE |
GB_INTERFACE_QUIRK_LEGACY_MODE_SWITCH |
GB_INTERFACE_QUIRK_NO_BUNDLE_ACTIVATE;
+
+ s2l_quirks = GB_INTERFACE_QUIRK_NO_PM;
+
switch (init_status) {
case GB_INIT_BOOTROM_UNIPRO_BOOT_STARTED:
case GB_INIT_BOOTROM_FALLBACK_UNIPRO_BOOT_STARTED:
intf->quirks |= bootrom_quirks;
break;
+ case GB_INIT_S2_LOADER_BOOT_STARTED:
+ /* S2 Loader doesn't support runtime PM */
+ intf->quirks &= ~bootrom_quirks;
+ intf->quirks |= s2l_quirks;
+ break;
default:
intf->quirks &= ~bootrom_quirks;
+ intf->quirks &= ~s2l_quirks;
}
/* Clear the init status. */
diff --git a/drivers/staging/greybus/interface.h b/drivers/staging/greybus/interface.h
index 89eecf0..174bc74 100644
--- a/drivers/staging/greybus/interface.h
+++ b/drivers/staging/greybus/interface.h
@@ -24,6 +24,7 @@ enum gb_interface_type {
#define GB_INTERFACE_QUIRK_FORCED_DISABLE BIT(3)
#define GB_INTERFACE_QUIRK_LEGACY_MODE_SWITCH BIT(4)
#define GB_INTERFACE_QUIRK_NO_BUNDLE_ACTIVATE BIT(5)
+#define GB_INTERFACE_QUIRK_NO_PM BIT(6)
struct gb_interface {
struct device dev;
OpenPOWER on IntegriCloud