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

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

Merge "ath10k: Define structure for copy engine interrupt map for SNOC"

parents d4f5120c fa855844
Loading
Loading
Loading
Loading
+12 −7
Original line number Diff line number Diff line
@@ -969,7 +969,7 @@ int ath10k_snoc_get_ce_id(struct ath10k *ar, int irq)
	struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar);

	for (i = 0; i < CE_COUNT_MAX; i++) {
		if (ar_snoc->ce_irqs[i] == irq)
		if (ar_snoc->ce_irqs[i].irq_line == irq)
		return i;
	}
	ath10k_err(ar, "No matching CE id for irq %d\n", irq);
@@ -1002,15 +1002,17 @@ static int ath10k_snoc_request_irq(struct ath10k *ar)
	int irqflags = IRQF_TRIGGER_RISING;

	for (id = 0; id < CE_COUNT_MAX; id++) {
		ret = request_irq(ar_snoc->ce_irqs[id],
		ret = request_irq(ar_snoc->ce_irqs[id].irq_line,
				  ath10k_snoc_per_engine_handler,
				  irqflags, ce_name[id], ar);
		if (ret) {
			ath10k_err(ar,
				   "%s: cannot register CE %d irq handler, ret = %d",
				   __func__, id, ret);
			free_irq(ar_snoc->ce_irqs[id], ar);
			atomic_set(&ar_snoc->ce_irqs[id].irq_req_stat, 0);
			return ret;
		} else {
			 atomic_set(&ar_snoc->ce_irqs[id].irq_req_stat, 1);
		}
	}

@@ -1022,10 +1024,13 @@ static void ath10k_snoc_free_irq(struct ath10k *ar)
	int id;
	struct ath10k_snoc *ar_snoc = ath10k_snoc_priv(ar);

	for (id = 0; id < CE_COUNT_MAX; id++)
		free_irq(ar_snoc->ce_irqs[id], ar);
	for (id = 0; id < CE_COUNT_MAX; id++) {
		if (atomic_read(&ar_snoc->ce_irqs[id].irq_req_stat)) {
			free_irq(ar_snoc->ce_irqs[id].irq_line, ar);
			atomic_set(&ar_snoc->ce_irqs[id].irq_req_stat, 0);
		}
	}
}


static int ath10k_snoc_get_soc_info(struct ath10k *ar)
{
@@ -1198,7 +1203,7 @@ static int ath10k_snoc_resource_init(struct ath10k *ar)
			ret = -ENODEV;
			goto out;
		} else {
			ar_snoc->ce_irqs[i] = res->start;
			ar_snoc->ce_irqs[i].irq_line = res->start;
		}
	}

+11 −1
Original line number Diff line number Diff line
@@ -103,6 +103,15 @@ struct ath10k_service_notifier_context {
	char name[QMI_SERVREG_LOC_NAME_LENGTH_V01 + 1];
};

/* struct ath10k_snoc_ce_irq: copy engine irq struct
 * @irq_req_stat: irq request status
 * @irq_line: irq line
 */
struct ath10k_snoc_ce_irq {
	atomic_t irq_req_stat;
	u32 irq_line;
};

/* struct ath10k_snoc: SNOC info struct
 * @dev: device structure
 * @ar:ath10k base structure
@@ -111,6 +120,7 @@ struct ath10k_service_notifier_context {
 * @target_info: snoc target info
 * @mem_len: mempry map length
 * @pipe_info: pipe info struct
 * @ce_irqs: copy engine irq list
 * @ce_lock: protect ce structures
 * @ce_states: maps ce id to ce state
 * @rx_post_retry: rx buffer post processing timer
@@ -134,7 +144,7 @@ struct ath10k_snoc {
	size_t mem_len;
	struct ath10k_snoc_pipe pipe_info[CE_COUNT_MAX];
	struct timer_list rx_post_retry;
	u32 ce_irqs[CE_COUNT_MAX];
	struct ath10k_snoc_ce_irq ce_irqs[CE_COUNT_MAX];
	u32 *vaddr_rri_on_ddr;
	bool is_driver_probed;
	struct notifier_block modem_ssr_nb;