Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp842931imu; Fri, 11 Jan 2019 10:00:36 -0800 (PST) X-Google-Smtp-Source: ALg8bN4vwi4XVSa7TOsHklTjgE+IbwOJayCeIJmMIHDY6QpeQSQEnw90dEDKgELhC8NcIcmKNzjA X-Received: by 2002:a63:f047:: with SMTP id s7mr14257783pgj.441.1547229636901; Fri, 11 Jan 2019 10:00:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547229636; cv=none; d=google.com; s=arc-20160816; b=J/6HwZhNrmQVY6yiLJglBjpstmV9HY7h2FlByuIIcs5AFJvjmKdRiVsUtPRhucc7zR 1yEU50vqo7EXv2b8bmtzW5e71h3owl+JXQ5qUQhONtAOVUDuHPuaaZ79x6viue9JxxHg 4nI0YMjyVso+LaiC5ajkJZSmV+Kzcp4uXRzAZ4niisVQ0sceBxWjjXxvC4Wd+5XrTQB8 aMiZu4U01sRwddQfibMc2B0R0SlbUh0PWwnZfmU+a6x36gB+Z/m3/6VN6RETOwgZ7dV9 NVFPk/f9CJxp6sFdgSD6MfNhB5WiEkrUeXClLGwGHd59Jh6uGe67sa4R8KdHN3GFwvQd GAxg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=yMu2oH6l8UQGwq0tVgGFJvbMaRSI3dr4K4dZxWhwCX8=; b=MgQJkEzAVRE0l8pxnYrwfbHMY5mYN5whc/6peMO+Cv4Cr/84pEi5wHfdbQ9UykWja0 CwzQpmodycw33e2CIy+mgwONmo2xo2jgEIIF5vyf5jMPH+24PDpVyQnsLz+gQqmeanY/ cpvGYBLJSs8qxaelEtQJQTnhd6fsJ35IBXM+Geq0eSJ5AOT+8aefA0qh8P41/z3Rjpqa MW6JsyJWbzy+vczAdXcB0fI8AnQwQM07zbl+BSREKvOWGYaqzA1SKou8p5gi+Ajxry6D dzgYA8d2ZkBrGupEAsn8Uvl6DmjnwheDZj5rn1bqGRhKlSw1QHT/2N+b0zqGRAZVhHAC B8ZQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d12si74906168pgf.470.2019.01.11.10.00.20; Fri, 11 Jan 2019 10:00:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732021AbfAKN7Y (ORCPT + 99 others); Fri, 11 Jan 2019 08:59:24 -0500 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:13019 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1728616AbfAKN7Y (ORCPT ); Fri, 11 Jan 2019 08:59:24 -0500 Received: from pps.filterd (m0046660.ppops.net [127.0.0.1]) by mx08-00178001.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x0BDuFAU028516; Fri, 11 Jan 2019 14:59:08 +0100 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx08-00178001.pphosted.com with ESMTP id 2pxpw9hqjh-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 11 Jan 2019 14:59:08 +0100 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 092F73A; Fri, 11 Jan 2019 13:59:06 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas24.st.com [10.75.90.94]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id D525F4E99; Fri, 11 Jan 2019 13:59:06 +0000 (GMT) Received: from SAFEX1HUBCAS21.st.com (10.75.90.45) by Safex1hubcas24.st.com (10.75.90.94) with Microsoft SMTP Server (TLS) id 14.3.361.1; Fri, 11 Jan 2019 14:59:06 +0100 Received: from localhost (10.201.20.178) by Webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.361.1; Fri, 11 Jan 2019 14:59:05 +0100 From: Loic Pallardy To: , , , , CC: , , , Loic Pallardy Subject: [PATCH 1/1] irqchip: stm32-exti: add domain translate function Date: Fri, 11 Jan 2019 14:58:52 +0100 Message-ID: <1547215132-85612-1-git-send-email-loic.pallardy@st.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.201.20.178] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-01-11_08:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Domain translate function is needed to recover irq configuration parameters from DT node Signed-off-by: Loic Pallardy --- drivers/irqchip/irq-stm32-exti.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/drivers/irqchip/irq-stm32-exti.c b/drivers/irqchip/irq-stm32-exti.c index 6edfd4bfa169..717879028cc4 100644 --- a/drivers/irqchip/irq-stm32-exti.c +++ b/drivers/irqchip/irq-stm32-exti.c @@ -819,9 +819,27 @@ static int __init stm32_exti_init(const struct stm32_exti_drv_data *drv_data, return ret; } +static int stm32_exti_h_translate(struct irq_domain *d, + struct irq_fwspec *fwspec, + unsigned long *out_hwirq, + unsigned int *out_type) +{ + if (is_of_node(fwspec->fwnode)) { + if (fwspec->param_count != 2) + return -EINVAL; + + *out_hwirq = fwspec->param[0]; + *out_type = fwspec->param[1] & IRQ_TYPE_SENSE_MASK; + return 0; + } + + return -EINVAL; +} + static const struct irq_domain_ops stm32_exti_h_domain_ops = { .alloc = stm32_exti_h_domain_alloc, .free = irq_domain_free_irqs_common, + .translate = stm32_exti_h_translate, }; static int -- 2.7.4