Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 58cde467 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "esoc: mdm-4x: Handle primary soc reset"

parents dd2ccc4e 2613adda
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -545,6 +545,15 @@ static void mdm_notify(enum esoc_notify notify, struct esoc_clink *esoc)
					      !mdm->soft_reset_inverted);
		}
		break;
	case ESOC_PRIMARY_REBOOT:
		dev_dbg(mdm->dev, "Triggering mdm cold reset");
		mdm->ready = 0;
		gpio_direction_output(MDM_GPIO(mdm, AP2MDM_SOFT_RESET),
				!!mdm->soft_reset_inverted);
		mdelay(300);
		gpio_direction_output(MDM_GPIO(mdm, AP2MDM_SOFT_RESET),
				!mdm->soft_reset_inverted);
		break;
	};
	return;
}
+18 −1
Original line number Diff line number Diff line
@@ -12,6 +12,7 @@

#include <linux/delay.h>
#include <linux/workqueue.h>
#include <linux/reboot.h>
#include "esoc.h"

enum {
@@ -36,10 +37,22 @@ struct mdm_drv {
	bool boot_fail;
	struct workqueue_struct *mdm_queue;
	struct work_struct ssr_work;
	struct notifier_block esoc_restart;
};

#define to_mdm_drv(d)	container_of(d, struct mdm_drv, cmd_eng)

static int esoc_msm_restart_handler(struct notifier_block *nb,
		unsigned long action, void *data)
{
	struct mdm_drv *mdm_drv = container_of(nb, struct mdm_drv,
					esoc_restart);
	struct esoc_clink *esoc_clink = mdm_drv->esoc_clink;
	const struct esoc_clink_ops const *clink_ops = esoc_clink->clink_ops;

	dev_dbg(&esoc_clink->dev, "Notifying esoc of cold reboot\n");
	clink_ops->notify(ESOC_PRIMARY_REBOOT, esoc_clink);
	return NOTIFY_OK;
}
static void mdm_handle_clink_evt(enum esoc_evt evt,
					struct esoc_eng *eng)
{
@@ -226,6 +239,10 @@ int esoc_ssr_probe(struct esoc_clink *esoc_clink)
	mdm_drv->esoc_clink = esoc_clink;
	mdm_drv->mode = PWR_OFF;
	mdm_drv->boot_fail = false;
	mdm_drv->esoc_restart.notifier_call = esoc_msm_restart_handler;
	ret = register_reboot_notifier(&mdm_drv->esoc_restart);
	if (ret)
		dev_err(&esoc_clink->dev, "register for reboot failed\n");
	return 0;
queue_err:
	esoc_clink_unregister_ssr(esoc_clink);
+1 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ enum esoc_notify {
	ESOC_DEBUG_DONE,
	ESOC_DEBUG_FAIL,
	ESOC_PRIMARY_CRASH,
	ESOC_PRIMARY_REBOOT,
};

enum esoc_req {