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

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

Merge "msm: sps: Add probe deferral support in sps driver"

parents 4cc34d8d f64fb0a7
Loading
Loading
Loading
Loading
+30 −6
Original line number Diff line number Diff line
@@ -664,6 +664,11 @@ int sps_get_bam_debug_info(u32 dev, u32 option, u32 para,
		return SPS_ERROR;
	}

	if (sps == NULL || !sps->is_ready) {
		SPS_DBG2("sps:%s:sps driver is not ready.\n", __func__);
		return -EPROBE_DEFER;
	}

	mutex_lock(&sps->lock);
	/* Search for the target BAM device */
	bam = sps_h2bam(dev);
@@ -1100,6 +1105,11 @@ int sps_phy2h(u32 phys_addr, u32 *handle)

	SPS_DBG("sps:%s.", __func__);

	if (sps == NULL || !sps->is_ready) {
		SPS_DBG2("sps:%s:sps driver is not ready.\n", __func__);
		return -EPROBE_DEFER;
	}

	if (handle == NULL) {
		SPS_ERR("sps:%s:handle is NULL.\n", __func__);
		return SPS_ERROR;
@@ -1142,6 +1152,11 @@ int sps_setup_bam2bam_fifo(struct sps_mem_buffer *mem_buffer,
		return SPS_ERROR;
	}

	if (sps == NULL || !sps->is_ready) {
		SPS_DBG2("sps:%s:sps driver is not ready.\n", __func__);
		return -EPROBE_DEFER;
	}

	if (use_offset) {
		if ((addr + size) <= sps->pipemem_size)
			mem_buffer->phys_base = sps->pipemem_phys_base + addr;
@@ -1752,6 +1767,11 @@ int sps_device_reset(u32 dev)
		return SPS_ERROR;
	}

	if (sps == NULL || !sps->is_ready) {
		SPS_DBG2("sps:%s:sps driver is not ready.\n", __func__);
		return -EPROBE_DEFER;
	}

	mutex_lock(&sps->lock);
	/* Search for the target BAM device */
	bam = sps_h2bam(dev);
@@ -1997,8 +2017,10 @@ int sps_ctrl_bam_dma_clk(bool clk_on)

	SPS_DBG("sps:%s.", __func__);

	if (!sps->is_ready)
	if (sps == NULL || !sps->is_ready) {
		SPS_DBG2("sps:%s:sps driver is not ready.\n", __func__);
		return -EPROBE_DEFER;
	}

	if (clk_on == true) {
		SPS_DBG("sps:vote for bam dma clk.\n");
@@ -2039,8 +2061,10 @@ int sps_register_bam_device(const struct sps_bam_props *bam_props,
		return SPS_ERROR;
	}

	if (sps == NULL)
		return SPS_ERROR;
	if (sps == NULL) {
		SPS_DBG2("sps:%s:sps driver is not ready.\n", __func__);
		return -EPROBE_DEFER;
	}

	/* BAM-DMA is registered internally during power-up */
	if ((!sps->is_ready) && !(bam_props->options & SPS_BAM_OPT_BAMDMA)) {
@@ -2507,7 +2531,7 @@ static int msm_sps_probe(struct platform_device *pdev)

	sps->dfab_clk = clk_get(sps->dev, "dfab_clk");
	if (IS_ERR(sps->dfab_clk)) {
		if (IS_ERR(sps->dfab_clk) == -EPROBE_DEFER)
		if (PTR_ERR(sps->dfab_clk) == -EPROBE_DEFER)
			ret = -EPROBE_DEFER;
		else
			SPS_ERR("sps:fail to get dfab_clk.");
@@ -2524,7 +2548,7 @@ static int msm_sps_probe(struct platform_device *pdev)
	if (!d_type) {
		sps->pmem_clk = clk_get(sps->dev, "mem_clk");
		if (IS_ERR(sps->pmem_clk)) {
			if (IS_ERR(sps->pmem_clk) == -EPROBE_DEFER)
			if (PTR_ERR(sps->pmem_clk) == -EPROBE_DEFER)
				ret = -EPROBE_DEFER;
			else
				SPS_ERR("sps:fail to get pmem_clk.");
@@ -2541,7 +2565,7 @@ static int msm_sps_probe(struct platform_device *pdev)
#ifdef CONFIG_SPS_SUPPORT_BAMDMA
	sps->bamdma_clk = clk_get(sps->dev, "dma_bam_pclk");
	if (IS_ERR(sps->bamdma_clk)) {
		if (IS_ERR(sps->bamdma_clk) == -EPROBE_DEFER)
		if (PTR_ERR(sps->bamdma_clk) == -EPROBE_DEFER)
			ret = -EPROBE_DEFER;
		else
			SPS_ERR("sps:fail to get bamdma_clk.");