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

Commit 157ae0b1 authored by Girish Mahadevan's avatar Girish Mahadevan
Browse files

spi: spi_qsd: Modify bus bandwidth voting



Modify the bus bandwidth voting vectors to remove the AB part.
The AB portions are not needed for SPI usescases as these add to
the latency of the transactions and in general AB is not needed for
smaller bus bandwidth requests like the requests from SPI driver.

Remove the use of the "active-only" field in the driver and the
logic it was driving in terms of bus voting scheme. The active-only
scheme should only be used if needed to vote for bus badwidth when
AP is active and it doesn't apply to SPI usecases.

Change-Id: I4c62cce9d1c7e32d57bc6367e0e5fbdf44261f6d
Signed-off-by: default avatarGirish Mahadevan <girishm@codeaurora.org>
parent 84a40fce
Loading
Loading
Loading
Loading
+11 −19
Original line number Diff line number Diff line
@@ -302,7 +302,6 @@ static void msm_spi_clk_path_unvote(struct msm_spi *dd)

static void msm_spi_clk_path_teardown(struct msm_spi *dd)
{
	if (dd->pdata->active_only)
	msm_spi_clk_path_unvote(dd);

	if (dd->clk_path_vote.client_hdl) {
@@ -356,7 +355,7 @@ static int msm_spi_clk_path_init_structs(struct msm_spi *dd)
	paths[MSM_SPI_CLK_PATH_RESUME_VEC]  = (struct msm_bus_vectors) {
		.src = dd->pdata->master_id,
		.dst = MSM_BUS_SLAVE_EBI_CH0,
		.ab  = MSM_SPI_CLK_PATH_AVRG_BW(dd),
		.ab  = 0,
		.ib  = MSM_SPI_CLK_PATH_BRST_BW(dd),
	};

@@ -371,7 +370,7 @@ static int msm_spi_clk_path_init_structs(struct msm_spi *dd)
	};

	*dd->clk_path_vote.pdata = (struct msm_bus_scale_pdata) {
		.active_only  = dd->pdata->active_only,
		.active_only  = 0,
		.name         = dev_name(dd->dev),
		.num_usecases = 2,
		.usecase      = usecases,
@@ -409,13 +408,11 @@ static int msm_spi_clk_path_postponed_register(struct msm_spi *dd)
			/* log a success message if an error msg was logged */
			dd->clk_path_vote.reg_err = false;
			dev_info(dd->dev,
				"msm_bus_scale_register_client(mstr-id:%d "
				"actv-only:%d):0x%x",
				dd->pdata->master_id, dd->pdata->active_only,
			"msm_bus_scale_register_client(mstr-id:%d): 0x%x",
				dd->pdata->master_id,
				dd->clk_path_vote.client_hdl);
		}

		if (dd->pdata->active_only)
		msm_spi_clk_path_vote(dd);
	} else {
		/* guard to log only one error on multiple failure */
@@ -423,9 +420,8 @@ static int msm_spi_clk_path_postponed_register(struct msm_spi *dd)
			dd->clk_path_vote.reg_err = true;

			dev_info(dd->dev,
				"msm_bus_scale_register_client(mstr-id:%d "
				"actv-only:%d):0",
				dd->pdata->master_id, dd->pdata->active_only);
				"msm_bus_scale_register_client(mstr-id:%d): 0",
				dd->pdata->master_id);
		}
	}

@@ -451,7 +447,6 @@ static void msm_spi_clk_path_init(struct msm_spi *dd)
	if (msm_spi_clk_path_postponed_register(dd))
		return;

	if (dd->pdata->active_only)
	msm_spi_clk_path_vote(dd);
}

@@ -2213,8 +2208,6 @@ struct msm_spi_platform_data *msm_spi_dt_to_pdata(
			&pdata->max_clock_speed,         DT_SGST, DT_U32,   0},
		{"qcom,infinite-mode",
			&pdata->infinite_mode,           DT_OPT,  DT_U32,   0},
		{"qcom,active-only",
			&pdata->active_only,             DT_OPT,  DT_BOOL,  0},
		{"qcom,master-id",
			&pdata->master_id,               DT_SGST, DT_U32,   0},
		{"qcom,ver-reg-exists",
@@ -2631,7 +2624,7 @@ static int msm_spi_pm_suspend_runtime(struct device *device)
	if (dd->pdata && !dd->pdata->is_shared)
		put_local_resources(dd);

	if (dd->pdata && !dd->pdata->active_only)
	if (dd->pdata)
		msm_spi_clk_path_unvote(dd);

suspend_exit:
@@ -2662,7 +2655,6 @@ static int msm_spi_pm_resume_runtime(struct device *device)
			dd->is_init_complete = true;
	}
	msm_spi_clk_path_init(dd);
	if (!dd->pdata->active_only)
	msm_spi_clk_path_vote(dd);

	if (!dd->pdata->is_shared) {
+0 −1
Original line number Diff line number Diff line
@@ -38,7 +38,6 @@
 */
struct msm_spi_platform_data {
	u32 max_clock_speed;
	bool active_only;
	u32  master_id;
	int (*gpio_config)(void);
	void (*gpio_release)(void);