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

Commit 2539702b authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "platform: qcom-geni-se : Remove ssr-enable flag from individual driver"

parents 3268e501 cc01bac3
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@ Required properties:
Optional property:
 - qcom,clk-freq-out: Desired I2C bus clock frequency in Hz.
   When missing default to 400000Hz.
 - ssr-enable: Required only for SSC QupV3 client for SSR notification.
 - qcom,clk-cfg: Array of <u32>, clk cfg array should have 2nd to 5th parameter as
   suggested by hardware expert. Standard frequency parameters taken cared by the
   driver itself. This field is needed only if client freq is not from the i2c standard
+0 −1
Original line number Diff line number Diff line
@@ -29,7 +29,6 @@ Optional properties:
- qcom,rt:	Specifies if the framework worker thread for this
		controller device should have "real-time" priority.
- qcom,disable-autosuspend: Specifies to disable runtime PM auto suspend.
- ssr-enable:	Required only for SSC QupV3 client for SSR notification.

SPI slave nodes must be children of the SPI master node and can contain
the following properties.
+13 −14
Original line number Diff line number Diff line
@@ -139,8 +139,8 @@ struct geni_i2c_dev {
	struct geni_i2c_ssr i2c_ssr;
};

static int ssr_i2c_force_suspend(struct device *dev);
static int ssr_i2c_force_resume(struct device *dev);
static void ssr_i2c_force_suspend(struct device *dev);
static void ssr_i2c_force_resume(struct device *dev);

struct geni_i2c_err_log {
	int err;
@@ -876,8 +876,6 @@ static int geni_i2c_probe(struct platform_device *pdev)
	if (!res)
		return -EINVAL;

	gi2c->i2c_rsc.rsc_ssr.ssr_enable = of_property_read_bool(
		pdev->dev.of_node, "ssr-enable");
	wrapper_ph_node = of_parse_phandle(pdev->dev.of_node,
				"qcom,wrapper-core", 0);
	if (IS_ERR_OR_NULL(wrapper_ph_node)) {
@@ -1053,15 +1051,20 @@ static int geni_i2c_hib_resume_noirq(struct device *device)
static int geni_i2c_runtime_suspend(struct device *dev)
{
	struct geni_i2c_dev *gi2c = dev_get_drvdata(dev);
	int ret = 0;

	if (gi2c->se_mode == FIFO_SE_DMA) {
		disable_irq(gi2c->irq);
		se_geni_resources_off(&gi2c->i2c_rsc);
		ret = se_geni_resources_off(&gi2c->i2c_rsc);
	} else {
		/* GPIO is set to sleep state already. So just clocks off */
		se_geni_clks_off(&gi2c->i2c_rsc);
		ret = se_geni_clks_off(&gi2c->i2c_rsc);
	}
	return 0;
	if (ret)
		GENI_SE_DBG(gi2c->ipcl, false, gi2c->dev,
			"%s failed ret:%d\n", __func__, ret);

	return ret;
}

static int geni_i2c_runtime_resume(struct device *dev)
@@ -1168,7 +1171,7 @@ static const struct dev_pm_ops geni_i2c_pm_ops = {
	.thaw		= geni_i2c_hib_resume_noirq,
};

static int ssr_i2c_force_suspend(struct device *dev)
static void ssr_i2c_force_suspend(struct device *dev)
{
	struct geni_i2c_dev *gi2c = dev_get_drvdata(dev);
	int ret = 0;
@@ -1178,7 +1181,7 @@ static int ssr_i2c_force_suspend(struct device *dev)
	if (!pm_runtime_status_suspended(gi2c->dev)) {
		ret =  geni_i2c_runtime_suspend(gi2c->dev);
		if (ret) {
			dev_err(gi2c->dev, "runtime suspend failed\n");
			dev_err(gi2c->dev, "%s failed ret:%d\n", __func__, ret);
		} else {
			pm_runtime_disable(gi2c->dev);
			pm_runtime_set_suspended(gi2c->dev);
@@ -1188,11 +1191,9 @@ static int ssr_i2c_force_suspend(struct device *dev)

	GENI_SE_DBG(gi2c->ipcl, false, gi2c->dev, "%s done\n", __func__);
	mutex_unlock(&gi2c->i2c_ssr.ssr_lock);

	return ret;
}

static int ssr_i2c_force_resume(struct device *dev)
static void ssr_i2c_force_resume(struct device *dev)
{
	struct geni_i2c_dev *gi2c = dev_get_drvdata(dev);

@@ -1201,8 +1202,6 @@ static int ssr_i2c_force_resume(struct device *dev)
	gi2c->se_mode = UNINITIALIZED;
	GENI_SE_DBG(gi2c->ipcl, false, gi2c->dev, "%s done\n", __func__);
	mutex_unlock(&gi2c->i2c_ssr.ssr_lock);

	return 0;
}

static const struct of_device_id geni_i2c_dt_match[] = {
+2 −7
Original line number Diff line number Diff line
@@ -421,11 +421,7 @@ static int geni_se_ssr_notify_block(struct notifier_block *n,
				"SSR notification before power down\n");
		break;
	case SUBSYS_AFTER_POWERUP:
		if (dev->ssr.probe_completed)
		geni_se_ssc_qup_up(dev);
		else
			dev->ssr.probe_completed = true;

		GENI_SE_DBG(dev->log_ctx, false, NULL,
				"SSR notification after power up\n");
		break;
@@ -1196,7 +1192,7 @@ int geni_se_resources_init(struct se_geni_rsc *rsc,

	INIT_LIST_HEAD(&rsc->ab_list);
	INIT_LIST_HEAD(&rsc->ib_list);
	if (geni_se_dev->ssr.subsys_name && rsc->rsc_ssr.ssr_enable) {
	if (geni_se_dev->ssr.subsys_name) {
		INIT_LIST_HEAD(&rsc->rsc_ssr.active_list);
		list_add(&rsc->rsc_ssr.active_list,
				&geni_se_dev->ssr.active_list_head);
@@ -1979,7 +1975,6 @@ static int geni_se_probe(struct platform_device *pdev)
			"qcom,subsys-name", &geni_se_dev->ssr.subsys_name);
	if (!ret) {
		INIT_LIST_HEAD(&geni_se_dev->ssr.active_list_head);
		geni_se_dev->ssr.probe_completed = false;
		ret = geni_se_ssc_qup_ssr_reg(geni_se_dev);
		if (ret) {
			dev_err(dev, "Unable to register SSR notification\n");
+4 −10
Original line number Diff line number Diff line
@@ -178,8 +178,8 @@ struct spi_geni_master {
};

static void spi_slv_setup(struct spi_geni_master *mas);
static int ssr_spi_force_suspend(struct device *dev);
static int ssr_spi_force_resume(struct device *dev);
static void ssr_spi_force_suspend(struct device *dev);
static void ssr_spi_force_resume(struct device *dev);

static ssize_t show_slave_state(struct device *dev,
		struct device_attribute *attr, char *buf)
@@ -1584,8 +1584,6 @@ static int spi_geni_probe(struct platform_device *pdev)
	}
	geni_mas->wrapper_dev = &wrapper_pdev->dev;
	geni_mas->spi_rsc.wrapper_dev = &wrapper_pdev->dev;
	rsc->rsc_ssr.ssr_enable = of_property_read_bool(pdev->dev.of_node,
			"ssr-enable");
	ret = geni_se_resources_init(rsc, SPI_CORE2X_VOTE,
				     (DEFAULT_SE_CLK * DEFAULT_BUS_WIDTH));
	if (ret) {
@@ -1864,7 +1862,7 @@ static int spi_geni_suspend(struct device *dev)
}
#endif

static int ssr_spi_force_suspend(struct device *dev)
static void ssr_spi_force_suspend(struct device *dev)
{
	struct spi_master *spi = get_spi_master(dev);
	struct spi_geni_master *mas = spi_master_get_devdata(spi);
@@ -1888,11 +1886,9 @@ static int ssr_spi_force_suspend(struct device *dev)

	GENI_SE_DBG(mas->ipc, false, mas->dev, "force suspend done\n");
	mutex_unlock(&mas->spi_ssr.ssr_lock);

	return ret;
}

static int ssr_spi_force_resume(struct device *dev)
static void ssr_spi_force_resume(struct device *dev)
{
	struct spi_master *spi = get_spi_master(dev);
	struct spi_geni_master *mas = spi_master_get_devdata(spi);
@@ -1901,8 +1897,6 @@ static int ssr_spi_force_resume(struct device *dev)
	mas->spi_ssr.is_ssr_down = false;
	GENI_SE_DBG(mas->ipc, false, mas->dev, "force resume done\n");
	mutex_unlock(&mas->spi_ssr.ssr_lock);

	return 0;
}

static const struct dev_pm_ops spi_geni_pm_ops = {
Loading