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

Commit 2fba68d9 authored by Deepak Katragadda's avatar Deepak Katragadda
Browse files

msm: SSR: Merge start/stop ops with powerup/shutdown ops



The start/stop ops were introduced to provide a clear migration
path for merging SSR drivers and PIL drivers together. Now that
the merge is over we can drop the start/stop ops and use the
powerup/shutdown ops in their place. Mostly this means we disable
the irq during probe so that powerup() can enable it and then
drop the start/stop callbacks.

Change-Id: I787b60a93a31a4085c4118292ea8a163df175765
Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
Signed-off-by: default avatarDeepak Katragadda <dkatraga@codeaurora.org>
parent 86155e46
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -36,8 +36,6 @@ struct module;
 * @depends_on: subsystem this subsystem depends on to operate
 * @dev: parent device
 * @owner: module the descriptor belongs to
 * @start: Start a subsystem
 * @stop: Stop a subsystem
 * @shutdown: Stop a subsystem
 * @powerup: Start a subsystem
 * @crash_shutdown: Shutdown a subsystem when the system crashes (can't sleep)
@@ -51,10 +49,7 @@ struct subsys_desc {
	struct device *dev;
	struct module *owner;

	int (*start)(const struct subsys_desc *desc);
	void (*stop)(const struct subsys_desc *desc);

	int (*shutdown)(const struct subsys_desc *desc);
	int (*shutdown)(const struct subsys_desc *desc, bool force_stop);
	int (*powerup)(const struct subsys_desc *desc);
	void (*crash_shutdown)(const struct subsys_desc *desc);
	int (*ramdump)(int, const struct subsys_desc *desc);
+2 −1
Original line number Diff line number Diff line
@@ -71,7 +71,8 @@ static void charm_disable_irqs(void)

}

static int charm_subsys_shutdown(const struct subsys_desc *crashed_subsys)
static int charm_subsys_shutdown(const struct subsys_desc *crashed_subsys,
							bool force_stop)
{
	charm_ready = 0;
	power_down_charm();
+2 −1
Original line number Diff line number Diff line
@@ -662,7 +662,8 @@ static irqreturn_t mdm_pblrdy_change(int irq, void *dev_id)
	return IRQ_HANDLED;
}

static int mdm_subsys_shutdown(const struct subsys_desc *crashed_subsys)
static int mdm_subsys_shutdown(const struct subsys_desc *crashed_subsys,
							bool force_stop)
{
	struct mdm_device *mdev =
	 container_of(crashed_subsys, struct mdm_device, mdm_subsys);
+10 −19
Original line number Diff line number Diff line
@@ -166,27 +166,19 @@ static void dsps_smsm_state_cb(void *data, uint32_t old_state,
	}
}

static int dsps_start(const struct subsys_desc *desc)
static int dsps_shutdown(const struct subsys_desc *desc, bool force_stop)
{
	struct dsps_data *drv = desc_to_drv(desc);

	return pil_boot(&drv->desc);
	if (force_stop) {
		if (drv->ppss_base) {
			writel_relaxed(0, drv->ppss_base +
					PPSS_WDOG_UNMASKED_INT_EN);
			/* Make sure wdog is disabled before shutting down */
			mb();
		}

static void dsps_stop(const struct subsys_desc *desc)
{
	struct dsps_data *drv = desc_to_drv(desc);
	pil_shutdown(&drv->desc);
	}

static int dsps_shutdown(const struct subsys_desc *desc)
{
	struct dsps_data *drv = desc_to_drv(desc);
	disable_irq_nosync(drv->wdog_irq);
	if (drv->ppss_base) {
		writel_relaxed(0, drv->ppss_base + PPSS_WDOG_UNMASKED_INT_EN);
		mb(); /* Make sure wdog is disabled before shutting down */
	}
	pil_shutdown(&drv->desc);
	return 0;
}
@@ -305,8 +297,6 @@ static int pil_dsps_driver_probe(struct platform_device *pdev)
	drv->subsys_desc.name = "dsps";
	drv->subsys_desc.dev = &pdev->dev;
	drv->subsys_desc.owner = THIS_MODULE;
	drv->subsys_desc.start = dsps_start;
	drv->subsys_desc.stop = dsps_stop;
	drv->subsys_desc.shutdown = dsps_shutdown;
	drv->subsys_desc.powerup = dsps_powerup;
	drv->subsys_desc.ramdump = dsps_ramdump,
@@ -334,6 +324,7 @@ static int pil_dsps_driver_probe(struct platform_device *pdev)
			dev_err(&pdev->dev, "request_irq failed\n");
			goto err_smsm;
		}
		disable_irq(drv->wdog_irq);
	} else {
		drv->wdog_irq = -1;
		dev_dbg(&pdev->dev, "ppss_wdog not supported\n");
+2 −20
Original line number Diff line number Diff line
@@ -362,29 +362,12 @@ static void smsm_state_cb(void *data, uint32_t old_state, uint32_t new_state)
	}
}

static int gss_start(const struct subsys_desc *desc)
{
	struct gss_data *drv;

	drv = container_of(desc, struct gss_data, subsys_desc);
	return pil_boot(&drv->pil_desc);
}

static void gss_stop(const struct subsys_desc *desc)
{
	struct gss_data *drv;

	drv = container_of(desc, struct gss_data, subsys_desc);
	pil_shutdown(&drv->pil_desc);
}

static int gss_shutdown(const struct subsys_desc *desc)
static int gss_shutdown(const struct subsys_desc *desc, bool force_stop)
{
	struct gss_data *drv = container_of(desc, struct gss_data, subsys_desc);

	pil_shutdown(&drv->pil_desc);
	disable_irq_nosync(drv->irq);

	return 0;
}

@@ -539,8 +522,6 @@ static int pil_gss_probe(struct platform_device *pdev)
	drv->subsys_desc.name = "gss";
	drv->subsys_desc.dev = &pdev->dev;
	drv->subsys_desc.owner = THIS_MODULE;
	drv->subsys_desc.start = gss_start;
	drv->subsys_desc.stop = gss_stop;
	drv->subsys_desc.shutdown = gss_shutdown;
	drv->subsys_desc.powerup = gss_powerup;
	drv->subsys_desc.ramdump = gss_ramdump;
@@ -577,6 +558,7 @@ static int pil_gss_probe(struct platform_device *pdev)
			IRQF_TRIGGER_RISING, "gss_a5_wdog", drv);
	if (ret < 0)
		goto err;
	disable_irq(drv->irq);
	return 0;
err:
	destroy_ramdump_device(drv->smem_ramdump_dev);
Loading