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

Commit 4c5faa02 authored by Zhen Kong's avatar Zhen Kong
Browse files

crypto: msm: add changes about no clock support



Make changes such that we have a no-clock-support check
because clocks are not handled by hlos crypto driver
on some targets.

Change-Id: Id68a8fa3c56f1d3b24088dd05c8837f8a83b32fc
Signed-off-by: default avatarZhen Kong <zkong@codeaurora.org>
parent 1529c90d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ Optional properties:
  - qcom,bsm-ee : optional, indicate the BAM EE value, changes from target to target. Default value is 1 if not specified.
  - qcom,smmu-s1-enable : Boolean flag to enable SMMU stage 1 translation.
  - iommus : A list of phandle and IOMMU specifier pairs that describe the IOMMU master interfaces of the device.
  - qcom,no-clock-support : indicates clocks are not handled by hlos crypto driver.

Example:

+1 −0
Original line number Diff line number Diff line
@@ -42,6 +42,7 @@ Optional properties:

  - qcom,smmu-s1-enable : Boolean flag to bypass SMMU stage 1 translation.
  - iommus : A list of phandle and IOMMU specifier pairs that describe the IOMMU master interfaces of the device.
  - qcom,no-clock-support : indicates clocks are not handled by hlos crypto driver.

Example:

+24 −0
Original line number Diff line number Diff line
@@ -163,6 +163,7 @@ struct qce_device {
	uint8_t *dummyreq_in_buf;
	struct dma_iommu_mapping *smmu_mapping;
	bool enable_s1_smmu;
	bool no_clock_support;
};

static void print_notify_debug(struct sps_event_notify *notify);
@@ -5714,6 +5715,9 @@ static int __qce_get_device_tree_data(struct platform_device *pdev,
	if (of_property_read_bool((&pdev->dev)->of_node, "qcom,smmu-s1-enable"))
		pce_dev->enable_s1_smmu = true;

	pce_dev->no_clock_support = of_property_read_bool((&pdev->dev)->of_node,
					"qcom,no-clock-support");

	pce_dev->ce_bam_info.dest_pipe_index	=
			2 * pce_dev->ce_bam_info.pipe_pair_index;
	pce_dev->ce_bam_info.src_pipe_index	=
@@ -5768,6 +5772,11 @@ static int __qce_init_clk(struct qce_device *pce_dev)
{
	int rc = 0;

	if (pce_dev->no_clock_support == true) {
		pr_debug("No clock support defined in dts\n");
		return rc;
	}

	pce_dev->ce_core_src_clk = clk_get(pce_dev->pdev, "core_clk_src");
	if (!IS_ERR(pce_dev->ce_core_src_clk)) {
		if (pce_dev->request_bw_before_clk)
@@ -5834,6 +5843,11 @@ static int __qce_init_clk(struct qce_device *pce_dev)

static void __qce_deinit_clk(struct qce_device *pce_dev)
{
	if (pce_dev->no_clock_support == true) {
		pr_debug("No clock support defined in dts\n");
		return;
	}

	if (pce_dev->ce_bus_clk)
		clk_put(pce_dev->ce_bus_clk);
	if (pce_dev->ce_clk)
@@ -5849,6 +5863,11 @@ int qce_enable_clk(void *handle)
	struct qce_device *pce_dev = (struct qce_device *)handle;
	int rc = 0;

	if (pce_dev->no_clock_support == true) {
		pr_debug("No clock support defined in dts\n");
		return rc;
	}

	if (pce_dev->ce_core_src_clk) {
		rc = clk_prepare_enable(pce_dev->ce_core_src_clk);
		if (rc) {
@@ -5903,6 +5922,11 @@ int qce_disable_clk(void *handle)
	struct qce_device *pce_dev = (struct qce_device *) handle;
	int rc = 0;

	if (pce_dev->no_clock_support == true) {
		pr_debug("No clock support defined in dts\n");
		return rc;
	}

	if (pce_dev->ce_bus_clk)
		clk_disable_unprepare(pce_dev->ce_bus_clk);
	if (pce_dev->ce_clk)